Sfoglia il codice sorgente

Recompiled with 0.10.0.

Herbert Vojčík 11 anni fa
parent
commit
6df7552090

+ 107 - 112
lib/js/Trapped-Backend.deploy.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Backend', {});
+smalltalk.addPackage('Trapped-Backend');
 smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
 smalltalk.addMethod(
 "_getBlock_",
@@ -7,8 +7,8 @@ selector: "getBlock:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@getBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock}, smalltalk.EavModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
+messageSends: []}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
@@ -24,8 +24,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(self)._error_("No gett
 self["@putBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._error_("No putter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.EavModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
+messageSends: ["initialize", "error:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
@@ -37,8 +37,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@getBlock"])._value_(anObject);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject}, smalltalk.EavModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.EavModel)})},
+messageSends: ["value:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
@@ -50,8 +50,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@putBlock"])._value_value_(anObject,anObject2);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2}, smalltalk.EavModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},smalltalk.EavModel)})},
+messageSends: ["value:value:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
@@ -61,8 +61,8 @@ selector: "putBlock:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@putBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock}, smalltalk.EavModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
+messageSends: []}),
 smalltalk.EavModel);
 
 
@@ -77,8 +77,8 @@ var self=this;
 var newValue;
 return smalltalk.withContext(function($ctx1) { 
newValue=_st(aBlock)._value_(_st(anEavModel)._on_(self));
 _st(anEavModel)._on_put_(self,_st(newValue)._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue}, smalltalk.Isolator)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue},smalltalk.Isolator)})},
+messageSends: ["value:", "on:", "on:put:", "deepCopy"]}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
@@ -88,8 +88,8 @@ selector: "model:read:",
 fn: function (anEavModel,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(aBlock)._value_(_st(_st(anEavModel)._on_(self))._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock}, smalltalk.Isolator)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock},smalltalk.Isolator)})},
+messageSends: ["value:", "deepCopy", "on:"]}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
@@ -101,8 +101,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@root"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"root",{}, smalltalk.Isolator)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"root",{},smalltalk.Isolator)})},
+messageSends: []}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
@@ -112,8 +112,8 @@ selector: "root:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@root"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject}, smalltalk.Isolator)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject},smalltalk.Isolator)})},
+messageSends: []}),
 smalltalk.Isolator);
 
 
@@ -126,8 +126,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(self)._new())._root_(anObject);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject}, smalltalk.Isolator.klass)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
+messageSends: ["root:", "new"]}),
 smalltalk.Isolator.klass);
 
 
@@ -139,21 +139,19 @@ selector: "changed:",
 fn: function (key){
 var self=this;
 var needsToRun;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1;
 needsToRun=false;
-$1=self;
-$2=(function(each){
-return smalltalk.withContext(function($ctx2) {
$3=_st(each)._accepts_(key);
-if(smalltalk.assert($3)){
+_st(self)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
$1=_st(each)._accepts_(key);
+if(smalltalk.assert($1)){
 _st(each)._flag();
 needsToRun=true;
 return needsToRun;
 };
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
-_st($1)._do_($2);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 _st(self)._dirty_(needsToRun);
-return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun}, smalltalk.KeyedPubSubBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},smalltalk.KeyedPubSubBase)})},
+messageSends: ["do:", "ifTrue:", "flag", "accepts:", "dirty:"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
@@ -169,8 +167,8 @@ _st((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._run();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._fork();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean}, smalltalk.KeyedPubSubBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
+messageSends: ["ifTrue:", "fork", "run"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
@@ -181,8 +179,8 @@ fn: function (key,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
 _st(self)._dirty_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock}, smalltalk.KeyedPubSubBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
+messageSends: ["add:", "flag", "value:value:", "dirty:"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
@@ -192,28 +190,25 @@ selector: "run",
 fn: function (){
 var self=this;
 var needsClean;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$5,$4,$2,$6;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 needsClean=false;
-$1=self;
-$2=(function(each){
-return smalltalk.withContext(function($ctx2) {
$3=_st(each)._isFlagged();
-$4=(function(){
-return smalltalk.withContext(function($ctx3) {
_st(each)._run();
-$5=_st(each)._isEnabled();
-if(! smalltalk.assert($5)){
+_st(self)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
$1=_st(each)._isFlagged();
+if(smalltalk.assert($1)){
+_st(each)._run();
+$2=_st(each)._isEnabled();
+if(! smalltalk.assert($2)){
 needsClean=true;
 return needsClean;
 };
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-return _st($3)._ifTrue_($4);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
-_st($1)._do_($2);
-$6=needsClean;
-if(smalltalk.assert($6)){
+};
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+$3=needsClean;
+if(smalltalk.assert($3)){
 _st(self)._clean();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean}, smalltalk.KeyedPubSubBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean},smalltalk.KeyedPubSubBase)})},
+messageSends: ["do:", "ifTrue:", "run", "ifFalse:", "isEnabled", "isFlagged", "clean"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
@@ -223,8 +218,8 @@ selector: "subscriptionFactory:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@factory"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock}, smalltalk.KeyedPubSubBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
+messageSends: []}),
 smalltalk.KeyedPubSubBase);
 
 
@@ -237,8 +232,8 @@ selector: "add:",
 fn: function (aSubscription){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@queue"])._add_(aSubscription);
-return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription}, smalltalk.SimpleKeyedPubSub)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},smalltalk.SimpleKeyedPubSub)})},
+messageSends: ["add:"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
@@ -250,8 +245,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@queue"]=_st(self["@queue"])._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._isEnabled();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"clean",{}, smalltalk.SimpleKeyedPubSub)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"clean",{},smalltalk.SimpleKeyedPubSub)})},
+messageSends: ["select:", "isEnabled"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
@@ -261,8 +256,8 @@ selector: "do:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@queue"])._do_(aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.SimpleKeyedPubSub)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SimpleKeyedPubSub)})},
+messageSends: ["do:"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
@@ -273,8 +268,8 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.KeyedPubSubBase.fn.prototype._initialize.apply(_st(self), []);
 self["@queue"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.SimpleKeyedPubSub)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
+messageSends: ["initialize", "new"]}),
 smalltalk.SimpleKeyedPubSub);
 
 
@@ -290,8 +285,8 @@ selector: "accepts:",
 fn: function (aKey){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey}, smalltalk.KeyedSubscriptionBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.KeyedSubscriptionBase)})},
+messageSends: ["subclassResponsibility"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -301,8 +296,8 @@ selector: "flag",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@flagged"]=true;
-return self}, function($ctx1) {$ctx1.fill(self,"flag",{}, smalltalk.KeyedSubscriptionBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"flag",{},smalltalk.KeyedSubscriptionBase)})},
+messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -315,8 +310,8 @@ return smalltalk.withContext(function($ctx1) { 
smalltalk.Object.fn.prototype._i
 self["@key"]=nil;
 self["@actionBlock"]=nil;
 self["@flagged"]=false;
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.KeyedSubscriptionBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.KeyedSubscriptionBase)})},
+messageSends: ["initialize"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -328,8 +323,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@actionBlock"])._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isEnabled",{}, smalltalk.KeyedSubscriptionBase)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"isEnabled",{},smalltalk.KeyedSubscriptionBase)})},
+messageSends: ["notNil"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -341,8 +336,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@flagged"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isFlagged",{}, smalltalk.KeyedSubscriptionBase)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"isFlagged",{},smalltalk.KeyedSubscriptionBase)})},
+messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -353,8 +348,8 @@ fn: function (anObject,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@key"]=anObject;
 self["@actionBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock}, smalltalk.KeyedSubscriptionBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock},smalltalk.KeyedSubscriptionBase)})},
+messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
@@ -374,8 +369,8 @@ return self["@flagged"];
 return smalltalk.withContext(function($ctx2) {
self["@actionBlock"]=nil;
 return self["@actionBlock"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"run",{}, smalltalk.KeyedSubscriptionBase)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedSubscriptionBase)})},
+messageSends: ["on:do:", "ensure:", "value"]}),
 smalltalk.KeyedSubscriptionBase);
 
 
@@ -392,8 +387,8 @@ $1=_st(_st(_st(aKey)._size()).__lt_eq(_st(self["@key"])._size()))._and_((functio
 return smalltalk.withContext(function($ctx2) {
return _st(aKey).__eq(_st(self["@key"])._copyFrom_to_((1),_st(aKey)._size()));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey}, smalltalk.ListKeyedSubscription)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.ListKeyedSubscription)})},
+messageSends: ["and:", "=", "copyFrom:to:", "size", "<="]}),
 smalltalk.ListKeyedSubscription);
 
 
@@ -408,8 +403,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@dispatcher"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"dispatcher",{}, smalltalk.ListKeyedEntity)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"dispatcher",{},smalltalk.ListKeyedEntity)})},
+messageSends: []}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
@@ -428,8 +423,8 @@ return $3;
 }, function($ctx2) {$ctx2.fillBlock({key:key,block:block},$ctx1)})}));
 $4=_st($1)._yourself();
 self["@dispatcher"]=$4;
-return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher}, smalltalk.ListKeyedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher},smalltalk.ListKeyedEntity)})},
+messageSends: ["subscriptionFactory:", "key:block:", "new", "yourself"]}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
@@ -440,8 +435,8 @@ fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@payload"]=anObject;
 _st(_st(self)._dispatcher())._changed_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject}, smalltalk.ListKeyedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
+messageSends: ["changed:", "dispatcher"]}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
@@ -453,8 +448,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._dispatcher())._on_hook_(path,(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._read_do_(path,aBlock);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock}, smalltalk.ListKeyedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock},smalltalk.ListKeyedEntity)})},
+messageSends: ["on:hook:", "read:do:", "dispatcher"]}),
 smalltalk.ListKeyedEntity);
 
 
@@ -474,8 +469,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(eavModel)._on_put_(sel
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._dispatcher())._changed_(path);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel}, smalltalk.ListKeyedDirectEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
+messageSends: ["asEavModel", "value:", "on:", "ensure:", "changed:", "dispatcher", "on:put:"]}),
 smalltalk.ListKeyedDirectEntity);
 
 smalltalk.addMethod(
@@ -487,8 +482,8 @@ var self=this;
 var eavModel;
 return smalltalk.withContext(function($ctx1) { 
eavModel=_st(path)._asEavModel();
 _st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedDirectEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
+messageSends: ["asEavModel", "value:", "on:"]}),
 smalltalk.ListKeyedDirectEntity);
 
 
