2
0
Переглянути джерело

Fixes #836

Recompiles all js files.
Nicolas Petton 11 роки тому
батько
коміт
bc254dbc3f

+ 2 - 4
js/Compiler-AST.js

@@ -351,9 +351,8 @@ try {
 $1=self._nodes();
 $ctx1.sendIdx["nodes"]=1;
 next=_st($1)._at_ifAbsent_(_st(_st(self._nodes())._indexOf_(aNode)).__plus((1)),(function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $2=_st(next)._nextChild();
 return $2;
 }
@@ -566,9 +565,8 @@ $1=_st(_st(self._nodes())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._requiresSmalltalkContext();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})))._notNil();
+})))._notNil();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"requiresSmalltalkContext",{},globals.Node)})},
 args: [],

+ 1 - 2
js/Compiler-IR.js

@@ -4037,9 +4037,8 @@ var $1,$2;
 var $early={};
 try {
 _st(aCollection)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 _st(self["@stream"])._nextPutAll_("var ");
 $ctx1.sendIdx["nextPutAll:"]=1;
 _st(aCollection)._do_separatedBy_((function(each){

+ 1 - 2
js/Compiler-Inlining.js

@@ -783,8 +783,7 @@ return smalltalk.withContext(function($ctx2) {
 return self._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 _st(self._stream())._nextPutNonLocalReturnWith_((function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn},globals.IRInliningJSTranslator)})},
 args: ["anIRInlinedReturn"],
 source: "visitIRInlinedNonLocalReturn: anIRInlinedReturn\x0a\x09self stream nextPutStatementWith: [\x0a\x09\x09self visit: anIRInlinedReturn instructions last ].\x0a\x09self stream nextPutNonLocalReturnWith: [ ]",

+ 3 - 6
js/Compiler-Interpreter.js

@@ -191,9 +191,8 @@ sequenceNode=$2;
 _st(_st(self["@node"])._parameters())._withIndexDo_((function(each,index){
 return smalltalk.withContext(function($ctx2) {
 return _st(context)._localAt_put_(each,_st(aCollection)._at_ifAbsent_(index,(function(){
-return smalltalk.withContext(function($ctx3) {
 return nil;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})));
+})));
 }, function($ctx2) {$ctx2.fillBlock({each:each,index:index},$ctx1,1)})}));
 $3=_st(context)._interpreter();
 $ctx1.sendIdx["interpreter"]=1;
@@ -828,9 +827,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._sendIndexes())._at_ifAbsent_(aString,(function(){
-return smalltalk.withContext(function($ctx2) {
 return (0);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"sendIndexAt:",{aString:aString},globals.AIContext)})},
 args: ["aString"],
@@ -1437,9 +1435,8 @@ try {
 $1=self._stack();
 $ctx1.sendIdx["stack"]=1;
 _st($1)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[nil];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $2=_st(self._stack())._last();
 return $2;
 }

+ 3 - 6
js/Compiler-Semantic.js

@@ -128,9 +128,8 @@ $ctx2.sendIdx["value"]=2;
 return _st($4)._at_ifAbsent_($5,(function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(self._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
-return smalltalk.withContext(function($ctx4) {
 return nil;
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
+}));
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 $ctx2.sendIdx["at:ifAbsent:"]=2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
@@ -559,9 +558,8 @@ var $2,$1;
 $2=globals.MethodLexicalScope.superclass.fn.prototype._bindingFor_.apply(_st(self), [aNode]);
 if(($receiver = $2) == nil || $receiver == null){
 $1=_st(self._iVars())._at_ifAbsent_(_st(aNode)._value(),(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 } else {
 $1=$2;
 };
@@ -786,8 +784,7 @@ fn: function (aScope){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._nonLocalReturns())._remove_ifAbsent_(aScope,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"removeNonLocalReturn:",{aScope:aScope},globals.MethodLexicalScope)})},
 args: ["aScope"],
 source: "removeNonLocalReturn: aScope\x0a\x09self nonLocalReturns remove: aScope ifAbsent: []",

+ 3 - 6
js/Helios-Browser.js

@@ -1161,12 +1161,10 @@ fn: function (aSelector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._overriddenCache())._removeKey_ifAbsent_(aSelector,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["removeKey:ifAbsent:"]=1;
 _st(self._overrideCache())._removeKey_ifAbsent_(aSelector,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"removeSelector:",{aSelector:aSelector},globals.HLClassCache)})},
 args: ["aSelector"],
 source: "removeSelector: aSelector\x0a\x09self overriddenCache \x0a    \x09removeKey: aSelector\x0a        ifAbsent: [ ].\x0a    self overrideCache \x0a    \x09removeKey: aSelector\x0a        ifAbsent: [ ]",
