diff --git a/sao/src/pyson.js b/sao/src/pyson.js index a63166f5a7..58d965a333 100644 --- a/sao/src/pyson.js +++ b/sao/src/pyson.js @@ -36,13 +36,13 @@ if (d === undefined) { 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 c64e7efcbe..4fef0368d0 100644 --- a/sao/tests/sao.js +++ b/sao/tests/sao.js @@ -1263,6 +1263,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", "")'); }); QUnit.test('DomainParser.group_operator', function() {