@@ -501,8 +496,8 @@ selector: "model:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.ListKeyedEntity.fn.prototype._model_.apply(_st(self), [_st((smalltalk.Isolator || Isolator))._on_(anObject)]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject}, smalltalk.ListKeyedIsolatedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
+messageSends: ["model:", "on:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
@@ -518,8 +513,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(self["@payload"])._mod
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._dispatcher())._changed_(path);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedIsolatedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
+messageSends: ["asEavModel", ",", "ensure:", "changed:", "dispatcher", "model:modify:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
@@ -531,8 +526,8 @@ var self=this;
 var eavModel;
 return smalltalk.withContext(function($ctx1) { 
eavModel=_st(_st([smalltalk.symbolFor("root")]).__comma(path))._asEavModel();
 _st(self["@payload"])._model_read_(eavModel,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedIsolatedEntity)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
+messageSends: ["asEavModel", ",", "model:read:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 
@@ -544,8 +539,8 @@ selector: "reverseTrapAt:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
return nil;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Object)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Object)})},
+messageSends: []}),
 smalltalk.Object);
 
 smalltalk.addMethod(
@@ -555,8 +550,8 @@ selector: "reverseTrapAt:put:",
 fn: function (anObject,value){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._error_(_st(_st("Trapped cannot put at ").__comma(_st(_st(self)._class())._name())).__comma(" type key."));
-return self}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Object)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Object)})},
+messageSends: ["error:", ",", "name", "class"]}),
 smalltalk.Object);
 
 smalltalk.addMethod(
@@ -607,8 +602,8 @@ return _st($9)._putBlock_($10);
 _st($7)._ifFalse_($8);
 $15=model;
 return $15;
-}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model}, smalltalk.SequenceableCollection)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model}, smalltalk.SequenceableCollection)})},
+messageSends: ["new", "getBlock:", "inject:into:", "ifNotNil:", "reverseTrapAt:", "ifFalse:", "putBlock:", "allButLast", "reverseTrapAt:put:", "last", "isEmpty"]}),
 smalltalk.SequenceableCollection);
 
 smalltalk.addMethod(
@@ -622,8 +617,8 @@ $1=_st(anObject)._at_ifAbsent_(self,(function(){
 return smalltalk.withContext(function($ctx2) {
return nil;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.String)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.String)})},
+messageSends: ["at:ifAbsent:"]}),
 smalltalk.String);
 
 smalltalk.addMethod(
@@ -635,8 +630,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(anObject)._at_put_(self,value);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.String)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.String)})},
+messageSends: ["at:put:"]}),
 smalltalk.String);
 
 smalltalk.addMethod(
@@ -656,8 +651,8 @@ return smalltalk.withContext(function($ctx2) {
throw $early=[nil];
 return $1;
 }
 catch(e) {if(e===$early)return e[0]; throw e}
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Symbol)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Symbol)})},
+messageSends: ["on:do:", "perform:"]}),
 smalltalk.Symbol);
 
 smalltalk.addMethod(
@@ -669,8 +664,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(anObject)._perform_withArguments_(_st(_st(self).__comma(":"))._asSymbol(),[value]);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Symbol)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Symbol)})},
+messageSends: ["perform:withArguments:", "asSymbol", ","]}),
 smalltalk.Symbol);
 
 smalltalk.addMethod(
@@ -684,8 +679,8 @@ $1=_st(anObject)._at_ifAbsent_(self,(function(){
 return smalltalk.withContext(function($ctx2) {
return nil;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Number)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:",{anObject:anObject}, smalltalk.Number)})},
+messageSends: ["at:ifAbsent:"]}),
 smalltalk.Number);
 
 smalltalk.addMethod(
@@ -697,7 +692,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(anObject)._at_put_(self,value);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Number)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value}, smalltalk.Number)})},
+messageSends: ["at:put:"]}),
 smalltalk.Number);
 

+ 53 - 58
lib/js/Trapped-Backend.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Backend', {});
+smalltalk.addPackage('Trapped-Backend');
 smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
 smalltalk.EavModel.comment="External actor value model."
 smalltalk.addMethod(
@@ -9,7 +9,7 @@ category: 'accessing',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@getBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock}, smalltalk.EavModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"getBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
 args: ["aBlock"],
 source: "getBlock: aBlock\x0a\x0agetBlock := aBlock",
 messageSends: [],
@@ -31,7 +31,7 @@ return smalltalk.withContext(function($ctx2) {
return _st(self)._error_("No gett
 self["@putBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._error_("No putter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.EavModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09getBlock := [ self error: 'No getter block.' ].\x0a\x09putBlock := [ self error: 'No putter block.' ].",
 messageSends: ["initialize", "error:"],
@@ -49,7 +49,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@getBlock"])._value_(anObject);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject}, smalltalk.EavModel)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.EavModel)})},
 args: ["anObject"],
 source: "on: anObject\x0a\x22Returns value of model applied on object\x22\x0a\x0a^getBlock value: anObject",
 messageSends: ["value:"],
@@ -67,7 +67,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@putBlock"])._value_value_(anObject,anObject2);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2}, smalltalk.EavModel)})},
+}, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},smalltalk.EavModel)})},
 args: ["anObject", "anObject2"],
 source: "on: anObject put: anObject2\x0a\x22Puts a value via model applied on object\x22\x0a\x0a^putBlock value: anObject value: anObject2",
 messageSends: ["value:value:"],
@@ -83,7 +83,7 @@ category: 'accessing',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@putBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock}, smalltalk.EavModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"putBlock:",{aBlock:aBlock},smalltalk.EavModel)})},
 args: ["aBlock"],
 source: "putBlock: aBlock\x0a\x0aputBlock := aBlock",
 messageSends: [],
@@ -104,7 +104,7 @@ var self=this;
 var newValue;
 return smalltalk.withContext(function($ctx1) { 
newValue=_st(aBlock)._value_(_st(anEavModel)._on_(self));
 _st(anEavModel)._on_put_(self,_st(newValue)._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue}, smalltalk.Isolator)})},
+return self}, function($ctx1) {$ctx1.fill(self,"model:modify:",{anEavModel:anEavModel,aBlock:aBlock,newValue:newValue},smalltalk.Isolator)})},
 args: ["anEavModel", "aBlock"],
 source: "model: anEavModel modify: aBlock\x0a\x0a| newValue |\x0anewValue := aBlock value: (anEavModel on: self).\x0aanEavModel on: self put: newValue deepCopy\x0a",
 messageSends: ["value:", "on:", "on:put:", "deepCopy"],
@@ -120,7 +120,7 @@ category: 'action',
 fn: function (anEavModel,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(aBlock)._value_(_st(_st(anEavModel)._on_(self))._deepCopy());
-return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock}, smalltalk.Isolator)})},
+return self}, function($ctx1) {$ctx1.fill(self,"model:read:",{anEavModel:anEavModel,aBlock:aBlock},smalltalk.Isolator)})},
 args: ["anEavModel", "aBlock"],
 source: "model: anEavModel read: aBlock\x0a\x0aaBlock value: (anEavModel on: self) deepCopy",
 messageSends: ["value:", "deepCopy", "on:"],
@@ -138,7 +138,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@root"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"root",{}, smalltalk.Isolator)})},
+}, function($ctx1) {$ctx1.fill(self,"root",{},smalltalk.Isolator)})},
 args: [],
 source: "root\x0a\x0a^root\x0a",
 messageSends: [],
@@ -154,7 +154,7 @@ category: 'accessing',
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@root"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject}, smalltalk.Isolator)})},
+return self}, function($ctx1) {$ctx1.fill(self,"root:",{anObject:anObject},smalltalk.Isolator)})},
 args: ["anObject"],
 source: "root: anObject\x0a\x0aroot := anObject",
 messageSends: [],
@@ -173,7 +173,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(self)._new())._root_(anObject);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject}, smalltalk.Isolator.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
 args: ["anObject"],
 source: "on: anObject\x0a^self new root: anObject",
 messageSends: ["root:", "new"],
@@ -192,20 +192,18 @@ category: 'action',
 fn: function (key){
 var self=this;
 var needsToRun;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1;
 needsToRun=false;
-$1=self;
-$2=(function(each){
-return smalltalk.withContext(function($ctx2) {
$3=_st(each)._accepts_(key);
-if(smalltalk.assert($3)){
+_st(self)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
$1=_st(each)._accepts_(key);
+if(smalltalk.assert($1)){
 _st(each)._flag();
 needsToRun=true;
 return needsToRun;
 };
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
-_st($1)._do_($2);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 _st(self)._dirty_(needsToRun);
-return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun}, smalltalk.KeyedPubSubBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},smalltalk.KeyedPubSubBase)})},
 args: ["key"],
 source: "changed: key\x0a\x09| needsToRun |\x0a    needsToRun := false.\x0a\x09self do: [ :each |\x0a\x09\x09(each accepts: key) ifTrue: [\x0a\x09\x09\x09each flag.\x0a            needsToRun := true.\x0a\x09\x09]\x0a\x09].\x0a\x09self dirty: needsToRun",
 messageSends: ["do:", "ifTrue:", "flag", "accepts:", "dirty:"],
@@ -227,7 +225,7 @@ _st((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._run();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._fork();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean}, smalltalk.KeyedPubSubBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
 args: ["aBoolean"],
 source: "dirty: aBoolean\x0a\x09aBoolean ifTrue: [[ self run ] fork]",
 messageSends: ["ifTrue:", "fork", "run"],
@@ -244,7 +242,7 @@ fn: function (key,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
 _st(self)._dirty_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock}, smalltalk.KeyedPubSubBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"on:hook:",{key:key,aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
 args: ["key", "aBlock"],
 source: "on: key hook: aBlock\x0a\x09self add: (factory value: key value: aBlock) flag.\x0a   \x09self dirty: true",
 messageSends: ["add:", "flag", "value:value:", "dirty:"],
@@ -260,27 +258,24 @@ category: 'action',
 fn: function (){
 var self=this;
 var needsClean;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$5,$4,$2,$6;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
 needsClean=false;
-$1=self;
-$2=(function(each){
-return smalltalk.withContext(function($ctx2) {
$3=_st(each)._isFlagged();
-$4=(function(){
-return smalltalk.withContext(function($ctx3) {
_st(each)._run();
-$5=_st(each)._isEnabled();
-if(! smalltalk.assert($5)){
+_st(self)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
$1=_st(each)._isFlagged();
+if(smalltalk.assert($1)){
+_st(each)._run();
+$2=_st(each)._isEnabled();
+if(! smalltalk.assert($2)){
 needsClean=true;
 return needsClean;
 };
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-return _st($3)._ifTrue_($4);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})});
-_st($1)._do_($2);
-$6=needsClean;
-if(smalltalk.assert($6)){
+};
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
+$3=needsClean;
+if(smalltalk.assert($3)){
 _st(self)._clean();
 };
-return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean}, smalltalk.KeyedPubSubBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean},smalltalk.KeyedPubSubBase)})},
 args: [],
 source: "run\x0a\x09| needsClean |\x0a    needsClean := false.\x0a\x09self do: [ :each |\x0a\x09\x09each isFlagged ifTrue: [\x0a            each run.\x0a            each isEnabled ifFalse: [ needsClean := true ]\x0a        ]\x0a\x09].\x0a    needsClean ifTrue: [ self clean ]",
 messageSends: ["do:", "ifTrue:", "run", "ifFalse:", "isEnabled", "isFlagged", "clean"],
@@ -296,7 +291,7 @@ category: 'action',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@factory"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock}, smalltalk.KeyedPubSubBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"subscriptionFactory:",{aBlock:aBlock},smalltalk.KeyedPubSubBase)})},
 args: ["aBlock"],
 source: "subscriptionFactory: aBlock\x0a    factory := aBlock",
 messageSends: [],
@@ -315,7 +310,7 @@ category: 'accessing',
 fn: function (aSubscription){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@queue"])._add_(aSubscription);
-return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription}, smalltalk.SimpleKeyedPubSub)})},
+return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},smalltalk.SimpleKeyedPubSub)})},
 args: ["aSubscription"],
 source: "add: aSubscription\x0a\x09queue add: aSubscription.\x0a",
 messageSends: ["add:"],