@@ -2883,9 +2881,8 @@ $ctx2.sendIdx["selector"]=1;
 return _st(each).__eq($1);
 $ctx2.sendIdx["="]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $2=self._selectedItem();
 $ctx1.sendIdx["selectedItem"]=1;
 if(($receiver = $2) == nil || $receiver == null){

+ 9 - 18
js/Helios-Core.js

@@ -163,8 +163,7 @@ return smalltalk.withContext(function($ctx2) {
 _st(self._announcer())._announce_(_st(_st($HLAboutToChange())._new())._actionBlock_(aBlock));
 return _st(aBlock)._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($HLChangeForbidden(),(function(ex){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},globals.HLModel)})},
 args: ["aBlock"],
 source: "withChangesDo: aBlock\x0a\x09[ \x0a\x09\x09self announcer announce: (HLAboutToChange new\x0a\x09\x09\x09actionBlock: aBlock).\x0a\x09\x09aBlock value.\x0a\x09]\x0a\x09\x09on: HLChangeForbidden \x0a\x09\x09do: [ :ex | ]",
@@ -892,9 +891,8 @@ if(($receiver = $2) == nil || $receiver == null){
 $1=$2;
 } else {
 $1=_st(_st(self._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},globals.HLToolModel)})},
@@ -3209,8 +3207,7 @@ var $2,$1;
 $2=self["@callback"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };
@@ -4308,8 +4305,7 @@ var $2,$1;
 $2=self["@actionBlock"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };
@@ -4365,8 +4361,7 @@ var $2,$1;
 $2=self["@cancelBlock"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };
@@ -4738,8 +4733,7 @@ var $1;
 $1=self._progressBars();
 $ctx1.sendIdx["progressBars"]=1;
 _st($1)._remove_ifAbsent_(aProgressBar,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 _st(_st(_st(aProgressBar)._wrapper())._asJQuery())._remove();
 $ctx1.sendIdx["remove"]=1;
 _st(self._progressBars())._ifEmpty_((function(){
@@ -4852,8 +4846,7 @@ var $2,$1;
 $2=self["@cancelCallback"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };
@@ -4909,8 +4902,7 @@ var $2,$1;
 $2=self["@confirmCallback"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };
@@ -5039,8 +5031,7 @@ var $2,$1;
 $2=self["@selectCallback"];
 if(($receiver = $2) == nil || $receiver == null){
 $1=(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
+});
 } else {
 $1=$2;
 };

+ 3 - 6
js/Helios-Helpers.js

@@ -316,9 +316,8 @@ protocolBag=_st($Dictionary())._new();
 $ctx1.sendIdx["new"]=1;
 methods=_st(_st($HLReferencesModel())._new())._implementorsOf_(_st(self["@method"])._selector());
 _st(methods)._ifEmpty_ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[false];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
+}),(function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(methods)._do_((function(aMethod){
 var protocol;
@@ -338,17 +337,15 @@ return _st(protocol).__eq(_st(self["@method"])._defaultProtocol());
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
 if(! smalltalk.assert($3)){
 return _st(protocolBag)._at_put_(protocol,_st(_st(protocolBag)._at_ifAbsent_(protocol,(function(){
-return smalltalk.withContext(function($ctx4) {
 return (0);
-}, function($ctx4) {$ctx4.fillBlock({},$ctx3,7)})}))).__plus((1)));
+}))).__plus((1)));
 };
 };
 }, function($ctx3) {$ctx3.fillBlock({aMethod:aMethod,protocol:protocol},$ctx2,3)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 _st(protocolBag)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[false];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
+}));
 protocolToUse=nil;
 counter=(0);
 _st(protocolBag)._keysAndValuesDo_((function(key,value){

+ 3 - 6
js/Helios-KeyBindings.js

@@ -492,9 +492,8 @@ $1=_st(self._bindings())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._label()).__eq(aString);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},globals.HLBindingGroup)})},
 args: ["aString"],
@@ -541,9 +540,8 @@ $1=_st(self._bindings())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._key()).__eq(anInteger);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"atKey:",{anInteger:anInteger},globals.HLBindingGroup)})},
 args: ["anInteger"],
@@ -668,8 +666,7 @@ var $2,$1;
 $2=self["@callback"];
 if(($receiver = $2) == nil || $receiver == null){
 self["@callback"]=(function(value){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,2)})});
+});
 $1=self["@callback"];
 } else {
 $1=$2;

+ 1 - 2
js/Helios-References.js

@@ -545,9 +545,8 @@ $1=_st(aMethod)._selector();
 $ctx2.sendIdx["selector"]=1;
 return _st(each).__eq($1);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
+}));
 $2=_st(aMethod)._selector();
 $ctx1.sendIdx["selector"]=2;
 self._selectedItem_($2);

+ 1 - 2
js/IDE.js

