Kaynağa Gözat

make it work with requirejs version

Herbert Vojčík 10 yıl önce
ebeveyn
işleme
2fa9e969a5

+ 1 - 1
.idea/runConfigurations/Amber_server.xml

@@ -1,5 +1,5 @@
 <component name="ProjectRunConfigurationManager">
-  <configuration default="false" name="Amber server" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="C:/Program Files/nodejs/node" path-to-js-file="vendor/amber/server/server.js" working-dir="$PROJECT_DIR$">
+  <configuration default="false" name="Amber server" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="C:/Program Files/nodejs/node" path-to-js-file="vendor/amber/cli/js/amber-cli.js" application-parameters="serve" working-dir="$PROJECT_DIR$">
     <RunnerSettings RunnerId="NodeJS.run" />
     <ConfigurationWrapper RunnerId="NodeJS.run" />
     <method />

+ 23 - 10
demo.html

@@ -1,23 +1,36 @@
 <html>
 <head>
     <title data-trap="App #title"></title>
-    <script src="vendor/amber/js/amber.js"></script>
+    <script src="/vendor/amber/support/amber.js"></script>
+    <script type='text/javascript' src='/vendor/amber/support/requirejs/require.min.js'></script>
     <link rel="stylesheet" href="demo.css" />
 </head>
 <body>
 <script type="text/javascript">
     var AppEntity;