@@ -333,7 +328,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@queue"]=_st(self["@queue"])._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._isEnabled();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"clean",{}, smalltalk.SimpleKeyedPubSub)})},
+return self}, function($ctx1) {$ctx1.fill(self,"clean",{},smalltalk.SimpleKeyedPubSub)})},
 args: [],
 source: "clean\x0a\x09queue := queue select: [ :each | each isEnabled ]",
 messageSends: ["select:", "isEnabled"],
@@ -349,7 +344,7 @@ category: 'enumeration',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@queue"])._do_(aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.SimpleKeyedPubSub)})},
+return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.SimpleKeyedPubSub)})},
 args: ["aBlock"],
 source: "do: aBlock\x0a\x09queue do: aBlock",
 messageSends: ["do:"],
@@ -366,7 +361,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.KeyedPubSubBase.fn.prototype._initialize.apply(_st(self), []);
 self["@queue"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.SimpleKeyedPubSub)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
 args: [],
 source: "initialize\x0a    super initialize.\x0a\x09queue := OrderedCollection new",
 messageSends: ["initialize", "new"],
@@ -389,7 +384,7 @@ category: 'testing',
 fn: function (aKey){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey}, smalltalk.KeyedSubscriptionBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.KeyedSubscriptionBase)})},
 args: ["aKey"],
 source: "accepts: aKey\x0a    \x22Should return true if change for aKey is relevant for this subscription\x22\x0a    self subclassResponsibility",
 messageSends: ["subclassResponsibility"],
@@ -405,7 +400,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@flagged"]=true;
-return self}, function($ctx1) {$ctx1.fill(self,"flag",{}, smalltalk.KeyedSubscriptionBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"flag",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
 source: "flag\x0a\x09flagged := true",
 messageSends: [],
@@ -424,7 +419,7 @@ return smalltalk.withContext(function($ctx1) { 
smalltalk.Object.fn.prototype._i
 self["@key"]=nil;
 self["@actionBlock"]=nil;
 self["@flagged"]=false;
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.KeyedSubscriptionBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a    key := nil.\x0a    actionBlock := nil.\x0a    flagged := false.",
 messageSends: ["initialize"],
@@ -442,7 +437,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@actionBlock"])._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isEnabled",{}, smalltalk.KeyedSubscriptionBase)})},
+}, function($ctx1) {$ctx1.fill(self,"isEnabled",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
 source: "isEnabled\x0a\x09^actionBlock notNil",
 messageSends: ["notNil"],
@@ -460,7 +455,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@flagged"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isFlagged",{}, smalltalk.KeyedSubscriptionBase)})},
+}, function($ctx1) {$ctx1.fill(self,"isFlagged",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
 source: "isFlagged\x0a\x09^flagged",
 messageSends: [],
@@ -477,7 +472,7 @@ fn: function (anObject,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@key"]=anObject;
 self["@actionBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock}, smalltalk.KeyedSubscriptionBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"key:block:",{anObject:anObject,aBlock:aBlock},smalltalk.KeyedSubscriptionBase)})},
 args: ["anObject", "aBlock"],
 source: "key: anObject block: aBlock\x0a\x09key := anObject.\x0a    actionBlock := aBlock",
 messageSends: [],
@@ -503,7 +498,7 @@ return self["@flagged"];
 return smalltalk.withContext(function($ctx2) {
self["@actionBlock"]=nil;
 return self["@actionBlock"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"run",{}, smalltalk.KeyedSubscriptionBase)})},
+return self}, function($ctx1) {$ctx1.fill(self,"run",{},smalltalk.KeyedSubscriptionBase)})},
 args: [],
 source: "run\x0a\x09[[ actionBlock value ] ensure: [ flagged := false ]]\x0a    on: KeyedPubSubUnsubscribe do: [ actionBlock := nil ]",
 messageSends: ["on:do:", "ensure:", "value"],
@@ -526,7 +521,7 @@ $1=_st(_st(_st(aKey)._size()).__lt_eq(_st(self["@key"])._size()))._and_((functio
 return smalltalk.withContext(function($ctx2) {
return _st(aKey).__eq(_st(self["@key"])._copyFrom_to_((1),_st(aKey)._size()));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey}, smalltalk.ListKeyedSubscription)})},
+}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.ListKeyedSubscription)})},
 args: ["aKey"],
 source: "accepts: aKey\x0a    ^aKey size <= key size and: [aKey = (key copyFrom: 1 to: aKey size)]",
 messageSends: ["and:", "=", "copyFrom:to:", "size", "<="],
@@ -548,7 +543,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@dispatcher"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"dispatcher",{}, smalltalk.ListKeyedEntity)})},
+}, function($ctx1) {$ctx1.fill(self,"dispatcher",{},smalltalk.ListKeyedEntity)})},
 args: [],
 source: "dispatcher\x0a\x09^dispatcher",
 messageSends: [],
@@ -573,7 +568,7 @@ return $3;
 }, function($ctx2) {$ctx2.fillBlock({key:key,block:block},$ctx1)})}));
 $4=_st($1)._yourself();
 self["@dispatcher"]=$4;
-return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher}, smalltalk.ListKeyedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"dispatcher:",{aDispatcher:aDispatcher},smalltalk.ListKeyedEntity)})},
 args: ["aDispatcher"],
 source: "dispatcher: aDispatcher\x0a\x09dispatcher := aDispatcher\x0a        subscriptionFactory: [ :key :block | ListKeyedSubscription new key: key block: block; yourself ];\x0a        yourself",
 messageSends: ["subscriptionFactory:", "key:block:", "new", "yourself"],
@@ -590,7 +585,7 @@ fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@payload"]=anObject;
 _st(_st(self)._dispatcher())._changed_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject}, smalltalk.ListKeyedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
 args: ["anObject"],
 source: "model: anObject\x0a\x09payload := anObject.\x0a    self dispatcher changed: #()",
 messageSends: ["changed:", "dispatcher"],
@@ -608,7 +603,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._dispatcher())._on_hook_(path,(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._read_do_(path,aBlock);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock}, smalltalk.ListKeyedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"watch:do:",{path:path,aBlock:aBlock},smalltalk.ListKeyedEntity)})},
 args: ["path", "aBlock"],
 source: "watch: path do: aBlock\x0a\x09self dispatcher on: path hook: [ self read: path do: aBlock ]\x0a",
 messageSends: ["on:hook:", "read:do:", "dispatcher"],
@@ -635,7 +630,7 @@ return smalltalk.withContext(function($ctx2) {
return _st(eavModel)._on_put_(sel
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._dispatcher())._changed_(path);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel}, smalltalk.ListKeyedDirectEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,newValue:newValue,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
 args: ["path", "aBlock"],
 source: "modify: path do: aBlock\x0a    | newValue eavModel |\x0a    eavModel := path asEavModel.\x0a    newValue := aBlock value: (eavModel on: payload).\x0a    [ eavModel on: payload put: newValue ] ensure: [ self dispatcher changed: path ]\x0a",
 messageSends: ["asEavModel", "value:", "on:", "ensure:", "changed:", "dispatcher", "on:put:"],
@@ -653,7 +648,7 @@ var self=this;
 var eavModel;
 return smalltalk.withContext(function($ctx1) { 
eavModel=_st(path)._asEavModel();
 _st(aBlock)._value_(_st(eavModel)._on_(self["@payload"]));
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedDirectEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedDirectEntity)})},
 args: ["path", "aBlock"],
 source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := path asEavModel.\x0a    aBlock value: (eavModel on: payload)\x0a",
 messageSends: ["asEavModel", "value:", "on:"],
@@ -673,7 +668,7 @@ category: 'accessing',
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.ListKeyedEntity.fn.prototype._model_.apply(_st(self), [_st((smalltalk.Isolator || Isolator))._on_(anObject)]);
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject}, smalltalk.ListKeyedIsolatedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
 args: ["anObject"],
 source: "model: anObject\x0a\x09super model: (Isolator on: anObject)",
 messageSends: ["model:", "on:"],
@@ -695,7 +690,7 @@ return smalltalk.withContext(function($ctx2) {
return _st(self["@payload"])._mod
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._dispatcher())._changed_(path);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedIsolatedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
 args: ["path", "aBlock"],
 source: "modify: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({#root},path) asEavModel.\x0a    [ payload model: eavModel modify: aBlock ] ensure: [ self dispatcher changed: path ]\x0a",
 messageSends: ["asEavModel", ",", "ensure:", "changed:", "dispatcher", "model:modify:"],
@@ -713,7 +708,7 @@ var self=this;
 var eavModel;
 return smalltalk.withContext(function($ctx1) { 
eavModel=_st(_st([smalltalk.symbolFor("root")]).__comma(path))._asEavModel();
 _st(self["@payload"])._model_read_(eavModel,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel}, smalltalk.ListKeyedIsolatedEntity)})},