@@ -4538,8 +4538,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self["@inspector"])._contents_((function(html){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"updateInspector",{},globals.Debugger)})},
 args: [],
 source: "updateInspector\x0a\x09inspector contents: [ :html | ]",

+ 1 - 2
js/Kernel-Classes.js

@@ -35,9 +35,8 @@ function $SystemAnnouncer(){return globals.SystemAnnouncer||(typeof SystemAnnoun
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$1,$4,$5,$6,$7,$8,$9,$10,$11;
 oldMethod=_st(self._methodDictionary())._at_ifAbsent_(_st(aMethod)._selector(),(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $2=self._protocols();
 $3=_st(aMethod)._protocol();
 $ctx1.sendIdx["protocol"]=1;

+ 9 - 18
js/Kernel-Collections.js

@@ -400,9 +400,8 @@ return smalltalk.withContext(function($ctx2) {
 return self._error_("Collection is empty");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 self._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
 throw $early=[each];
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
+}));
 return self}
 catch(e) {if(e===$early)return e[0]; throw e}
 }, function($ctx1) {$ctx1.fill(self,"anyOne",{},globals.Collection)})},
@@ -686,10 +685,9 @@ var self=this;
 var actionBeforeElement;
 return smalltalk.withContext(function($ctx1) { 
 actionBeforeElement=(function(){
-return smalltalk.withContext(function($ctx2) {
 actionBeforeElement=anotherBlock;
 return actionBeforeElement;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})});
+});
 self._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 _st(actionBeforeElement)._value();
@@ -729,9 +727,8 @@ return smalltalk.withContext(function($ctx1) {
 var $2,$1;
 $2=self._isEmpty();
 $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
 return self;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifEmpty:",{aBlock:aBlock},globals.Collection)})},
 args: ["aBlock"],
@@ -770,9 +767,8 @@ return smalltalk.withContext(function($ctx1) {
 var $2,$1;
 $2=self._notEmpty();
 $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
 return self;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifNotEmpty:",{aBlock:aBlock},globals.Collection)})},
 args: ["aBlock"],
@@ -1331,9 +1327,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._at_ifPresent_ifAbsent_(anIndex,aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{anIndex:anIndex,aBlock:aBlock},globals.IndexableCollection)})},
 args: ["anIndex", "aBlock"],
@@ -2245,9 +2240,8 @@ var index;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 index=_st(self["@values"])._indexOf_ifAbsent_(anObject,(function(){
-return smalltalk.withContext(function($ctx2) {
 return (0);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $2=_st(index).__eq((0));
 if(smalltalk.assert($2)){
 $1=_st(aBlock)._value();
@@ -2920,9 +2914,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._indexOf_ifAbsent_(anObject,(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._notNil();
+})))._notNil();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"includes:",{anObject:anObject},globals.SequenceableCollection)})},
 args: ["anObject"],
@@ -2963,9 +2956,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._indexOf_startingAt_ifAbsent_(anObject,start,(function(){
-return smalltalk.withContext(function($ctx2) {
 return (0);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"indexOf:startingAt:",{anObject:anObject,start:start},globals.SequenceableCollection)})},
 args: ["anObject", "start"],
@@ -3522,9 +3514,8 @@ var index;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 index=self._indexOf_ifAbsent_(anObject,(function(){
-return smalltalk.withContext(function($ctx2) {
 return (0);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $2=_st(index).__eq((0));
 if(smalltalk.assert($2)){
 $1=_st(aBlock)._value();

+ 5 - 10
js/Kernel-Infrastructure.js

@@ -1604,8 +1604,7 @@ return smalltalk.withContext(function($ctx2) {
 return _st(each)._package();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._asSet();
 _st($2)._remove_ifAbsent_(self,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
@@ -1637,8 +1636,7 @@ return _st(each)._superclass();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $2=_st($3)._asSet();
 _st($2)._remove_ifAbsent_(nil,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 _st($2)._addAll_(_st(_st($Smalltalk())._classes())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 $6=_st(each)._protocols();
@@ -2018,12 +2016,10 @@ function $PlatformInterface(){return globals.PlatformInterface||(typeof Platform
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st($PlatformInterface())._globals())._at_ifPresent_ifAbsent_(aString,(function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"existsGlobal:",{aString:aString},globals.PlatformInterface.klass)})},
 args: ["aString"],
@@ -2788,8 +2784,7 @@ fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._globalJsVariables())._remove_ifAbsent_(aString,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"deleteGlobalJsVariable:",{aString:aString},globals.SmalltalkImage)})},
 args: ["aString"],
 source: "deleteGlobalJsVariable: aString\x0a\x09self globalJsVariables remove: aString ifAbsent:[]",

+ 3 - 6
js/Kernel-Methods.js

@@ -403,8 +403,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._whileFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"whileFalse",{},globals.BlockClosure)})},
 args: [],
 source: "whileFalse\x0a\x09self whileFalse: []",
@@ -437,8 +436,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._whileTrue_((function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return self}, function($ctx1) {$ctx1.fill(self,"whileTrue",{},globals.BlockClosure)})},
 args: [],
 source: "whileTrue\x0a\x09self whileTrue: []",
@@ -924,9 +922,8 @@ return smalltalk.withContext(function($ctx2) {
 self["@poolSize"]=_st(self["@poolSize"]).__minus((1));
 self["@poolSize"];
 block=_st(self["@queue"])._nextIfAbsent_((function(){
-return smalltalk.withContext(function($ctx3) {
 return sentinel;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 block;
 $2=_st(block).__eq_eq(sentinel);
 if(! smalltalk.assert($2)){

+ 5 - 10
js/Kernel-Objects.js

@@ -1306,9 +1306,8 @@ return smalltalk.withContext(function($ctx1) {
 var $2,$1;
 $2=self.__eq(true);
 $1=_st($2)._ifTrue_ifFalse_(aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"and:",{aBlock:aBlock},globals.Boolean)})},
 args: ["aBlock"],
@@ -1395,8 +1394,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._ifTrue_ifFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),aBlock);
+}),aBlock);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifFalse:",{aBlock:aBlock},globals.Boolean)})},
 args: ["aBlock"],
@@ -1433,8 +1431,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._ifTrue_ifFalse_(aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifTrue:",{aBlock:aBlock},globals.Boolean)})},
 args: ["aBlock"],
@@ -1524,9 +1521,8 @@ return smalltalk.withContext(function($ctx1) {
 var $2,$1;
 $2=self.__eq(true);
 $1=_st($2)._ifTrue_ifFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),aBlock);
+}),aBlock);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"or:",{aBlock:aBlock},globals.Boolean)})},
 args: ["aBlock"],
