|
@@ -2347,12 +2347,12 @@ smalltalk.addMethod(
|
|
|
smalltalk.method({
|
|
|
selector: "jsObject",
|
|
|
category: 'accessing',
|
|
|
-fn: function () {
|
|
|
+fn: function (){
|
|
|
var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null};
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{}, smalltalk.JSObjectProxyTest)});},
|
|
|
+return smalltalk.withContext(function($ctx1) {
return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined};
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"jsObject",{}, smalltalk.JSObjectProxyTest)})},
|
|
|
args: [],
|
|
|
-source: "jsObject\x0a\x09<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null}>",
|
|
|
+source: "jsObject\x0a\x09<return jsObject = {a: 1, b: function() {return 2;}, c: function(object) {return object;}, d: '', 'e': null, 'f': undefined}>",
|
|
|
messageSends: [],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
@@ -2365,19 +2365,24 @@ selector: "testAtIfAbsent",
|
|
|
category: 'tests',
|
|
|
fn: function (){
|
|
|
var self=this;
|
|
|
-return smalltalk.withContext(function($ctx1) {
_st(self)._assert_equals_("Property does not exist",_st(_st(self)._jsObject())._at_ifAbsent_("abc",(function(){
|
|
|
+var testObject;
|
|
|
+return smalltalk.withContext(function($ctx1) {
testObject=_st(self)._jsObject();
|
|
|
+_st(self)._assert_equals_("Property does not exist",_st(testObject)._at_ifAbsent_("abc",(function(){
|
|
|
+return smalltalk.withContext(function($ctx2) {
return "Property does not exist";
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
|
|
+_st(self)._assert_equals_(nil,_st(testObject)._at_ifAbsent_("e",(function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
return "Property does not exist";
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
|
|
-_st(self)._assert_equals_(nil,_st(_st(self)._jsObject())._at_ifAbsent_("e",(function(){
|
|
|
+_st(self)._assert_equals_((1),_st(testObject)._at_ifAbsent_("a",(function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
return "Property does not exist";
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
|
|
-_st(self)._assert_equals_((1),_st(_st(self)._jsObject())._at_ifAbsent_("a",(function(){
|
|
|
+_st(self)._assert_equals_(nil,_st(testObject)._at_ifAbsent_("f",(function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
return "Property does not exist";
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})));
|
|
|
-return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{}, smalltalk.JSObjectProxyTest)})},
|
|
|
+return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject}, smalltalk.JSObjectProxyTest)})},
|
|
|
args: [],
|
|
|
-source: "testAtIfAbsent\x0a\x09self assert: 'Property does not exist' equals: (self jsObject at: 'abc' ifAbsent: ['Property does not exist']).\x0a\x09self assert: nil equals: (self jsObject at: 'e' ifAbsent: ['Property does not exist']).\x0a self assert: 1 equals: (self jsObject at: 'a' ifAbsent: ['Property does not exist']).",
|
|
|
-messageSends: ["assert:equals:", "at:ifAbsent:", "jsObject"],
|
|
|
+source: "testAtIfAbsent\x0a\x09| testObject |\x0a testObject := self jsObject.\x0a\x09self assert: 'Property does not exist' equals: (testObject at: 'abc' ifAbsent: ['Property does not exist']).\x0a\x09self assert: nil equals: (testObject at: 'e' ifAbsent: ['Property does not exist']).\x0a self assert: 1 equals: (testObject at: 'a' ifAbsent: ['Property does not exist']).\x0a self assert: nil equals: (testObject at: 'f' ifAbsent: ['Property does not exist']).",
|
|
|
+messageSends: ["jsObject", "assert:equals:", "at:ifAbsent:"],
|
|
|
referencedClasses: []
|
|
|
}),
|
|
|
smalltalk.JSObjectProxyTest);
|