+return self}, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},smalltalk.ListKeyedIsolatedEntity)})},
 args: ["path", "aBlock"],
 source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := ({#root},path) asEavModel.\x0a    payload model: eavModel read: aBlock\x0a",
 messageSends: ["asEavModel", ",", "model:read:"],

+ 25 - 25
lib/js/Trapped-Demo.deploy.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Demo', {});
+smalltalk.addPackage('Trapped-Demo');
 smalltalk.addClass('App', smalltalk.ListKeyedIsolatedEntity, [], 'Trapped-Demo');
 smalltalk.addMethod(
 "_initialize",
@@ -14,8 +14,8 @@ return smalltalk.withContext(function($ctx2) {
return _st(self)._modify_do_([sma
 return smalltalk.withContext(function($ctx3) {
return [smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt("learn trapped"),_st("done").__minus_gt(true)]),smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt("build a trapped app"),_st("done").__minus_gt(false)])];
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.App)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
+messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "valueWithTimeout:", "modify:do:", "->"]}),
 smalltalk.App);
 
 
@@ -29,8 +29,8 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._todos())._add_(smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt(_st(self)._todoText()),_st("done").__minus_gt(false)]));
 _st(self)._todoText_("");
-return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{}, smalltalk.AppModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{},smalltalk.AppModel)})},
+messageSends: ["add:", "->", "todoText", "todos", "todoText:"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -40,8 +40,8 @@ selector: "archive",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._todos_(_st(self)._todosNotDone());
-return self}, function($ctx1) {$ctx1.fill(self,"archive",{}, smalltalk.AppModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"archive",{},smalltalk.AppModel)})},
+messageSends: ["todos:", "todosNotDone"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -53,8 +53,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(self)._todosNotDone())._size();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"remaining",{}, smalltalk.AppModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"remaining",{},smalltalk.AppModel)})},
+messageSends: ["size", "todosNotDone"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -66,8 +66,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@title"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.AppModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"title",{},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -77,8 +77,8 @@ selector: "title:",
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@title"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString}, smalltalk.AppModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -90,8 +90,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@todoText"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todoText",{}, smalltalk.AppModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"todoText",{},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -101,8 +101,8 @@ selector: "todoText:",
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@todoText"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString}, smalltalk.AppModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -114,8 +114,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@todos"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todos",{}, smalltalk.AppModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"todos",{},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -125,8 +125,8 @@ selector: "todos:",
 fn: function (anArray){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@todos"]=anArray;
-return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray}, smalltalk.AppModel)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray},smalltalk.AppModel)})},
+messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
@@ -140,8 +140,8 @@ $1=_st(_st(self)._todos())._reject_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._at_("done");
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{}, smalltalk.AppModel)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{},smalltalk.AppModel)})},
+messageSends: ["reject:", "at:", "todos"]}),
 smalltalk.AppModel);
 
 
@@ -214,8 +214,8 @@ return $8;
 return smalltalk.withContext(function($ctx3) {
return _st(html)._with_("Loading ...");
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.AppView)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.AppView)})},
+messageSends: ["trapDescend:", "trap:", "h2", "trap:toggle:ifNotPresent:", "do:", "span", "with:", "href:", "a", "onClick:", "modify:", "archive", "trapIter:tag:do:", "empty", "root", "type:", "input", "trap:read:", "class:", ",", "ul", "onSubmit:", "addTodo", "form", "at:put:", "placeholder:", "value:", "div"]}),
 smalltalk.AppView);
 
 

+ 13 - 13
lib/js/Trapped-Demo.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Demo', {});
+smalltalk.addPackage('Trapped-Demo');
 smalltalk.addClass('App', smalltalk.ListKeyedIsolatedEntity, [], 'Trapped-Demo');
 smalltalk.App.comment="// Code from AngularJS Todo example, http://angularjs.org/#todo-js\x0afunction TodoCtrl($scope) {\x0a  $scope.todos = [\x0a    {text:'learn angular', done:true},\x0a    {text:'build an angular app', done:false}];\x0a \x0a  $scope.addTodo = function() {\x0a    $scope.todos.push({text:$scope.todoText, done:false});\x0a    $scope.todoText = '';\x0a  };\x0a \x0a  $scope.remaining = function() {\x0a    var count = 0;\x0a    angular.forEach($scope.todos, function(todo) {\x0a      count += todo.done ? 0 : 1;\x0a    });\x0a    return count;\x0a  };\x0a \x0a  $scope.archive = function() {\x0a    var oldTodos = $scope.todos;\x0a    $scope.todos = [];\x0a    angular.forEach(oldTodos, function(todo) {\x0a      if (!todo.done) $scope.todos.push(todo);\x0a    });\x0a  };\x0a}"
 smalltalk.addMethod(
@@ -16,7 +16,7 @@ return smalltalk.withContext(function($ctx2) {
return _st(self)._modify_do_([sma
 return smalltalk.withContext(function($ctx3) {
return [smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt("learn trapped"),_st("done").__minus_gt(true)]),smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt("build a trapped app"),_st("done").__minus_gt(false)])];
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.App)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a    self dispatcher: SimpleKeyedPubSub new.\x0a    self model: (AppModel new title: 'Todo').\x0a    [ self modify: #(#todos) do: [{\x0a        #{'text'->'learn trapped'. 'done'->true}.\x0a        #{'text'->'build a trapped app'. 'done'->false}\x0a    }]] valueWithTimeout: 2000\x0a",
 messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "valueWithTimeout:", "modify:do:", "->"],
@@ -37,7 +37,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._todos())._add_(smalltalk.HashedCollection._fromPairs_([_st("text").__minus_gt(_st(self)._todoText()),_st("done").__minus_gt(false)]));
 _st(self)._todoText_("");
-return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{}, smalltalk.AppModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{},smalltalk.AppModel)})},
 args: [],
 source: "addTodo\x0a    self todos add: #{'text'->self todoText. 'done'->false}.\x0a    self todoText: ''",
 messageSends: ["add:", "->", "todoText", "todos", "todoText:"],
@@ -53,7 +53,7 @@ category: 'action',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._todos_(_st(self)._todosNotDone());
-return self}, function($ctx1) {$ctx1.fill(self,"archive",{}, smalltalk.AppModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"archive",{},smalltalk.AppModel)})},
 args: [],
 source: "archive\x0a    self todos: self todosNotDone",
 messageSends: ["todos:", "todosNotDone"],
@@ -71,7 +71,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(_st(self)._todosNotDone())._size();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"remaining",{}, smalltalk.AppModel)})},
+}, function($ctx1) {$ctx1.fill(self,"remaining",{},smalltalk.AppModel)})},
 args: [],
 source: "remaining\x0a    ^self todosNotDone size",
 messageSends: ["size", "todosNotDone"],
@@ -89,7 +89,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@title"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"title",{}, smalltalk.AppModel)})},
+}, function($ctx1) {$ctx1.fill(self,"title",{},smalltalk.AppModel)})},
 args: [],
 source: "title\x0a\x09^title",
 messageSends: [],
@@ -105,7 +105,7 @@ category: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@title"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString}, smalltalk.AppModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString},smalltalk.AppModel)})},
 args: ["aString"],
 source: "title: aString\x0a\x09title := aString",
 messageSends: [],
@@ -123,7 +123,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@todoText"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todoText",{}, smalltalk.AppModel)})},
+}, function($ctx1) {$ctx1.fill(self,"todoText",{},smalltalk.AppModel)})},
 args: [],
 source: "todoText\x0a\x09^todoText",
 messageSends: [],
@@ -139,7 +139,7 @@ category: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@todoText"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString}, smalltalk.AppModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString},smalltalk.AppModel)})},
 args: ["aString"],
 source: "todoText: aString\x0a\x09todoText := aString",
 messageSends: [],
@@ -157,7 +157,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@todos"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todos",{}, smalltalk.AppModel)})},
+}, function($ctx1) {$ctx1.fill(self,"todos",{},smalltalk.AppModel)})},
 args: [],
 source: "todos\x0a\x09^todos",
 messageSends: [],
@@ -173,7 +173,7 @@ category: 'accessing',
 fn: function (anArray){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@todos"]=anArray;
-return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray}, smalltalk.AppModel)})},
+return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray},smalltalk.AppModel)})},
 args: ["anArray"],
 source: "todos: anArray\x0a\x09todos := anArray",
 messageSends: [],
@@ -193,7 +193,7 @@ $1=_st(_st(self)._todos())._reject_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(each)._at_("done");
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{}, smalltalk.AppModel)})},
+}, function($ctx1) {$ctx1.fill(self,"todosNotDone",{},smalltalk.AppModel)})},
 args: [],
 source: "todosNotDone\x0a    ^self todos reject: [ :each | each at: 'done' ]",
 messageSends: ["reject:", "at:", "todos"],
@@ -273,7 +273,7 @@ return $8;
 return smalltalk.withContext(function($ctx3) {
return _st(html)._with_("Loading ...");
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.AppView)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.AppView)})},
 args: ["html"],
 source: "renderOn: html\x0a    #() trapDescend: [ :snap |\x0a\x09html h2 trap: #(#title).\x0a    html div trap: #(#todos) toggle: [ snap do: [\x0a        html span trap:#(#remaining).\x0a        html with: ' of '.\x0a        html span trap: #(#todos #size).\x0a        html with: ' remaining [ '.\x0a        html a href:''; onClick: [\x0a            snap modify: [ :model | model archive ].\x0a            false\x0a        ]; with: 'archive'.\x0a        html with: ' ]'.\x0a        html ul with: [ html trapIter: #(#todos) tag: #li do: [ :each |\x0a            html root empty.\x0a            html input type: 'checkbox'; trap: #('done').\x0a            html span trap: #('done') read: [ :model | html root class: 'done-', model ]; trap: #('text').\x0a        ]].\x0a        html form onSubmit: [\x0a            snap modify: [ :model | model addTodo ].\x0a            false\x0a        ]; with: [\x0a            html input type: 'text'; trap: #(#todoText); at: 'size' put: 30; placeholder: 'add new todo here'.\x0a            html input class: 'btn-primary'; type: 'submit'; value: 'add'.\x0a        ].\x0a    ]] ifNotPresent: [ html with: 'Loading ...' ]]",
 messageSends: ["trapDescend:", "trap:", "h2", "trap:toggle:ifNotPresent:", "do:", "span", "with:", "href:", "a", "onClick:", "modify:", "archive", "trapIter:tag:do:", "empty", "root", "type:", "input", "trap:read:", "class:", ",", "ul", "onSubmit:", "addTodo", "form", "at:put:", "placeholder:", "value:", "div"],