@@ -3829,8 +3825,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._ifNil_ifNotNil_(aBlock,(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifNil:",{aBlock:aBlock},globals.UndefinedObject)})},
 args: ["aBlock"],

+ 66 - 132
js/Kernel-Tests.js

@@ -220,12 +220,10 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._assert_equals_(_st((function(){
-return smalltalk.withContext(function($ctx2) {
 return (3);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
+}))._ensure_((function(){
 return (4);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})),(3));
+})),(3));
 return self}, function($ctx1) {$ctx1.fill(self,"testEnsure",{},globals.BlockClosureTest)})},
 args: [],
 source: "testEnsure\x0a\x09self assert: ([ 3 ] ensure: [ 4 ]) equals: 3",
@@ -248,9 +246,8 @@ return _st((function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(_st($Error())._new())._signal();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx3) {
 return true;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
+}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 return self}, function($ctx1) {$ctx1.fill(self,"testEnsureRaises",{},globals.BlockClosureTest)})},
 args: [],
@@ -326,14 +323,12 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st((function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._numArgs();
+}))._numArgs();
 $ctx1.sendIdx["numArgs"]=1;
 self._assert_equals_($1,(0));
 $ctx1.sendIdx["assert:equals:"]=1;
 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)})},
 args: [],
 source: "testNumArgs\x0a\x09self assert: [] numArgs equals: 0.\x0a\x09self assert: [ :a :b | ] numArgs equals: 2",
@@ -354,9 +349,8 @@ self._assert_(_st((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st($Error())._new())._signal();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
+})));
 return self}, function($ctx1) {$ctx1.fill(self,"testOnDo",{},globals.BlockClosureTest)})},
 args: [],
 source: "testOnDo\x0a\x09self assert: ([ Error new signal ] on: Error do: [ :ex | true ])",
@@ -392,9 +386,8 @@ return _st(x).__star(y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,3)})}))._value_value_((2),(4)),(8));
 $ctx1.sendIdx["assert:equals:"]=3;
 self._assert_equals_(_st((function(a,b,c){
-return smalltalk.withContext(function($ctx2) {
 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)})},
 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",
@@ -412,9 +405,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st((function(){
-return smalltalk.withContext(function($ctx2) {
 return (1);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithPossibleArguments_([(3), (4)]);
+}))._valueWithPossibleArguments_([(3), (4)]);
 $ctx1.sendIdx["valueWithPossibleArguments:"]=1;
 self._assert_equals_($1,(1));
 $ctx1.sendIdx["assert:equals:"]=1;
@@ -861,58 +853,50 @@ var self=this;
 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;
 $1=true._and_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["and:"]=1;
 self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
 $2=true._and_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["and:"]=2;
 self._deny_($2);
 $ctx1.sendIdx["deny:"]=1;
 $3=false._and_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
+}));
 $ctx1.sendIdx["and:"]=3;
 self._deny_($3);
 $ctx1.sendIdx["deny:"]=2;
 $5=false._and_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
+}));
 $ctx1.sendIdx["and:"]=4;
 $4=self._deny_($5);
 $ctx1.sendIdx["deny:"]=3;
 $6=true._or_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
