Return new instances of PYSON object from PYSON shortcut methods
Closes #12985
This commit is contained in:
+3
-3
@@ -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__;
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user