+ 107 - 115
lib/js/Trapped-Frontend.deploy.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Frontend', {});
+smalltalk.addPackage('Trapped-Frontend');
 smalltalk.addClass('TrappedBinder', smalltalk.Object, ['brush'], 'Trapped-Frontend');
 smalltalk.addMethod(
 "_brush_",
@@ -7,8 +7,8 @@ selector: "brush:",
 fn: function (aTagBrush){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@brush"]=aTagBrush;
-return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush}, smalltalk.TrappedBinder)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush},smalltalk.TrappedBinder)})},
+messageSends: []}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
@@ -18,8 +18,8 @@ selector: "installFor:",
 fn: function (path){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@brush"])._trap_read_(path,_st(self)._showBlock());
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedBinder)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedBinder)})},
+messageSends: ["trap:read:", "showBlock"]}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
@@ -29,8 +29,8 @@ selector: "prim:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
return anObject.valueOf();
-return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject}, smalltalk.TrappedBinder)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject},smalltalk.TrappedBinder)})},
+messageSends: []}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
@@ -55,8 +55,8 @@ $3=_st($4)._with_($5);
 return $3;
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedBinder)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedBinder)})},
+messageSends: ["empty", "with:", "ifNil:"]}),
 smalltalk.TrappedBinder);
 
 
@@ -76,8 +76,8 @@ return smalltalk.withContext(function($ctx4) {
return _st(_st(_st(self["@brush"]
 }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedCheckedBinder)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedCheckedBinder)})},
+messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "notNil", "attr:", "asJQuery"]}),
 smalltalk.TrappedCheckedBinder);
 
 smalltalk.addMethod(
@@ -95,8 +95,8 @@ return smalltalk.withContext(function($ctx3) {
return false;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedCheckedBinder)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedCheckedBinder)})},
+messageSends: ["attr:put:", "ifNotNil:ifNil:", "prim:", "asJQuery"]}),
 smalltalk.TrappedCheckedBinder);
 
 
@@ -116,8 +116,8 @@ return smalltalk.withContext(function($ctx4) {
return _st(_st(self["@brush"])._a
 }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedValBinder)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedValBinder)})},
+messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "val", "asJQuery"]}),
 smalltalk.TrappedValBinder);
 
 smalltalk.addMethod(
@@ -136,8 +136,8 @@ return smalltalk.withContext(function($ctx4) {
}, function($ctx4) {$ctx4.fillBlo
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedValBinder)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedValBinder)})},
+messageSends: ["val:", "ifNotNil:ifNil:", "prim:", "asJQuery"]}),
 smalltalk.TrappedValBinder);
 
 
@@ -150,8 +150,8 @@ selector: "renderOn:",
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(html)._root())._trap_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.TrappedDumbView)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TrappedDumbView)})},
+messageSends: ["trap:", "root"]}),
 smalltalk.TrappedDumbView);
 
 
@@ -166,8 +166,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self)._subclassResponsibility();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.TrappedSingleton)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
+messageSends: ["subclassResponsibility"]}),
 smalltalk.TrappedSingleton);
 
 
@@ -187,8 +187,8 @@ $1=self["@current"];
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.TrappedSingleton.klass)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TrappedSingleton.klass)})},
+messageSends: ["ifNil:", "new"]}),
 smalltalk.TrappedSingleton.klass);
 
 smalltalk.addMethod(
@@ -198,8 +198,8 @@ selector: "start:",
 fn: function (args){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._current())._start_(args);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.TrappedSingleton.klass)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
+messageSends: ["start:", "current"]}),
 smalltalk.TrappedSingleton.klass);
 
 
@@ -211,39 +211,37 @@ selector: "binder:",
 fn: function (aTagBrush){
 var self=this;
 var binder,tag;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$2,$5,$7,$8,$6;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$6,$7,$5;
 tag=_st(_st(aTagBrush)._element())._nodeName();
 $1=_st(tag).__eq("INPUT");
-$2=(function(){
-var type;
-return smalltalk.withContext(function($ctx2) {
type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
+if(smalltalk.assert($1)){
+type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
 type;
-$3=_st(type).__eq("checkbox");
-if(smalltalk.assert($3)){
+$2=_st(type).__eq("checkbox");
+if(smalltalk.assert($2)){
 binder=_st((smalltalk.TrappedCheckedBinder || TrappedCheckedBinder))._new();
 binder;
 };
-$4=_st(type).__eq("text");
-if(smalltalk.assert($4)){
+$3=_st(type).__eq("text");
+if(smalltalk.assert($3)){
 binder=_st((smalltalk.TrappedValBinder || TrappedValBinder))._new();
-return binder;
+binder;
 };
-}, function($ctx2) {$ctx2.fillBlock({type:type},$ctx1)})});
-_st($1)._ifTrue_($2);
-$5=binder;
-if(($receiver = $5) == nil || $receiver == undefined){
+};
+$4=binder;
+if(($receiver = $4) == nil || $receiver == undefined){
 binder=_st((smalltalk.TrappedBinder || TrappedBinder))._new();
 binder;
 } else {
-$5;
+$4;
 };
-$7=binder;
-_st($7)._brush_(aTagBrush);
-$8=_st($7)._yourself();
-$6=$8;
-return $6;
-}, function($ctx1) {$ctx1.fill(self,"binder:",{aTagBrush:aTagBrush,binder:binder,tag:tag}, smalltalk.Trapped)})}
-}),
+$6=binder;
+_st($6)._brush_(aTagBrush);
+$7=_st($6)._yourself();
+$5=$7;
+return $5;
+}, function($ctx1) {$ctx1.fill(self,"binder:",{aTagBrush:aTagBrush,binder:binder,tag:tag},smalltalk.Trapped)})},
+messageSends: ["nodeName", "element", "ifTrue:", "attr:", "asJQuery", "new", "=", "ifNil:", "brush:", "yourself"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -255,8 +253,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@registry"])._at_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString}, smalltalk.Trapped)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString},smalltalk.Trapped)})},
+messageSends: ["at:"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -275,8 +273,8 @@ model=_st(self)._byName_(_st(path)._first());
 model;
 return _st(aBlock)._value_(_st(_st((smalltalk.TrappedSnapshot || TrappedSnapshot))._new())._path_model_(path,model));
 }, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc}, smalltalk.Trapped)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},smalltalk.Trapped)})},
+messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -287,8 +285,8 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
 self["@registry"]=smalltalk.HashedCollection._fromPairs_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Trapped)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
+messageSends: ["initialize"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -298,8 +296,8 @@ selector: "register:",
 fn: function (aListKeyedEntity){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity}, smalltalk.Trapped)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},smalltalk.Trapped)})},
+messageSends: ["register:name:", "name", "class"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -309,8 +307,8 @@ selector: "register:name:",
 fn: function (aListKeyedEntity,aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@registry"])._at_put_(aString,aListKeyedEntity);
-return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString}, smalltalk.Trapped)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString},smalltalk.Trapped)})},
+messageSends: ["at:put:"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
@@ -319,12 +317,11 @@ smalltalk.method({
 selector: "start:",
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1;
 _st(args)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._register_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-$1=_st("[data-trap]")._asJQuery();
-$2=(function(index,elem){
+_st(_st("[data-trap]")._asJQuery())._each_((function(index,elem){
 var trap,jq,viewName,modelName,tokens,path;
 return smalltalk.withContext(function($ctx2) {
jq=_st(elem)._asJQuery();
 jq;
@@ -332,8 +329,8 @@ trap=_st(jq)._attr_("data-trap");
 trap;
 tokens=_st(trap)._tokenize_(":");
 tokens;
-$3=_st(_st(tokens)._size()).__eq((1));
-if(smalltalk.assert($3)){
+$1=_st(_st(tokens)._size()).__eq((1));
+if(smalltalk.assert($1)){
 tokens=_st(["TrappedDumbView"]).__comma(tokens);
 tokens;
 };
@@ -350,10 +347,9 @@ path;
 return _st(_st([modelName]).__comma(path))._trapDescend_((function(){
 return smalltalk.withContext(function($ctx3) {
return _st(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(viewName))._new())._appendToJQuery_(jq);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1)})});
-_st($1)._each_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.Trapped)})}
-}),
+}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.Trapped)})},
+messageSends: ["do:", "register:", "each:", "asJQuery", "attr:", "tokenize:", "ifTrue:", ",", "=", "size", "first", "select:", "notEmpty", "second", "parse:", "allButFirst", "trapDescend:", "appendToJQuery:", "new", "at:", "current"]}),
 smalltalk.Trapped);
 
 
@@ -372,8 +368,8 @@ return smalltalk.withContext(function($ctx3) {
return _st(_st(html)._perform_(aS
 return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
 }, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1)})}));
 _st(envjq)._remove();
-return self}, function($ctx1) {$ctx1.fill(self,"envelope:loop:before:tag:do:",{envelope:envelope,model:model,endjq:endjq,aSymbol:aSymbol,aBlock:aBlock,envjq:envjq}, smalltalk.Trapped.klass)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"envelope:loop:before:tag:do:",{envelope:envelope,model:model,endjq:endjq,aSymbol:aSymbol,aBlock:aBlock,envjq:envjq},smalltalk.Trapped.klass)})},
+messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "insertBefore:", "detach", "children", "remove"]}),
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
@@ -392,8 +388,8 @@ return $1;
 return _st(self)._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
 };
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:tag:do:",{model:model,start:start,end:end,aSymbol:aSymbol,aBlock:aBlock}, smalltalk.Trapped.klass)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:tag:do:",{model:model,start:start,end:end,aSymbol:aSymbol,aBlock:aBlock},smalltalk.Trapped.klass)})},
+messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"]}),
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
@@ -402,29 +398,25 @@ smalltalk.method({
 selector: "parse:",
 fn: function (anArray){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$4,$5,$7,$6,$3,$1;
-$2=anArray;
-$3=(function(each){
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+$1=_st(anArray)._collect_((function(each){
 var asNum;
 return smalltalk.withContext(function($ctx2) {
_st(asNum).__eq(_st(each)._asNumber());
-$4=_st(asNum).__eq(asNum);
-$5=(function(){
-return smalltalk.withContext(function($ctx3) {
return asNum;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-$6=(function(){
-return smalltalk.withContext(function($ctx3) {
$7=_st(_st(each)._first()).__eq("#");
-if(smalltalk.assert($7)){
+$2=_st(asNum).__eq(asNum);
+if(smalltalk.assert($2)){
+return asNum;
+} else {
+$3=_st(_st(each)._first()).__eq("#");
+if(smalltalk.assert($3)){
 return _st(_st(each)._allButFirst())._asSymbol();
 } else {
 return each;
 };
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-return _st($4)._ifTrue_ifFalse_($5,$6);
-}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1)})});
-$1=_st($2)._collect_($3);
+};
+}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"parse:",{anArray:anArray}, smalltalk.Trapped.klass)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"parse:",{anArray:anArray},smalltalk.Trapped.klass)})},
+messageSends: ["collect:", "=", "asNumber", "ifTrue:ifFalse:", "asSymbol", "allButFirst", "first"]}),
 smalltalk.Trapped.klass);
 
 
@@ -436,8 +428,8 @@ selector: "append:do:",
 fn: function (anArray,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock}, smalltalk.TrappedPathStack)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},smalltalk.TrappedPathStack)})},