+}));
 $ctx1.sendIdx["or:"]=1;
 self._assert_($6);
 $ctx1.sendIdx["assert:"]=2;
 $7=true._or_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
+}));
 $ctx1.sendIdx["or:"]=2;
 self._assert_($7);
 $ctx1.sendIdx["assert:"]=3;
 $8=false._or_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)})}));
+}));
 $ctx1.sendIdx["or:"]=3;
 self._assert_($8);
 $ctx1.sendIdx["assert:"]=4;
 $10=false._or_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
+}));
 $ctx1.sendIdx["or:"]=4;
 $9=self._deny_($10);
 $ctx1.sendIdx["deny:"]=4;
@@ -927,9 +911,8 @@ $ctx1.sendIdx["assert:"]=5;
 $13=(1).__gt((0));
 $ctx1.sendIdx[">"]=2;
 $12=_st($13)._and_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})}));
+}));
 $ctx1.sendIdx["and:"]=6;
 self._deny_($12);
 $ctx1.sendIdx["deny:"]=5;
@@ -952,9 +935,8 @@ $ctx1.sendIdx["assert:"]=6;
 $19=(1).__gt((0));
 $ctx1.sendIdx[">"]=6;
 $18=_st($19)._or_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,13)})}));
+}));
 $ctx1.sendIdx["or:"]=6;
 self._assert_($18);
 $ctx1.sendIdx["assert:"]=7;
@@ -1645,9 +1627,8 @@ var $2,$1,$3,$5,$4,$8,$7,$6,$11,$10,$9;
 $2=self._collection();
 $ctx1.sendIdx["collection"]=1;
 $1=_st($2)._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
 return each;
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["collect:"]=1;
 $3=self._collection();
 $ctx1.sendIdx["collection"]=2;
@@ -1656,9 +1637,8 @@ $ctx1.sendIdx["assert:equals:"]=1;
 $5=self._collectionWithNewValue();
 $ctx1.sendIdx["collectionWithNewValue"]=1;
 $4=_st($5)._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
 return each;
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["collect:"]=2;
 self._assert_equals_($4,self._collectionWithNewValue());
 $ctx1.sendIdx["assert:equals:"]=2;
@@ -1683,9 +1663,8 @@ $ctx2.sendIdx["sampleNewValue"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
 $ctx1.sendIdx["collect:"]=4;
 $9=_st($10)._detect_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
+}));
 self._assert_equals_($9,self._sampleNewValue());
 $ctx1.sendIdx["assert:equals:"]=4;
 self._assert_equals_(_st(self._collection())._collect_((function(each){
@@ -1776,9 +1755,8 @@ return smalltalk.withContext(function($ctx2) {
 $1=self._collection();
 $ctx2.sendIdx["collection"]=1;
 return _st($1)._detect_((function(){
-return smalltalk.withContext(function($ctx3) {
 return true;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 $ctx2.sendIdx["detect:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 self._should_raise_((function(){
@@ -1786,16 +1764,14 @@ return smalltalk.withContext(function($ctx2) {
 $2=self._collection();
 $ctx2.sendIdx["collection"]=2;
 return _st($2)._detect_((function(){
-return smalltalk.withContext(function($ctx3) {
 return false;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
+}));
 $ctx2.sendIdx["detect:"]=2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),$Error());
 $ctx1.sendIdx["should:raise:"]=1;
 $3=_st(self._sampleNewValueAsCollection())._detect_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
+}));
 $ctx1.sendIdx["detect:"]=3;
 $4=self._sampleNewValue();
 $ctx1.sendIdx["sampleNewValue"]=1;
@@ -1841,34 +1817,28 @@ sentinel=_st($Object())._new();
 $3=self._collection();
 $ctx1.sendIdx["collection"]=1;
 $2=_st($3)._detect_ifNone_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return sentinel;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["detect:ifNone:"]=1;
 $1=_st($2).__tild_eq(sentinel);
 self._assert_($1);
 $5=self._collection();
 $ctx1.sendIdx["collection"]=2;
 $4=_st($5)._detect_ifNone_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return sentinel;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
+}));
 $ctx1.sendIdx["detect:ifNone:"]=2;
 self._assert_equals_($4,sentinel);
 $ctx1.sendIdx["assert:equals:"]=1;
 $6=_st(self._sampleNewValueAsCollection())._detect_ifNone_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return sentinel;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
+}));
 $ctx1.sendIdx["detect:ifNone:"]=3;
 $7=self._sampleNewValue();
 $ctx1.sendIdx["sampleNewValue"]=1;
@@ -1881,9 +1851,8 @@ $ctx2.sendIdx["sampleNewValue"]=2;
 return _st(each).__eq($9);
 $ctx2.sendIdx["="]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,7)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return sentinel;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
+}));
 $ctx1.sendIdx["detect:ifNone:"]=4;
 $10=self._sampleNewValue();
 $ctx1.sendIdx["sampleNewValue"]=3;
@@ -1893,9 +1862,8 @@ self._assert_equals_(_st(self._collection())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each).__eq(self._sampleNewValue());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,9)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return sentinel;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})})),sentinel);
+})),sentinel);
 return self}, function($ctx1) {$ctx1.fill(self,"testDetectIfNone",{sentinel:sentinel},globals.CollectionTest)})},
 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",
