|
@@ -220,12 +220,10 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
self._assert_equals_(_st((function(){
|
|
self._assert_equals_(_st((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (3);
|
|
return (3);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}))._ensure_((function(){
|
|
return (4);
|
|
return (4);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})),(3));
|
|
|
|
|
|
+})),(3));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
|
|
source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
|
|
@@ -248,9 +246,8 @@ return _st((function(){
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return _st(_st($Error())._new())._signal();
|
|
return _st(_st($Error())._new())._signal();
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}))._ensure_((function(){
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}))._ensure_((function(){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
|
|
|
|
|
|
+}));
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
@@ -299,20 +296,19 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
|
|
|
|
- function theTestPrototype() {this.name = "theTestPrototype";}
|
|
|
|
- function theTestConstructor(arg1, arg2, arg3) {}
|
|
|
|
- theTestConstructor.prototype = new theTestPrototype;
|
|
|
|
|
|
+ function TestConstructor(arg1, arg2, arg3) {}
|
|
|
|
+ TestConstructor.prototype.name = 'theTestPrototype';
|
|
|
|
|
|
- var theWrappedConstructor = _st(theTestConstructor);
|
|
|
|
- var theResult = theWrappedConstructor._newWithValues_([1, 2, 3 ]);
|
|
|
|
- self._assert_equals_(Object.getPrototypeOf(theResult).name, 'theTestPrototype');
|
|
|
|
|
|
+ var wrappedConstructor = _st(TestConstructor);
|
|
|
|
+ var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);
|
|
|
|
+ self._assert_(result instanceof TestConstructor);
|
|
|
|
+ self._assert_equals_(result.name, 'theTestPrototype');
|
|
|
|
|
|
"newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
|
|
"newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
|
|
- function constructionShouldFail() {var anotherResult = theWrappedConstructor._newWithValues_('This is so wrong');}
|
|
|
|
- self._should_raise_(_st(constructionShouldFail), globals.Error);;
|
|
|
|
|
|
+ self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, globals.Error);;
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNewWithValues",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
-source: "testNewWithValues\x0a<\x0a\x09function theTestPrototype() {this.name = \x22theTestPrototype\x22;}\x0a\x09function theTestConstructor(arg1, arg2, arg3) {}\x0a\x09theTestConstructor.prototype = new theTestPrototype;\x0a\x0a\x09var theWrappedConstructor = _st(theTestConstructor);\x0a\x09var theResult = theWrappedConstructor._newWithValues_([1, 2, 3 ]);\x0a\x09self._assert_equals_(Object.getPrototypeOf(theResult).name, 'theTestPrototype');\x0a\x0a\x09\x22newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made.\x22\x0a\x09function constructionShouldFail() {var anotherResult = theWrappedConstructor._newWithValues_('This is so wrong');}\x0a\x09self._should_raise_(_st(constructionShouldFail), globals.Error);\x0a>",
|
|
|
|
|
|
+source: "testNewWithValues\x0a<\x0a\x09function TestConstructor(arg1, arg2, arg3) {}\x0a\x09TestConstructor.prototype.name = 'theTestPrototype';\x0a\x0a\x09var wrappedConstructor = _st(TestConstructor);\x0a\x09var result = wrappedConstructor._newWithValues_([1, 2, 3 ]);\x0a\x09self._assert_(result instanceof TestConstructor);\x0a\x09self._assert_equals_(result.name, 'theTestPrototype');\x0a\x0a\x09\x22newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made.\x22\x0a\x09self._should_raise_(function () {wrappedConstructor._newWithValues_('single argument');}, globals.Error);\x0a>",
|
|
messageSends: [],
|
|
messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -327,14 +323,12 @@ var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
var $1;
|
|
var $1;
|
|
$1=_st((function(){
|
|
$1=_st((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._numArgs();
|
|
|
|
|
|
+}))._numArgs();
|
|
$ctx1.sendIdx["numArgs"]=1;
|
|
$ctx1.sendIdx["numArgs"]=1;
|
|
self._assert_equals_($1,(0));
|
|
self._assert_equals_($1,(0));
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
self._assert_equals_(_st((function(a,b){
|
|
self._assert_equals_(_st((function(a,b){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)})}))._numArgs(),(2));
|
|
|
|
|
|
+}))._numArgs(),(2));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNumArgs",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
|
|
source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
|
|
@@ -355,9 +349,8 @@ self._assert_(_st((function(){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return _st(_st($Error())._new())._signal();
|
|
return _st(_st($Error())._new())._signal();
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
|
|
|
|
|
|
+})));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
|
|
source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
|
|
@@ -393,9 +386,8 @@ return _st(x).__star(y);
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)})}))._value_value_((2),(4)),(8));
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)})}))._value_value_((2),(4)),(8));
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
self._assert_equals_(_st((function(a,b,c){
|
|
self._assert_equals_(_st((function(a,b,c){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (1);
|
|
return (1);
|
|
-}, function($ctx2) {$ctx2.fillBlock({a:a,b:b,c:c},$ctx1,4)})}))._value(),(1));
|
|
|
|
|
|
+}))._value(),(1));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testValue",{},globals.BlockClosureTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testValue",{},globals.BlockClosureTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testValue\x0a\x09self assert: ([ 1+1 ] value) equals: 2.\x0a\x09self assert: ([ :x | x +1 ] value: 2) equals: 3.\x0a\x09self assert: ([ :x :y | x*y ] value: 2 value: 4) equals: 8.\x0a\x0a\x09\x22Arguments are optional in Amber. This isn't ANSI compliant.\x22\x0a\x0a\x09self assert: ([ :a :b :c | 1 ] value) equals: 1",
|
|
source: "testValue\x0a\x09self assert: ([ 1+1 ] value) equals: 2.\x0a\x09self assert: ([ :x | x +1 ] value: 2) equals: 3.\x0a\x09self assert: ([ :x :y | x*y ] value: 2 value: 4) equals: 8.\x0a\x0a\x09\x22Arguments are optional in Amber. This isn't ANSI compliant.\x22\x0a\x0a\x09self assert: ([ :a :b :c | 1 ] value) equals: 1",
|
|
@@ -413,9 +405,8 @@ var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
var $1,$2;
|
|
var $1,$2;
|
|
$1=_st((function(){
|
|
$1=_st((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (1);
|
|
return (1);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithPossibleArguments_([(3), (4)]);
|
|
|
|
|
|
+}))._valueWithPossibleArguments_([(3), (4)]);
|
|
$ctx1.sendIdx["valueWithPossibleArguments:"]=1;
|
|
$ctx1.sendIdx["valueWithPossibleArguments:"]=1;
|
|
self._assert_equals_($1,(1));
|
|
self._assert_equals_($1,(1));
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
@@ -862,58 +853,50 @@ var self=this;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$16,$15,$14,$17,$19,$18,$22,$21,$20;
|
|
var $1,$2,$3,$5,$4,$6,$7,$8,$10,$9,$11,$13,$12,$16,$15,$14,$17,$19,$18,$22,$21,$20;
|
|
$1=true._and_((function(){
|
|
$1=true._and_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["and:"]=1;
|
|
$ctx1.sendIdx["and:"]=1;
|
|
self._assert_($1);
|
|
self._assert_($1);
|
|
$ctx1.sendIdx["assert:"]=1;
|
|
$ctx1.sendIdx["assert:"]=1;
|
|
$2=true._and_((function(){
|
|
$2=true._and_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["and:"]=2;
|
|
$ctx1.sendIdx["and:"]=2;
|
|
self._deny_($2);
|
|
self._deny_($2);
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$3=false._and_((function(){
|
|
$3=false._and_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["and:"]=3;
|
|
$ctx1.sendIdx["and:"]=3;
|
|
self._deny_($3);
|
|
self._deny_($3);
|
|
$ctx1.sendIdx["deny:"]=2;
|
|
$ctx1.sendIdx["deny:"]=2;
|
|
$5=false._and_((function(){
|
|
$5=false._and_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["and:"]=4;
|
|
$ctx1.sendIdx["and:"]=4;
|
|
$4=self._deny_($5);
|
|
$4=self._deny_($5);
|
|
$ctx1.sendIdx["deny:"]=3;
|
|
$ctx1.sendIdx["deny:"]=3;
|
|
$6=true._or_((function(){
|
|
$6=true._or_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["or:"]=1;
|
|
$ctx1.sendIdx["or:"]=1;
|
|
self._assert_($6);
|
|
self._assert_($6);
|
|
$ctx1.sendIdx["assert:"]=2;
|
|
$ctx1.sendIdx["assert:"]=2;
|
|
$7=true._or_((function(){
|
|
$7=true._or_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["or:"]=2;
|
|
$ctx1.sendIdx["or:"]=2;
|
|
self._assert_($7);
|
|
self._assert_($7);
|
|
$ctx1.sendIdx["assert:"]=3;
|
|
$ctx1.sendIdx["assert:"]=3;
|
|
$8=false._or_((function(){
|
|
$8=false._or_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["or:"]=3;
|
|
$ctx1.sendIdx["or:"]=3;
|
|
self._assert_($8);
|
|
self._assert_($8);
|
|
$ctx1.sendIdx["assert:"]=4;
|
|
$ctx1.sendIdx["assert:"]=4;
|
|
$10=false._or_((function(){
|
|
$10=false._or_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["or:"]=4;
|
|
$ctx1.sendIdx["or:"]=4;
|
|
$9=self._deny_($10);
|
|
$9=self._deny_($10);
|
|
$ctx1.sendIdx["deny:"]=4;
|
|
$ctx1.sendIdx["deny:"]=4;
|
|
@@ -928,9 +911,8 @@ $ctx1.sendIdx["assert:"]=5;
|
|
$13=(1).__gt((0));
|
|
$13=(1).__gt((0));
|
|
$ctx1.sendIdx[">"]=2;
|
|
$ctx1.sendIdx[">"]=2;
|
|
$12=_st($13)._and_((function(){
|
|
$12=_st($13)._and_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["and:"]=6;
|
|
$ctx1.sendIdx["and:"]=6;
|
|
self._deny_($12);
|
|
self._deny_($12);
|
|
$ctx1.sendIdx["deny:"]=5;
|
|
$ctx1.sendIdx["deny:"]=5;
|
|
@@ -953,9 +935,8 @@ $ctx1.sendIdx["assert:"]=6;
|
|
$19=(1).__gt((0));
|
|
$19=(1).__gt((0));
|
|
$ctx1.sendIdx[">"]=6;
|
|
$ctx1.sendIdx[">"]=6;
|
|
$18=_st($19)._or_((function(){
|
|
$18=_st($19)._or_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["or:"]=6;
|
|
$ctx1.sendIdx["or:"]=6;
|
|
self._assert_($18);
|
|
self._assert_($18);
|
|
$ctx1.sendIdx["assert:"]=7;
|
|
$ctx1.sendIdx["assert:"]=7;
|
|
@@ -1646,9 +1627,8 @@ var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
|
|
$2=self._collection();
|
|
$2=self._collection();
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$1=_st($2)._collect_((function(each){
|
|
$1=_st($2)._collect_((function(each){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return each;
|
|
return each;
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["collect:"]=1;
|
|
$ctx1.sendIdx["collect:"]=1;
|
|
$3=self._collection();
|
|
$3=self._collection();
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$ctx1.sendIdx["collection"]=2;
|
|
@@ -1657,9 +1637,8 @@ $ctx1.sendIdx["assert:equals:"]=1;
|
|
$5=self._collectionWithNewValue();
|
|
$5=self._collectionWithNewValue();
|
|
$ctx1.sendIdx["collectionWithNewValue"]=1;
|
|
$ctx1.sendIdx["collectionWithNewValue"]=1;
|
|
$4=_st($5)._collect_((function(each){
|
|
$4=_st($5)._collect_((function(each){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return each;
|
|
return each;
|
|
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["collect:"]=2;
|
|
$ctx1.sendIdx["collect:"]=2;
|
|
self._assert_equals_($4,self._collectionWithNewValue());
|
|
self._assert_equals_($4,self._collectionWithNewValue());
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
@@ -1684,9 +1663,8 @@ $ctx2.sendIdx["sampleNewValue"]=1;
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
$ctx1.sendIdx["collect:"]=4;
|
|
$ctx1.sendIdx["collect:"]=4;
|
|
$9=_st($10)._detect_((function(){
|
|
$9=_st($10)._detect_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
|
|
|
|
|
|
+}));
|
|
self._assert_equals_($9,self._sampleNewValue());
|
|
self._assert_equals_($9,self._sampleNewValue());
|
|
$ctx1.sendIdx["assert:equals:"]=4;
|
|
$ctx1.sendIdx["assert:equals:"]=4;
|
|
self._assert_equals_(_st(self._collection())._collect_((function(each){
|
|
self._assert_equals_(_st(self._collection())._collect_((function(each){
|
|
@@ -1777,9 +1755,8 @@ return smalltalk.withContext(function($ctx2) {
|
|
$1=self._collection();
|
|
$1=self._collection();
|
|
$ctx2.sendIdx["collection"]=1;
|
|
$ctx2.sendIdx["collection"]=1;
|
|
return _st($1)._detect_((function(){
|
|
return _st($1)._detect_((function(){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx2.sendIdx["detect:"]=1;
|
|
$ctx2.sendIdx["detect:"]=1;
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
self._should_raise_((function(){
|
|
self._should_raise_((function(){
|
|
@@ -1787,16 +1764,14 @@ return smalltalk.withContext(function($ctx2) {
|
|
$2=self._collection();
|
|
$2=self._collection();
|
|
$ctx2.sendIdx["collection"]=2;
|
|
$ctx2.sendIdx["collection"]=2;
|
|
return _st($2)._detect_((function(){
|
|
return _st($2)._detect_((function(){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
|
|
|
|
|
|
+}));
|
|
$ctx2.sendIdx["detect:"]=2;
|
|
$ctx2.sendIdx["detect:"]=2;
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),$Error());
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),$Error());
|
|
$ctx1.sendIdx["should:raise:"]=1;
|
|
$ctx1.sendIdx["should:raise:"]=1;
|
|
$3=_st(self._sampleNewValueAsCollection())._detect_((function(){
|
|
$3=_st(self._sampleNewValueAsCollection())._detect_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["detect:"]=3;
|
|
$ctx1.sendIdx["detect:"]=3;
|
|
$4=self._sampleNewValue();
|
|
$4=self._sampleNewValue();
|
|
$ctx1.sendIdx["sampleNewValue"]=1;
|
|
$ctx1.sendIdx["sampleNewValue"]=1;
|
|
@@ -1842,34 +1817,28 @@ sentinel=_st($Object())._new();
|
|
$3=self._collection();
|
|
$3=self._collection();
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$2=_st($3)._detect_ifNone_((function(){
|
|
$2=_st($3)._detect_ifNone_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["detect:ifNone:"]=1;
|
|
$ctx1.sendIdx["detect:ifNone:"]=1;
|
|
$1=_st($2).__tild_eq(sentinel);
|
|
$1=_st($2).__tild_eq(sentinel);
|
|
self._assert_($1);
|
|
self._assert_($1);
|
|
$5=self._collection();
|
|
$5=self._collection();
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$4=_st($5)._detect_ifNone_((function(){
|
|
$4=_st($5)._detect_ifNone_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["detect:ifNone:"]=2;
|
|
$ctx1.sendIdx["detect:ifNone:"]=2;
|
|
self._assert_equals_($4,sentinel);
|
|
self._assert_equals_($4,sentinel);
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$6=_st(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
|
|
$6=_st(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["detect:ifNone:"]=3;
|
|
$ctx1.sendIdx["detect:ifNone:"]=3;
|
|
$7=self._sampleNewValue();
|
|
$7=self._sampleNewValue();
|
|
$ctx1.sendIdx["sampleNewValue"]=1;
|
|
$ctx1.sendIdx["sampleNewValue"]=1;
|
|
@@ -1882,9 +1851,8 @@ $ctx2.sendIdx["sampleNewValue"]=2;
|
|
return _st(each).__eq($9);
|
|
return _st(each).__eq($9);
|
|
$ctx2.sendIdx["="]=1;
|
|
$ctx2.sendIdx["="]=1;
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["detect:ifNone:"]=4;
|
|
$ctx1.sendIdx["detect:ifNone:"]=4;
|
|
$10=self._sampleNewValue();
|
|
$10=self._sampleNewValue();
|
|
$ctx1.sendIdx["sampleNewValue"]=3;
|
|
$ctx1.sendIdx["sampleNewValue"]=3;
|
|
@@ -1894,9 +1862,8 @@ self._assert_equals_(_st(self._collection())._detect_ifNone_((function(each){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return _st(each).__eq(self._sampleNewValue());
|
|
return _st(each).__eq(self._sampleNewValue());
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})})),sentinel);
|
|
|
|
|
|
+})),sentinel);
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},globals.CollectionTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},globals.CollectionTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testDetectIfNone\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09self assert: (self collection detect: [ true ] ifNone: [ sentinel ]) ~= sentinel.\x0a\x09self assert: (self collection detect: [ false ] ifNone: [ sentinel ]) equals: sentinel.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: sentinel",
|
|
source: "testDetectIfNone\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09self assert: (self collection detect: [ true ] ifNone: [ sentinel ]) ~= sentinel.\x0a\x09self assert: (self collection detect: [ false ] ifNone: [ sentinel ]) equals: sentinel.\x0a\x09self assert: (self sampleNewValueAsCollection detect: [ true ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collectionWithNewValue detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: self sampleNewValue.\x0a\x09self assert: (self collection detect: [ :each | each = self sampleNewValue ] ifNone: [ sentinel ]) equals: sentinel",
|
|
@@ -1956,18 +1923,16 @@ $ctx1.sendIdx["collectionClass"]=1;
|
|
$2=_st($3)._new();
|
|
$2=_st($3)._new();
|
|
$ctx1.sendIdx["new"]=1;
|
|
$ctx1.sendIdx["new"]=1;
|
|
$1=_st($2)._ifEmpty_((function(){
|
|
$1=_st($2)._ifEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["ifEmpty:"]=1;
|
|
$ctx1.sendIdx["ifEmpty:"]=1;
|
|
self._assert_equals_($1,(42));
|
|
self._assert_equals_($1,(42));
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$5=self._collection();
|
|
$5=self._collection();
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$4=_st($5)._ifEmpty_((function(){
|
|
$4=_st($5)._ifEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$6=self._collection();
|
|
$6=self._collection();
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$ctx1.sendIdx["collection"]=2;
|
|
self._assert_equals_($4,$6);
|
|
self._assert_equals_($4,$6);
|
|
@@ -1977,9 +1942,8 @@ $ctx1.sendIdx["collectionClass"]=2;
|
|
$8=_st($9)._new();
|
|
$8=_st($9)._new();
|
|
$ctx1.sendIdx["new"]=2;
|
|
$ctx1.sendIdx["new"]=2;
|
|
$7=_st($8)._ifNotEmpty_((function(){
|
|
$7=_st($8)._ifNotEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["ifNotEmpty:"]=1;
|
|
$ctx1.sendIdx["ifNotEmpty:"]=1;
|
|
$11=self._collectionClass();
|
|
$11=self._collectionClass();
|
|
$ctx1.sendIdx["collectionClass"]=3;
|
|
$ctx1.sendIdx["collectionClass"]=3;
|
|
@@ -1990,9 +1954,8 @@ $ctx1.sendIdx["assert:equals:"]=3;
|
|
$13=self._collection();
|
|
$13=self._collection();
|
|
$ctx1.sendIdx["collection"]=3;
|
|
$ctx1.sendIdx["collection"]=3;
|
|
$12=_st($13)._ifNotEmpty_((function(){
|
|
$12=_st($13)._ifNotEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
|
|
|
|
+}));
|
|
self._assert_equals_($12,(42));
|
|
self._assert_equals_($12,(42));
|
|
$ctx1.sendIdx["assert:equals:"]=4;
|
|
$ctx1.sendIdx["assert:equals:"]=4;
|
|
$16=self._collectionClass();
|
|
$16=self._collectionClass();
|
|
@@ -2000,43 +1963,35 @@ $ctx1.sendIdx["collectionClass"]=4;
|
|
$15=_st($16)._new();
|
|
$15=_st($16)._new();
|
|
$ctx1.sendIdx["new"]=4;
|
|
$ctx1.sendIdx["new"]=4;
|
|
$14=_st($15)._ifEmpty_ifNotEmpty_((function(){
|
|
$14=_st($15)._ifEmpty_ifNotEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return (999);
|
|
return (999);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
|
|
$ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
|
|
self._assert_equals_($14,(42));
|
|
self._assert_equals_($14,(42));
|
|
$ctx1.sendIdx["assert:equals:"]=5;
|
|
$ctx1.sendIdx["assert:equals:"]=5;
|
|
$18=self._collection();
|
|
$18=self._collection();
|
|
$ctx1.sendIdx["collection"]=4;
|
|
$ctx1.sendIdx["collection"]=4;
|
|
$17=_st($18)._ifEmpty_ifNotEmpty_((function(){
|
|
$17=_st($18)._ifEmpty_ifNotEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return (999);
|
|
return (999);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
|
|
|
|
|
|
+}));
|
|
self._assert_equals_($17,(999));
|
|
self._assert_equals_($17,(999));
|
|
$ctx1.sendIdx["assert:equals:"]=6;
|
|
$ctx1.sendIdx["assert:equals:"]=6;
|
|
$19=_st(_st(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
|
|
$19=_st(_st(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return (999);
|
|
return (999);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
|
|
$ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
|
|
self._assert_equals_($19,(999));
|
|
self._assert_equals_($19,(999));
|
|
$ctx1.sendIdx["assert:equals:"]=7;
|
|
$ctx1.sendIdx["assert:equals:"]=7;
|
|
self._assert_equals_(_st(self._collection())._ifNotEmpty_ifEmpty_((function(){
|
|
self._assert_equals_(_st(self._collection())._ifNotEmpty_ifEmpty_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return (42);
|
|
return (42);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)})}),(function(){
|
|
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
|
|
+}),(function(){
|
|
return (999);
|
|
return (999);
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)})})),(42));
|
|
|
|
|
|
+})),(42));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},globals.CollectionTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},globals.CollectionTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testIfEmptyFamily\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ]) equals: self collectionClass new.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ]) equals: 42.\x0a\x09\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 999.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 42",
|
|
source: "testIfEmptyFamily\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ]) equals: self collection.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ]) equals: self collectionClass new.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ]) equals: 42.\x0a\x09\x0a\x09self assert: (self collectionClass new ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 42.\x0a\x09self assert: (self collection ifEmpty: [ 42 ] ifNotEmpty: [ 999 ]) equals: 999.\x0a\x0a\x09self assert: (self collectionClass new ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 999.\x0a\x09self assert: (self collection ifNotEmpty: [ 42 ] ifEmpty: [ 999 ]) equals: 42",
|
|
@@ -2130,9 +2085,8 @@ var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
|
|
$2=self._collection();
|
|
$2=self._collection();
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$ctx1.sendIdx["collection"]=1;
|
|
$1=_st($2)._select_((function(){
|
|
$1=_st($2)._select_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return false;
|
|
return false;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["select:"]=1;
|
|
$ctx1.sendIdx["select:"]=1;
|
|
$4=self._collectionClass();
|
|
$4=self._collectionClass();
|
|
$ctx1.sendIdx["collectionClass"]=1;
|
|
$ctx1.sendIdx["collectionClass"]=1;
|
|
@@ -2143,9 +2097,8 @@ $ctx1.sendIdx["assert:equals:"]=1;
|
|
$6=self._collection();
|
|
$6=self._collection();
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$ctx1.sendIdx["collection"]=2;
|
|
$5=_st($6)._select_((function(){
|
|
$5=_st($6)._select_((function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return true;
|
|
return true;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["select:"]=2;
|
|
$ctx1.sendIdx["select:"]=2;
|
|
$7=self._collection();
|
|
$7=self._collection();
|
|
$ctx1.sendIdx["collection"]=3;
|
|
$ctx1.sendIdx["collection"]=3;
|
|
@@ -2451,11 +2404,10 @@ visited;
|
|
$2=self._collection();
|
|
$2=self._collection();
|
|
$ctx2.sendIdx["collection"]=1;
|
|
$ctx2.sendIdx["collection"]=1;
|
|
$1=_st($2)._at_ifPresent_(each,(function(value1){
|
|
$1=_st($2)._at_ifPresent_(each,(function(value1){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
visited=value1;
|
|
visited=value1;
|
|
visited;
|
|
visited;
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx3) {$ctx3.fillBlock({value1:value1},$ctx2,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx2.sendIdx["at:ifPresent:"]=1;
|
|
$ctx2.sendIdx["at:ifPresent:"]=1;
|
|
self._assert_equals_($1,nil);
|
|
self._assert_equals_($1,nil);
|
|
$ctx2.sendIdx["assert:equals:"]=1;
|
|
$ctx2.sendIdx["assert:equals:"]=1;
|
|
@@ -2468,11 +2420,10 @@ visited;
|
|
$4=self._collection();
|
|
$4=self._collection();
|
|
$ctx2.sendIdx["collection"]=2;
|
|
$ctx2.sendIdx["collection"]=2;
|
|
$3=_st($4)._at_ifPresent_(index,(function(value2){
|
|
$3=_st($4)._at_ifPresent_(index,(function(value2){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
visited=value2;
|
|
visited=value2;
|
|
visited;
|
|
visited;
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx3) {$ctx3.fillBlock({value2:value2},$ctx2,4)})}));
|
|
|
|
|
|
+}));
|
|
self._assert_equals_($3,sentinel);
|
|
self._assert_equals_($3,sentinel);
|
|
$ctx2.sendIdx["assert:equals:"]=2;
|
|
$ctx2.sendIdx["assert:equals:"]=2;
|
|
return self._assert_equals_(visited,_st(self._collection())._at_(index));
|
|
return self._assert_equals_(visited,_st(self._collection())._at_(index));
|
|
@@ -2503,11 +2454,10 @@ visited;
|
|
$2=self._collection();
|
|
$2=self._collection();
|
|
$ctx2.sendIdx["collection"]=1;
|
|
$ctx2.sendIdx["collection"]=1;
|
|
$1=_st($2)._at_ifPresent_ifAbsent_(each,(function(value1){
|
|
$1=_st($2)._at_ifPresent_ifAbsent_(each,(function(value1){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
visited=value1;
|
|
visited=value1;
|
|
visited;
|
|
visited;
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx3) {$ctx3.fillBlock({value1:value1},$ctx2,2)})}),(function(){
|
|
|
|
|
|
+}),(function(){
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return self._sampleNewValue();
|
|
return self._sampleNewValue();
|
|
$ctx3.sendIdx["sampleNewValue"]=1;
|
|
$ctx3.sendIdx["sampleNewValue"]=1;
|
|
@@ -2526,11 +2476,10 @@ visited;
|
|
$5=self._collection();
|
|
$5=self._collection();
|
|
$ctx2.sendIdx["collection"]=2;
|
|
$ctx2.sendIdx["collection"]=2;
|
|
$4=_st($5)._at_ifPresent_ifAbsent_(index,(function(value2){
|
|
$4=_st($5)._at_ifPresent_ifAbsent_(index,(function(value2){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
visited=value2;
|
|
visited=value2;
|
|
visited;
|
|
visited;
|
|
return sentinel;
|
|
return sentinel;
|
|
-}, function($ctx3) {$ctx3.fillBlock({value2:value2},$ctx2,5)})}),(function(){
|
|
|
|
|
|
+}),(function(){
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return smalltalk.withContext(function($ctx3) {
|
|
return self._sampleNewValue();
|
|
return self._sampleNewValue();
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)})}));
|
|
}, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)})}));
|
|
@@ -2913,17 +2862,11 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
var associations;
|
|
var associations;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-var $1,$2,$3,$5,$4;
|
|
|
|
|
|
+var $1;
|
|
$1="a".__minus_gt((1));
|
|
$1="a".__minus_gt((1));
|
|
$ctx1.sendIdx["->"]=1;
|
|
$ctx1.sendIdx["->"]=1;
|
|
-$2="b".__minus_gt((2));
|
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
|
-associations=[$1,$2];
|
|
|
|
-$3=_st(_st(self._class())._collectionClass())._from_(associations);
|
|
|
|
-$5="a".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
|
-$4=globals.HashedCollection._from_([$5,"b".__minus_gt((2))]);
|
|
|
|
-self._assertSameContents_as_($3,$4);
|
|
|
|
|
|
+associations=[$1,"b".__minus_gt((2))];
|
|
|
|
+self._assertSameContents_as_(_st(_st(self._class())._collectionClass())._from_(associations),globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},globals.AssociativeCollectionTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testFrom",{associations:associations},globals.AssociativeCollectionTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testFrom\x0a\x22Accept a collection of associations.\x22\x0a| associations |\x0aassociations := { 'a' -> 1. 'b' -> 2 }.\x0aself assertSameContents: ( self class collectionClass from: associations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
|
|
source: "testFrom\x0a\x22Accept a collection of associations.\x22\x0a| associations |\x0aassociations := { 'a' -> 1. 'b' -> 2 }.\x0aself assertSameContents: ( self class collectionClass from: associations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
|
|
@@ -2967,17 +2910,12 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
var flattenedAssociations;
|
|
var flattenedAssociations;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-var $1,$3,$2;
|
|
|
|
flattenedAssociations=["a",(1),"b",(2)];
|
|
flattenedAssociations=["a",(1),"b",(2)];
|
|
-$1=_st(_st(self._class())._collectionClass())._newFromPairs_(flattenedAssociations);
|
|
|
|
-$3="a".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$2=globals.HashedCollection._from_([$3,"b".__minus_gt((2))]);
|
|
|
|
-self._assertSameContents_as_($1,$2);
|
|
|
|
|
|
+self._assertSameContents_as_(_st(_st(self._class())._collectionClass())._newFromPairs_(flattenedAssociations),globals.HashedCollection._newFromPairs_(["a",(1),"b",(2)]));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},globals.AssociativeCollectionTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testNewFromPairs",{flattenedAssociations:flattenedAssociations},globals.AssociativeCollectionTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testNewFromPairs\x0a\x22Accept an array in which all odd indexes are keys and evens are values.\x22\x0a| flattenedAssociations |\x0aflattenedAssociations := { 'a'. 1. 'b'. 2 }.\x0aself assertSameContents: ( self class collectionClass newFromPairs: flattenedAssociations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
|
|
source: "testNewFromPairs\x0a\x22Accept an array in which all odd indexes are keys and evens are values.\x22\x0a| flattenedAssociations |\x0aflattenedAssociations := { 'a'. 1. 'b'. 2 }.\x0aself assertSameContents: ( self class collectionClass newFromPairs: flattenedAssociations ) as: #{ 'a' -> 1. 'b' -> 2 }.",
|
|
-messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class", "->"],
|
|
|
|
|
|
+messageSends: ["assertSameContents:as:", "newFromPairs:", "collectionClass", "class"],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.AssociativeCollectionTest);
|
|
globals.AssociativeCollectionTest);
|
|
@@ -3386,16 +3324,14 @@ $ctx1.sendIdx["at:"]=1;
|
|
self._assert_equals_($1,"world");
|
|
self._assert_equals_($1,"world");
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$2=_st(d)._at_ifAbsent_("hello",(function(){
|
|
$2=_st(d)._at_ifAbsent_("hello",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return nil;
|
|
return nil;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifAbsent:"]=1;
|
|
$ctx1.sendIdx["at:ifAbsent:"]=1;
|
|
self._assert_equals_($2,"world");
|
|
self._assert_equals_($2,"world");
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
self._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
|
|
self._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return nil;
|
|
return nil;
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))).__eq("world"));
|
|
|
|
|
|
+}))).__eq("world"));
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$3=_st(d)._includesKey_("hello");
|
|
$3=_st(d)._includesKey_("hello");
|
|
$ctx1.sendIdx["includesKey:"]=1;
|
|
$ctx1.sendIdx["includesKey:"]=1;
|
|
@@ -3443,16 +3379,11 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
function $Dictionary(){return globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
|
|
function $Dictionary(){return globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-var $3,$2,$1;
|
|
|
|
-$3="hello".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$2=globals.HashedCollection._from_([$3]);
|
|
|
|
-$1=_st($2)._asDictionary();
|
|
|
|
-self._assert_equals_($1,_st($Dictionary())._with_("hello".__minus_gt((1))));
|
|
|
|
|
|
+self._assert_equals_(_st(globals.HashedCollection._newFromPairs_(["hello",(1)]))._asDictionary(),_st($Dictionary())._with_("hello".__minus_gt((1))));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},globals.DictionaryTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},globals.DictionaryTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
|
|
source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asDictionary equals: (Dictionary with: 'hello' -> 1)",
|
|
-messageSends: ["assert:equals:", "asDictionary", "->", "with:"],
|
|
|
|
|
|
+messageSends: ["assert:equals:", "asDictionary", "with:", "->"],
|
|
referencedClasses: ["Dictionary"]
|
|
referencedClasses: ["Dictionary"]
|
|
}),
|
|
}),
|
|
globals.DictionaryTest);
|
|
globals.DictionaryTest);
|
|
@@ -3482,20 +3413,13 @@ selector: "collection",
|
|
protocol: 'fixture',
|
|
protocol: 'fixture',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-var $2,$3,$4,$1;
|
|
|
|
-$2="b".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$3="a".__minus_gt((2));
|
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
|
-$4="c".__minus_gt((3));
|
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
|
-$1=globals.HashedCollection._from_([$2,$3,$4,"d".__minus_gt((-4))]);
|
|
|
|
|
|
+var $1;
|
|
|
|
+$1=globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4)]);
|
|
return $1;
|
|
return $1;
|
|
-}, function($ctx1) {$ctx1.fill(self,"collection",{},globals.HashedCollectionTest)})},
|
|
|
|
|
|
+},
|
|
args: [],
|
|
args: [],
|
|
source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
|
|
source: "collection\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4 }",
|
|
-messageSends: ["->"],
|
|
|
|
|
|
+messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -3523,20 +3447,13 @@ selector: "collectionOfPrintStrings",
|
|
protocol: 'fixture',
|
|
protocol: 'fixture',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-var $2,$3,$4,$1;
|
|
|
|
-$2="b".__minus_gt("1");
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$3="a".__minus_gt("2");
|
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
|
-$4="c".__minus_gt("3");
|
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
|
-$1=globals.HashedCollection._from_([$2,$3,$4,"d".__minus_gt("-4")]);
|
|
|
|
|
|
+var $1;
|
|
|
|
+$1=globals.HashedCollection._newFromPairs_(["b","1","a","2","c","3","d","-4"]);
|
|
return $1;
|
|
return $1;
|
|
-}, function($ctx1) {$ctx1.fill(self,"collectionOfPrintStrings",{},globals.HashedCollectionTest)})},
|
|
|
|
|
|
+},
|
|
args: [],
|
|
args: [],
|
|
source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
|
|
source: "collectionOfPrintStrings\x0a\x09^ #{ 'b' -> '1'. 'a' -> '2'. 'c' -> '3'. 'd' -> '-4' }",
|
|
-messageSends: ["->"],
|
|
|
|
|
|
+messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -3579,26 +3496,13 @@ selector: "collectionWithDuplicates",
|
|
protocol: 'fixture',
|
|
protocol: 'fixture',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-var $2,$3,$4,$5,$6,$7,$1;
|
|
|
|
-$2="b".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$3="a".__minus_gt((2));
|
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
|
-$4="c".__minus_gt((3));
|
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
|
-$5="d".__minus_gt((-4));
|
|
|
|
-$ctx1.sendIdx["->"]=4;
|
|
|
|
-$6="e".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=5;
|
|
|
|
-$7="f".__minus_gt((2));
|
|
|
|
-$ctx1.sendIdx["->"]=6;
|
|
|
|
-$1=globals.HashedCollection._from_([$2,$3,$4,$5,$6,$7,"g".__minus_gt((10))]);
|
|
|
|
|
|
+var $1;
|
|
|
|
+$1=globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"e",(1),"f",(2),"g",(10)]);
|
|
return $1;
|
|
return $1;
|
|
-}, function($ctx1) {$ctx1.fill(self,"collectionWithDuplicates",{},globals.HashedCollectionTest)})},
|
|
|
|
|
|
+},
|
|
args: [],
|
|
args: [],
|
|
source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10 }",
|
|
source: "collectionWithDuplicates\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'e' -> 1. 'f' -> 2. 'g' -> 10 }",
|
|
-messageSends: ["->"],
|
|
|
|
|
|
+messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -3609,22 +3513,13 @@ selector: "collectionWithNewValue",
|
|
protocol: 'fixture',
|
|
protocol: 'fixture',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
-var $2,$3,$4,$5,$1;
|
|
|
|
-$2="b".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$3="a".__minus_gt((2));
|
|
|
|
-$ctx1.sendIdx["->"]=2;
|
|
|
|
-$4="c".__minus_gt((3));
|
|
|
|
-$ctx1.sendIdx["->"]=3;
|
|
|
|
-$5="d".__minus_gt((-4));
|
|
|
|
-$ctx1.sendIdx["->"]=4;
|
|
|
|
-$1=globals.HashedCollection._from_([$2,$3,$4,$5,"new".__minus_gt("N")]);
|
|
|
|
|
|
+var $1;
|
|
|
|
+$1=globals.HashedCollection._newFromPairs_(["b",(1),"a",(2),"c",(3),"d",(-4),"new","N"]);
|
|
return $1;
|
|
return $1;
|
|
-}, function($ctx1) {$ctx1.fill(self,"collectionWithNewValue",{},globals.HashedCollectionTest)})},
|
|
|
|
|
|
+},
|
|
args: [],
|
|
args: [],
|
|
source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
|
|
source: "collectionWithNewValue\x0a\x09^ #{ 'b' -> 1. 'a' -> 2. 'c' -> 3. 'd' -> -4. 'new' -> 'N' }",
|
|
-messageSends: ["->"],
|
|
|
|
|
|
+messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -3635,14 +3530,13 @@ selector: "sampleNewValueAsCollection",
|
|
protocol: 'fixture',
|
|
protocol: 'fixture',
|
|
fn: function (){
|
|
fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
-return smalltalk.withContext(function($ctx1) {
|
|
|
|
var $1;
|
|
var $1;
|
|
-$1=globals.HashedCollection._from_(["new".__minus_gt("N")]);
|
|
|
|
|
|
+$1=globals.HashedCollection._newFromPairs_(["new","N"]);
|
|
return $1;
|
|
return $1;
|
|
-}, function($ctx1) {$ctx1.fill(self,"sampleNewValueAsCollection",{},globals.HashedCollectionTest)})},
|
|
|
|
|
|
+},
|
|
args: [],
|
|
args: [],
|
|
source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
|
|
source: "sampleNewValueAsCollection\x0a\x09^ #{ 'new' -> 'N' }",
|
|
-messageSends: ["->"],
|
|
|
|
|
|
+messageSends: [],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -3655,16 +3549,11 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
|
|
function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-var $3,$2,$1;
|
|
|
|
-$3="hello".__minus_gt((1));
|
|
|
|
-$ctx1.sendIdx["->"]=1;
|
|
|
|
-$2=globals.HashedCollection._from_([$3]);
|
|
|
|
-$1=_st($2)._asHashedCollection();
|
|
|
|
-self._assert_equals_($1,_st($HashedCollection())._with_("hello".__minus_gt((1))));
|
|
|
|
|
|
+self._assert_equals_(_st(globals.HashedCollection._newFromPairs_(["hello",(1)]))._asHashedCollection(),_st($HashedCollection())._with_("hello".__minus_gt((1))));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},globals.HashedCollectionTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaries",{},globals.HashedCollectionTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
|
|
source: "testDynamicDictionaries\x0a\x09self assert: #{'hello' -> 1} asHashedCollection equals: (HashedCollection with: 'hello' -> 1)",
|
|
-messageSends: ["assert:equals:", "asHashedCollection", "->", "with:"],
|
|
|
|
|
|
+messageSends: ["assert:equals:", "asHashedCollection", "with:", "->"],
|
|
referencedClasses: ["HashedCollection"]
|
|
referencedClasses: ["HashedCollection"]
|
|
}),
|
|
}),
|
|
globals.HashedCollectionTest);
|
|
globals.HashedCollectionTest);
|
|
@@ -4498,12 +4387,12 @@ fn: function (){
|
|
var self=this;
|
|
var self=this;
|
|
var array;
|
|
var array;
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
-array=[(3), (1), (4), (5), (2)];
|
|
|
|
|
|
+array=[(10), (1), (5)];
|
|
_st(array)._sort();
|
|
_st(array)._sort();
|
|
-self._assert_equals_(array,[(1), (2), (3), (4), (5)]);
|
|
|
|
|
|
+self._assert_equals_(array,[(1), (5), (10)]);
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},globals.ArrayTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testSort",{array:array},globals.ArrayTest)})},
|
|
args: [],
|
|
args: [],
|
|
-source: "testSort\x0a\x09| array |\x0a\x09array := #(3 1 4 5 2). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 2 3 4 5)",
|
|
|
|
|
|
+source: "testSort\x0a\x09| array |\x0a\x09array := #(10 1 5). \x0a\x09array sort.\x0a\x09self assert: array equals: #(1 5 10)",
|
|
messageSends: ["sort", "assert:equals:"],
|
|
messageSends: ["sort", "assert:equals:"],
|
|
referencedClasses: []
|
|
referencedClasses: []
|
|
}),
|
|
}),
|
|
@@ -4851,9 +4740,8 @@ return smalltalk.withContext(function($ctx1) {
|
|
self._should_raise_((function(){
|
|
self._should_raise_((function(){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return "hello"._at_ifAbsentPut_((6),(function(){
|
|
return "hello"._at_ifAbsentPut_((6),(function(){
|
|
-return smalltalk.withContext(function($ctx3) {
|
|
|
|
return "a";
|
|
return "a";
|
|
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
|
|
|
|
|
|
+}));
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},globals.StringTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},globals.StringTest)})},
|
|
args: [],
|
|
args: [],
|
|
@@ -5003,8 +4891,7 @@ $ctx1.sendIdx["="]=1;
|
|
self._deny_($1);
|
|
self._deny_($1);
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$ctx1.sendIdx["deny:"]=1;
|
|
$2="hello".__eq([]._at_ifAbsent_((1),(function(){
|
|
$2="hello".__eq([]._at_ifAbsent_((1),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})));
|
|
|
|
|
|
+})));
|
|
$ctx1.sendIdx["="]=2;
|
|
$ctx1.sendIdx["="]=2;
|
|
self._deny_($2);
|
|
self._deny_($2);
|
|
$ctx1.sendIdx["deny:"]=2;
|
|
$ctx1.sendIdx["deny:"]=2;
|
|
@@ -5807,30 +5694,26 @@ return smalltalk.withContext(function($ctx1) {
|
|
var $1,$2,$3;
|
|
var $1,$2,$3;
|
|
testObject=self._jsObject();
|
|
testObject=self._jsObject();
|
|
$1=_st(testObject)._at_ifAbsent_("abc",(function(){
|
|
$1=_st(testObject)._at_ifAbsent_("abc",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "Property does not exist";
|
|
return "Property does not exist";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifAbsent:"]=1;
|
|
$ctx1.sendIdx["at:ifAbsent:"]=1;
|
|
self._assert_equals_($1,"Property does not exist");
|
|
self._assert_equals_($1,"Property does not exist");
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$2=_st(testObject)._at_ifAbsent_("e",(function(){
|
|
$2=_st(testObject)._at_ifAbsent_("e",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "Property does not exist";
|
|
return "Property does not exist";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifAbsent:"]=2;
|
|
$ctx1.sendIdx["at:ifAbsent:"]=2;
|
|
self._assert_equals_($2,nil);
|
|
self._assert_equals_($2,nil);
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
$3=_st(testObject)._at_ifAbsent_("a",(function(){
|
|
$3=_st(testObject)._at_ifAbsent_("a",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "Property does not exist";
|
|
return "Property does not exist";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifAbsent:"]=3;
|
|
$ctx1.sendIdx["at:ifAbsent:"]=3;
|
|
self._assert_equals_($3,(1));
|
|
self._assert_equals_($3,(1));
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
self._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
|
|
self._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "Property does not exist";
|
|
return "Property does not exist";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})})),nil);
|
|
|
|
|
|
+})),nil);
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},globals.JSObjectProxyTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsent",{testObject:testObject},globals.JSObjectProxyTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testAtIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifAbsent: [ 'Property does not exist' ]) equals: 'Property does not exist'.\x0a\x09self assert: (testObject at: 'e' ifAbsent: [ 'Property does not exist' ]) equals: nil.\x0a\x09self assert: (testObject at: 'a' ifAbsent: [ 'Property does not exist' ]) equals: 1.\x0a\x09self assert: (testObject at: 'f' ifAbsent: [ 'Property does not exist' ]) equals: nil.",
|
|
source: "testAtIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifAbsent: [ 'Property does not exist' ]) equals: 'Property does not exist'.\x0a\x09self assert: (testObject at: 'e' ifAbsent: [ 'Property does not exist' ]) equals: nil.\x0a\x09self assert: (testObject at: 'a' ifAbsent: [ 'Property does not exist' ]) equals: 1.\x0a\x09self assert: (testObject at: 'f' ifAbsent: [ 'Property does not exist' ]) equals: nil.",
|
|
@@ -5908,9 +5791,8 @@ $ctx2.sendIdx["asString"]=1;
|
|
return "hello ".__comma($2);
|
|
return "hello ".__comma($2);
|
|
$ctx2.sendIdx[","]=1;
|
|
$ctx2.sendIdx[","]=1;
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "not present";
|
|
return "not present";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
|
|
self._assert_equals_($1,"not present");
|
|
self._assert_equals_($1,"not present");
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
$ctx1.sendIdx["assert:equals:"]=1;
|
|
@@ -5921,9 +5803,8 @@ $ctx2.sendIdx["asString"]=2;
|
|
return "hello ".__comma($4);
|
|
return "hello ".__comma($4);
|
|
$ctx2.sendIdx[","]=2;
|
|
$ctx2.sendIdx[","]=2;
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "not present";
|
|
return "not present";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
|
|
self._assert_equals_($3,"hello nil");
|
|
self._assert_equals_($3,"hello nil");
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
$ctx1.sendIdx["assert:equals:"]=2;
|
|
@@ -5934,9 +5815,8 @@ $ctx2.sendIdx["asString"]=3;
|
|
return "hello ".__comma($6);
|
|
return "hello ".__comma($6);
|
|
$ctx2.sendIdx[","]=3;
|
|
$ctx2.sendIdx[","]=3;
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "not present";
|
|
return "not present";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
|
|
$ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
|
|
self._assert_equals_($5,"hello 1");
|
|
self._assert_equals_($5,"hello 1");
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
$ctx1.sendIdx["assert:equals:"]=3;
|
|
@@ -5944,9 +5824,8 @@ self._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return "hello ".__comma(_st(x)._asString());
|
|
return "hello ".__comma(_st(x)._asString());
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)})}),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)})}),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "not present";
|
|
return "not present";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})})),"hello nil");
|
|
|
|
|
|
+})),"hello nil");
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},globals.JSObjectProxyTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"testAtIfPresentIfAbsent",{testObject:testObject},globals.JSObjectProxyTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "testAtIfPresentIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'not present'.\x0a\x09self assert: (testObject at: 'e' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.",
|
|
source: "testAtIfPresentIfAbsent\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09self assert: (testObject at: 'abc' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'not present'.\x0a\x09self assert: (testObject at: 'e' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.\x0a\x09self assert: (testObject at: 'a' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello 1'.\x0a\x09self assert: (testObject at: 'f' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.",
|
|
@@ -6643,22 +6522,19 @@ _st((function(){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return self._deinstallTop();
|
|
return self._deinstallTop();
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["on:do:"]=1;
|
|
$ctx1.sendIdx["on:do:"]=1;
|
|
_st((function(){
|
|
_st((function(){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return self._deinstallMiddle();
|
|
return self._deinstallMiddle();
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}))._on_do_($Error(),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}))._on_do_($Error(),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["on:do:"]=2;
|
|
$ctx1.sendIdx["on:do:"]=2;
|
|
_st((function(){
|
|
_st((function(){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return self._deinstallBottom();
|
|
return self._deinstallBottom();
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}))._on_do_($Error(),(function(){
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}))._on_do_($Error(),(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
|
|
|
|
|
|
+}));
|
|
return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},globals.MethodInheritanceTest)})},
|
|
return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},globals.MethodInheritanceTest)})},
|
|
args: [],
|
|
args: [],
|
|
source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
|
|
source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
|
|
@@ -7762,9 +7638,8 @@ function $Object(){return globals.Object||(typeof Object=="undefined"?nil:Object
|
|
return smalltalk.withContext(function($ctx1) {
|
|
return smalltalk.withContext(function($ctx1) {
|
|
o=_st($Object())._new();
|
|
o=_st($Object())._new();
|
|
_st(o)._basicAt_put_("func",(function(){
|
|
_st(o)._basicAt_put_("func",(function(){
|
|
-return smalltalk.withContext(function($ctx2) {
|
|
|
|
return "hello";
|
|
return "hello";
|
|
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
|
|
|
|
|
|
+}));
|
|
$ctx1.sendIdx["basicAt:put:"]=1;
|
|
$ctx1.sendIdx["basicAt:put:"]=1;
|
|
_st(o)._basicAt_put_("func2",(function(a){
|
|
_st(o)._basicAt_put_("func2",(function(a){
|
|
return smalltalk.withContext(function($ctx2) {
|
|
return smalltalk.withContext(function($ctx2) {
|