+messageSends: ["with:do:", ","]}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
@@ -449,8 +441,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@elements"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"elements",{}, smalltalk.TrappedPathStack)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
+messageSends: []}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
@@ -461,8 +453,8 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
 self["@elements"]=[];
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.TrappedPathStack)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
+messageSends: ["initialize"]}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
@@ -481,8 +473,8 @@ return _st(aBlock)._value();
 return smalltalk.withContext(function($ctx2) {
self["@elements"]=old;
 return self["@elements"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old}, smalltalk.TrappedPathStack)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},smalltalk.TrappedPathStack)})},
+messageSends: ["ensure:", "value"]}),
 smalltalk.TrappedPathStack);
 
 
@@ -497,8 +489,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st((smalltalk.TrappedPathStack || TrappedPathStack))._current())._with_do_(self["@path"],(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(aBlock)._value_(self["@model"]);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.TrappedSnapshot)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
+messageSends: ["with:do:", "value:", "current"]}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
@@ -510,8 +502,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@model"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"model",{}, smalltalk.TrappedSnapshot)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
+messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
@@ -521,8 +513,8 @@ selector: "modify:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._modify_do_(_st(_st(self)._path())._allButFirst(),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock}, smalltalk.TrappedSnapshot)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
+messageSends: ["modify:do:", "allButFirst", "path", "model"]}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
@@ -534,8 +526,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@path"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"path",{}, smalltalk.TrappedSnapshot)})}
-}),
+}, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
+messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
@@ -546,8 +538,8 @@ fn: function (anArray,aTrappedMW){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@path"]=anArray;
 self["@model"]=aTrappedMW;
-return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW}, smalltalk.TrappedSnapshot)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW},smalltalk.TrappedSnapshot)})},
+messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 
@@ -559,8 +551,8 @@ selector: "trapDescend:",
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st((smalltalk.Trapped || Trapped))._current())._descend_snapshotDo_(self,aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock}, smalltalk.Array)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock}, smalltalk.Array)})},
+messageSends: ["descend:snapshotDo:", "current"]}),
 smalltalk.Array);
 
 smalltalk.addMethod(
@@ -579,8 +571,8 @@ return end;
 _st(start)._trap_read_(path,(function(model){
 return smalltalk.withContext(function($ctx2) {
return _st((smalltalk.Trapped || Trapped))._loop_between_and_tag_do_(model,start,end,aSymbol,aBlock);
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trapIter:tag:do:",{path:path,aSymbol:aSymbol,aBlock:aBlock,start:start,end:end}, smalltalk.HTMLCanvas)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trapIter:tag:do:",{path:path,aSymbol:aSymbol,aBlock:aBlock,start:start,end:end}, smalltalk.HTMLCanvas)})},
+messageSends: ["with:", "script", "trap:read:", "loop:between:and:tag:do:"]}),
 smalltalk.HTMLCanvas);
 
 smalltalk.addMethod(
@@ -590,8 +582,8 @@ selector: "trap:",
 fn: function (path){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(_st((smalltalk.Trapped || Trapped))._current())._binder_(self))._installFor_(path);
-return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path}, smalltalk.TagBrush)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path}, smalltalk.TagBrush)})},
+messageSends: ["installFor:", "binder:", "current"]}),
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
@@ -619,8 +611,8 @@ return smalltalk.withContext(function($ctx5) {
return _st(aBlock)._value_value_(
 return _st($3)._watch_do_($4,$5);
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})});
 _st($1)._trapDescend_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock}, smalltalk.TagBrush)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock}, smalltalk.TagBrush)})},
+messageSends: ["trapDescend:", "watch:do:", "allButFirst", "path", "ifTrue:", "signal", "isEmpty", "toArray", "closest:", "asJQuery", "do:", "with:", "value:value:", "model"]}),
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
@@ -632,8 +624,8 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._trap_toggle_ifNotPresent_(path,aBlock,(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(_st(self)._asJQuery())._hide();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:",{path:path,aBlock:aBlock}, smalltalk.TagBrush)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:",{path:path,aBlock:aBlock}, smalltalk.TagBrush)})},
+messageSends: ["trap:toggle:ifNotPresent:", "hide", "asJQuery"]}),
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
@@ -667,7 +659,7 @@ return _st($8)._value_value_(data,html);
 return _st($4)._ifFalse_($5);
 }, function($ctx2) {$ctx2.fillBlock({data:data,html:html},$ctx1)})});
 _st($1)._trap_read_($2,$3);
-return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:ifNotPresent:",{path:path,aBlock:aBlock,anotherBlock:anotherBlock,shown:shown}, smalltalk.TagBrush)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:ifNotPresent:",{path:path,aBlock:aBlock,anotherBlock:anotherBlock,shown:shown}, smalltalk.TagBrush)})},
+messageSends: ["trap:read:", "ifFalse:", "notNil", "empty", "asJQuery", "show", "value:value:", "ifTrue:ifFalse:", "="]}),
 smalltalk.TagBrush);
 

+ 64 - 72
lib/js/Trapped-Frontend.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Frontend', {});
+smalltalk.addPackage('Trapped-Frontend');
 smalltalk.addClass('TrappedBinder', smalltalk.Object, ['brush'], 'Trapped-Frontend');
 smalltalk.addMethod(
 "_brush_",
@@ -8,7 +8,7 @@ category: 'accessing',
 fn: function (aTagBrush){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@brush"]=aTagBrush;
-return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush}, smalltalk.TrappedBinder)})},
+return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush},smalltalk.TrappedBinder)})},
 args: ["aTagBrush"],
 source: "brush: aTagBrush\x0a\x09brush := aTagBrush",
 messageSends: [],
@@ -24,7 +24,7 @@ category: 'action',
 fn: function (path){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@brush"])._trap_read_(path,_st(self)._showBlock());
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedBinder)})},
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedBinder)})},
 args: ["path"],
 source: "installFor: path\x0a\x09brush trap: path read: self showBlock",
 messageSends: ["trap:read:", "showBlock"],
@@ -40,7 +40,7 @@ category: 'converting',
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
return anObject.valueOf();
-return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject}, smalltalk.TrappedBinder)})},
+return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject},smalltalk.TrappedBinder)})},
 args: ["anObject"],
 source: "prim: anObject\x0a\x09<return anObject.valueOf()>",
 messageSends: [],
@@ -71,7 +71,7 @@ $3=_st($4)._with_($5);
 return $3;
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedBinder)})},
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedBinder)})},
 args: [],
 source: "showBlock\x0a\x09^[ :model | brush empty; with: (model ifNil: [[]]) ]",
 messageSends: ["empty", "with:", "ifNil:"],
@@ -97,7 +97,7 @@ return smalltalk.withContext(function($ctx4) {
return _st(_st(_st(self["@brush"]
 }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedCheckedBinder)})},
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedCheckedBinder)})},
 args: ["path"],
 source: "installFor: path\x0a\x09super installFor: path.\x0a    path trapDescend: [ :snap |\x0a\x09    brush onChange: [ snap modify: [\x0a            (brush asJQuery attr: 'checked') notNil\x0a        ]]\x0a    ]",
 messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "notNil", "attr:", "asJQuery"],
@@ -121,7 +121,7 @@ return smalltalk.withContext(function($ctx3) {
return false;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedCheckedBinder)})},
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedCheckedBinder)})},
 args: [],
 source: "showBlock\x0a\x09^[ :model | brush asJQuery attr: 'checked' put: (model ifNotNil: [ self prim: model ] ifNil: [ false ]) ]",
 messageSends: ["attr:put:", "ifNotNil:ifNil:", "prim:", "asJQuery"],
@@ -147,7 +147,7 @@ return smalltalk.withContext(function($ctx4) {
return _st(_st(self["@brush"])._a
 }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path}, smalltalk.TrappedValBinder)})},
+return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedValBinder)})},
 args: ["path"],
 source: "installFor: path\x0a\x09super installFor: path.\x0a    path trapDescend: [ :snap |\x0a\x09    brush onChange: [ snap modify: [\x0a            brush asJQuery val\x0a        ]]\x0a    ]",
 messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "val", "asJQuery"],
@@ -172,7 +172,7 @@ return smalltalk.withContext(function($ctx4) {
}, function($ctx4) {$ctx4.fillBlo
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"showBlock",{}, smalltalk.TrappedValBinder)})},
+}, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedValBinder)})},
 args: [],
 source: "showBlock\x0a\x09^[ :model | brush asJQuery val: (model ifNotNil: [self prim: model] ifNil: [[]]) ]",
 messageSends: ["val:", "ifNotNil:ifNil:", "prim:", "asJQuery"],
@@ -192,7 +192,7 @@ category: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(html)._root())._trap_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html}, smalltalk.TrappedDumbView)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TrappedDumbView)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09html root trap: #()",
 messageSends: ["trap:", "root"],
@@ -213,7 +213,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self)._subclassResponsibility();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.TrappedSingleton)})},
+}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
 args: ["args"],
 source: "start: args\x0a\x09^ self subclassResponsibility",
 messageSends: ["subclassResponsibility"],
@@ -239,7 +239,7 @@ $1=self["@current"];
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{}, smalltalk.TrappedSingleton.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TrappedSingleton.klass)})},
 args: [],
 source: "current\x0a\x09^ current ifNil: [ current := self new ]",
 messageSends: ["ifNil:", "new"],
@@ -255,7 +255,7 @@ category: 'action',
 fn: function (args){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._current())._start_(args);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.TrappedSingleton.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
 args: ["args"],
 source: "start: args\x0a\x09self current start: args",
 messageSends: ["start:", "current"],