@@ -1955,18 +1923,16 @@ $ctx1.sendIdx["collectionClass"]=1;
 $2=_st($3)._new();
 $ctx1.sendIdx["new"]=1;
 $1=_st($2)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["ifEmpty:"]=1;
 self._assert_equals_($1,(42));
 $ctx1.sendIdx["assert:equals:"]=1;
 $5=self._collection();
 $ctx1.sendIdx["collection"]=1;
 $4=_st($5)._ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $6=self._collection();
 $ctx1.sendIdx["collection"]=2;
 self._assert_equals_($4,$6);
@@ -1976,9 +1942,8 @@ $ctx1.sendIdx["collectionClass"]=2;
 $8=_st($9)._new();
 $ctx1.sendIdx["new"]=2;
 $7=_st($8)._ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
+}));
 $ctx1.sendIdx["ifNotEmpty:"]=1;
 $11=self._collectionClass();
 $ctx1.sendIdx["collectionClass"]=3;
@@ -1989,9 +1954,8 @@ $ctx1.sendIdx["assert:equals:"]=3;
 $13=self._collection();
 $ctx1.sendIdx["collection"]=3;
 $12=_st($13)._ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
+}));
 self._assert_equals_($12,(42));
 $ctx1.sendIdx["assert:equals:"]=4;
 $16=self._collectionClass();
@@ -1999,43 +1963,35 @@ $ctx1.sendIdx["collectionClass"]=4;
 $15=_st($16)._new();
 $ctx1.sendIdx["new"]=4;
 $14=_st($15)._ifEmpty_ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return (999);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
+}));
 $ctx1.sendIdx["ifEmpty:ifNotEmpty:"]=1;
 self._assert_equals_($14,(42));
 $ctx1.sendIdx["assert:equals:"]=5;
 $18=self._collection();
 $ctx1.sendIdx["collection"]=4;
 $17=_st($18)._ifEmpty_ifNotEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return (999);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
+}));
 self._assert_equals_($17,(999));
 $ctx1.sendIdx["assert:equals:"]=6;
 $19=_st(_st(self._collectionClass())._new())._ifNotEmpty_ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,9)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return (999);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,10)})}));
+}));
 $ctx1.sendIdx["ifNotEmpty:ifEmpty:"]=1;
 self._assert_equals_($19,(999));
 $ctx1.sendIdx["assert:equals:"]=7;
 self._assert_equals_(_st(self._collection())._ifNotEmpty_ifEmpty_((function(){
-return smalltalk.withContext(function($ctx2) {
 return (42);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,11)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
+}),(function(){
 return (999);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,12)})})),(42));
+})),(42));
 return self}, function($ctx1) {$ctx1.fill(self,"testIfEmptyFamily",{},globals.CollectionTest)})},
 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",
@@ -2129,9 +2085,8 @@ var $2,$1,$4,$3,$6,$5,$7,$9,$10,$8,$12,$13,$11,$14,$16,$17,$15;
 $2=self._collection();
 $ctx1.sendIdx["collection"]=1;
 $1=_st($2)._select_((function(){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["select:"]=1;
 $4=self._collectionClass();
 $ctx1.sendIdx["collectionClass"]=1;
@@ -2142,9 +2097,8 @@ $ctx1.sendIdx["assert:equals:"]=1;
 $6=self._collection();
 $ctx1.sendIdx["collection"]=2;
 $5=_st($6)._select_((function(){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["select:"]=2;
 $7=self._collection();
 $ctx1.sendIdx["collection"]=3;
@@ -2450,11 +2404,10 @@ visited;
 $2=self._collection();
 $ctx2.sendIdx["collection"]=1;
 $1=_st($2)._at_ifPresent_(each,(function(value1){
-return smalltalk.withContext(function($ctx3) {
 visited=value1;
 visited;
 return sentinel;
-}, function($ctx3) {$ctx3.fillBlock({value1:value1},$ctx2,2)})}));
+}));
 $ctx2.sendIdx["at:ifPresent:"]=1;
 self._assert_equals_($1,nil);
 $ctx2.sendIdx["assert:equals:"]=1;
@@ -2467,11 +2420,10 @@ visited;
 $4=self._collection();
 $ctx2.sendIdx["collection"]=2;
 $3=_st($4)._at_ifPresent_(index,(function(value2){
-return smalltalk.withContext(function($ctx3) {
 visited=value2;
 visited;
 return sentinel;
-}, function($ctx3) {$ctx3.fillBlock({value2:value2},$ctx2,4)})}));
+}));
 self._assert_equals_($3,sentinel);
 $ctx2.sendIdx["assert:equals:"]=2;
 return self._assert_equals_(visited,_st(self._collection())._at_(index));