-    loadAmber({
-        packages:['Trapped-Backend', 'Trapped-Frontend', 'Trapped-Demo'],
-        packageHome:'lib/',
-        ready:function () {
-            $(function() {
-                smalltalk.Browser._openOn_(smalltalk.App);
-                AppEntity = smalltalk.App._new();
-                smalltalk.Trapped._start_([AppEntity]);
-            });
+    require.config({
+        config: {
+            'amber_vm/smalltalk': {
+                defaultNamespace: 'gh_herby_trapped'
+            }
+        },
+        paths: {
+            'gh_herby_trapped': '/lib/js'
         }
     });
+    require(
+            ["amber_vm/smalltalk", "amber_set/full-devel",
+                "gh_herby_trapped/Trapped-Backend", "gh_herby_trapped/Trapped-Frontend", "gh_herby_trapped/Trapped-Demo" ],
+            function (smalltalk) {
+                smalltalk.initialize();
+
+                $(function() {
+                    smalltalk.Browser._openOn_(smalltalk.App);
+                    AppEntity = smalltalk.App._new();
+                    smalltalk.Trapped._start_([AppEntity]);
+                });
+            }
+    );
 </script>
 <div data-trap="AppView: App">
 </div>

+ 22 - 7
devel.html

@@ -1,16 +1,31 @@
 <html>
 <head>
     <title>{{name}}</title>
-    <script src="/vendor/amber/js/amber.js"></script>
+    <script src="/vendor/amber/support/amber.js"></script>
+    <script type='text/javascript' src='/vendor/amber/support/requirejs/require.min.js'></script>
 </head>
 <body>
 <script type="text/javascript">
-    loadAmber({
-        files:['Trapped-Backend.js', 'Trapped-Tests.js'],
-        packageHome:'lib/',
-        ready:function () {
-            smalltalk.Browser._openOn_(smalltalk.IsolatorTest);
-        }});
+    require.config({
+        config: {
+            'amber_vm/smalltalk': {
+                defaultNamespace: 'gh_herby_trapped'
+            }
+        },
+        paths: {
+            'gh_herby_trapped': '/lib/js',
+            'gh_herby_trapped/_source': '/lib/st'
+        }
+    });
+    require(
+            ["amber_vm/smalltalk", "amber_set/full-devel",
+                "gh_herby_trapped/Trapped-Backend", "gh_herby_trapped/Trapped-Tests" ],
+            function (smalltalk) {
+                smalltalk.initialize();
+
+                smalltalk.Browser._openOn_(smalltalk.IsolatorTest);
+            }
+    );
 </script>
 <div>
 </div>

+ 69 - 118
lib/js/Trapped-Backend.deploy.js

@@ -1,7 +1,9 @@
+define("gh_herby_trapped/Trapped-Backend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects", "amber/Kernel-Exceptions", "amber/Kernel-Collections"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Backend');
+smalltalk.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_getBlock_",
 smalltalk.method({
 selector: "getBlock:",
 fn: function (aBlock){
@@ -13,27 +15,25 @@ messageSends: []}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
+smalltalk.EavModel.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@getBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._error_("No getter block.");
+return self._error_("No getter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
 self["@putBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._error_("No putter block.");
+return self._error_("No putter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
 messageSends: ["initialize", "error:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 fn: function (anObject){
@@ -47,7 +47,6 @@ messageSends: ["value:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_on_put_",
 smalltalk.method({
 selector: "on:put:",
 fn: function (anObject,anObject2){
@@ -61,7 +60,6 @@ messageSends: ["value:value:"]}),
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_putBlock_",
 smalltalk.method({
 selector: "putBlock:",
 fn: function (aBlock){
@@ -76,7 +74,6 @@ smalltalk.EavModel);
 
 smalltalk.addClass('Isolator', smalltalk.Object, ['root'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_model_modify_",
 smalltalk.method({
 selector: "model:modify:",
 fn: function (anEavModel,aBlock){
@@ -90,7 +87,6 @@ messageSends: ["value:", "on:", "on:put:", "deepCopy"]}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_model_read_",
 smalltalk.method({
 selector: "model:read:",
 fn: function (anEavModel,aBlock){
@@ -102,7 +98,6 @@ messageSends: ["value:", "deepCopy", "on:"]}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_root",
 smalltalk.method({
 selector: "root",
 fn: function (){
@@ -116,7 +111,6 @@ messageSends: []}),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_root_",
 smalltalk.method({
 selector: "root:",
 fn: function (anObject){
@@ -129,14 +123,13 @@ smalltalk.Isolator);
 
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._new())._root_(anObject);
+$1=_st(self._new())._root_(anObject);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
 messageSends: ["root:", "new"]}),
@@ -145,7 +138,6 @@ smalltalk.Isolator.klass);
 
 smalltalk.addClass('KeyedPubSubBase', smalltalk.Object, ['factory'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_changed_",
 smalltalk.method({
 selector: "changed:",
 fn: function (key){
@@ -154,7 +146,7 @@ var needsToRun;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 needsToRun=false;
-_st(self)._do_((function(each){
+self._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 $1=_st(each)._accepts_(key);
 if(smalltalk.assert($1)){
@@ -163,13 +155,12 @@ needsToRun=true;
 return needsToRun;
 };
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-_st(self)._dirty_(needsToRun);
+self._dirty_(needsToRun);
 return self}, function($ctx1) {$ctx1.fill(self,"changed:",{key:key,needsToRun:needsToRun},smalltalk.KeyedPubSubBase)})},
 messageSends: ["do:", "ifTrue:", "flag", "accepts:", "dirty:"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_dirty_",
 smalltalk.method({
 selector: "dirty:",
 fn: function (aBoolean){
@@ -180,7 +171,7 @@ $1=aBoolean;
 if(smalltalk.assert($1)){
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._run();
+return self._run();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._fork();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
@@ -188,20 +179,18 @@ messageSends: ["ifTrue:", "fork", "run"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_on_hook_",
 smalltalk.method({
 selector: "on:hook:",
 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);
+self._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
+self._dirty_(true);
 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(
-"_run",
 smalltalk.method({
 selector: "run",
 fn: function (){
@@ -210,7 +199,7 @@ var needsClean;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
 needsClean=false;
-_st(self)._do_((function(each){
+self._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 $1=_st(each)._isFlagged();
 if(smalltalk.assert($1)){
@@ -224,14 +213,13 @@ return needsClean;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 $3=needsClean;
 if(smalltalk.assert($3)){
-_st(self)._clean();
+self._clean();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean},smalltalk.KeyedPubSubBase)})},
 messageSends: ["do:", "ifTrue:", "run", "ifFalse:", "isEnabled", "isFlagged", "clean"]}),
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_subscriptionFactory_",
 smalltalk.method({
 selector: "subscriptionFactory:",
 fn: function (aBlock){
@@ -246,7 +234,6 @@ smalltalk.KeyedPubSubBase);
 
 smalltalk.addClass('SimpleKeyedPubSub', smalltalk.KeyedPubSubBase, ['queue'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_add_",
 smalltalk.method({
 selector: "add:",
 fn: function (aSubscription){
@@ -258,7 +245,6 @@ messageSends: ["add:"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_clean",
 smalltalk.method({
 selector: "clean",
 fn: function (){
@@ -273,7 +259,6 @@ messageSends: ["select:", "isEnabled"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_do_",
 smalltalk.method({
 selector: "do:",
 fn: function (aBlock){
@@ -285,14 +270,14 @@ messageSends: ["do:"]}),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
 var self=this;
+function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.KeyedPubSubBase.fn.prototype._initialize.apply(_st(self), []);
-self["@queue"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
+smalltalk.SimpleKeyedPubSub.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@queue"]=_st($OrderedCollection())._new();
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
 messageSends: ["initialize", "new"]}),
 smalltalk.SimpleKeyedPubSub);
@@ -304,19 +289,17 @@ smalltalk.addClass('KeyedPubSubUnsubscribe', smalltalk.Error, [], 'Trapped-Backe
 
 smalltalk.addClass('KeyedSubscriptionBase', smalltalk.Object, ['key', 'actionBlock', 'flagged'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_accepts_",
 smalltalk.method({
 selector: "accepts:",
 fn: function (aKey){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._subclassResponsibility();
+self._subclassResponsibility();
 return self}, function($ctx1) {$ctx1.fill(self,"accepts:",{aKey:aKey},smalltalk.KeyedSubscriptionBase)})},
 messageSends: ["subclassResponsibility"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_flag",
 smalltalk.method({
 selector: "flag",
 fn: function (){
@@ -328,13 +311,12 @@ messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
+smalltalk.KeyedSubscriptionBase.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@key"]=nil;
 self["@actionBlock"]=nil;
 self["@flagged"]=false;
@@ -343,7 +325,6 @@ messageSends: ["initialize"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_isEnabled",
 smalltalk.method({
 selector: "isEnabled",
 fn: function (){
@@ -357,7 +338,6 @@ messageSends: ["notNil"]}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_isFlagged",
 smalltalk.method({
 selector: "isFlagged",
 fn: function (){
@@ -371,7 +351,6 @@ messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_key_block_",
 smalltalk.method({
 selector: "key:block:",
 fn: function (anObject,aBlock){
@@ -384,23 +363,23 @@ messageSends: []}),
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_run",
 smalltalk.method({
 selector: "run",
 fn: function (){
 var self=this;
+function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
 return smalltalk.withContext(function($ctx1) { 
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st((function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(self["@actionBlock"])._value();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx3) {
 self["@flagged"]=false;
 return self["@flagged"];
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.KeyedPubSubUnsubscribe || KeyedPubSubUnsubscribe),(function(){
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($KeyedPubSubUnsubscribe(),(function(){
 return smalltalk.withContext(function($ctx2) {
 self["@actionBlock"]=nil;
 return self["@actionBlock"];
@@ -413,7 +392,6 @@ smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addClass('ListKeyedSubscription', smalltalk.KeyedSubscriptionBase, [], 'Trapped-Backend');
 smalltalk.addMethod(
-"_accepts_",
 smalltalk.method({
 selector: "accepts:",
 fn: function (aKey){
@@ -433,7 +411,6 @@ smalltalk.ListKeyedSubscription);
 
 smalltalk.addClass('ListKeyedEntity', smalltalk.Object, ['dispatcher', 'payload'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_dispatcher",
 smalltalk.method({
 selector: "dispatcher",
 fn: function (){
@@ -447,17 +424,17 @@ messageSends: []}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_dispatcher_",
 smalltalk.method({
 selector: "dispatcher:",
 fn: function (aDispatcher){
 var self=this;
+function $ListKeyedSubscription(){return smalltalk.ListKeyedSubscription||(typeof ListKeyedSubscription=="undefined"?nil:ListKeyedSubscription)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4;
 $1=aDispatcher;
 _st($1)._subscriptionFactory_((function(key,block){
 return smalltalk.withContext(function($ctx2) {
-$2=_st((smalltalk.ListKeyedSubscription || ListKeyedSubscription))._new();
+$2=_st($ListKeyedSubscription())._new();
 _st($2)._key_block_(key,block);
 $3=_st($2)._yourself();
 return $3;
@@ -469,28 +446,26 @@ messageSends: ["subscriptionFactory:", "key:block:", "new", "yourself"]}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_model_",
 smalltalk.method({
 selector: "model:",
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@payload"]=anObject;
-_st(_st(self)._dispatcher())._changed_([]);
+_st(self._dispatcher())._changed_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
 messageSends: ["changed:", "dispatcher"]}),
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_watch_do_",
 smalltalk.method({
 selector: "watch:do:",
 fn: function (path,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(self)._dispatcher())._on_hook_(path,(function(){
+_st(self._dispatcher())._on_hook_(path,(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._read_do_(path,aBlock);
+return 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)})},
 messageSends: ["on:hook:", "read:do:", "dispatcher"]}),
@@ -500,7 +475,6 @@ smalltalk.ListKeyedEntity);
 
 smalltalk.addClass('ListKeyedDirectEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
 smalltalk.addMethod(
-"_modify_do_",
 smalltalk.method({
 selector: "modify:do:",
 fn: function (path,aBlock){
@@ -514,14 +488,13 @@ return smalltalk.withContext(function($ctx2) {
 return _st(eavModel)._on_put_(self["@payload"],newValue);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._dispatcher())._changed_(path);
+return _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)})},
 messageSends: ["asEavModel", "value:", "on:", "ensure:", "changed:", "dispatcher", "on:put:"]}),
 smalltalk.ListKeyedDirectEntity);
 
 smalltalk.addMethod(
-"_read_do_",
 smalltalk.method({
 selector: "read:do:",
 fn: function (path,aBlock){
@@ -538,19 +511,18 @@ smalltalk.ListKeyedDirectEntity);
 
 smalltalk.addClass('ListKeyedIsolatedEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
 smalltalk.addMethod(
-"_model_",
 smalltalk.method({
 selector: "model:",
 fn: function (anObject){
 var self=this;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.ListKeyedEntity.fn.prototype._model_.apply(_st(self), [_st((smalltalk.Isolator || Isolator))._on_(anObject)]);
+smalltalk.ListKeyedIsolatedEntity.superclass.fn.prototype._model_.apply(_st(self), [_st($Isolator())._on_(anObject)]);
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
 messageSends: ["model:", "on:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
-"_modify_do_",
 smalltalk.method({
 selector: "modify:do:",
 fn: function (path,aBlock){
@@ -563,14 +535,13 @@ return smalltalk.withContext(function($ctx2) {
 return _st(self["@payload"])._model_modify_(eavModel,aBlock);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._dispatcher())._changed_(path);
+return _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)})},
 messageSends: ["asEavModel", ",", "ensure:", "changed:", "dispatcher", "model:modify:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
-"_read_do_",
 smalltalk.method({
 selector: "read:do:",
 fn: function (path,aBlock){
@@ -584,91 +555,75 @@ messageSends: ["asEavModel", ",", "model:read:"]}),
 smalltalk.ListKeyedIsolatedEntity);
 
 
-
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 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(
-"_reverseTrapAt_put_",
 smalltalk.method({
 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)})},
+self._error_(_st("Trapped cannot put at ".__comma(_st(self._class())._name())).__comma(" type key."));
+return self}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value},smalltalk.Object)})},
 messageSends: ["error:", ",", "name", "class"]}),
 smalltalk.Object);
 
 smalltalk.addMethod(
-"_asEavModel",
 smalltalk.method({
 selector: "asEavModel",
 fn: function (){
 var self=this;
 var model;
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$6,$5,$2,$7,$9,$11,$12,$14,$13,$10,$8,$15;
-model=_st((smalltalk.EavModel || EavModel))._new();
-$1=model;
-$2=(function(anObject){
+var $1,$2,$3,$4;
+model=_st($EavModel())._new();
+_st(model)._getBlock_((function(anObject){
 return smalltalk.withContext(function($ctx2) {
-$3=self;
-$4=anObject;
-$5=(function(soFar,segment){
+return self._inject_into_(anObject,(function(soFar,segment){
 return smalltalk.withContext(function($ctx3) {
-$6=soFar;
-if(($receiver = $6) == nil || $receiver == undefined){
-return $6;
+$1=soFar;
+if(($receiver = $1) == nil || $receiver == undefined){
+return $1;
 } else {
 return _st(segment)._reverseTrapAt_(soFar);
 };
-}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
-return _st($3)._inject_into_($4,$5);
-}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1)})});
-_st($1)._getBlock_($2);
-$7=_st(self)._isEmpty();
-$8=(function(){
-return smalltalk.withContext(function($ctx2) {
-$9=model;
-$10=(function(anObject,value){
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1)})}));
+$2=self._isEmpty();
+if(! smalltalk.assert($2)){
+_st(model)._putBlock_((function(anObject,value){
 var penultimate;
+return smalltalk.withContext(function($ctx2) {
+penultimate=_st(self._allButLast())._inject_into_(anObject,(function(soFar,segment){
 return smalltalk.withContext(function($ctx3) {
-$11=_st(self)._allButLast();
-$12=anObject;
-$13=(function(soFar,segment){
-return smalltalk.withContext(function($ctx4) {
-$14=soFar;
-if(($receiver = $14) == nil || $receiver == undefined){
-return $14;
+$3=soFar;
+if(($receiver = $3) == nil || $receiver == undefined){
+return $3;
 } else {
 return _st(segment)._reverseTrapAt_(soFar);
 };
-}, function($ctx4) {$ctx4.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
-penultimate=_st($11)._inject_into_($12,$13);
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2)})}));
 penultimate;
-return _st(_st(self)._last())._reverseTrapAt_put_(penultimate,value);
-}, function($ctx3) {$ctx3.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1)})});
-return _st($9)._putBlock_($10);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
-_st($7)._ifFalse_($8);
-$15=model;
-return $15;
-}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model}, smalltalk.SequenceableCollection)})},
+return _st(self._last())._reverseTrapAt_put_(penultimate,value);
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1)})}));
+};
+$4=model;
+return $4;
+}, 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(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 fn: function (anObject){
@@ -680,7 +635,7 @@ var $early={};
 try {
 $1=_st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(anObject)._perform_(_st(self)._first());
+return _st(anObject)._perform_(self._first());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($MessageNotUnderstood(),(function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[nil];
@@ -693,21 +648,19 @@ messageSends: ["on:do:", "perform:", "first"]}),
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 fn: function (anObject,value){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(anObject)._perform_withArguments_(_st(_st(_st(self)._first()).__comma(":"))._asSymbol(),[value]);
+$1=_st(anObject)._perform_withArguments_(_st(_st(self._first()).__comma(":"))._asSymbol(),[value]);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value},smalltalk.Array)})},
 messageSends: ["perform:withArguments:", "asSymbol", ",", "first"]}),
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 fn: function (anObject){
@@ -719,12 +672,11 @@ 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(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 fn: function (anObject,value){
@@ -733,38 +685,37 @@ 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(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) {
+return smalltalk.withContext(function($ctx1) { 
 var $1;
 $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(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 fn: function (anObject,value){
 var self=this;
-return smalltalk.withContext(function($ctx1) {
+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);
 
+});

+ 81 - 130
lib/js/Trapped-Backend.js

@@ -1,8 +1,10 @@
+define("gh_herby_trapped/Trapped-Backend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects", "amber/Kernel-Exceptions", "amber/Kernel-Collections"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Backend');
+smalltalk.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('EavModel', smalltalk.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
-smalltalk.EavModel.comment="External actor value model."
+smalltalk.EavModel.comment="External actor value model.";
 smalltalk.addMethod(
-"_getBlock_",
 smalltalk.method({
 selector: "getBlock:",
 category: 'accessing',
@@ -19,21 +21,20 @@ referencedClasses: []
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
+smalltalk.EavModel.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@getBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._error_("No getter block.");
+return self._error_("No getter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
 self["@putBlock"]=(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._error_("No putter block.");
+return self._error_("No putter block.");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.EavModel)})},
 args: [],
@@ -44,7 +45,6 @@ referencedClasses: []
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 category: 'accessing',
@@ -63,7 +63,6 @@ referencedClasses: []
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_on_put_",
 smalltalk.method({
 selector: "on:put:",
 category: 'accessing',
@@ -82,7 +81,6 @@ referencedClasses: []
 smalltalk.EavModel);
 
 smalltalk.addMethod(
-"_putBlock_",
 smalltalk.method({
 selector: "putBlock:",
 category: 'accessing',
@@ -102,7 +100,6 @@ smalltalk.EavModel);
 
 smalltalk.addClass('Isolator', smalltalk.Object, ['root'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_model_modify_",
 smalltalk.method({
 selector: "model:modify:",
 category: 'action',
@@ -114,14 +111,13 @@ 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)})},
 args: ["anEavModel", "aBlock"],
-source: "model: anEavModel modify: aBlock\x0a\x0a| newValue |\x0anewValue := aBlock value: (anEavModel on: self).\x0aanEavModel on: self put: newValue deepCopy\x0a",
+source: "model: anEavModel modify: aBlock\x0a\x0a| newValue |\x0anewValue := aBlock value: (anEavModel on: self).\x0aanEavModel on: self put: newValue deepCopy",
 messageSends: ["value:", "on:", "on:put:", "deepCopy"],
 referencedClasses: []
 }),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_model_read_",
 smalltalk.method({
 selector: "model:read:",
 category: 'action',
@@ -138,7 +134,6 @@ referencedClasses: []
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_root",
 smalltalk.method({
 selector: "root",
 category: 'accessing',
@@ -150,14 +145,13 @@ $1=self["@root"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"root",{},smalltalk.Isolator)})},
 args: [],
-source: "root\x0a\x0a^root\x0a",
+source: "root\x0a\x0a^root",
 messageSends: [],
 referencedClasses: []
 }),
 smalltalk.Isolator);
 
 smalltalk.addMethod(
-"_root_",
 smalltalk.method({
 selector: "root:",
 category: 'accessing',
@@ -175,7 +169,6 @@ smalltalk.Isolator);
 
 
 smalltalk.addMethod(
-"_on_",
 smalltalk.method({
 selector: "on:",
 category: 'instance creation',
@@ -183,7 +176,7 @@ fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(self)._new())._root_(anObject);
+$1=_st(self._new())._root_(anObject);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Isolator.klass)})},
 args: ["anObject"],
@@ -195,9 +188,8 @@ smalltalk.Isolator.klass);
 
 
 smalltalk.addClass('KeyedPubSubBase', smalltalk.Object, ['factory'], 'Trapped-Backend');
-smalltalk.KeyedPubSubBase.comment="I represent a pub-sub based on a key.\x0aI manage key-block subscriptions as well as running blocks that are dirty.\x0aThe subscription objects are reponsible of decision if the change is relevant for them.\x0aSubscription object must be subclasses of KeyedSubscriptionBase.\x0a\x0aMy subclasses must provide implementation for:\x0a\x09add:\x0a    do:\x0a    clean\x0a    (optionally) run\x0a\x0aand issue this call before actual use:\x0a\x09subscritionFactory: (setting [:key:block|...] factory that creates appropriate subscription)"
+smalltalk.KeyedPubSubBase.comment="I represent a pub-sub based on a key.\x0aI manage key-block subscriptions as well as running blocks that are dirty.\x0aThe subscription objects are reponsible of decision if the change is relevant for them.\x0aSubscription object must be subclasses of KeyedSubscriptionBase.\x0a\x0aMy subclasses must provide implementation for:\x0a\x09add:\x0a    do:\x0a    clean\x0a    (optionally) run\x0a\x0aand issue this call before actual use:\x0a\x09subscritionFactory: (setting [:key:block|...] factory that creates appropriate subscription)";
 smalltalk.addMethod(
-"_changed_",
 smalltalk.method({
 selector: "changed:",
 category: 'action',
@@ -207,7 +199,7 @@ var needsToRun;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 needsToRun=false;
-_st(self)._do_((function(each){
+self._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 $1=_st(each)._accepts_(key);
 if(smalltalk.assert($1)){
@@ -216,7 +208,7 @@ needsToRun=true;
 return needsToRun;
 };
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-_st(self)._dirty_(needsToRun);
+self._dirty_(needsToRun);
 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",
@@ -226,7 +218,6 @@ referencedClasses: []
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_dirty_",
 smalltalk.method({
 selector: "dirty:",
 category: 'action',
@@ -238,7 +229,7 @@ $1=aBoolean;
 if(smalltalk.assert($1)){
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._run();
+return self._run();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._fork();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},smalltalk.KeyedPubSubBase)})},
@@ -250,15 +241,14 @@ referencedClasses: []
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_on_hook_",
 smalltalk.method({
 selector: "on:hook:",
 category: 'action',
 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);
+self._add_(_st(_st(self["@factory"])._value_value_(key,aBlock))._flag());
+self._dirty_(true);
 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",
@@ -268,7 +258,6 @@ referencedClasses: []
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_run",
 smalltalk.method({
 selector: "run",
 category: 'action',
@@ -278,7 +267,7 @@ var needsClean;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
 needsClean=false;
-_st(self)._do_((function(each){
+self._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 $1=_st(each)._isFlagged();
 if(smalltalk.assert($1)){
@@ -292,7 +281,7 @@ return needsClean;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 $3=needsClean;
 if(smalltalk.assert($3)){
-_st(self)._clean();
+self._clean();
 };
 return self}, function($ctx1) {$ctx1.fill(self,"run",{needsClean:needsClean},smalltalk.KeyedPubSubBase)})},
 args: [],
@@ -303,7 +292,6 @@ referencedClasses: []
 smalltalk.KeyedPubSubBase);
 
 smalltalk.addMethod(
-"_subscriptionFactory_",
 smalltalk.method({
 selector: "subscriptionFactory:",
 category: 'action',
@@ -323,7 +311,6 @@ smalltalk.KeyedPubSubBase);
 
 smalltalk.addClass('SimpleKeyedPubSub', smalltalk.KeyedPubSubBase, ['queue'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_add_",
 smalltalk.method({
 selector: "add:",
 category: 'accessing',
@@ -333,14 +320,13 @@ return smalltalk.withContext(function($ctx1) {
 _st(self["@queue"])._add_(aSubscription);
 return self}, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},smalltalk.SimpleKeyedPubSub)})},
 args: ["aSubscription"],
-source: "add: aSubscription\x0a\x09queue add: aSubscription.\x0a",
+source: "add: aSubscription\x0a\x09queue add: aSubscription.",
 messageSends: ["add:"],
 referencedClasses: []
 }),
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_clean",
 smalltalk.method({
 selector: "clean",
 category: 'bookkeeping',
@@ -360,7 +346,6 @@ referencedClasses: []
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_do_",
 smalltalk.method({
 selector: "do:",
 category: 'enumeration',
@@ -377,15 +362,15 @@ referencedClasses: []
 smalltalk.SimpleKeyedPubSub);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
 fn: function (){
 var self=this;
+function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.KeyedPubSubBase.fn.prototype._initialize.apply(_st(self), []);
-self["@queue"]=_st((smalltalk.OrderedCollection || OrderedCollection))._new();
+smalltalk.SimpleKeyedPubSub.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@queue"]=_st($OrderedCollection())._new();
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SimpleKeyedPubSub)})},
 args: [],
 source: "initialize\x0a    super initialize.\x0a\x09queue := OrderedCollection new",
@@ -397,19 +382,18 @@ smalltalk.SimpleKeyedPubSub);
 
 
 smalltalk.addClass('KeyedPubSubUnsubscribe', smalltalk.Error, [], 'Trapped-Backend');
-smalltalk.KeyedPubSubUnsubscribe.comment="SIgnal me from the subscription block to unsubscribe it."
+smalltalk.KeyedPubSubUnsubscribe.comment="SIgnal me from the subscription block to unsubscribe it.";
 
 
 smalltalk.addClass('KeyedSubscriptionBase', smalltalk.Object, ['key', 'actionBlock', 'flagged'], 'Trapped-Backend');
 smalltalk.addMethod(
-"_accepts_",
 smalltalk.method({
 selector: "accepts:",
 category: 'testing',
 fn: function (aKey){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(self)._subclassResponsibility();
+self._subclassResponsibility();
 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",
@@ -419,7 +403,6 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_flag",
 smalltalk.method({
 selector: "flag",
 category: 'accessing',
@@ -436,14 +419,13 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
+smalltalk.KeyedSubscriptionBase.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@key"]=nil;
 self["@actionBlock"]=nil;
 self["@flagged"]=false;
@@ -456,7 +438,6 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_isEnabled",
 smalltalk.method({
 selector: "isEnabled",
 category: 'testing',
@@ -475,7 +456,6 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_isFlagged",
 smalltalk.method({
 selector: "isFlagged",
 category: 'testing',
@@ -494,7 +474,6 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_key_block_",
 smalltalk.method({
 selector: "key:block:",
 category: 'accessing',
@@ -512,24 +491,24 @@ referencedClasses: []
 smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addMethod(
-"_run",
 smalltalk.method({
 selector: "run",
 category: 'action',
 fn: function (){
 var self=this;
+function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
 return smalltalk.withContext(function($ctx1) { 
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st((function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(self["@actionBlock"])._value();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._ensure_((function(){
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx3) {
 self["@flagged"]=false;
 return self["@flagged"];
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_((smalltalk.KeyedPubSubUnsubscribe || KeyedPubSubUnsubscribe),(function(){
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($KeyedPubSubUnsubscribe(),(function(){
 return smalltalk.withContext(function($ctx2) {
 self["@actionBlock"]=nil;
 return self["@actionBlock"];
@@ -546,7 +525,6 @@ smalltalk.KeyedSubscriptionBase);
 
 smalltalk.addClass('ListKeyedSubscription', smalltalk.KeyedSubscriptionBase, [], 'Trapped-Backend');
 smalltalk.addMethod(
-"_accepts_",
 smalltalk.method({
 selector: "accepts:",
 category: 'testing',
@@ -570,9 +548,8 @@ smalltalk.ListKeyedSubscription);
 
 
 smalltalk.addClass('ListKeyedEntity', smalltalk.Object, ['dispatcher', 'payload'], 'Trapped-Backend');
-smalltalk.ListKeyedEntity.comment="I am base class for #('string-at-index' #selector numeric-at-index)-array-path-keyed entities,\x0athat moderate access to the wrapped model object via read;do and modify:do:\x0aand allow pub-sub via watch:do:.\x0aThis wrapped model can be any smalltalk object.\x0a\x0aMy subclasses need to provide implementation for:\x0a\x09read:do:\x0a    modify:do:\x0a\x0aand must issue these calls when initializing:\x0a\x09model: (with a wrapped object)\x0a\x09dispatcher: (with a subclass of KeyedPubSubBase)\x0a"
+smalltalk.ListKeyedEntity.comment="I am base class for #('string-at-index' #selector numeric-at-index)-array-path-keyed entities,\x0athat moderate access to the wrapped model object via read;do and modify:do:\x0aand allow pub-sub via watch:do:.\x0aThis wrapped model can be any smalltalk object.\x0a\x0aMy subclasses need to provide implementation for:\x0a\x09read:do:\x0a    modify:do:\x0a\x0aand must issue these calls when initializing:\x0a\x09model: (with a wrapped object)\x0a\x09dispatcher: (with a subclass of KeyedPubSubBase)";
 smalltalk.addMethod(
-"_dispatcher",
 smalltalk.method({
 selector: "dispatcher",
 category: 'accessing',
@@ -591,18 +568,18 @@ referencedClasses: []
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_dispatcher_",
 smalltalk.method({
 selector: "dispatcher:",
 category: 'accessing',
 fn: function (aDispatcher){
 var self=this;
+function $ListKeyedSubscription(){return smalltalk.ListKeyedSubscription||(typeof ListKeyedSubscription=="undefined"?nil:ListKeyedSubscription)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4;
 $1=aDispatcher;
 _st($1)._subscriptionFactory_((function(key,block){
 return smalltalk.withContext(function($ctx2) {
-$2=_st((smalltalk.ListKeyedSubscription || ListKeyedSubscription))._new();
+$2=_st($ListKeyedSubscription())._new();
 _st($2)._key_block_(key,block);
 $3=_st($2)._yourself();
 return $3;
@@ -618,7 +595,6 @@ referencedClasses: ["ListKeyedSubscription"]
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_model_",
 smalltalk.method({
 selector: "model:",
 category: 'accessing',
@@ -626,7 +602,7 @@ fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@payload"]=anObject;
-_st(_st(self)._dispatcher())._changed_([]);
+_st(self._dispatcher())._changed_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedEntity)})},
 args: ["anObject"],
 source: "model: anObject\x0a\x09payload := anObject.\x0a    self dispatcher changed: #()",
@@ -636,20 +612,19 @@ referencedClasses: []
 smalltalk.ListKeyedEntity);
 
 smalltalk.addMethod(
-"_watch_do_",
 smalltalk.method({
 selector: "watch:do:",
 category: 'action',
 fn: function (path,aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(self)._dispatcher())._on_hook_(path,(function(){
+_st(self._dispatcher())._on_hook_(path,(function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._read_do_(path,aBlock);
+return 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)})},
 args: ["path", "aBlock"],
-source: "watch: path do: aBlock\x0a\x09self dispatcher on: path hook: [ self read: path do: aBlock ]\x0a",
+source: "watch: path do: aBlock\x0a\x09self dispatcher on: path hook: [ self read: path do: aBlock ]",
 messageSends: ["on:hook:", "read:do:", "dispatcher"],
 referencedClasses: []
 }),
@@ -658,9 +633,8 @@ smalltalk.ListKeyedEntity);
 
 
 smalltalk.addClass('ListKeyedDirectEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
-smalltalk.ListKeyedDirectEntity.comment="I am ListKeyedEntity that directly manipulate\x0athe wrapped model object."
+smalltalk.ListKeyedDirectEntity.comment="I am ListKeyedEntity that directly manipulate\x0athe wrapped model object.";
 smalltalk.addMethod(
-"_modify_do_",
 smalltalk.method({
 selector: "modify:do:",
 category: 'action',
@@ -675,18 +649,17 @@ return smalltalk.withContext(function($ctx2) {
 return _st(eavModel)._on_put_(self["@payload"],newValue);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._dispatcher())._changed_(path);
+return _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)})},
 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",
+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 ]",
 messageSends: ["asEavModel", "value:", "on:", "ensure:", "changed:", "dispatcher", "on:put:"],
 referencedClasses: []
 }),
 smalltalk.ListKeyedDirectEntity);
 
 smalltalk.addMethod(
-"_read_do_",
 smalltalk.method({
 selector: "read:do:",
 category: 'action',
@@ -698,7 +671,7 @@ 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)})},
 args: ["path", "aBlock"],
-source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := path asEavModel.\x0a    aBlock value: (eavModel on: payload)\x0a",
+source: "read: path do: aBlock\x0a    | eavModel |\x0a    eavModel := path asEavModel.\x0a    aBlock value: (eavModel on: payload)",
 messageSends: ["asEavModel", "value:", "on:"],
 referencedClasses: []
 }),
@@ -707,16 +680,16 @@ smalltalk.ListKeyedDirectEntity);
 
 
 smalltalk.addClass('ListKeyedIsolatedEntity', smalltalk.ListKeyedEntity, [], 'Trapped-Backend');
-smalltalk.ListKeyedIsolatedEntity.comment="I am ListKeyedEntity that guards access\x0ato the wrapped model object via Isolator."
+smalltalk.ListKeyedIsolatedEntity.comment="I am ListKeyedEntity that guards access\x0ato the wrapped model object via Isolator.";
 smalltalk.addMethod(
-"_model_",
 smalltalk.method({
 selector: "model:",
 category: 'accessing',
 fn: function (anObject){
 var self=this;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.ListKeyedEntity.fn.prototype._model_.apply(_st(self), [_st((smalltalk.Isolator || Isolator))._on_(anObject)]);
+smalltalk.ListKeyedIsolatedEntity.superclass.fn.prototype._model_.apply(_st(self), [_st($Isolator())._on_(anObject)]);
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},smalltalk.ListKeyedIsolatedEntity)})},
 args: ["anObject"],
 source: "model: anObject\x0a\x09super model: (Isolator on: anObject)",
@@ -726,7 +699,6 @@ referencedClasses: ["Isolator"]
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
-"_modify_do_",
 smalltalk.method({
 selector: "modify:do:",
 category: 'action',
@@ -740,7 +712,7 @@ return smalltalk.withContext(function($ctx2) {
 return _st(self["@payload"])._model_modify_(eavModel,aBlock);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(self)._dispatcher())._changed_(path);
+return _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)})},
 args: ["path", "aBlock"],
@@ -751,7 +723,6 @@ referencedClasses: []
 smalltalk.ListKeyedIsolatedEntity);
 
 smalltalk.addMethod(
-"_read_do_",
 smalltalk.method({
 selector: "read:do:",
 category: 'action',
@@ -770,9 +741,7 @@ referencedClasses: []
 smalltalk.ListKeyedIsolatedEntity);
 
 
-
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 category: '*Trapped-Backend',
@@ -780,7 +749,7 @@ 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)})},
 args: ["anObject"],
 source: "reverseTrapAt: anObject\x0a\x09^nil",
 messageSends: [],
@@ -789,15 +758,14 @@ referencedClasses: []
 smalltalk.Object);
 
 smalltalk.addMethod(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 category: '*Trapped-Backend',
 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)})},
+self._error_(_st("Trapped cannot put at ".__comma(_st(self._class())._name())).__comma(" type key."));
+return self}, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value},smalltalk.Object)})},
 args: ["anObject", "value"],
 source: "reverseTrapAt: anObject put: value\x0a\x09self error: 'Trapped cannot put at ', self class name, ' type key.'",
 messageSends: ["error:", ",", "name", "class"],
@@ -806,61 +774,49 @@ referencedClasses: []
 smalltalk.Object);
 
 smalltalk.addMethod(
-"_asEavModel",
 smalltalk.method({
 selector: "asEavModel",
 category: '*Trapped-Backend',
 fn: function (){
 var self=this;
 var model;
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$6,$5,$2,$7,$9,$11,$12,$14,$13,$10,$8,$15;
-model=_st((smalltalk.EavModel || EavModel))._new();
-$1=model;
-$2=(function(anObject){
+var $1,$2,$3,$4;
+model=_st($EavModel())._new();
+_st(model)._getBlock_((function(anObject){
 return smalltalk.withContext(function($ctx2) {
-$3=self;
-$4=anObject;
-$5=(function(soFar,segment){
+return self._inject_into_(anObject,(function(soFar,segment){
 return smalltalk.withContext(function($ctx3) {
-$6=soFar;
-if(($receiver = $6) == nil || $receiver == undefined){
-return $6;
+$1=soFar;
+if(($receiver = $1) == nil || $receiver == undefined){
+return $1;
 } else {
 return _st(segment)._reverseTrapAt_(soFar);
 };
-}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
-return _st($3)._inject_into_($4,$5);
-}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1)})});
-_st($1)._getBlock_($2);
-$7=_st(self)._isEmpty();
-$8=(function(){
-return smalltalk.withContext(function($ctx2) {
-$9=model;
-$10=(function(anObject,value){
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1)})}));
+$2=self._isEmpty();
+if(! smalltalk.assert($2)){
+_st(model)._putBlock_((function(anObject,value){
 var penultimate;
+return smalltalk.withContext(function($ctx2) {
+penultimate=_st(self._allButLast())._inject_into_(anObject,(function(soFar,segment){
 return smalltalk.withContext(function($ctx3) {
-$11=_st(self)._allButLast();
-$12=anObject;
-$13=(function(soFar,segment){
-return smalltalk.withContext(function($ctx4) {
-$14=soFar;
-if(($receiver = $14) == nil || $receiver == undefined){
-return $14;
+$3=soFar;
+if(($receiver = $3) == nil || $receiver == undefined){
+return $3;
 } else {
 return _st(segment)._reverseTrapAt_(soFar);
 };
-}, function($ctx4) {$ctx4.fillBlock({soFar:soFar,segment:segment},$ctx1)})});
-penultimate=_st($11)._inject_into_($12,$13);
+}, function($ctx3) {$ctx3.fillBlock({soFar:soFar,segment:segment},$ctx2)})}));
 penultimate;
-return _st(_st(self)._last())._reverseTrapAt_put_(penultimate,value);
-}, function($ctx3) {$ctx3.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1)})});
-return _st($9)._putBlock_($10);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
-_st($7)._ifFalse_($8);
-$15=model;
-return $15;
-}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model}, smalltalk.SequenceableCollection)})},
+return _st(self._last())._reverseTrapAt_put_(penultimate,value);
+}, function($ctx2) {$ctx2.fillBlock({anObject:anObject,value:value,penultimate:penultimate},$ctx1)})}));
+};
+$4=model;
+return $4;
+}, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model},smalltalk.SequenceableCollection)})},
 args: [],
 source: "asEavModel\x0a    | model |\x0a    model := EavModel new.\x0a    model getBlock: [ :anObject |\x0a        self inject: anObject into: [ :soFar :segment |\x0a            soFar ifNotNil: [ segment reverseTrapAt: soFar ]]].\x0a    self isEmpty ifFalse: [\x0a        model putBlock: [ :anObject :value | | penultimate |\x0a            penultimate :=  self allButLast inject: anObject into: [ :soFar :segment |\x0a                soFar ifNotNil: [ segment reverseTrapAt: soFar ]].\x0a            self last reverseTrapAt: penultimate put: value ]].\x0a    ^model",
 messageSends: ["new", "getBlock:", "inject:into:", "ifNotNil:", "reverseTrapAt:", "ifFalse:", "putBlock:", "allButLast", "reverseTrapAt:put:", "last", "isEmpty"],
@@ -869,7 +825,6 @@ referencedClasses: ["EavModel"]
 smalltalk.SequenceableCollection);
 
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 category: '*Trapped-Backend',
@@ -882,7 +837,7 @@ var $early={};
 try {
 $1=_st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(anObject)._perform_(_st(self)._first());
+return _st(anObject)._perform_(self._first());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($MessageNotUnderstood(),(function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[nil];
@@ -899,7 +854,6 @@ referencedClasses: ["MessageNotUnderstood"]
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 category: '*Trapped-Backend',
@@ -907,7 +861,7 @@ fn: function (anObject,value){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(anObject)._perform_withArguments_(_st(_st(_st(self)._first()).__comma(":"))._asSymbol(),[value]);
+$1=_st(anObject)._perform_withArguments_(_st(_st(self._first()).__comma(":"))._asSymbol(),[value]);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"reverseTrapAt:put:",{anObject:anObject,value:value},smalltalk.Array)})},
 args: ["anObject", "value"],
@@ -918,7 +872,6 @@ referencedClasses: []
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 category: '*Trapped-Backend',
@@ -931,7 +884,7 @@ 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)})},
 args: ["anObject"],
 source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
 messageSends: ["at:ifAbsent:"],
@@ -940,7 +893,6 @@ referencedClasses: []
 smalltalk.String);
 
 smalltalk.addMethod(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 category: '*Trapped-Backend',
@@ -950,7 +902,7 @@ 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)})},
 args: ["anObject", "value"],
 source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
 messageSends: ["at:put:"],
@@ -959,20 +911,19 @@ referencedClasses: []
 smalltalk.String);
 
 smalltalk.addMethod(
-"_reverseTrapAt_",
 smalltalk.method({
 selector: "reverseTrapAt:",
 category: '*Trapped-Backend',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) {
+return smalltalk.withContext(function($ctx1) { 
 var $1;
 $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)})},
 args: ["anObject"],
 source: "reverseTrapAt: anObject\x0a\x09^anObject at: self ifAbsent: [nil]",
 messageSends: ["at:ifAbsent:"],
@@ -981,17 +932,16 @@ referencedClasses: []
 smalltalk.Number);
 
 smalltalk.addMethod(
-"_reverseTrapAt_put_",
 smalltalk.method({
 selector: "reverseTrapAt:put:",
 category: '*Trapped-Backend',
 fn: function (anObject,value){
 var self=this;
-return smalltalk.withContext(function($ctx1) {
+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)})},
 args: ["anObject", "value"],
 source: "reverseTrapAt: anObject put: value\x0a\x09^anObject at: self put: value",
 messageSends: ["at:put:"],
@@ -999,3 +949,4 @@ referencedClasses: []
 }),
 smalltalk.Number);
 
+});

+ 48 - 46
lib/js/Trapped-Demo.deploy.js

@@ -1,7 +1,9 @@
+define("gh_herby_trapped/Trapped-Demo", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Backend", "amber/Kernel-Objects", "amber/Canvas"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Demo');
+smalltalk.packages["Trapped-Demo"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('App', smalltalk.ListKeyedIsolatedEntity, [], 'Trapped-Demo');
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
@@ -9,15 +11,15 @@ var self=this;
 function $SimpleKeyedPubSub(){return smalltalk.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
 function $AppModel(){return smalltalk.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.ListKeyedIsolatedEntity.fn.prototype._initialize.apply(_st(self), []);
-_st(self)._dispatcher_(_st($SimpleKeyedPubSub())._new());
-_st(self)._model_(_st(_st($AppModel())._new())._title_("Todo"));
+smalltalk.App.superclass.fn.prototype._initialize.apply(_st(self), []);
+self._dispatcher_(_st($SimpleKeyedPubSub())._new());
+self._model_(_st(_st($AppModel())._new())._title_("Todo"));
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._modify_do_([["todos"]],(function(){
+return self._modify_do_([["todos"]],(function(){
 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)})}));
+return [smalltalk.HashedCollection._from_(["text".__minus_gt("learn trapped"),"done".__minus_gt(true)]),smalltalk.HashedCollection._from_(["text".__minus_gt("build a trapped app"),"done".__minus_gt(false)])];
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
 messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "valueWithTimeout:", "modify:do:", "->"]}),
@@ -27,48 +29,48 @@ smalltalk.App);
 
 smalltalk.addClass('AppModel', smalltalk.Object, ['title', 'todos', 'todoText'], 'Trapped-Demo');
 smalltalk.addMethod(
-"_addTodo",
 smalltalk.method({
 selector: "addTodo",
 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 smalltalk.withContext(function($ctx1) { 
+_st(self._todos())._add_(smalltalk.HashedCollection._from_(["text".__minus_gt(self._todoText()),"done".__minus_gt(false)]));
+self._todoText_("");
 return self}, function($ctx1) {$ctx1.fill(self,"addTodo",{},smalltalk.AppModel)})},
 messageSends: ["add:", "->", "todoText", "todos", "todoText:"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_archive",
 smalltalk.method({
 selector: "archive",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._todos_(_st(self)._todosNotDone());
+return smalltalk.withContext(function($ctx1) { 
+self._todos_(self._todosNotDone());
 return self}, function($ctx1) {$ctx1.fill(self,"archive",{},smalltalk.AppModel)})},
 messageSends: ["todos:", "todosNotDone"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_remaining",
 smalltalk.method({
 selector: "remaining",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._todosNotDone())._size();
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._todosNotDone())._size();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"remaining",{},smalltalk.AppModel)})},
 messageSends: ["size", "todosNotDone"]}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_title",
 smalltalk.method({
 selector: "title",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@title"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"title",{},smalltalk.AppModel)})},
@@ -76,23 +78,23 @@ messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_title_",
 smalltalk.method({
 selector: "title:",
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@title"]=aString;
+return smalltalk.withContext(function($ctx1) { 
+self["@title"]=aString;
 return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString},smalltalk.AppModel)})},
 messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todoText",
 smalltalk.method({
 selector: "todoText",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@todoText"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"todoText",{},smalltalk.AppModel)})},
@@ -100,23 +102,23 @@ messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todoText_",
 smalltalk.method({
 selector: "todoText:",
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@todoText"]=aString;
+return smalltalk.withContext(function($ctx1) { 
+self["@todoText"]=aString;
 return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString},smalltalk.AppModel)})},
 messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todos",
 smalltalk.method({
 selector: "todos",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@todos"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"todos",{},smalltalk.AppModel)})},
@@ -124,25 +126,26 @@ messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todos_",
 smalltalk.method({
 selector: "todos:",
 fn: function (anArray){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@todos"]=anArray;
+return smalltalk.withContext(function($ctx1) { 
+self["@todos"]=anArray;
 return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray},smalltalk.AppModel)})},
 messageSends: []}),
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todosNotDone",
 smalltalk.method({
 selector: "todosNotDone",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._todos())._reject_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._at_("done");
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_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)})},
@@ -153,14 +156,13 @@ smalltalk.AppModel);
 
 smalltalk.addClass('AppView', smalltalk.Widget, [], 'Trapped-Demo');
 smalltalk.addMethod(
-"_renderOn_",
 smalltalk.method({
 selector: "renderOn:",
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5,$6,$7,$9,$10,$11,$12,$8;
-_st([])._trapDescend_((function(snap){
+[]._trapDescend_((function(snap){
 return smalltalk.withContext(function($ctx2) {
 _st(_st(html)._h2())._trap_([["title"]]);
 return _st(_st(html)._div())._trap_toggle_ifNotPresent_([["todos"]],(function(){
@@ -178,9 +180,9 @@ return smalltalk.withContext(function($ctx5) {
 _st(snap)._modify_((function(model){
 return smalltalk.withContext(function($ctx6) {
 return _st(model)._archive();
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5)})}));
 return false;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $2=_st($1)._with_("archive");
 $2;
 _st(html)._with_(" ]");
@@ -196,21 +198,21 @@ $4;
 $5=_st(html)._span();
 _st($5)._trap_read_(["done"],(function(model){
 return smalltalk.withContext(function($ctx7) {
-return _st(_st(html)._root())._class_(_st("done-").__comma(model));
-}, function($ctx7) {$ctx7.fillBlock({model:model},$ctx1)})}));
+return _st(_st(html)._root())._class_("done-".__comma(model));
+}, function($ctx7) {$ctx7.fillBlock({model:model},$ctx6)})}));
 $6=_st($5)._trap_(["text"]);
 return $6;
-}, function($ctx6) {$ctx6.fillBlock({each:each},$ctx1)})}));
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({each:each},$ctx5)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $7=_st(html)._form();
 _st($7)._onSubmit_((function(){
 return smalltalk.withContext(function($ctx5) {
 _st(snap)._modify_((function(model){
 return smalltalk.withContext(function($ctx6) {
 return _st(model)._addTodo();
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5)})}));
 return false;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $8=_st($7)._with_((function(){
 return smalltalk.withContext(function($ctx5) {
 $9=_st(html)._input();
@@ -224,17 +226,17 @@ _st($11)._class_("btn-primary");
 _st($11)._type_("submit");
 $12=_st($11)._value_("add");
 return $12;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 return $8;
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),(function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(html)._with_("Loading ...");
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 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);
 
 
-
+});

+ 51 - 49
lib/js/Trapped-Demo.js

@@ -1,8 +1,10 @@
+define("gh_herby_trapped/Trapped-Demo", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "gh_herby_trapped/Trapped-Backend", "amber/Kernel-Objects", "amber/Canvas"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Demo');
+smalltalk.packages["Trapped-Demo"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 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.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(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
@@ -11,15 +13,15 @@ var self=this;
 function $SimpleKeyedPubSub(){return smalltalk.SimpleKeyedPubSub||(typeof SimpleKeyedPubSub=="undefined"?nil:SimpleKeyedPubSub)}
 function $AppModel(){return smalltalk.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.ListKeyedIsolatedEntity.fn.prototype._initialize.apply(_st(self), []);
-_st(self)._dispatcher_(_st($SimpleKeyedPubSub())._new());
-_st(self)._model_(_st(_st($AppModel())._new())._title_("Todo"));
+smalltalk.App.superclass.fn.prototype._initialize.apply(_st(self), []);
+self._dispatcher_(_st($SimpleKeyedPubSub())._new());
+self._model_(_st(_st($AppModel())._new())._title_("Todo"));
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(self)._modify_do_([["todos"]],(function(){
+return self._modify_do_([["todos"]],(function(){
 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)})}));
+return [smalltalk.HashedCollection._from_(["text".__minus_gt("learn trapped"),"done".__minus_gt(true)]),smalltalk.HashedCollection._from_(["text".__minus_gt("build a trapped app"),"done".__minus_gt(false)])];
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
 args: [],
@@ -32,16 +34,16 @@ smalltalk.App);
 
 
 smalltalk.addClass('AppModel', smalltalk.Object, ['title', 'todos', 'todoText'], 'Trapped-Demo');
-smalltalk.AppModel.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.AppModel.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(
-"_addTodo",
 smalltalk.method({
 selector: "addTodo",
 category: 'action',
 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 smalltalk.withContext(function($ctx1) { 
+_st(self._todos())._add_(smalltalk.HashedCollection._from_(["text".__minus_gt(self._todoText()),"done".__minus_gt(false)]));
+self._todoText_("");
 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: ''",
@@ -51,13 +53,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_archive",
 smalltalk.method({
 selector: "archive",
 category: 'action',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._todos_(_st(self)._todosNotDone());
+return smalltalk.withContext(function($ctx1) { 
+self._todos_(self._todosNotDone());
 return self}, function($ctx1) {$ctx1.fill(self,"archive",{},smalltalk.AppModel)})},
 args: [],
 source: "archive\x0a    self todos: self todosNotDone",
@@ -67,14 +69,14 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_remaining",
 smalltalk.method({
 selector: "remaining",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._todosNotDone())._size();
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._todosNotDone())._size();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"remaining",{},smalltalk.AppModel)})},
 args: [],
@@ -85,13 +87,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_title",
 smalltalk.method({
 selector: "title",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@title"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"title",{},smalltalk.AppModel)})},
@@ -103,13 +105,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_title_",
 smalltalk.method({
 selector: "title:",
 category: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@title"]=aString;
+return smalltalk.withContext(function($ctx1) { 
+self["@title"]=aString;
 return self}, function($ctx1) {$ctx1.fill(self,"title:",{aString:aString},smalltalk.AppModel)})},
 args: ["aString"],
 source: "title: aString\x0a\x09title := aString",
@@ -119,13 +121,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todoText",
 smalltalk.method({
 selector: "todoText",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@todoText"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"todoText",{},smalltalk.AppModel)})},
@@ -137,13 +139,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todoText_",
 smalltalk.method({
 selector: "todoText:",
 category: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@todoText"]=aString;
+return smalltalk.withContext(function($ctx1) { 
+self["@todoText"]=aString;
 return self}, function($ctx1) {$ctx1.fill(self,"todoText:",{aString:aString},smalltalk.AppModel)})},
 args: ["aString"],
 source: "todoText: aString\x0a\x09todoText := aString",
@@ -153,13 +155,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todos",
 smalltalk.method({
 selector: "todos",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@todos"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"todos",{},smalltalk.AppModel)})},
@@ -171,13 +173,13 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todos_",
 smalltalk.method({
 selector: "todos:",
 category: 'accessing',
 fn: function (anArray){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@todos"]=anArray;
+return smalltalk.withContext(function($ctx1) { 
+self["@todos"]=anArray;
 return self}, function($ctx1) {$ctx1.fill(self,"todos:",{anArray:anArray},smalltalk.AppModel)})},
 args: ["anArray"],
 source: "todos: anArray\x0a\x09todos := anArray",
@@ -187,15 +189,16 @@ referencedClasses: []
 smalltalk.AppModel);
 
 smalltalk.addMethod(
-"_todosNotDone",
 smalltalk.method({
 selector: "todosNotDone",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(_st(self)._todos())._reject_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._at_("done");
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_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)})},
@@ -209,9 +212,8 @@ smalltalk.AppModel);
 
 
 smalltalk.addClass('AppView', smalltalk.Widget, [], 'Trapped-Demo');
-smalltalk.AppView.comment="  <!-- Code from AngularJS Todo example, http://angularjs.org/#todo-html -->\x0a  <body>\x0a    <h2>Todo</h2>\x0a    <div ng-controller=\x22TodoCtrl\x22>\x0a      <span>{{remaining()}} of {{todos.length}} remaining</span>\x0a      [ <a href=\x22\x22 ng-click=\x22archive()\x22>archive</a> ]\x0a      <ul class=\x22unstyled\x22>\x0a        <li ng-repeat=\x22todo in todos\x22>\x0a          <input type=\x22checkbox\x22 ng-model=\x22todo.done\x22>\x0a          <span class=\x22done-{{todo.done}}\x22>{{todo.text}}</span>\x0a        </li>\x0a      </ul>\x0a      <form ng-submit=\x22addTodo()\x22>\x0a        <input type=\x22text\x22 ng-model=\x22todoText\x22  size=\x2230\x22\x0a               placeholder=\x22add new todo here\x22>\x0a        <input class=\x22btn-primary\x22 type=\x22submit\x22 value=\x22add\x22>\x0a      </form>\x0a    </div>\x0a  </body>\x0a"
+smalltalk.AppView.comment="<!-- Code from AngularJS Todo example, http://angularjs.org/#todo-html -->\x0a  <body>\x0a    <h2>Todo</h2>\x0a    <div ng-controller=\x22TodoCtrl\x22>\x0a      <span>{{remaining()}} of {{todos.length}} remaining</span>\x0a      [ <a href=\x22\x22 ng-click=\x22archive()\x22>archive</a> ]\x0a      <ul class=\x22unstyled\x22>\x0a        <li ng-repeat=\x22todo in todos\x22>\x0a          <input type=\x22checkbox\x22 ng-model=\x22todo.done\x22>\x0a          <span class=\x22done-{{todo.done}}\x22>{{todo.text}}</span>\x0a        </li>\x0a      </ul>\x0a      <form ng-submit=\x22addTodo()\x22>\x0a        <input type=\x22text\x22 ng-model=\x22todoText\x22  size=\x2230\x22\x0a               placeholder=\x22add new todo here\x22>\x0a        <input class=\x22btn-primary\x22 type=\x22submit\x22 value=\x22add\x22>\x0a      </form>\x0a    </div>\x0a  </body>";
 smalltalk.addMethod(
-"_renderOn_",
 smalltalk.method({
 selector: "renderOn:",
 category: 'rendering',
@@ -219,7 +221,7 @@ fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4,$5,$6,$7,$9,$10,$11,$12,$8;
-_st([])._trapDescend_((function(snap){
+[]._trapDescend_((function(snap){
 return smalltalk.withContext(function($ctx2) {
 _st(_st(html)._h2())._trap_([["title"]]);
 return _st(_st(html)._div())._trap_toggle_ifNotPresent_([["todos"]],(function(){
@@ -237,9 +239,9 @@ return smalltalk.withContext(function($ctx5) {
 _st(snap)._modify_((function(model){
 return smalltalk.withContext(function($ctx6) {
 return _st(model)._archive();
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5)})}));
 return false;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $2=_st($1)._with_("archive");
 $2;
 _st(html)._with_(" ]");
@@ -255,21 +257,21 @@ $4;
 $5=_st(html)._span();
 _st($5)._trap_read_(["done"],(function(model){
 return smalltalk.withContext(function($ctx7) {
-return _st(_st(html)._root())._class_(_st("done-").__comma(model));
-}, function($ctx7) {$ctx7.fillBlock({model:model},$ctx1)})}));
+return _st(_st(html)._root())._class_("done-".__comma(model));
+}, function($ctx7) {$ctx7.fillBlock({model:model},$ctx6)})}));
 $6=_st($5)._trap_(["text"]);
 return $6;
-}, function($ctx6) {$ctx6.fillBlock({each:each},$ctx1)})}));
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({each:each},$ctx5)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $7=_st(html)._form();
 _st($7)._onSubmit_((function(){
 return smalltalk.withContext(function($ctx5) {
 _st(snap)._modify_((function(model){
 return smalltalk.withContext(function($ctx6) {
 return _st(model)._addTodo();
-}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx1)})}));
+}, function($ctx6) {$ctx6.fillBlock({model:model},$ctx5)})}));
 return false;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 $8=_st($7)._with_((function(){
 return smalltalk.withContext(function($ctx5) {
 $9=_st(html)._input();
@@ -283,13 +285,13 @@ _st($11)._class_("btn-primary");
 _st($11)._type_("submit");
 $12=_st($11)._value_("add");
 return $12;
-}, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
+}, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
 return $8;
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),(function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(html)._with_("Loading ...");
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.AppView)})},
 args: ["html"],
@@ -300,4 +302,4 @@ referencedClasses: []
 smalltalk.AppView);
 
 
-
+});

+ 208 - 166
lib/js/Trapped-Frontend.deploy.js

@@ -1,53 +1,58 @@
+define("gh_herby_trapped/Trapped-Frontend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects", "amber/Canvas", "amber/Kernel-Collections"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Frontend');
+smalltalk.packages["Trapped-Frontend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('TrappedBinder', smalltalk.Object, ['brush'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_brush_",
 smalltalk.method({
 selector: "brush:",
 fn: function (aTagBrush){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@brush"]=aTagBrush;
+return smalltalk.withContext(function($ctx1) { 
+self["@brush"]=aTagBrush;
 return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush},smalltalk.TrappedBinder)})},
 messageSends: []}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self["@brush"])._trap_read_(path,_st(self)._showBlock());
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@brush"])._trap_read_(path,self._showBlock());
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedBinder)})},
 messageSends: ["trap:read:", "showBlock"]}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_prim_",
 smalltalk.method({
 selector: "prim:",
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return anObject.valueOf();
+return smalltalk.withContext(function($ctx1) { 
+return anObject.valueOf();
 return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject},smalltalk.TrappedBinder)})},
 messageSends: []}),
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$4,$6,$5,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$6,$5,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
$2=self["@brush"];
+return smalltalk.withContext(function($ctx2) {
+$2=self["@brush"];
 _st($2)._empty();
 $4=$2;
 $6=model;
 if(($receiver = $6) == nil || $receiver == undefined){
 $5=(function(){
-return smalltalk.withContext(function($ctx3) {
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
+return smalltalk.withContext(function($ctx3) {
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
 } else {
 $5=$6;
 };
@@ -63,36 +68,43 @@ smalltalk.TrappedBinder);
 
 smalltalk.addClass('TrappedCheckedBinder', smalltalk.TrappedBinder, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedBinder.fn.prototype._installFor_.apply(_st(self), [path]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedCheckedBinder.superclass.fn.prototype._installFor_.apply(_st(self), [path]);
 _st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
return _st(self["@brush"])._onChange_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(snap)._modify_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(_st(self["@brush"])._asJQuery())._attr_("checked"))._notNil();
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+return _st(self["@brush"])._onChange_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(snap)._modify_((function(){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(_st(self["@brush"])._asJQuery())._attr_("checked"))._notNil();
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedCheckedBinder)})},
 messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "notNil", "attr:", "asJQuery"]}),
 smalltalk.TrappedCheckedBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(self["@brush"])._asJQuery())._attr_put_("checked",_st(model)._ifNotNil_ifNil_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(self)._prim_(model);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx3) {
return false;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
+return smalltalk.withContext(function($ctx2) {
+$2=_st(self["@brush"])._asJQuery();
+$4=model;
+if(($receiver = $4) == nil || $receiver == undefined){
+$3=false;
+} else {
+$3=self._prim_(model);
+};
+return _st($2)._attr_put_("checked",$3);
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedCheckedBinder)})},
@@ -103,37 +115,45 @@ smalltalk.TrappedCheckedBinder);
 
 smalltalk.addClass('TrappedValBinder', smalltalk.TrappedBinder, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedBinder.fn.prototype._installFor_.apply(_st(self), [path]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedValBinder.superclass.fn.prototype._installFor_.apply(_st(self), [path]);
 _st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
return _st(self["@brush"])._onChange_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(snap)._modify_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(self["@brush"])._asJQuery())._val();
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+return _st(self["@brush"])._onChange_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(snap)._modify_((function(){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(self["@brush"])._asJQuery())._val();
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedValBinder)})},
 messageSends: ["installFor:", "trapDescend:", "onChange:", "modify:", "val", "asJQuery"]}),
 smalltalk.TrappedValBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(self["@brush"])._asJQuery())._val_(_st(model)._ifNotNil_ifNil_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(self)._prim_(model);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx3) {
return (function(){
-return smalltalk.withContext(function($ctx4) {
}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})});
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
+return smalltalk.withContext(function($ctx2) {
+$2=_st(self["@brush"])._asJQuery();
+$4=model;
+if(($receiver = $4) == nil || $receiver == undefined){
+$3=(function(){
+return smalltalk.withContext(function($ctx3) {
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
+} else {
+$3=self._prim_(model);
+};
+return _st($2)._val_($3);
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedValBinder)})},
@@ -144,12 +164,12 @@ smalltalk.TrappedValBinder);
 
 smalltalk.addClass('TrappedDumbView', smalltalk.Widget, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_renderOn_",
 smalltalk.method({
 selector: "renderOn:",
 fn: function (html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(html)._root())._trap_([]);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(html)._root())._trap_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TrappedDumbView)})},
 messageSends: ["trap:", "root"]}),
 smalltalk.TrappedDumbView);
@@ -158,13 +178,13 @@ smalltalk.TrappedDumbView);
 
 smalltalk.addClass('TrappedSingleton', smalltalk.Object, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(self)._subclassResponsibility();
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self._subclassResponsibility();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
 messageSends: ["subclassResponsibility"]}),
@@ -173,15 +193,15 @@ smalltalk.TrappedSingleton);
 
 smalltalk.TrappedSingleton.klass.iVarNames = ['current'];
 smalltalk.addMethod(
-"_current",
 smalltalk.method({
 selector: "current",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
 $2=self["@current"];
 if(($receiver = $2) == nil || $receiver == undefined){
-self["@current"]=_st(self)._new();
+self["@current"]=self._new();
 $1=self["@current"];
 } else {
 $1=$2;
@@ -192,12 +212,12 @@ messageSends: ["ifNil:", "new"]}),
 smalltalk.TrappedSingleton.klass);
 
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._current())._start_(args);
+return smalltalk.withContext(function($ctx1) { 
+_st(self._current())._start_(args);
 return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
 messageSends: ["start:", "current"]}),
 smalltalk.TrappedSingleton.klass);
@@ -205,32 +225,36 @@ smalltalk.TrappedSingleton.klass);
 
 smalltalk.addClass('Trapped', smalltalk.TrappedSingleton, ['registry'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_binder_",
 smalltalk.method({
 selector: "binder:",
 fn: function (aTagBrush){
 var self=this;
 var binder,tag;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$6,$7,$5;
+function $TrappedCheckedBinder(){return smalltalk.TrappedCheckedBinder||(typeof TrappedCheckedBinder=="undefined"?nil:TrappedCheckedBinder)}
+function $TrappedValBinder(){return smalltalk.TrappedValBinder||(typeof TrappedValBinder=="undefined"?nil:TrappedValBinder)}
+function $TrappedBinder(){return smalltalk.TrappedBinder||(typeof TrappedBinder=="undefined"?nil:TrappedBinder)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$6,$7,$5;
 tag=_st(_st(aTagBrush)._element())._nodeName();
 $1=_st(tag).__eq("INPUT");
 if(smalltalk.assert($1)){
+var type;
 type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
 type;
 $2=_st(type).__eq("checkbox");
 if(smalltalk.assert($2)){
-binder=_st((smalltalk.TrappedCheckedBinder || TrappedCheckedBinder))._new();
+binder=_st($TrappedCheckedBinder())._new();
 binder;
 };
 $3=_st(type).__eq("text");
 if(smalltalk.assert($3)){
-binder=_st((smalltalk.TrappedValBinder || TrappedValBinder))._new();
+binder=_st($TrappedValBinder())._new();
 binder;
 };
 };
 $4=binder;
 if(($receiver = $4) == nil || $receiver == undefined){
-binder=_st((smalltalk.TrappedBinder || TrappedBinder))._new();
+binder=_st($TrappedBinder())._new();
 binder;
 } else {
 $4;
@@ -245,12 +269,12 @@ messageSends: ["nodeName", "element", "ifTrue:", "attr:", "asJQuery", "new", "="
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_byName_",
 smalltalk.method({
 selector: "byName:",
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+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)})},
@@ -258,72 +282,79 @@ messageSends: ["at:"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_descend_snapshotDo_",
 smalltalk.method({
 selector: "descend:snapshotDo:",
 fn: function (anArray,aBlock){
 var self=this;
 var tpsc;
-return smalltalk.withContext(function($ctx1) { 
tpsc=_st((smalltalk.TrappedPathStack || TrappedPathStack))._current();
+function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+function $TrappedSnapshot(){return smalltalk.TrappedSnapshot||(typeof TrappedSnapshot=="undefined"?nil:TrappedSnapshot)}
+return smalltalk.withContext(function($ctx1) { 
+tpsc=_st($TrappedPathStack())._current();
 _st(tpsc)._append_do_(anArray,(function(){
 var path,model;
-return smalltalk.withContext(function($ctx2) {
path=_st(_st(tpsc)._elements())._copy();
+return smalltalk.withContext(function($ctx2) {
+path=_st(_st(tpsc)._elements())._copy();
 path;
-model=_st(self)._byName_(_st(path)._first());
+model=self._byName_(_st(path)._first());
 model;
-return _st(aBlock)._value_(_st(_st((smalltalk.TrappedSnapshot || TrappedSnapshot))._new())._path_model_(path,model));
+return _st(aBlock)._value_(_st(_st($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)})},
 messageSends: ["current", "append:do:", "copy", "elements", "byName:", "first", "value:", "path:model:", "new"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
-self["@registry"]=smalltalk.HashedCollection._fromPairs_([]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.Trapped.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@registry"]=smalltalk.HashedCollection._from_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
 messageSends: ["initialize"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_register_",
 smalltalk.method({
 selector: "register:",
 fn: function (aListKeyedEntity){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
+return smalltalk.withContext(function($ctx1) { 
+self._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
 return self}, function($ctx1) {$ctx1.fill(self,"register:",{aListKeyedEntity:aListKeyedEntity},smalltalk.Trapped)})},
 messageSends: ["register:name:", "name", "class"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_register_name_",
 smalltalk.method({
 selector: "register:name:",
 fn: function (aListKeyedEntity,aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self["@registry"])._at_put_(aString,aListKeyedEntity);
+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)})},
 messageSends: ["at:put:"]}),
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(args)._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._register_(each);
+return smalltalk.withContext(function($ctx2) {
+return self._register_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-_st(_st("[data-trap]")._asJQuery())._each_((function(index,elem){
+_st("[data-trap]"._asJQuery())._each_((function(index,elem){
 var trap,jq,viewName,modelName,tokens,path;
-return smalltalk.withContext(function($ctx2) {
jq=_st(elem)._asJQuery();
+return smalltalk.withContext(function($ctx2) {
+jq=_st(elem)._asJQuery();
 jq;
 trap=_st(jq)._attr_("data-trap");
 trap;
@@ -337,16 +368,18 @@ tokens;
 viewName=_st(tokens)._first();
 viewName;
 tokens=_st(_st(_st(tokens)._second())._tokenize_(" "))._select_((function(each){
-return smalltalk.withContext(function($ctx3) {
return _st(each)._notEmpty();
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
+return smalltalk.withContext(function($ctx3) {
+return _st(each)._notEmpty();
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
 tokens;
 modelName=_st(tokens)._first();
 modelName;
-path=_st((smalltalk.Trapped || Trapped))._parse_(_st(tokens)._allButFirst());
+path=_st($Trapped())._parse_(_st(tokens)._allButFirst());
 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)})}));
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(_st(_st($Smalltalk())._current())._at_(viewName))._new())._appendToJQuery_(jq);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, 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"]}),
@@ -354,17 +387,19 @@ smalltalk.Trapped);
 
 
 smalltalk.addMethod(
-"_envelope_loop_before_tag_do_",
 smalltalk.method({
 selector: "envelope:loop:before:tag:do:",
 fn: function (envelope,model,endjq,aSymbol,aBlock){
 var self=this;
 var envjq;
-return smalltalk.withContext(function($ctx1) { 
envjq=_st(envelope)._asJQuery();
+return smalltalk.withContext(function($ctx1) { 
+envjq=_st(envelope)._asJQuery();
 _st(model)._withIndexDo_((function(item,i){
-return smalltalk.withContext(function($ctx2) {
_st(envelope)._with_((function(html){
-return smalltalk.withContext(function($ctx3) {
return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
-}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+_st(envelope)._with_((function(html){
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
+}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx2)})}));
 return _st(_st(_st(envjq)._children())._detach())._insertBefore_(endjq);
 }, function($ctx2) {$ctx2.fillBlock({item:item,i:i},$ctx1)})}));
 _st(envjq)._remove();
@@ -373,19 +408,20 @@ messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "i
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
-"_loop_between_and_tag_do_",
 smalltalk.method({
 selector: "loop:between:and:tag:do:",
 fn: function (model,start,end,aSymbol,aBlock){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(_st(start)._asJQuery())._nextUntil_(_st(end)._element()))._remove();
 _st(start)._with_((function(html){
-return smalltalk.withContext(function($ctx2) {
$1=model;
+return smalltalk.withContext(function($ctx2) {
+$1=model;
 if(($receiver = $1) == nil || $receiver == undefined){
 return $1;
 } else {
-return _st(self)._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
+return 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)})},
@@ -393,7 +429,6 @@ messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
-"_parse_",
 smalltalk.method({
 selector: "parse:",
 fn: function (anArray){
@@ -425,23 +460,23 @@ smalltalk.Trapped.klass);
 
 smalltalk.addClass('TrappedPathStack', smalltalk.TrappedSingleton, ['elements'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_append_do_",
 smalltalk.method({
 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 smalltalk.withContext(function($ctx1) { 
+self._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
 return self}, function($ctx1) {$ctx1.fill(self,"append:do:",{anArray:anArray,aBlock:aBlock},smalltalk.TrappedPathStack)})},
 messageSends: ["with:do:", ","]}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_elements",
 smalltalk.method({
 selector: "elements",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@elements"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
@@ -449,31 +484,33 @@ messageSends: []}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedPathStack.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@elements"]=[];
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
 messageSends: ["initialize"]}),
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_with_do_",
 smalltalk.method({
 selector: "with:do:",
 fn: function (anArray,aBlock){
 var self=this;
 var old;
-return smalltalk.withContext(function($ctx1) { 
old=self["@elements"];
+return smalltalk.withContext(function($ctx1) { 
+old=self["@elements"];
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
self["@elements"]=anArray;
+return smalltalk.withContext(function($ctx2) {
+self["@elements"]=anArray;
 self["@elements"];
 return _st(aBlock)._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
self["@elements"]=old;
+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)})},
@@ -484,25 +521,27 @@ smalltalk.TrappedPathStack);
 
 smalltalk.addClass('TrappedSnapshot', smalltalk.Object, ['path', 'model'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_do_",
 smalltalk.method({
 selector: "do:",
 fn: function (aBlock){
 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 $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($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)})},
 messageSends: ["with:do:", "value:", "current"]}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_model",
 smalltalk.method({
 selector: "model",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@model"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
@@ -510,23 +549,23 @@ messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_modify_",
 smalltalk.method({
 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 smalltalk.withContext(function($ctx1) { 
+_st(self._model())._modify_do_(_st(self._path())._allButFirst(),aBlock);
 return self}, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},smalltalk.TrappedSnapshot)})},
 messageSends: ["modify:do:", "allButFirst", "path", "model"]}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_path",
 smalltalk.method({
 selector: "path",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@path"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
@@ -534,135 +573,138 @@ messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_path_model_",
 smalltalk.method({
 selector: "path:model:",
 fn: function (anArray,aTrappedMW){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@path"]=anArray;
+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)})},
 messageSends: []}),
 smalltalk.TrappedSnapshot);
 
 
-
 smalltalk.addMethod(
-"_trapDescend_",
 smalltalk.method({
 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)})},
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($Trapped())._current())._descend_snapshotDo_(self,aBlock);
+return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock},smalltalk.Array)})},
 messageSends: ["descend:snapshotDo:", "current"]}),
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_trapIter_tag_do_",
 smalltalk.method({
 selector: "trapIter:tag:do:",
 fn: function (path,aSymbol,aBlock){
 var self=this;
 var start,end;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._with_((function(html){
-return smalltalk.withContext(function($ctx2) {
start=_st(html)._script();
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+self._with_((function(html){
+return smalltalk.withContext(function($ctx2) {
+start=_st(html)._script();
 start;
 end=_st(html)._script();
 return end;
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
 _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);
+return smalltalk.withContext(function($ctx2) {
+return _st($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(
-"_trap_",
 smalltalk.method({
 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)})},
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(_st($Trapped())._current())._binder_(self))._installFor_(path);
+return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path},smalltalk.TagBrush)})},
 messageSends: ["installFor:", "binder:", "current"]}),
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
-"_trap_read_",
 smalltalk.method({
 selector: "trap:read:",
 fn: function (path,aBlock){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$6,$5,$2;
-$1=path;
-$2=(function(snap){
-return smalltalk.withContext(function($ctx2) {
$3=_st(snap)._model();
-$4=_st(_st(snap)._path())._allButFirst();
-$5=(function(data){
-return smalltalk.withContext(function($ctx3) {
$6=_st(_st(_st(_st(self)._asJQuery())._closest_("html"))._toArray())._isEmpty();
-if(smalltalk.assert($6)){
-_st((smalltalk.KeyedPubSubUnsubscribe || KeyedPubSubUnsubscribe))._signal();
+function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+_st(path)._trapDescend_((function(snap){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(snap)._model())._watch_do_(_st(_st(snap)._path())._allButFirst(),(function(data){
+return smalltalk.withContext(function($ctx3) {
+$1=_st(_st(_st(self._asJQuery())._closest_("html"))._toArray())._isEmpty();
+if(smalltalk.assert($1)){
+_st($KeyedPubSubUnsubscribe())._signal();
 };
 return _st(snap)._do_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(self)._with_((function(html){
-return smalltalk.withContext(function($ctx5) {
return _st(aBlock)._value_value_(data,html);
-}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx1)})}));
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx1)})});
-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 smalltalk.withContext(function($ctx4) {
+return self._with_((function(html){
+return smalltalk.withContext(function($ctx5) {
+return _st(aBlock)._value_value_(data,html);
+}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4)})}));
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
+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(
-"_trap_toggle_",
 smalltalk.method({
 selector: "trap:toggle:",
 fn: function (path,aBlock){
 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();
+return smalltalk.withContext(function($ctx1) { 
+self._trap_toggle_ifNotPresent_(path,aBlock,(function(){
+return smalltalk.withContext(function($ctx2) {
+return _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(
-"_trap_toggle_ifNotPresent_",
 smalltalk.method({
 selector: "trap:toggle:ifNotPresent:",
 fn: function (path,aBlock,anotherBlock){
 var self=this;
 var shown;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$4,$6,$7,$9,$8,$5,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$5,$4;
 shown=nil;
-$1=self;
-$2=path;
-$3=(function(data,html){
-return smalltalk.withContext(function($ctx2) {
$4=_st(shown).__eq(_st(data)._notNil());
-$5=(function(){
-return smalltalk.withContext(function($ctx3) {
shown=_st(data)._notNil();
+self._trap_read_(path,(function(data,html){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(shown).__eq(_st(data)._notNil());
+if(! smalltalk.assert($1)){
+shown=_st(data)._notNil();
 shown;
-$6=_st(self)._asJQuery();
-_st($6)._empty();
-$7=_st($6)._show();
-$7;
-$9=shown;
-if(smalltalk.assert($9)){
-$8=aBlock;
+$2=self._asJQuery();
+_st($2)._empty();
+$3=_st($2)._show();
+$3;
+$5=shown;
+if(smalltalk.assert($5)){
+$4=aBlock;
 } else {
-$8=anotherBlock;
+$4=anotherBlock;
+};
+return _st($4)._value_value_(data,html);
 };
-return _st($8)._value_value_(data,html);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-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)})},
+}, function($ctx2) {$ctx2.fillBlock({data:data,html:html},$ctx1)})}));
+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);
 
+});

+ 211 - 169
lib/js/Trapped-Frontend.js

@@ -1,13 +1,16 @@
+define("gh_herby_trapped/Trapped-Frontend", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/Kernel-Objects", "amber/Canvas", "amber/Kernel-Collections"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Frontend');
+smalltalk.packages["Trapped-Frontend"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('TrappedBinder', smalltalk.Object, ['brush'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_brush_",
 smalltalk.method({
 selector: "brush:",
 category: 'accessing',
 fn: function (aTagBrush){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@brush"]=aTagBrush;
+return smalltalk.withContext(function($ctx1) { 
+self["@brush"]=aTagBrush;
 return self}, function($ctx1) {$ctx1.fill(self,"brush:",{aTagBrush:aTagBrush},smalltalk.TrappedBinder)})},
 args: ["aTagBrush"],
 source: "brush: aTagBrush\x0a\x09brush := aTagBrush",
@@ -17,13 +20,13 @@ referencedClasses: []
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 category: 'action',
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self["@brush"])._trap_read_(path,_st(self)._showBlock());
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@brush"])._trap_read_(path,self._showBlock());
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedBinder)})},
 args: ["path"],
 source: "installFor: path\x0a\x09brush trap: path read: self showBlock",
@@ -33,13 +36,13 @@ referencedClasses: []
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_prim_",
 smalltalk.method({
 selector: "prim:",
 category: 'converting',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return anObject.valueOf();
+return smalltalk.withContext(function($ctx1) { 
+return anObject.valueOf();
 return self}, function($ctx1) {$ctx1.fill(self,"prim:",{anObject:anObject},smalltalk.TrappedBinder)})},
 args: ["anObject"],
 source: "prim: anObject\x0a\x09<return anObject.valueOf()>",
@@ -49,21 +52,23 @@ referencedClasses: []
 smalltalk.TrappedBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 category: 'action',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$4,$6,$5,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$6,$5,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
$2=self["@brush"];
+return smalltalk.withContext(function($ctx2) {
+$2=self["@brush"];
 _st($2)._empty();
 $4=$2;
 $6=model;
 if(($receiver = $6) == nil || $receiver == undefined){
 $5=(function(){
-return smalltalk.withContext(function($ctx3) {
}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
+return smalltalk.withContext(function($ctx3) {
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
 } else {
 $5=$6;
 };
@@ -83,19 +88,22 @@ smalltalk.TrappedBinder);
 
 smalltalk.addClass('TrappedCheckedBinder', smalltalk.TrappedBinder, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 category: 'action',
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedBinder.fn.prototype._installFor_.apply(_st(self), [path]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedCheckedBinder.superclass.fn.prototype._installFor_.apply(_st(self), [path]);
 _st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
return _st(self["@brush"])._onChange_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(snap)._modify_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(_st(self["@brush"])._asJQuery())._attr_("checked"))._notNil();
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+return _st(self["@brush"])._onChange_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(snap)._modify_((function(){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(_st(self["@brush"])._asJQuery())._attr_("checked"))._notNil();
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedCheckedBinder)})},
 args: ["path"],
@@ -106,19 +114,23 @@ referencedClasses: []
 smalltalk.TrappedCheckedBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 category: 'action',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(self["@brush"])._asJQuery())._attr_put_("checked",_st(model)._ifNotNil_ifNil_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(self)._prim_(model);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx3) {
return false;
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
+return smalltalk.withContext(function($ctx2) {
+$2=_st(self["@brush"])._asJQuery();
+$4=model;
+if(($receiver = $4) == nil || $receiver == undefined){
+$3=false;
+} else {
+$3=self._prim_(model);
+};
+return _st($2)._attr_put_("checked",$3);
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedCheckedBinder)})},
@@ -133,19 +145,22 @@ smalltalk.TrappedCheckedBinder);
 
 smalltalk.addClass('TrappedValBinder', smalltalk.TrappedBinder, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_installFor_",
 smalltalk.method({
 selector: "installFor:",
 category: 'action',
 fn: function (path){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedBinder.fn.prototype._installFor_.apply(_st(self), [path]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedValBinder.superclass.fn.prototype._installFor_.apply(_st(self), [path]);
 _st(path)._trapDescend_((function(snap){
-return smalltalk.withContext(function($ctx2) {
return _st(self["@brush"])._onChange_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(snap)._modify_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(self["@brush"])._asJQuery())._val();
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+return _st(self["@brush"])._onChange_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(snap)._modify_((function(){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(self["@brush"])._asJQuery())._val();
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"installFor:",{path:path},smalltalk.TrappedValBinder)})},
 args: ["path"],
@@ -156,20 +171,25 @@ referencedClasses: []
 smalltalk.TrappedValBinder);
 
 smalltalk.addMethod(
-"_showBlock",
 smalltalk.method({
 selector: "showBlock",
 category: 'action',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$3,$1;
 $1=(function(model){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(self["@brush"])._asJQuery())._val_(_st(model)._ifNotNil_ifNil_((function(){
-return smalltalk.withContext(function($ctx3) {
return _st(self)._prim_(model);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx3) {
return (function(){
-return smalltalk.withContext(function($ctx4) {
}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})});
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})));
+return smalltalk.withContext(function($ctx2) {
+$2=_st(self["@brush"])._asJQuery();
+$4=model;
+if(($receiver = $4) == nil || $receiver == undefined){
+$3=(function(){
+return smalltalk.withContext(function($ctx3) {
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})});
+} else {
+$3=self._prim_(model);
+};
+return _st($2)._val_($3);
 }, function($ctx2) {$ctx2.fillBlock({model:model},$ctx1)})});
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"showBlock",{},smalltalk.TrappedValBinder)})},
@@ -183,15 +203,15 @@ smalltalk.TrappedValBinder);
 
 
 smalltalk.addClass('TrappedDumbView', smalltalk.Widget, [], 'Trapped-Frontend');
-smalltalk.TrappedDumbView.comment="I just read and show an actual path."
+smalltalk.TrappedDumbView.comment="I just read and show an actual path.";
 smalltalk.addMethod(
-"_renderOn_",
 smalltalk.method({
 selector: "renderOn:",
 category: 'rendering',
 fn: function (html){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(html)._root())._trap_([]);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(html)._root())._trap_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TrappedDumbView)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09html root trap: #()",
@@ -204,14 +224,14 @@ smalltalk.TrappedDumbView);
 
 smalltalk.addClass('TrappedSingleton', smalltalk.Object, [], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 category: 'action',
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
-$1=_st(self)._subclassResponsibility();
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self._subclassResponsibility();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton)})},
 args: ["args"],
@@ -224,16 +244,16 @@ smalltalk.TrappedSingleton);
 
 smalltalk.TrappedSingleton.klass.iVarNames = ['current'];
 smalltalk.addMethod(
-"_current",
 smalltalk.method({
 selector: "current",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
 $2=self["@current"];
 if(($receiver = $2) == nil || $receiver == undefined){
-self["@current"]=_st(self)._new();
+self["@current"]=self._new();
 $1=self["@current"];
 } else {
 $1=$2;
@@ -248,13 +268,13 @@ referencedClasses: []
 smalltalk.TrappedSingleton.klass);
 
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 category: 'action',
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._current())._start_(args);
+return smalltalk.withContext(function($ctx1) { 
+_st(self._current())._start_(args);
 return self}, function($ctx1) {$ctx1.fill(self,"start:",{args:args},smalltalk.TrappedSingleton.klass)})},
 args: ["args"],
 source: "start: args\x0a\x09self current start: args",
@@ -266,33 +286,37 @@ smalltalk.TrappedSingleton.klass);
 
 smalltalk.addClass('Trapped', smalltalk.TrappedSingleton, ['registry'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_binder_",
 smalltalk.method({
 selector: "binder:",
 category: 'binders',
 fn: function (aTagBrush){
 var self=this;
 var binder,tag;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$6,$7,$5;
+function $TrappedCheckedBinder(){return smalltalk.TrappedCheckedBinder||(typeof TrappedCheckedBinder=="undefined"?nil:TrappedCheckedBinder)}
+function $TrappedValBinder(){return smalltalk.TrappedValBinder||(typeof TrappedValBinder=="undefined"?nil:TrappedValBinder)}
+function $TrappedBinder(){return smalltalk.TrappedBinder||(typeof TrappedBinder=="undefined"?nil:TrappedBinder)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$6,$7,$5;
 tag=_st(_st(aTagBrush)._element())._nodeName();
 $1=_st(tag).__eq("INPUT");
 if(smalltalk.assert($1)){
+var type;
 type=_st(_st(aTagBrush)._asJQuery())._attr_("type");
 type;
 $2=_st(type).__eq("checkbox");
 if(smalltalk.assert($2)){
-binder=_st((smalltalk.TrappedCheckedBinder || TrappedCheckedBinder))._new();
+binder=_st($TrappedCheckedBinder())._new();
 binder;
 };
 $3=_st(type).__eq("text");
 if(smalltalk.assert($3)){
-binder=_st((smalltalk.TrappedValBinder || TrappedValBinder))._new();
+binder=_st($TrappedValBinder())._new();
 binder;
 };
 };
 $4=binder;
 if(($receiver = $4) == nil || $receiver == undefined){
-binder=_st((smalltalk.TrappedBinder || TrappedBinder))._new();
+binder=_st($TrappedBinder())._new();
 binder;
 } else {
 $4;
@@ -311,13 +335,13 @@ referencedClasses: ["TrappedCheckedBinder", "TrappedValBinder", "TrappedBinder"]
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_byName_",
 smalltalk.method({
 selector: "byName:",
 category: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+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)})},
@@ -329,21 +353,24 @@ referencedClasses: []
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_descend_snapshotDo_",
 smalltalk.method({
 selector: "descend:snapshotDo:",
 category: 'action',
 fn: function (anArray,aBlock){
 var self=this;
 var tpsc;
-return smalltalk.withContext(function($ctx1) { 
tpsc=_st((smalltalk.TrappedPathStack || TrappedPathStack))._current();
+function $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+function $TrappedSnapshot(){return smalltalk.TrappedSnapshot||(typeof TrappedSnapshot=="undefined"?nil:TrappedSnapshot)}
+return smalltalk.withContext(function($ctx1) { 
+tpsc=_st($TrappedPathStack())._current();
 _st(tpsc)._append_do_(anArray,(function(){
 var path,model;
-return smalltalk.withContext(function($ctx2) {
path=_st(_st(tpsc)._elements())._copy();
+return smalltalk.withContext(function($ctx2) {
+path=_st(_st(tpsc)._elements())._copy();
 path;
-model=_st(self)._byName_(_st(path)._first());
+model=self._byName_(_st(path)._first());
 model;
-return _st(aBlock)._value_(_st(_st((smalltalk.TrappedSnapshot || TrappedSnapshot))._new())._path_model_(path,model));
+return _st(aBlock)._value_(_st(_st($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)})},
 args: ["anArray", "aBlock"],
@@ -354,14 +381,14 @@ referencedClasses: ["TrappedPathStack", "TrappedSnapshot"]
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
-self["@registry"]=smalltalk.HashedCollection._fromPairs_([]);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.Trapped.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@registry"]=smalltalk.HashedCollection._from_([]);
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Trapped)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09registry := #{}.",
@@ -371,13 +398,13 @@ referencedClasses: []
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_register_",
 smalltalk.method({
 selector: "register:",
 category: 'accessing',
 fn: function (aListKeyedEntity){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
+return smalltalk.withContext(function($ctx1) { 
+self._register_name_(aListKeyedEntity,_st(_st(aListKeyedEntity)._class())._name());
 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",
@@ -387,13 +414,13 @@ referencedClasses: []
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_register_name_",
 smalltalk.method({
 selector: "register:name:",
 category: 'accessing',
 fn: function (aListKeyedEntity,aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(self["@registry"])._at_put_(aString,aListKeyedEntity);
+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)})},
 args: ["aListKeyedEntity", "aString"],
 source: "register: aListKeyedEntity name: aString\x0a\x09registry at: aString put: aListKeyedEntity",
@@ -403,19 +430,23 @@ referencedClasses: []
 smalltalk.Trapped);
 
 smalltalk.addMethod(
-"_start_",
 smalltalk.method({
 selector: "start:",
 category: 'action',
 fn: function (args){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(args)._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._register_(each);
+return smalltalk.withContext(function($ctx2) {
+return self._register_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
-_st(_st("[data-trap]")._asJQuery())._each_((function(index,elem){
+_st("[data-trap]"._asJQuery())._each_((function(index,elem){
 var trap,jq,viewName,modelName,tokens,path;
-return smalltalk.withContext(function($ctx2) {
jq=_st(elem)._asJQuery();
+return smalltalk.withContext(function($ctx2) {
+jq=_st(elem)._asJQuery();
 jq;
 trap=_st(jq)._attr_("data-trap");
 trap;
@@ -429,16 +460,18 @@ tokens;
 viewName=_st(tokens)._first();
 viewName;
 tokens=_st(_st(_st(tokens)._second())._tokenize_(" "))._select_((function(each){
-return smalltalk.withContext(function($ctx3) {
return _st(each)._notEmpty();
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
+return smalltalk.withContext(function($ctx3) {
+return _st(each)._notEmpty();
+}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
 tokens;
 modelName=_st(tokens)._first();
 modelName;
-path=_st((smalltalk.Trapped || Trapped))._parse_(_st(tokens)._allButFirst());
+path=_st($Trapped())._parse_(_st(tokens)._allButFirst());
 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)})}));
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(_st(_st($Smalltalk())._current())._at_(viewName))._new())._appendToJQuery_(jq);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, 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"],
@@ -450,56 +483,58 @@ smalltalk.Trapped);
 
 
 smalltalk.addMethod(
-"_envelope_loop_before_tag_do_",
 smalltalk.method({
 selector: "envelope:loop:before:tag:do:",
 category: 'private',
 fn: function (envelope,model,endjq,aSymbol,aBlock){
 var self=this;
 var envjq;
-return smalltalk.withContext(function($ctx1) { 
envjq=_st(envelope)._asJQuery();
+return smalltalk.withContext(function($ctx1) { 
+envjq=_st(envelope)._asJQuery();
 _st(model)._withIndexDo_((function(item,i){
-return smalltalk.withContext(function($ctx2) {
_st(envelope)._with_((function(html){
-return smalltalk.withContext(function($ctx3) {
return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
-}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx1)})}));
+return smalltalk.withContext(function($ctx2) {
+_st(envelope)._with_((function(html){
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(html)._perform_(aSymbol))._trap_read_([i],aBlock);
+}, function($ctx3) {$ctx3.fillBlock({html:html},$ctx2)})}));
 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)})},
 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",
+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",
 messageSends: ["asJQuery", "withIndexDo:", "with:", "trap:read:", "perform:", "insertBefore:", "detach", "children", "remove"],
 referencedClasses: []
 }),
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
-"_loop_between_and_tag_do_",
 smalltalk.method({
 selector: "loop:between:and:tag:do:",
 category: 'private',
 fn: function (model,start,end,aSymbol,aBlock){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(_st(start)._asJQuery())._nextUntil_(_st(end)._element()))._remove();
 _st(start)._with_((function(html){
-return smalltalk.withContext(function($ctx2) {
$1=model;
+return smalltalk.withContext(function($ctx2) {
+$1=model;
 if(($receiver = $1) == nil || $receiver == undefined){
 return $1;
 } else {
-return _st(self)._envelope_loop_before_tag_do_(_st(html)._div(),model,_st(end)._asJQuery(),aSymbol,aBlock);
+return 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)})},
 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",
+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]]",
 messageSends: ["remove", "nextUntil:", "element", "asJQuery", "with:", "ifNotNil:", "envelope:loop:before:tag:do:", "div"],
 referencedClasses: []
 }),
 smalltalk.Trapped.klass);
 
 smalltalk.addMethod(
-"_parse_",
 smalltalk.method({
 selector: "parse:",
 category: 'accessing',
@@ -536,13 +571,13 @@ smalltalk.Trapped.klass);
 
 smalltalk.addClass('TrappedPathStack', smalltalk.TrappedSingleton, ['elements'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_append_do_",
 smalltalk.method({
 selector: "append:do:",
 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 smalltalk.withContext(function($ctx1) { 
+self._with_do_(_st(self["@elements"]).__comma(anArray),aBlock);
 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",
@@ -552,13 +587,13 @@ referencedClasses: []
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_elements",
 smalltalk.method({
 selector: "elements",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@elements"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"elements",{},smalltalk.TrappedPathStack)})},
@@ -570,13 +605,13 @@ referencedClasses: []
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_initialize",
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
smalltalk.TrappedSingleton.fn.prototype._initialize.apply(_st(self), []);
+return smalltalk.withContext(function($ctx1) { 
+smalltalk.TrappedPathStack.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@elements"]=[];
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TrappedPathStack)})},
 args: [],
@@ -587,20 +622,22 @@ referencedClasses: []
 smalltalk.TrappedPathStack);
 
 smalltalk.addMethod(
-"_with_do_",
 smalltalk.method({
 selector: "with:do:",
 category: 'descending',
 fn: function (anArray,aBlock){
 var self=this;
 var old;
-return smalltalk.withContext(function($ctx1) { 
old=self["@elements"];
+return smalltalk.withContext(function($ctx1) { 
+old=self["@elements"];
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
self["@elements"]=anArray;
+return smalltalk.withContext(function($ctx2) {
+self["@elements"]=anArray;
 self["@elements"];
 return _st(aBlock)._value();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._ensure_((function(){
-return smalltalk.withContext(function($ctx2) {
self["@elements"]=old;
+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)})},
@@ -615,14 +652,16 @@ smalltalk.TrappedPathStack);
 
 smalltalk.addClass('TrappedSnapshot', smalltalk.Object, ['path', 'model'], 'Trapped-Frontend');
 smalltalk.addMethod(
-"_do_",
 smalltalk.method({
 selector: "do:",
 category: 'action',
 fn: function (aBlock){
 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 $TrappedPathStack(){return smalltalk.TrappedPathStack||(typeof TrappedPathStack=="undefined"?nil:TrappedPathStack)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($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)})},
 args: ["aBlock"],
@@ -633,13 +672,13 @@ referencedClasses: ["TrappedPathStack"]
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_model",
 smalltalk.method({
 selector: "model",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@model"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.TrappedSnapshot)})},
@@ -651,13 +690,13 @@ referencedClasses: []
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_modify_",
 smalltalk.method({
 selector: "modify:",
 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 smalltalk.withContext(function($ctx1) { 
+_st(self._model())._modify_do_(_st(self._path())._allButFirst(),aBlock);
 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",
@@ -667,13 +706,13 @@ referencedClasses: []
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_path",
 smalltalk.method({
 selector: "path",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@path"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"path",{},smalltalk.TrappedSnapshot)})},
@@ -685,13 +724,13 @@ referencedClasses: []
 smalltalk.TrappedSnapshot);
 
 smalltalk.addMethod(
-"_path_model_",
 smalltalk.method({
 selector: "path:model:",
 category: 'accessing',
 fn: function (anArray,aTrappedMW){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@path"]=anArray;
+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)})},
 args: ["anArray", "aTrappedMW"],
@@ -702,16 +741,16 @@ referencedClasses: []
 smalltalk.TrappedSnapshot);
 
 
-
 smalltalk.addMethod(
-"_trapDescend_",
 smalltalk.method({
 selector: "trapDescend:",
 category: '*Trapped-Frontend',
 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)})},
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st($Trapped())._current())._descend_snapshotDo_(self,aBlock);
+return self}, function($ctx1) {$ctx1.fill(self,"trapDescend:",{aBlock:aBlock},smalltalk.Array)})},
 args: ["aBlock"],
 source: "trapDescend: aBlock\x0a\x09Trapped current descend: self snapshotDo: aBlock",
 messageSends: ["descend:snapshotDo:", "current"],
@@ -720,23 +759,26 @@ referencedClasses: ["Trapped"]
 smalltalk.Array);
 
 smalltalk.addMethod(
-"_trapIter_tag_do_",
 smalltalk.method({
 selector: "trapIter:tag:do:",
 category: '*Trapped-Frontend',
 fn: function (path,aSymbol,aBlock){
 var self=this;
 var start,end;
-return smalltalk.withContext(function($ctx1) { 
_st(self)._with_((function(html){
-return smalltalk.withContext(function($ctx2) {
start=_st(html)._script();
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+self._with_((function(html){
+return smalltalk.withContext(function($ctx2) {
+start=_st(html)._script();
 start;
 end=_st(html)._script();
 return end;
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
 _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);
+return smalltalk.withContext(function($ctx2) {
+return _st($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)})},
 args: ["path", "aSymbol", "aBlock"],
 source: "trapIter: path tag: aSymbol do: aBlock\x0a\x09| start end |\x0a    self with: [ :html | start := html script. end := html script ].\x0a    start trap: path read: [ :model |\x0a    \x09Trapped loop: model between: start and: end tag: aSymbol do: aBlock.\x0a    ]",
 messageSends: ["with:", "script", "trap:read:", "loop:between:and:tag:do:"],
@@ -745,14 +787,15 @@ referencedClasses: ["Trapped"]
 smalltalk.HTMLCanvas);
 
 smalltalk.addMethod(
-"_trap_",
 smalltalk.method({
 selector: "trap:",
 category: '*Trapped-Frontend',
 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)})},
+function $Trapped(){return smalltalk.Trapped||(typeof Trapped=="undefined"?nil:Trapped)}
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(_st($Trapped())._current())._binder_(self))._installFor_(path);
+return self}, function($ctx1) {$ctx1.fill(self,"trap:",{path:path},smalltalk.TagBrush)})},
 args: ["path"],
 source: "trap: path\x0a\x09(Trapped current binder: self) installFor: path",
 messageSends: ["installFor:", "binder:", "current"],
@@ -761,32 +804,32 @@ referencedClasses: ["Trapped"]
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
-"_trap_read_",
 smalltalk.method({
 selector: "trap:read:",
 category: '*Trapped-Frontend',
 fn: function (path,aBlock){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$3,$4,$6,$5,$2;
-$1=path;
-$2=(function(snap){
-return smalltalk.withContext(function($ctx2) {
$3=_st(snap)._model();
-$4=_st(_st(snap)._path())._allButFirst();
-$5=(function(data){
-return smalltalk.withContext(function($ctx3) {
$6=_st(_st(_st(_st(self)._asJQuery())._closest_("html"))._toArray())._isEmpty();
-if(smalltalk.assert($6)){
-_st((smalltalk.KeyedPubSubUnsubscribe || KeyedPubSubUnsubscribe))._signal();
+function $KeyedPubSubUnsubscribe(){return smalltalk.KeyedPubSubUnsubscribe||(typeof KeyedPubSubUnsubscribe=="undefined"?nil:KeyedPubSubUnsubscribe)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+_st(path)._trapDescend_((function(snap){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(snap)._model())._watch_do_(_st(_st(snap)._path())._allButFirst(),(function(data){
+return smalltalk.withContext(function($ctx3) {
+$1=_st(_st(_st(self._asJQuery())._closest_("html"))._toArray())._isEmpty();
+if(smalltalk.assert($1)){
+_st($KeyedPubSubUnsubscribe())._signal();
 };
 return _st(snap)._do_((function(){
-return smalltalk.withContext(function($ctx4) {
return _st(self)._with_((function(html){
-return smalltalk.withContext(function($ctx5) {
return _st(aBlock)._value_value_(data,html);
-}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx1)})}));
-}, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
-}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx1)})});
-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 smalltalk.withContext(function($ctx4) {
+return self._with_((function(html){
+return smalltalk.withContext(function($ctx5) {
+return _st(aBlock)._value_value_(data,html);
+}, function($ctx5) {$ctx5.fillBlock({html:html},$ctx4)})}));
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
+}, function($ctx3) {$ctx3.fillBlock({data:data},$ctx2)})}));
+}, function($ctx2) {$ctx2.fillBlock({snap:snap},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"trap:read:",{path:path,aBlock:aBlock},smalltalk.TagBrush)})},
 args: ["path", "aBlock"],
 source: "trap: path read: aBlock\x0a\x09path trapDescend: [ :snap |\x0a        snap model watch: snap path allButFirst do: [ :data |\x0a            (self asJQuery closest: 'html') toArray isEmpty ifTrue: [ KeyedPubSubUnsubscribe signal ].\x0a        \x09snap do: [ self with: [ :html | aBlock value: data value: html ] ]\x0a    \x09]\x0a    ]",
 messageSends: ["trapDescend:", "watch:do:", "allButFirst", "path", "ifTrue:", "signal", "isEmpty", "toArray", "closest:", "asJQuery", "do:", "with:", "value:value:", "model"],
@@ -795,16 +838,17 @@ referencedClasses: ["KeyedPubSubUnsubscribe"]
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
-"_trap_toggle_",
 smalltalk.method({
 selector: "trap:toggle:",
 category: '*Trapped-Frontend',
 fn: function (path,aBlock){
 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();
+return smalltalk.withContext(function($ctx1) { 
+self._trap_toggle_ifNotPresent_(path,aBlock,(function(){
+return smalltalk.withContext(function($ctx2) {
+return _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)})},
 args: ["path", "aBlock"],
 source: "trap: path toggle: aBlock\x0a    self trap: path toggle: aBlock ifNotPresent: [ self asJQuery hide ]",
 messageSends: ["trap:toggle:ifNotPresent:", "hide", "asJQuery"],
@@ -813,38 +857,35 @@ referencedClasses: []
 smalltalk.TagBrush);
 
 smalltalk.addMethod(
-"_trap_toggle_ifNotPresent_",
 smalltalk.method({
 selector: "trap:toggle:ifNotPresent:",
 category: '*Trapped-Frontend',
 fn: function (path,aBlock,anotherBlock){
 var self=this;
 var shown;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$4,$6,$7,$9,$8,$5,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$5,$4;
 shown=nil;
-$1=self;
-$2=path;
-$3=(function(data,html){
-return smalltalk.withContext(function($ctx2) {
$4=_st(shown).__eq(_st(data)._notNil());
-$5=(function(){
-return smalltalk.withContext(function($ctx3) {
shown=_st(data)._notNil();
+self._trap_read_(path,(function(data,html){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(shown).__eq(_st(data)._notNil());
+if(! smalltalk.assert($1)){
+shown=_st(data)._notNil();
 shown;
-$6=_st(self)._asJQuery();
-_st($6)._empty();
-$7=_st($6)._show();
-$7;
-$9=shown;
-if(smalltalk.assert($9)){
-$8=aBlock;
+$2=self._asJQuery();
+_st($2)._empty();
+$3=_st($2)._show();
+$3;
+$5=shown;
+if(smalltalk.assert($5)){
+$4=aBlock;
 } else {
-$8=anotherBlock;
+$4=anotherBlock;
+};
+return _st($4)._value_value_(data,html);
 };
-return _st($8)._value_value_(data,html);
-}, function($ctx3) {$ctx3.fillBlock({},$ctx1)})});
-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)})},
+}, function($ctx2) {$ctx2.fillBlock({data:data,html:html},$ctx1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"trap:toggle:ifNotPresent:",{path:path,aBlock:aBlock,anotherBlock:anotherBlock,shown:shown},smalltalk.TagBrush)})},
 args: ["path", "aBlock", "anotherBlock"],
 source: "trap: path toggle: aBlock ifNotPresent: anotherBlock\x0a    | shown |\x0a    shown := nil.\x0a    self trap: path read: [ :data : html |\x0a        shown = data notNil ifFalse: [\x0a            shown := data notNil.\x0a            self asJQuery empty; show.\x0a            (shown ifTrue: [aBlock] ifFalse: [anotherBlock]) value: data value: html.\x0a        ]\x0a    ]",
 messageSends: ["trap:read:", "ifFalse:", "notNil", "empty", "asJQuery", "show", "value:value:", "ifTrue:ifFalse:", "="],
@@ -852,3 +893,4 @@ referencedClasses: []
 }),
 smalltalk.TagBrush);
 
+});

+ 133 - 86
lib/js/Trapped-Tests.deploy.js

@@ -1,18 +1,24 @@
+define("gh_herby_trapped/Trapped-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/SUnit"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Tests');
+smalltalk.packages["Trapped-Tests"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
 smalltalk.addMethod(
-"_setUp",
 smalltalk.method({
 selector: "setUp",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
-$1=_st((smalltalk.EavModel || EavModel))._new();
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(x)._root();
+return smalltalk.withContext(function($ctx2) {
+return _st(x)._root();
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(x)._root_(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)})},
@@ -20,282 +26,323 @@ messageSends: ["getBlock:", "root", "new", "putBlock:", "root:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testNontrivialModelGetsAppropriateValueForModification",
 smalltalk.method({
 selector: "testNontrivialModelGetsAppropriateValueForModification",
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (5)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-$1=_st((smalltalk.EavModel || EavModel))._new();
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (5)]], "baz"]),"moo".__minus_gt("zoo")]));
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 model=$2;
 _st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (5)]],result);
+self._assert_equals_([(1), [(2), (5)]],result);
 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(
-"_testNontrivialModelModifiesAppropriateValue",
 smalltalk.method({
 selector: "testNontrivialModelModifiesAppropriateValue",
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-$1=_st((smalltalk.EavModel || EavModel))._new();
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),"moo".__minus_gt("zoo")]));
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 model=$2;
 _st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
return smalltalk.symbolFor("new");
+return smalltalk.withContext(function($ctx2) {
+return "new";
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_(smalltalk.symbolFor("new"),result);
+self._assert_equals_("new",result);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", "new", "baz"]),"moo".__minus_gt("zoo")]),result);
 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(
-"_testNontrivialModelReturnsAppropriateValue",
 smalltalk.method({
 selector: "testNontrivialModelReturnsAppropriateValue",
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-model=_st(_st((smalltalk.EavModel || EavModel))._new())._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),"moo".__minus_gt("zoo")]));
+model=_st(_st($EavModel())._new())._getBlock_((function(x){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 _st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 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(
-"_testRootModelExaminesThenModifiesRoot",
 smalltalk.method({
 selector: "testRootModelExaminesThenModifiesRoot",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(r)._second();
+return smalltalk.withContext(function($ctx2) {
+return _st(r)._second();
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(2), (3)],result);
+self._assert_equals_([(2), (3)],result);
 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(
-"_testRootModelGetsRootForModification",
 smalltalk.method({
 selector: "testRootModelGetsRootForModification",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(2), [(1), (0)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(2), [(1), (0)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(2), [(1), (0)]],result);
+self._assert_equals_([(2), [(1), (0)]],result);
 return self}, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 messageSends: ["on:", "model:modify:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
 newValue=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
newValue=r;
+return smalltalk.withContext(function($ctx2) {
+newValue=r;
 newValue;
 _st(r)._at_put_((1),(4));
 return r;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"baz");
-_st(self)._assert_equals_([(4), [(2), (3)]],result);
+self._assert_equals_([(4), [(2), (3)]],result);
 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(
-"_testRootModelModifiesAndDeeplyIsolatesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
-newValue=smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
+newValue=smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return newValue;
+return smalltalk.withContext(function($ctx2) {
+return newValue;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(_st(newValue)._at_("foo"))._at_put_((1),"bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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(
-"_testRootModelModifiesAndIsolatesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndIsolatesRoot",
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
-newValue=smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
+newValue=smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return newValue;
+return smalltalk.withContext(function($ctx2) {
+return newValue;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_("foo","bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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(
-"_testRootModelModifiesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesRoot",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+return smalltalk.withContext(function($ctx2) {
+return smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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(
-"_testRootModelReturnsDeeplyIsolatedRoot",
 smalltalk.method({
 selector: "testRootModelReturnsDeeplyIsolatedRoot",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(r)._at_((2)))._at_put_((1),(0));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(r)._at_((2)))._at_put_((1),(0));
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 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(
-"_testRootModelReturnsIsolatedRoot",
 smalltalk.method({
 selector: "testRootModelReturnsIsolatedRoot",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (4)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (4)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(r)._at_put_((2),nil);
+return smalltalk.withContext(function($ctx2) {
+return _st(r)._at_put_((2),nil);
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (4)]],result);
+self._assert_equals_([(1), [(2), (4)]],result);
 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(
-"_testRootModelReturnsRoot",
 smalltalk.method({
 selector: "testRootModelReturnsRoot",
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 return self}, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},smalltalk.IsolatorTest)})},
 messageSends: ["on:", "model:read:", "assert:equals:"]}),
 smalltalk.IsolatorTest);
 
 
-
+});

+ 146 - 99
lib/js/Trapped-Tests.js

@@ -1,366 +1,413 @@
+define("gh_herby_trapped/Trapped-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber/SUnit"], function(smalltalk,nil,_st){
 smalltalk.addPackage('Trapped-Tests');
+smalltalk.packages["Trapped-Tests"].transport = {"type":"amd","amdNamespace":"gh_herby_trapped"};
+
 smalltalk.addClass('IsolatorTest', smalltalk.TestCase, ['rootModel'], 'Trapped-Tests');
 smalltalk.addMethod(
-"_setUp",
 smalltalk.method({
 selector: "setUp",
 category: 'running',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
-$1=_st((smalltalk.EavModel || EavModel))._new();
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(x)._root();
+return smalltalk.withContext(function($ctx2) {
+return _st(x)._root();
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(x)._root_(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)})},
 args: [],
-source: "setUp\x0a\x0arootModel := EavModel new\x0a\x09getBlock: [:x | x root];\x0a    putBlock: [:x :y | x root: y].\x0a",
+source: "setUp\x0a\x0arootModel := EavModel new\x0a\x09getBlock: [:x | x root];\x0a    putBlock: [:x :y | x root: y].",
 messageSends: ["getBlock:", "root", "new", "putBlock:", "root:"],
 referencedClasses: ["EavModel"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testNontrivialModelGetsAppropriateValueForModification",
 smalltalk.method({
 selector: "testNontrivialModelGetsAppropriateValueForModification",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (5)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-$1=_st((smalltalk.EavModel || EavModel))._new();
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (5)]], "baz"]),"moo".__minus_gt("zoo")]));
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 model=$2;
 _st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (5)]],result);
+self._assert_equals_([(1), [(2), (5)]],result);
 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",
+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",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testNontrivialModelModifiesAppropriateValue",
 smalltalk.method({
 selector: "testNontrivialModelModifiesAppropriateValue",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-$1=_st((smalltalk.EavModel || EavModel))._new();
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),"moo".__minus_gt("zoo")]));
+$1=_st($EavModel())._new();
 _st($1)._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 $2=_st($1)._putBlock_((function(x,y){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1)})}));
 model=$2;
 _st(isolator)._model_modify_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
return smalltalk.symbolFor("new");
+return smalltalk.withContext(function($ctx2) {
+return "new";
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_(smalltalk.symbolFor("new"),result);
+self._assert_equals_("new",result);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", "new", "baz"]),"moo".__minus_gt("zoo")]),result);
 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",
+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",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "putBlock:", "at:put:", "model:modify:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testNontrivialModelReturnsAppropriateValue",
 smalltalk.method({
 selector: "testNontrivialModelReturnsAppropriateValue",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,model,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_(smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),_st("moo").__minus_gt("zoo")]));
-model=_st(_st((smalltalk.EavModel || EavModel))._new())._getBlock_((function(x){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+function $EavModel(){return smalltalk.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_(smalltalk.HashedCollection._from_(["foo".__minus_gt(["bar", [(1), [(2), (3)]], "baz"]),"moo".__minus_gt("zoo")]));
+model=_st(_st($EavModel())._new())._getBlock_((function(x){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st(x)._root())._at_("foo"))._at_((2));
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1)})}));
 _st(isolator)._model_read_(model,(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 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",
+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",
 messageSends: ["on:", "->", "getBlock:", "at:", "root", "new", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator", "EavModel"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelExaminesThenModifiesRoot",
 smalltalk.method({
 selector: "testRootModelExaminesThenModifiesRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(r)._second();
+return smalltalk.withContext(function($ctx2) {
+return _st(r)._second();
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(2), (3)],result);
+self._assert_equals_([(2), (3)],result);
 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",
+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",
 messageSends: ["on:", "model:modify:", "second", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelGetsRootForModification",
 smalltalk.method({
 selector: "testRootModelGetsRootForModification",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(2), [(1), (0)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(2), [(1), (0)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(2), [(1), (0)]],result);
+self._assert_equals_([(2), [(1), (0)]],result);
 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",
+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",
 messageSends: ["on:", "model:modify:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
 newValue=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
newValue=r;
+return smalltalk.withContext(function($ctx2) {
+newValue=r;
 newValue;
 _st(r)._at_put_((1),(4));
 return r;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_((2),"baz");
-_st(self)._assert_equals_([(4), [(2), (3)]],result);
+self._assert_equals_([(4), [(2), (3)]],result);
 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",
+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",
 messageSends: ["on:", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelModifiesAndDeeplyIsolatesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
-newValue=smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
+newValue=smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return newValue;
+return smalltalk.withContext(function($ctx2) {
+return newValue;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(_st(newValue)._at_("foo"))._at_put_((1),"bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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",
+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",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "at:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelModifiesAndIsolatesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesAndIsolatesRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result,newValue;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
-newValue=smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
+newValue=smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return newValue;
+return smalltalk.withContext(function($ctx2) {
+return newValue;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(newValue)._at_put_("foo","bar");
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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",
+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",
 messageSends: ["on:", "->", "model:modify:", "at:put:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelModifiesRoot",
 smalltalk.method({
 selector: "testRootModelModifiesRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_modify_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt([(4), (5), (6)])]);
+return smalltalk.withContext(function($ctx2) {
+return smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]);
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+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);
+self._assert_equals_(smalltalk.HashedCollection._from_(["foo".__minus_gt([(4), (5), (6)])]),result);
 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",
+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",
 messageSends: ["on:", "model:modify:", "->", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelReturnsDeeplyIsolatedRoot",
 smalltalk.method({
 selector: "testRootModelReturnsDeeplyIsolatedRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(r)._at_((2)))._at_put_((1),(0));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(r)._at_((2)))._at_put_((1),(0));
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 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",
+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",
 messageSends: ["on:", "model:read:", "at:put:", "at:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelReturnsIsolatedRoot",
 smalltalk.method({
 selector: "testRootModelReturnsIsolatedRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (4)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (4)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
return _st(r)._at_put_((2),nil);
+return smalltalk.withContext(function($ctx2) {
+return _st(r)._at_put_((2),nil);
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (4)]],result);
+self._assert_equals_([(1), [(2), (4)]],result);
 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",
+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",
 messageSends: ["on:", "model:read:", "at:put:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 smalltalk.addMethod(
-"_testRootModelReturnsRoot",
 smalltalk.method({
 selector: "testRootModelReturnsRoot",
 category: 'tests',
 fn: function (){
 var self=this;
 var isolator,result;
-return smalltalk.withContext(function($ctx1) { 
result=nil;
-isolator=_st((smalltalk.Isolator || Isolator))._on_([(1), [(2), (3)]]);
+function $Isolator(){return smalltalk.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+return smalltalk.withContext(function($ctx1) { 
+result=nil;
+isolator=_st($Isolator())._on_([(1), [(2), (3)]]);
 _st(isolator)._model_read_(self["@rootModel"],(function(r){
-return smalltalk.withContext(function($ctx2) {
result=r;
+return smalltalk.withContext(function($ctx2) {
+result=r;
 return result;
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1)})}));
-_st(self)._assert_equals_([(1), [(2), (3)]],result);
+self._assert_equals_([(1), [(2), (3)]],result);
 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",
+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",
 messageSends: ["on:", "model:read:", "assert:equals:"],
 referencedClasses: ["Isolator"]
 }),
 smalltalk.IsolatorTest);
 
 
-
+});