@@ -273,38 +273,36 @@ category: 'binders',
 fn: function (aTagBrush){
 var self=this;
 var binder,tag;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$2,$5,$7,$8,$6;
+return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$6,$7,$5;
 tag=_st(_st(aTagBrush)._element())._nodeName();
 $1=_st(tag).__eq("INPUT");
-$2=(function(){
-var type;
-return smalltalk.withContext(function($ctx2) {
type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
+if(smalltalk.assert($1)){
+type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
 type;
-$3=_st(type).__eq("checkbox");
-if(smalltalk.assert($3)){
+$2=_st(type).__eq("checkbox");
+if(smalltalk.assert($2)){
 binder=_st((smalltalk.TrappedCheckedBinder || TrappedCheckedBinder))._new();
 binder;
 };
-$4=_st(type).__eq("text");
-if(smalltalk.assert($4)){
+$3=_st(type).__eq("text");
+if(smalltalk.assert($3)){
 binder=_st((smalltalk.TrappedValBinder || TrappedValBinder))._new();
-return binder;
+binder;
 };
-}, function($ctx2) {$ctx2.fillBlock({type:type},$ctx1)})});
-_st($1)._ifTrue_($2);
-$5=binder;
-if(($receiver = $5) == nil || $receiver == undefined){
+};
+$4=binder;
+if(($receiver = $4) == nil || $receiver == undefined){
 binder=_st((smalltalk.TrappedBinder || TrappedBinder))._new();
 binder;
 } else {
-$5;
+$4;
 };
-$7=binder;
-_st($7)._brush_(aTagBrush);
-$8=_st($7)._yourself();
-$6=$8;
-return $6;
-}, function($ctx1) {$ctx1.fill(self,"binder:",{aTagBrush:aTagBrush,binder:binder,tag:tag}, smalltalk.Trapped)})},
+$6=binder;
+_st($6)._brush_(aTagBrush);
+$7=_st($6)._yourself();
+$5=$7;
+return $5;
+}, function($ctx1) {$ctx1.fill(self,"binder:",{aTagBrush:aTagBrush,binder:binder,tag:tag},smalltalk.Trapped)})},
 args: ["aTagBrush"],
 source: "binder: aTagBrush\x0a    \x22Prototype; will select based on tag etc.\x22\x0a    | binder tag |\x0a    tag := aTagBrush element nodeName.\x0a    tag = 'INPUT' ifTrue: [\x0a        | type |\x0a        type := aTagBrush asJQuery attr: 'type'.\x0a        type = 'checkbox' ifTrue: [ binder := TrappedCheckedBinder new ].\x0a        type = 'text' ifTrue: [ binder := TrappedValBinder new ]\x0a    ].\x0a    binder ifNil: [ binder := TrappedBinder new ].\x0a    ^ binder brush: aTagBrush; yourself",
 messageSends: ["nodeName", "element", "ifTrue:", "attr:", "asJQuery", "new", "=", "ifNil:", "brush:", "yourself"],
@@ -322,7 +320,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=_st(self["@registry"])._at_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString}, smalltalk.Trapped)})},
+}, function($ctx1) {$ctx1.fill(self,"byName:",{aString:aString},smalltalk.Trapped)})},
 args: ["aString"],
 source: "byName: aString\x0a\x09^ registry at: aString",
 messageSends: ["at:"],
@@ -347,7 +345,7 @@ model=_st(self)._byName_(_st(path)._first());
 model;
 return _st(aBlock)._value_(_st(_st((smalltalk.TrappedSnapshot || TrappedSnapshot))._new())._path_model_(path,model));
 }, function($ctx2) {$ctx2.fillBlock({path:path,model:model},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc}, smalltalk.Trapped)})},
+return self}, function($ctx1) {$ctx1.fill(self,"descend:snapshotDo:",{anArray:anArray,aBlock:aBlock,tpsc:tpsc},smalltalk.Trapped)})},
 args: ["anArray", "aBlock"],
 source: "descend: anArray snapshotDo: aBlock\x0a\x09| tpsc |\x0a    tpsc := TrappedPathStack current.\x0a    tpsc append: anArray do: [\x0a        | path model |\x0a        path := tpsc elements copy.\x0a   \x09    model := self byName: path first.\x0a        aBlock value: (TrappedSnapshot new path: path model: model)\x0a    ]",
 messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"],
@@ -364,7 +362,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
 self["@registry"]=smalltalk.HashedCollection._fromPairs_([]);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.Trapped)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09registry := #{}.",
 messageSends: ["initialize"],
@@ -380,7 +378,7 @@ category: 'accessing',
 fn: function (aListKeyedEntity){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity}, smalltalk.Trapped)})},
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},smalltalk.Trapped)})},
 args: ["aListKeyedEntity"],
 source: "register: aListKeyedEntity\x0a\x09self register: aListKeyedEntity name: aListKeyedEntity class name",
 messageSends: ["register:name:", "name", "class"],
@@ -396,7 +394,7 @@ category: 'accessing',
 fn: function (aListKeyedEntity,aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self["@registry"])._at_put_(aString,aListKeyedEntity);
-return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString}, smalltalk.Trapped)})},
+return self}, function($ctx1) {$ctx1.fill(self,"register:name:",{aListKeyedEntity:aListKeyedEntity,aString:aString},smalltalk.Trapped)})},
 args: ["aListKeyedEntity", "aString"],
 source: "register: aListKeyedEntity name: aString\x0a\x09registry at: aString put: aListKeyedEntity",
 messageSends: ["at:put:"],
@@ -411,12 +409,11 @@ selector: "start:",
 category: 'action',
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$2;
+return smalltalk.withContext(function($ctx1) { 
var $1;
 _st(args)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
return _st(self)._register_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-$1=_st("[data-trap]")._asJQuery();
-$2=(function(index,elem){
+_st(_st("[data-trap]")._asJQuery())._each_((function(index,elem){
 var trap,jq,viewName,modelName,tokens,path;
 return smalltalk.withContext(function($ctx2) {
jq=_st(elem)._asJQuery();
 jq;
@@ -424,8 +421,8 @@ trap=_st(jq)._attr_("data-trap");
 trap;
 tokens=_st(trap)._tokenize_(":");
 tokens;
-$3=_st(_st(tokens)._size()).__eq((1));
-if(smalltalk.assert($3)){
+$1=_st(_st(tokens)._size()).__eq((1));
+if(smalltalk.assert($1)){
 tokens=_st(["TrappedDumbView"]).__comma(tokens);
 tokens;
 };
@@ -442,9 +439,8 @@ path;
 return _st(_st([modelName]).__comma(path))._trapDescend_((function(){
 return smalltalk.withContext(function($ctx3) {
return _st(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(viewName))._new())._appendToJQuery_(jq);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1)})});
-_st($1)._each_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args}, smalltalk.Trapped)})},
+}, function($ctx2) {$ctx2.fillBlock({index:index,elem:elem,trap:trap,jq:jq,viewName:viewName,modelName:modelName,tokens:tokens,path:path},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.Trapped)})},
 args: ["args"],
 source: "start: args\x0a    args do: [ :each | self register: each ].\x0a\x09'[data-trap]' asJQuery each: [ :index :elem |\x0a    \x09| trap jq viewName modelName tokens path |\x0a        jq := elem asJQuery.\x0a        trap := jq attr: 'data-trap'.\x0a        tokens := trap tokenize: ':'.\x0a        tokens size = 1 ifTrue: [ tokens := { 'TrappedDumbView' }, tokens ].\x0a        viewName := tokens first.\x0a        tokens := (tokens second tokenize: ' ') select: [ :each | each notEmpty ].\x0a        modelName := tokens first.\x0a        path := Trapped parse: tokens allButFirst.\x0a        { modelName }, path trapDescend: [(Smalltalk current at: viewName) new appendToJQuery: jq].\x0a    ]",
 messageSends: ["do:", "register:", "each:", "asJQuery", "attr:", "tokenize:", "ifTrue:", ",", "=", "size", "first", "select:", "notEmpty", "second", "parse:", "allButFirst", "trapDescend:", "appendToJQuery:", "new", "at:", "current"],
@@ -469,7 +465,7 @@ return smalltalk.withContext(function($ctx3) {
return _st(_st(html)._perform_(aS
 return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
 }, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1)})}));
 _st(envjq)._remove();
-return self}, function($ctx1) {$ctx1.fill(self,"envelope:loop:before:tag:do:",{envelope:envelope,model:model,endjq:endjq,aSymbol:aSymbol,aBlock:aBlock,envjq:envjq}, smalltalk.Trapped.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"envelope:loop:before:tag:do:",{envelope:envelope,model:model,endjq:endjq,aSymbol:aSymbol,aBlock:aBlock,envjq:envjq},smalltalk.Trapped.klass)})},
 args: ["envelope", "model", "endjq", "aSymbol", "aBlock"],
 source: "envelope: envelope loop: model before: endjq tag: aSymbol do: aBlock\x0a   \x09| envjq |\x0a    envjq := envelope asJQuery.\x0a    model withIndexDo: [ :item :i |\x0a        envelope with: [ :html | (html perform: aSymbol) trap: {i} read: aBlock ].\x0a        envjq children detach insertBefore: endjq.\x0a    ].\x0a    envjq remove\x0a",
 messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "insertBefore:", "detach", "children", "remove"],
@@ -494,7 +490,7 @@ return $1;
 return _st(self)._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
 };
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:tag:do:",{model:model,start:start,end:end,aSymbol:aSymbol,aBlock:aBlock}, smalltalk.Trapped.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"loop:between:and:tag:do:",{model:model,start:start,end:end,aSymbol:aSymbol,aBlock:aBlock},smalltalk.Trapped.klass)})},
 args: ["model", "start", "end", "aSymbol", "aBlock"],
 source: "loop: model between: start and: end tag: aSymbol do: aBlock\x0a    (start asJQuery nextUntil: end element) remove.\x0a    start with: [ :html | model ifNotNil: [\x0a    \x09self envelope: html div loop: model before: end asJQuery tag: aSymbol do: aBlock\x0a\x09]]\x0a",
 messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
@@ -509,28 +505,24 @@ selector: "parse:",
 category: 'accessing',
 fn: function (anArray){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$4,$5,$7,$6,$3,$1;
-$2=anArray;
-$3=(function(each){
+return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+$1=_st(anArray)._collect_((function(each){
 var asNum;
 return smalltalk.withContext(function($ctx2) {
_st(asNum).__eq(_st(each)._asNumber());
-$4=_st(asNum).__eq(asNum);
-$5=(function(){
-return smalltalk.withContext(function($ctx3) {
return asNum;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-$6=(function(){
-return smalltalk.withContext(function($ctx3) {
$7=_st(_st(each)._first()).__eq("#");
-if(smalltalk.assert($7)){
+$2=_st(asNum).__eq(asNum);
+if(smalltalk.assert($2)){
+return asNum;
+} else {
+$3=_st(_st(each)._first()).__eq("#");
+if(smalltalk.assert($3)){
 return _st(_st(each)._allButFirst())._asSymbol();
 } else {
 return each;
 };
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-return _st($4)._ifTrue_ifFalse_($5,$6);
-}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1)})});
-$1=_st($2)._collect_($3);
+};
+}, function($ctx2) {$ctx2.fillBlock({each:each,asNum:asNum},$ctx1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"parse:",{anArray:anArray}, smalltalk.Trapped.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"parse:",{anArray:anArray},smalltalk.Trapped.klass)})},
 args: ["anArray"],
 source: "parse: anArray\x0a\x09^anArray collect: [ :each |\x0a    \x09| asNum |\x0a       \x09asNum = each asNumber.\x0a        asNum = asNum ifTrue: [ asNum ] ifFalse: [\x0a\x09\x09\x09each first = '#' ifTrue: [ each allButFirst asSymbol ] ifFalse: [ each ]]]",
 messageSends: ["collect:", "=", "asNumber", "ifTrue:ifFalse:", "asSymbol", "allButFirst", "first"],
@@ -548,7 +540,7 @@ category: 'descending',
 fn: function (anArray,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(self)._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock}, smalltalk.TrappedPathStack)})},
+return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},smalltalk.TrappedPathStack)})},
 args: ["anArray", "aBlock"],
 source: "append: anArray do: aBlock\x0a    self with: elements, anArray do: aBlock",
 messageSends: ["with:do:", ","],