@@ -2502,11 +2454,10 @@ visited;
 $2=self._collection();
 $ctx2.sendIdx["collection"]=1;
 $1=_st($2)._at_ifPresent_ifAbsent_(each,(function(value1){
-return smalltalk.withContext(function($ctx3) {
 visited=value1;
 visited;
 return sentinel;
-}, function($ctx3) {$ctx3.fillBlock({value1:value1},$ctx2,2)})}),(function(){
+}),(function(){
 return smalltalk.withContext(function($ctx3) {
 return self._sampleNewValue();
 $ctx3.sendIdx["sampleNewValue"]=1;
@@ -2525,11 +2476,10 @@ visited;
 $5=self._collection();
 $ctx2.sendIdx["collection"]=2;
 $4=_st($5)._at_ifPresent_ifAbsent_(index,(function(value2){
-return smalltalk.withContext(function($ctx3) {
 visited=value2;
 visited;
 return sentinel;
-}, function($ctx3) {$ctx3.fillBlock({value2:value2},$ctx2,5)})}),(function(){
+}),(function(){
 return smalltalk.withContext(function($ctx3) {
 return self._sampleNewValue();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)})}));
@@ -3385,16 +3335,14 @@ $ctx1.sendIdx["at:"]=1;
 self._assert_equals_($1,"world");
 $ctx1.sendIdx["assert:equals:"]=1;
 $2=_st(d)._at_ifAbsent_("hello",(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["at:ifAbsent:"]=1;
 self._assert_equals_($2,"world");
 $ctx1.sendIdx["assert:equals:"]=2;
 self._deny_(_st(_st(d)._at_ifAbsent_("foo",(function(){
-return smalltalk.withContext(function($ctx2) {
 return nil;
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))).__eq("world"));
+}))).__eq("world"));
 $ctx1.sendIdx["deny:"]=1;
 $3=_st(d)._includesKey_("hello");
 $ctx1.sendIdx["includesKey:"]=1;
@@ -4850,9 +4798,8 @@ return smalltalk.withContext(function($ctx1) {
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return "hello"._at_ifAbsentPut_((6),(function(){
-return smalltalk.withContext(function($ctx3) {
 return "a";
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 return self}, function($ctx1) {$ctx1.fill(self,"testAtIfAbsentPut",{},globals.StringTest)})},
 args: [],
@@ -5002,8 +4949,7 @@ $ctx1.sendIdx["="]=1;
 self._deny_($1);
 $ctx1.sendIdx["deny:"]=1;
 $2="hello".__eq([]._at_ifAbsent_((1),(function(){
-return smalltalk.withContext(function($ctx2) {
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})));
+})));
 $ctx1.sendIdx["="]=2;
 self._deny_($2);
 $ctx1.sendIdx["deny:"]=2;
@@ -5806,30 +5752,26 @@ return smalltalk.withContext(function($ctx1) {
 var $1,$2,$3;
 testObject=self._jsObject();
 $1=_st(testObject)._at_ifAbsent_("abc",(function(){
-return smalltalk.withContext(function($ctx2) {
 return "Property does not exist";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["at:ifAbsent:"]=1;
 self._assert_equals_($1,"Property does not exist");
 $ctx1.sendIdx["assert:equals:"]=1;
 $2=_st(testObject)._at_ifAbsent_("e",(function(){
-return smalltalk.withContext(function($ctx2) {
 return "Property does not exist";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["at:ifAbsent:"]=2;
 self._assert_equals_($2,nil);
 $ctx1.sendIdx["assert:equals:"]=2;
 $3=_st(testObject)._at_ifAbsent_("a",(function(){
-return smalltalk.withContext(function($ctx2) {
 return "Property does not exist";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
+}));
 $ctx1.sendIdx["at:ifAbsent:"]=3;
 self._assert_equals_($3,(1));
 $ctx1.sendIdx["assert:equals:"]=3;
 self._assert_equals_(_st(testObject)._at_ifAbsent_("f",(function(){
-return smalltalk.withContext(function($ctx2) {
 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)})},
 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.",
@@ -5907,9 +5849,8 @@ $ctx2.sendIdx["asString"]=1;
 return "hello ".__comma($2);
 $ctx2.sendIdx[","]=1;
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return "not present";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+}));
 $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=1;
 self._assert_equals_($1,"not present");
 $ctx1.sendIdx["assert:equals:"]=1;
@@ -5920,9 +5861,8 @@ $ctx2.sendIdx["asString"]=2;
 return "hello ".__comma($4);
 $ctx2.sendIdx[","]=2;
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,3)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return "not present";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
+}));
 $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=2;
 self._assert_equals_($3,"hello nil");
 $ctx1.sendIdx["assert:equals:"]=2;
@@ -5933,9 +5873,8 @@ $ctx2.sendIdx["asString"]=3;
 return "hello ".__comma($6);
 $ctx2.sendIdx[","]=3;
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,5)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 return "not present";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
+}));
 $ctx1.sendIdx["at:ifPresent:ifAbsent:"]=3;
 self._assert_equals_($5,"hello 1");
 $ctx1.sendIdx["assert:equals:"]=3;
@@ -5943,9 +5882,8 @@ self._assert_equals_(_st(testObject)._at_ifPresent_ifAbsent_("f",(function(x){
 return smalltalk.withContext(function($ctx2) {
 return "hello ".__comma(_st(x)._asString());
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,7)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
 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)})},
 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'.",
@@ -6642,22 +6580,19 @@ _st((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._deinstallTop();
 }, 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;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._deinstallMiddle();
 }, 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;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._deinstallBottom();
 }, 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)})},
 args: [],
 source: "tearDown\x0a\x09[ self deinstallTop ] on: Error do: [ ].\x0a\x09[ self deinstallMiddle ] on: Error do: [ ].\x0a\x09[ self deinstallBottom ] on: Error do: [ ]",
@@ -7761,9 +7696,8 @@ function $Object(){return globals.Object||(typeof Object=="undefined"?nil:Object
 return smalltalk.withContext(function($ctx1) { 
 o=_st($Object())._new();
 _st(o)._basicAt_put_("func",(function(){
-return smalltalk.withContext(function($ctx2) {
 return "hello";
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+}));
 $ctx1.sendIdx["basicAt:put:"]=1;
 _st(o)._basicAt_put_("func2",(function(a){
 return smalltalk.withContext(function($ctx2) {

+ 2 - 4
js/SUnit-Tests.js

@@ -407,16 +407,14 @@ return smalltalk.withContext(function($ctx1) {
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._async_((function(){
-return smalltalk.withContext(function($ctx3) {
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 $ctx2.sendIdx["async:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 self._timeout_((0));
 self._shouldnt_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._async_((function(){
-return smalltalk.withContext(function($ctx3) {
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
+}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),$Error());
 self._finished();
 return self}, function($ctx1) {$ctx1.fill(self,"testAsyncNeedsTimeout",{},globals.SUnitAsyncTest)})},

+ 2 - 4
js/SUnit.js

@@ -321,9 +321,8 @@ return smalltalk.withContext(function($ctx2) {
 _st(aBlock)._value();
 return false;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_(anExceptionClass,(function(ex){
-return smalltalk.withContext(function($ctx2) {
 return true;
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
+})));
 return self}, function($ctx1) {$ctx1.fill(self,"should:raise:",{aBlock:aBlock,anExceptionClass:anExceptionClass},globals.TestCase)})},
 args: ["aBlock", "anExceptionClass"],
 source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([ aBlock value. false ]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [ :ex | true ])",
@@ -344,9 +343,8 @@ return smalltalk.withContext(function($ctx2) {
 _st(aBlock)._value();
 return true;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_(anExceptionClass,(function(ex){
-return smalltalk.withContext(function($ctx2) {
 return false;
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
+})));
 return self}, function($ctx1) {$ctx1.fill(self,"shouldnt:raise:",{aBlock:aBlock,anExceptionClass:anExceptionClass},globals.TestCase)})},
 args: ["aBlock", "anExceptionClass"],
 source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([ aBlock value. true ]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [ :ex | false ])",

+ 2 - 4
js/Spaces.js

@@ -264,8 +264,7 @@ self._deny_(_st(self["@space"])._isConnected());
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(self["@space"])._do_((function(){
-return smalltalk.withContext(function($ctx3) {
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$ObjectSpaceConnectionError());
 return self}, function($ctx1) {$ctx1.fill(self,"testConnection",{},globals.ObjectSpaceTest)})},
 args: [],
@@ -306,9 +305,8 @@ var $2,$1;
 _st(self["@space"])._whenReadyDo_((function(){
 return smalltalk.withContext(function($ctx2) {
 result=_st(self["@space"])._do_((function(){
-return smalltalk.withContext(function($ctx3) {
 return smalltalk;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
+}));
 result;
 $2=_st(result)._class();
 $ctx2.sendIdx["class"]=1;