diff --git a/sao/src/pyson.js b/sao/src/pyson.js index e22ed5a16c..c7269147b2 100644 --- a/sao/src/pyson.js +++ b/sao/src/pyson.js @@ -33,13 +33,13 @@ throw 'NotImplementedError'; }, get: function(k, d='') { - return Sao.PYSON.Get(this, k, d); + return new Sao.PYSON.Get(this, k, d); }, in_: function(obj) { - return Sao.PYSON.In(this, obj); + return new Sao.PYSON.In(this, obj); }, contains: function(k) { - return Sao.PYSON.In(k, this); + return new Sao.PYSON.In(k, this); }, toString: function() { var klass = this.pyson().__class__; diff --git a/sao/tests/sao.js b/sao/tests/sao.js index 74b36efd2a..25f85b4fca 100644 --- a/sao/tests/sao.js +++ b/sao/tests/sao.js @@ -1294,6 +1294,9 @@ QUnit.strictEqual( eval_pyson('Or(True, False).toString()'), "Or(true, false)", "eval_pyson('Or(True, False)').toString()"); + QUnit.strictEqual( + eval_pyson('Eval("foo", {}).get("bar").toString()'), + 'Get(Eval("foo", {}), "bar", "")'); }); var humanize_tests = [