@@ -566,7 +558,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@elements"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"elements",{}, smalltalk.TrappedPathStack)})},
+}, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
 args: [],
 source: "elements\x0a\x09^elements",
 messageSends: [],
@@ -583,7 +575,7 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
 self["@elements"]=[];
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.TrappedPathStack)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
 args: [],
 source: "initialize\x0a    super initialize.\x0a\x09elements := #().",
 messageSends: ["initialize"],
@@ -608,7 +600,7 @@ return _st(aBlock)._value();
 return smalltalk.withContext(function($ctx2) {
self["@elements"]=old;
 return self["@elements"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old}, smalltalk.TrappedPathStack)})},
+return self}, function($ctx1) {$ctx1.fill(self,"with:do:",{anArray:anArray,aBlock:aBlock,old:old},smalltalk.TrappedPathStack)})},
 args: ["anArray", "aBlock"],
 source: "with: anArray do: aBlock\x0a\x09| old |\x0a    old := elements.\x0a    [ elements := anArray.\x0a\x09aBlock value ] ensure: [ elements := old ]",
 messageSends: ["ensure:", "value"],
@@ -629,7 +621,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st((smalltalk.TrappedPathStack || TrappedPathStack))._current())._with_do_(self["@path"],(function(){
 return smalltalk.withContext(function($ctx2) {
return _st(aBlock)._value_(self["@model"]);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock}, smalltalk.TrappedSnapshot)})},
+return self}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
 args: ["aBlock"],
 source: "do: aBlock\x0a\x09TrappedPathStack current with: path do: [ aBlock value: model ]",
 messageSends: ["with:do:", "value:", "current"],
@@ -647,7 +639,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@model"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"model",{}, smalltalk.TrappedSnapshot)})},
+}, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
 args: [],
 source: "model\x0a\x09^model",
 messageSends: [],
@@ -663,7 +655,7 @@ category: 'action',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._modify_do_(_st(_st(self)._path())._allButFirst(),aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock}, smalltalk.TrappedSnapshot)})},
+return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
 args: ["aBlock"],
 source: "modify: aBlock\x0a\x09self model modify: self path allButFirst do: aBlock",
 messageSends: ["modify:do:", "allButFirst", "path", "model"],
@@ -681,7 +673,7 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
var $1;
 $1=self["@path"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"path",{}, smalltalk.TrappedSnapshot)})},
+}, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
 args: [],
 source: "path\x0a\x09^path",
 messageSends: [],
@@ -698,7 +690,7 @@ fn: function (anArray,aTrappedMW){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
self["@path"]=anArray;
 self["@model"]=aTrappedMW;
-return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW}, smalltalk.TrappedSnapshot)})},
+return self}, function($ctx1) {$ctx1.fill(self,"path:model:",{anArray:anArray,aTrappedMW:aTrappedMW},smalltalk.TrappedSnapshot)})},
 args: ["anArray", "aTrappedMW"],
 source: "path: anArray model: aTrappedMW\x0a\x09path := anArray.\x0a    model := aTrappedMW",
 messageSends: [],

+ 27 - 27
lib/js/Trapped-Tests.deploy.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Tests', {});
+smalltalk.addPackage('Trapped-Tests');
 smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
 smalltalk.addMethod(
 "_setUp",
@@ -15,8 +15,8 @@ $2=_st($1)._putBlock_((function(x,y){
 return smalltalk.withContext(function($ctx2) {
return _st(x)._root_(y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 self["@rootModel"]=$2;
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.IsolatorTest)})},
+messageSends: ["getBlock:", "root", "new", "putBlock:", "root:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -42,8 +42,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (5)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -77,8 +77,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", smalltalk.symbolFor("new"), "baz"]),_st("moo").__minus_gt("zoo")]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -98,8 +98,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -119,8 +119,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(2), (3)],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -137,8 +137,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(2), [(1), (0)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:modify:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -164,8 +164,8 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"baz");
 _st(self)._assert_equals_([(4), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -188,8 +188,8 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(_st(newValue)._at_("foo"))._at_put_((3),"baz");
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "->", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -212,8 +212,8 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_("foo","baz");
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "->", "model:modify:", "at:put:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -233,8 +233,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:modify:", "->", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -254,8 +254,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -275,8 +275,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (4)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
@@ -293,8 +293,8 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})}
-}),
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
+messageSends: ["on:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 

+ 14 - 14
lib/js/Trapped-Tests.js

@@ -1,4 +1,4 @@
-smalltalk.addPackage('Trapped-Tests', {});
+smalltalk.addPackage('Trapped-Tests');
 smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
 smalltalk.addMethod(
 "_setUp",
@@ -16,7 +16,7 @@ $2=_st($1)._putBlock_((function(x,y){
 return smalltalk.withContext(function($ctx2) {
return _st(x)._root_(y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 self["@rootModel"]=$2;
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.IsolatorTest)})},
 args: [],
 source: "setUp\x0a\x0arootModel := EavModel new\x0a\x09getBlock: [:x | x root];\x0a    putBlock: [:x :y | x root: y].\x0a",
 messageSends: ["getBlock:", "root", "new", "putBlock:", "root:"],
@@ -48,7 +48,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (5)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testNontrivialModelGetsAppropriateValueForModification\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 5)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|result := r].\x0aself assert: #(1 #(2 5)) equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "assert:equals:"],
@@ -88,7 +88,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", smalltalk.symbolFor("new"), "baz"]),_st("moo").__minus_gt("zoo")]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testNontrivialModelModifiesAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new\x0a\x09getBlock: [ :x | (x root at: 'foo') at: 2 ];\x0a\x09putBlock: [ :x :y | (x root at: 'foo') at: 2 put: y].\x0aisolator model: model modify: [:r|#new].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #new equals: result.\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{ 'foo' -> #('bar' #new 'baz'). 'moo' -> 'zoo' } equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"],
@@ -114,7 +114,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testNontrivialModelReturnsAppropriateValue\x0a| isolator model result |\x0aresult := nil.\x0aisolator := Isolator on: #{ 'foo' -> #('bar' #(1 #(2 3)) 'baz'). 'moo' -> 'zoo' }.\x0amodel := EavModel new getBlock: [ :x | (x root at: 'foo') at: 2 ].\x0aisolator model: model read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "model:read:", "assert:equals:"],
@@ -140,7 +140,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(2), (3)],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelExaminesThenModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|r second].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(2 3) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"],
@@ -163,7 +163,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(2), [(1), (0)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelGetsRootForModification\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(2 #(1 0)).\x0aisolator model: rootModel modify: [:r|result := r].\x0aself assert: #(2 #(1 0)) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "assert:equals:"],
@@ -195,7 +195,7 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"baz");
 _st(self)._assert_equals_([(4), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot\x0a| isolator result newValue |\x0aresult := nil. newValue := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|newValue := r. r at: 1 put: 4. r].\x0anewValue at: 2 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 2 put: 'baz'.\x0aself assert: #(4 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
@@ -224,7 +224,7 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(_st(newValue)._at_("foo"))._at_put_((3),"baz");
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelModifiesAndDeeplyIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0a(newValue at: 'foo') at: 1 put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0a(newValue at: 'foo') at: 3 put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"],
@@ -253,7 +253,7 @@ return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_("foo","baz");
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelModifiesAndIsolatesRoot\x0a| isolator result newValue |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0anewValue := #{'foo'->#(4 5 6)}.\x0aisolator model: rootModel modify: [:r|newValue].\x0anewValue at: 'foo' put: 'bar'.\x0aisolator model: rootModel read: [:r|result := r].\x0anewValue at: 'foo' put: 'baz'.\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
@@ -279,7 +279,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]),result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelModifiesRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel modify: [:r|#{'foo'->#(4 5 6)}].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #{'foo'->#(4 5 6)} equals: result\x0a",
 messageSends: ["on:", "model:modify:", "->", "model:read:", "assert:equals:"],
@@ -305,7 +305,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelReturnsDeeplyIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|(r at: 2) at: 1 put: 0].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"],
@@ -331,7 +331,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (4)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelReturnsIsolatedRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 4)).\x0aisolator model: rootModel read: [:r|r at: 2 put: nil].\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 4)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"],
@@ -354,7 +354,7 @@ return smalltalk.withContext(function($ctx2) {
result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(self)._assert_equals_([(1), [(2), (3)]],result);
-return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result}, smalltalk.IsolatorTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 args: [],
 source: "testRootModelReturnsRoot\x0a| isolator result |\x0aresult := nil.\x0aisolator := Isolator on: #(1 #(2 3)).\x0aisolator model: rootModel read: [:r|result := r].\x0aself assert: #(1 #(2 3)) equals: result\x0a",
 messageSends: ["on:", "model:read:", "assert:equals:"],

+ 1 - 1
lib/st/Trapped-Backend.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Backend' properties: #{}!
+Smalltalk current createPackage: 'Trapped-Backend'!
 Object subclass: #EavModel
 	instanceVariableNames: 'getBlock putBlock'
 	package: 'Trapped-Backend'!

+ 1 - 1
lib/st/Trapped-Demo.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Demo' properties: #{}!
+Smalltalk current createPackage: 'Trapped-Demo'!
 ListKeyedIsolatedEntity subclass: #App
 	instanceVariableNames: ''
 	package: 'Trapped-Demo'!

+ 1 - 1
lib/st/Trapped-Frontend.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Frontend' properties: #{}!
+Smalltalk current createPackage: 'Trapped-Frontend'!
 Object subclass: #TrappedBinder
 	instanceVariableNames: 'brush'
 	package: 'Trapped-Frontend'!

+ 1 - 1
lib/st/Trapped-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Trapped-Tests' properties: #{}!
+Smalltalk current createPackage: 'Trapped-Tests'!
 TestCase subclass: #IsolatorTest
 	instanceVariableNames: 'rootModel'
 	package: 'Trapped-Tests'!