Browse Source

Move to amber 0.19.1.

Herbert Vojčík 6 years ago
parent
commit
d4d702cef5

+ 32 - 24
Gruntfile.js

@@ -1,21 +1,29 @@
 'use strict';
 
 module.exports = function (grunt) {
-    var path = require('path'),
-        helpers = require('amber-dev').helpers;
-
     // These plugins provide necessary tasks.
     grunt.loadNpmTasks('grunt-contrib-clean');
     grunt.loadNpmTasks('grunt-contrib-requirejs');
-    grunt.loadNpmTasks('grunt-execute');
+    grunt.loadNpmTasks('grunt-exec');
     grunt.loadNpmTasks('amber-dev');
 
+    var path = require('path'),
+        helpers = require('amber-dev').helpers;
+
     // Default task.
-    grunt.registerTask('default', ['amdconfig:app', 'amberc:axon', 'amberc:all', 'amberc:counter', 'amberc:todo']);
-    grunt.registerTask('test', ['amdconfig:app', 'requirejs:test_runner', 'execute:test_runner', 'clean:test_runner']);
+    grunt.registerTask('default', ['amdconfig:app', 'amberc:axon', 'amberc:all']);
+    grunt.registerTask('test', ['amdconfig:app', 'requirejs:test_runner', 'exec:test_runner', 'clean:test_runner']);
     grunt.registerTask('devel', ['amdconfig:app', 'requirejs:devel']);
     grunt.registerTask('deploy', ['amdconfig:app', 'requirejs:deploy']);
 
+    var polyfillThenPromiseApp = function () {
+        define(["require", "amber/es2015-polyfills"], function (require) {
+            return new Promise(function (resolve, reject) {
+                require(["__app__"], resolve, reject);
+            });
+        });
+    };
+
     // Project configuration.
     grunt.initConfig({
         // Metadata.
@@ -73,15 +81,15 @@ module.exports = function (grunt) {
                 options: {
                     mainConfigFile: "config.js",
                     rawText: {
-                        "amber/compatibility": '/*stub*/',
-                        "amber/Platform": '/*stub*/',
-                        "app": 'define(["deploy"],function(x){return x});define("amber/Platform",["amber_core/Platform-Browser"],{});'
+                        "app": '(' + polyfillThenPromiseApp + '());',
+                        "__app__": 'define(["deploy", "amber_core/Platform-Browser"],function(x){return x});'
                     },
                     pragmas: {
                         excludeIdeData: true,
                         excludeDebugContexts: true
                     },
-                    include: ['config', 'config-browser', 'node_modules/requirejs/require', 'app'],
+                    include: ['config', 'node_modules/requirejs/require', 'app', 'amber/lazypack', '__app__'],
+                    optimize: "uglify2",
                     out: "the.js"
                 }
             },
@@ -89,11 +97,10 @@ module.exports = function (grunt) {
                 options: {
                     mainConfigFile: "config.js",
                     rawText: {
-                        "amber/compatibility": '/*stub*/',
-                        "amber/Platform": '/*stub*/',
-                        "app": 'define(["devel"],function(x){return x});define("amber/Platform",["amber_core/Platform-Browser"],{});'
+                        "app": '(' + polyfillThenPromiseApp + '());',
+                        "__app__": 'define(["devel", "amber_core/Platform-Browser"],function(x){return x});'
                     },
-                    include: ['config', 'config-browser', 'node_modules/requirejs/require', 'app'],
+                    include: ['config', 'node_modules/requirejs/require', 'app', '__app__'],
                     exclude: ['devel'],
                     out: "the.js"
                 }
@@ -102,18 +109,21 @@ module.exports = function (grunt) {
                 options: {
                     mainConfigFile: "config.js",
                     rawText: {
-                        "app": "(" + function () {
-                            define(["testing", "amber_devkit/NodeTestRunner"], function (amber) {
-                                amber.initialize();
-                                amber.globals.NodeTestRunner._main();
+                        "jquery": "/* do not load in node test runner */",
+                        "__app__": "(" + function () {
+                            define(["testing", "amber_core/Platform-Node", "amber_devkit/NodeTestRunner"], function (amber) {
+                                amber.initialize().then(function () {
+                                    amber.globals.NodeTestRunner._main();
+                                });
                             });
-                        } + "());"
+                        } + "());",
+                        "app": "(" + polyfillThenPromiseApp + "());"
                     },
                     paths: {"amber_devkit": helpers.libPath},
                     pragmas: {
                         excludeIdeData: true
                     },
-                    include: ['config-node', 'app'],
+                    include: ['app', 'amber/lazypack', '__app__'],
                     insertRequire: ['app'],
                     optimize: "none",
                     wrap: helpers.nodeWrapperWithShebang,
@@ -122,10 +132,8 @@ module.exports = function (grunt) {
             }
         },
 
-        execute: {
-            test_runner: {
-                src: ['test_runner.js']
-            }
+        exec: {
+            test_runner: 'node test_runner.js'
         },
 
         clean: {

+ 23 - 16
bower.json

@@ -1,18 +1,6 @@
 {
   "name": "trapped",
-  "homepage": "https://lolg.it/herby/trapped",
-  "authors": [
-    "Herbert Vojčík <herby@mailbox.sk>"
-  ],
   "description": "Bidirectional DOM data-binding for Amber Smalltalk",
-  "keywords": [
-    "amber",
-    "data",
-    "binding",
-    "web",
-    "dom"
-  ],
-  "license": "MIT",
   "ignore": [
     "**/.*",
     "node_modules",
@@ -22,14 +10,33 @@
     "test",
     "tests"
   ],
+  "authors": [
+    {
+      "name": "Herbert Vojčík",
+      "email": "herby@mailbox.sk"
+    }
+  ],
+  "homepage": "https://lolg.it/herby/trapped",
+  "keywords": [
+    "amber",
+    "data",
+    "binding",
+    "web",
+    "dom"
+  ],
+  "license": [
+    "MIT"
+  ],
+  "private": false,
   "dependencies": {
-    "amber": ">=0.15.0",
+    "amber": "^0.19.1",
+    "amber-compat-es2015": "^0.1.5",
     "lyst": "^0.1.2",
     "xontent": "^0.1.0"
   },
   "devDependencies": {
+    "amber-contrib-legacy": "^0.5.0",
     "amber-ide-starter-dialog": "^0.1.0",
-    "amber-contrib-legacy": ">=0.3.0",
-    "helios": ">=0.6.0"
+    "helios": "^0.8.0"
   }
-}
+}

+ 11 - 10
example-counter/counter.html

@@ -6,30 +6,31 @@
         [data-trap] {
             display: none
         }
+
         button {
             font-family: monospace;
         }
     </style>
-    <meta name="author" content="Herbert Vojčík" />
+    <meta name="author" content="Herbert Vojčík"/>
     <script type='text/javascript' src='../the.js'></script>
     <script type="text/javascript">
         var blackboard;
         require.config({baseUrl: '..'});
-        require(
-                ["app", "trapped-counter/Trapped-Counter" ],
-                function (amber) {
-                    amber.initialize({
-                        //used for all new packages in IDE
-                        'transport.defaultAmdNamespace': "trapped-counter"
-                    });
+        require(["app", "trapped-counter/Trapped-Counter"], function (amberPromise) {
+            amberPromise.then(function (amber) {
+                amber.initialize({
+                    //used for all new packages in IDE
+                    'transport.defaultAmdNamespace': "trapped-counter"
+                }).then(function () {
                     require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
 
                     $(function () {
                         blackboard = amber.globals.App._new();
                         amber.globals.Trapped._start_([blackboard]);
                     });
-                }
-        );
+                });
+            });
+        });
     </script>
 </head>
 <body>

+ 32 - 33
example-counter/src/Trapped-Counter.js

@@ -1,39 +1,40 @@
-define("trapped-counter/Trapped-Counter", ["amber/boot", "trapped/Trapped-Backend", "amber_core/Kernel-Objects"], function($boot){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Trapped-Counter');
+define(["amber/boot", "amber_core/Kernel-Objects", "trapped/Trapped-Backend"], function($boot){"use strict";
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
+$core.addPackage("Trapped-Counter");
 $core.packages["Trapped-Counter"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Trapped-Counter"].transport = {"type":"amd","amdNamespace":"trapped-counter"};
 
-$core.addClass('App', $globals.IsolatingTrapper, [], 'Trapped-Counter');
+$core.addClass("App", $globals.IsolatingTrapper, [], "Trapped-Counter");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.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}";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
-function $SimpleAxon(){return $globals.SimpleAxon||(typeof SimpleAxon=="undefined"?nil:SimpleAxon)}
-function $AppModel(){return $globals.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.App.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.App.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-$1=$recv($SimpleAxon())._new();
+$1=$recv($globals.SimpleAxon)._new();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["new"]=1;
 //>>excludeEnd("ctx");
-self._axon_($1);
-self._model_($recv($AppModel())._new());
+$self._axon_($1);
+$self._model_($recv($globals.AppModel)._new());
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.App)});
@@ -50,17 +51,17 @@ $globals.App);
 
 
 
-$core.addClass('AppModel', $globals.Object, ['value'], 'Trapped-Counter');
+$core.addClass("AppModel", $globals.Object, ["value"], "Trapped-Counter");
 $core.addMethod(
 $core.method({
 selector: "decrement",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self["@value"]=$recv(self["@value"]).__minus((1));
+$self["@value"]=$recv($self["@value"]).__minus((1));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.AppModel)});
@@ -78,13 +79,13 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "increment",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self["@value"]=$recv(self["@value"]).__plus((1));
+$self["@value"]=$recv($self["@value"]).__plus((1));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.AppModel)});
@@ -102,21 +103,21 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.AppModel.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.AppModel.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@value"]=(0);
+$self["@value"]=(0);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AppModel)});
@@ -134,12 +135,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "value",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@value"];
-return $1;
+var self=this,$self=this;
+return $self["@value"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -154,10 +153,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "value:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aNumber){
-var self=this;
-self["@value"]=aNumber;
+var self=this,$self=this;
+$self["@value"]=aNumber;
 return self;
 
 },

+ 64 - 189
example-todo/src/Trapped-Todo.js

@@ -1,53 +1,59 @@
-define("trapped-todo/Trapped-Todo", ["amber/boot", "trapped/Trapped-Backend", "amber_core/Kernel-Objects", "trapped/Trapped-Frontend"], function($boot){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Trapped-Todo');
+define(["amber/boot", "amber_core/Kernel-Objects", "trapped/Trapped-Backend", "trapped/Trapped-Frontend"], function($boot){"use strict";
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
+$core.addPackage("Trapped-Todo");
 $core.packages["Trapped-Todo"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Trapped-Todo"].transport = {"type":"amd","amdNamespace":"trapped-todo"};
 
-$core.addClass('App', $globals.IsolatingTrapper, [], 'Trapped-Todo');
+$core.addClass("App", $globals.IsolatingTrapper, [], "Trapped-Todo");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.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}";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
-function $SimpleAxon(){return $globals.SimpleAxon||(typeof SimpleAxon=="undefined"?nil:SimpleAxon)}
-function $AppModel(){return $globals.AppModel||(typeof AppModel=="undefined"?nil:AppModel)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
+var $1,$3,$2;
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.App.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.App.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-$1=$recv($SimpleAxon())._new();
+$1=$recv($globals.SimpleAxon)._new();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["new"]=1;
 //>>excludeEnd("ctx");
-self._axon_($1);
-self._model_($recv($recv($AppModel())._new())._title_("Todo"));
-self._watch_do_([["todos"], nil],(function(){
+$self._axon_($1);
+$3=$recv($globals.AppModel)._new();
+//>>excludeStart("ctx", pragmas.excludeDebugContexts);
+$ctx1.sendIdx["new"]=2;
+//>>excludeEnd("ctx");
+$2=$recv($3)._title_("Todo");
+$self._model_($2);
+$recv($self._axon())._addInterest_($recv($recv($globals.InterestedInTrapPathSubtree)._new())._aspect_block_([["todos"]],(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._changed_([["remaining"]]);
+return $self._changed_([["remaining"]]);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
-}));
+})));
 $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._modify_do_([["todos"]],(function(){
+return $self._modify_do_([["todos"]],(function(){
 return [$globals.HashedCollection._newFromPairs_(["text","learn trapped","done",true]),$globals.HashedCollection._newFromPairs_(["text","build a trapped app","done",false])];
 
 }));
@@ -62,30 +68,30 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a    self axon: SimpleAxon new.\x0a    self model: (AppModel new title: 'Todo').\x0a\x09self watch: #((todos) nil) do: [ self changed: #((remaining)) ].\x0a    [ self modify: #((todos)) do: [{\x0a        #{'text'->'learn trapped'. 'done'->true}.\x0a        #{'text'->'build a trapped app'. 'done'->false}\x0a    }]] valueWithTimeout: 2000",
-referencedClasses: ["SimpleAxon", "AppModel"],
+source: "initialize\x0a\x09super initialize.\x0a    self axon: SimpleAxon new.\x0a    self model: (AppModel new title: 'Todo').\x0a\x09self axon addInterest: (\x0a\x09\x09InterestedInTrapPathSubtree new\x0a\x09\x09\x09aspect: #((todos))\x0a\x09\x09\x09block: [ self changed: #((remaining)) ]).\x0a    [ self modify: #((todos)) do: [{\x0a        #{'text'->'learn trapped'. 'done'->true}.\x0a        #{'text'->'build a trapped app'. 'done'->false}\x0a    }]] valueWithTimeout: 2000",
+referencedClasses: ["SimpleAxon", "AppModel", "InterestedInTrapPathSubtree"],
 //>>excludeEnd("ide");
-messageSends: ["initialize", "axon:", "new", "model:", "title:", "watch:do:", "changed:", "valueWithTimeout:", "modify:do:"]
+messageSends: ["initialize", "axon:", "new", "model:", "title:", "addInterest:", "axon", "aspect:block:", "changed:", "valueWithTimeout:", "modify:do:"]
 }),
 $globals.App);
 
 
 
-$core.addClass('AppModel', $globals.Object, ['title', 'todos', 'todoText'], 'Trapped-Todo');
+$core.addClass("AppModel", $globals.Object, ["title", "todos", "todoText"], "Trapped-Todo");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.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}";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "addTodo",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._todos())._add_($globals.HashedCollection._newFromPairs_(["text",self._todoText(),"done",false]));
-self._todoText_("");
+$recv($self._todos())._add_($globals.HashedCollection._newFromPairs_(["text",$self._todoText(),"done",false]));
+$self._todoText_("");
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"addTodo",{},$globals.AppModel)});
@@ -103,13 +109,13 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "archive",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._todos_(self._todosNotDone());
+$self._todos_($self._todosNotDone());
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"archive",{},$globals.AppModel)});
@@ -124,98 +130,16 @@ messageSends: ["todos:", "todosNotDone"]
 }),
 $globals.AppModel);
 
-$core.addMethod(
-$core.method({
-selector: "decrement",
-protocol: 'action',
-fn: function (){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-self["@value"]=$recv(self["@value"]).__minus((1));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"decrement",{},$globals.AppModel)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "decrement\x0a\x09value := value - 1",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["-"]
-}),
-$globals.AppModel);
-
-$core.addMethod(
-$core.method({
-selector: "increment",
-protocol: 'action',
-fn: function (){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-self["@value"]=$recv(self["@value"]).__plus((1));
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"increment",{},$globals.AppModel)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "increment\x0a\x09value := value + 1",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["+"]
-}),
-$globals.AppModel);
-
-$core.addMethod(
-$core.method({
-selector: "initialize",
-protocol: 'initialization',
-fn: function (){
-var self=this;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-return $core.withContext(function($ctx1) {
-//>>excludeEnd("ctx");
-(
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
-//>>excludeEnd("ctx");
-$globals.AppModel.superclass.fn.prototype._initialize.apply($recv(self), []));
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = false;
-//>>excludeEnd("ctx");;
-self["@value"]=(0);
-return self;
-//>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AppModel)});
-//>>excludeEnd("ctx");
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09value := 0",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: ["initialize"]
-}),
-$globals.AppModel);
-
 $core.addMethod(
 $core.method({
 selector: "remaining",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self._todosNotDone())._size();
-return $1;
+return $recv($self._todosNotDone())._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"remaining",{},$globals.AppModel)});
 //>>excludeEnd("ctx");
@@ -232,12 +156,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "title",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@title"];
-return $1;
+var self=this,$self=this;
+return $self["@title"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -252,10 +174,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "title:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@title"]=aString;
+var self=this,$self=this;
+$self["@title"]=aString;
 return self;
 
 },
@@ -271,12 +193,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "todoText",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@todoText"];
-return $1;
+var self=this,$self=this;
+return $self["@todoText"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -291,10 +211,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "todoText:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aString){
-var self=this;
-self["@todoText"]=aString;
+var self=this,$self=this;
+$self["@todoText"]=aString;
 return self;
 
 },
@@ -310,12 +230,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "todos",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@todos"];
-return $1;
+var self=this,$self=this;
+return $self["@todos"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -330,10 +248,10 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "todos:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anArray){
-var self=this;
-self["@todos"]=anArray;
+var self=this,$self=this;
+$self["@todos"]=anArray;
 return self;
 
 },
@@ -349,14 +267,13 @@ $globals.AppModel);
 $core.addMethod(
 $core.method({
 selector: "todosNotDone",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self._todos())._reject_((function(each){
+return $recv($self._todos())._reject_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -365,7 +282,6 @@ return $recv(each)._at_("done");
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"todosNotDone",{},$globals.AppModel)});
 //>>excludeEnd("ctx");
@@ -379,57 +295,17 @@ messageSends: ["reject:", "todos", "at:"]
 }),
 $globals.AppModel);
 
-$core.addMethod(
-$core.method({
-selector: "value",
-protocol: 'accessing',
-fn: function (){
-var self=this;
-var $1;
-$1=self["@value"];
-return $1;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: [],
-source: "value\x0a\x09^value",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.AppModel);
-
-$core.addMethod(
-$core.method({
-selector: "value:",
-protocol: 'accessing',
-fn: function (aNumber){
-var self=this;
-self["@value"]=aNumber;
-return self;
-
-},
-//>>excludeStart("ide", pragmas.excludeIdeData);
-args: ["aNumber"],
-source: "value: aNumber\x0a\x09value := aNumber",
-referencedClasses: [],
-//>>excludeEnd("ide");
-messageSends: []
-}),
-$globals.AppModel);
-
 
 $core.addMethod(
 $core.method({
 selector: "classDoneXxx",
-protocol: '*Trapped-Todo',
+protocol: "*Trapped-Todo",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=self._dataToView_((function(carrier){
+return $self._dataToView_((function(carrier){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -438,9 +314,8 @@ return $recv($recv(carrier)._target())._class_("done-".__comma($recv(carrier)._v
 }, function($ctx2) {$ctx2.fillBlock({carrier:carrier},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"classDoneXxx",{},$globals.TrappedProcessor.klass)});
+}, function($ctx1) {$ctx1.fill(self,"classDoneXxx",{},$globals.TrappedProcessor.a$cls)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -450,6 +325,6 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["dataToView:", "class:", "target", ",", "value"]
 }),
-$globals.TrappedProcessor.klass);
+$globals.TrappedProcessor.a$cls);
 
 });

+ 4 - 1
example-todo/src/Trapped-Todo.st

@@ -37,7 +37,10 @@ initialize
 	super initialize.
     self axon: SimpleAxon new.
     self model: (AppModel new title: 'Todo').
-	self watch: #((todos) nil) do: [ self changed: #((remaining)) ].
+	self axon addInterest: (
+		InterestedInTrapPathSubtree new
+			aspect: #((todos))
+			block: [ self changed: #((remaining)) ]).
     [ self modify: #((todos)) do: [{
         #{'text'->'learn trapped'. 'done'->true}.
         #{'text'->'build a trapped app'. 'done'->false}

+ 12 - 11
example-todo/todo.html

@@ -7,27 +7,28 @@
             display: none
         }
     </style>
-    <meta name="author" content="Herbert Vojčík" />
+    <meta name="author" content="Herbert Vojčík"/>
     <link rel="stylesheet" href="todo.css"/>
     <script type='text/javascript' src='../the.js'></script>
     <script type="text/javascript">
         var blackboard;
         require.config({baseUrl: '..'});
-        require(
-                ["app", "trapped-todo/Trapped-Todo"],
-                function (amber) {
-                    amber.initialize({
-                        //used for all new packages in IDE
-                        'transport.defaultAmdNamespace': "trapped-todo"
-                    });
+        require(["app", "trapped-todo/Trapped-Todo"], function (amberPromise) {
+            amberPromise.then(function (amber) {
+
+                amber.initialize({
+                    //used for all new packages in IDE
+                    'transport.defaultAmdNamespace': "trapped-todo"
+                }).then(function () {
                     require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
 
                     $(function () {
                         blackboard = amber.globals.App._new();
                         amber.globals.Trapped._start_([blackboard]);
                     });
-                }
-        );
+                });
+            });
+        });
     </script>
 </head>
 <body>
@@ -41,7 +42,7 @@
         <li>
             <label>
                 <input type="checkbox" data-trap="done: inputChecked"/>
-                <span data-trap="done: (replace ^ with ^done-) (attr class). text" ></span>
+                <span data-trap="done: (replace ^ with ^done-) (attr class). text"></span>
             </label>
         </li>
     </ul>

+ 20 - 15
index.html

@@ -1,23 +1,28 @@
 <!DOCTYPE html>
 <html>
 
-  <head>
+<head>
     <title>Trapped</title>
-    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
-    <meta name="author" content="Herbert Vojčík" />
+    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+    <meta name="author" content="Herbert Vojčík"/>
     <script type='text/javascript' src='the.js'></script>
-  </head>
+</head>
 
-  <body>
-  <script type='text/javascript'>
-      require(['app'], function (amber) {
-          amber.initialize({
-            //used for all new packages in IDE
-            'transport.defaultAmdNamespace': "trapped"
-          });
-          require(["amber-ide-starter-dialog"], function (dlg) { dlg.start(); });
-      });
-  </script>
-  </body>
+<body>
+<script type='text/javascript'>
+    require(['app'], function (amberPromise) {
+        amberPromise.then(function (amber) {
+            amber.initialize({
+                //used for all new packages in IDE
+                'transport.defaultAmdNamespace': "trapped"
+            }).then(function () {
+                require(["amber-ide-starter-dialog"], function (dlg) {
+                    dlg.start();
+                });
+            });
+        });
+    });
+</script>
+</body>
 
 </html>

+ 14 - 8
package.json

@@ -6,7 +6,8 @@
   "homepage": "https://lolg.it/herby/trapped",
   "author": {
     "name": "Herbert Vojčík",
-    "email": "herby@mailbox.sk"
+    "email": "herby@mailbox.sk",
+    "url": "https://blog.herby.sk/"
   },
   "repository": {
     "type": "git",
@@ -15,19 +16,24 @@
   "bugs": {
     "url": "https://lolg.it/herby/trapped/issues"
   },
-  "license": "MIT",
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://lolg.it/herby/trapped.git/blob/master/LICENSE-MIT"
+    }
+  ],
   "engines": {
-    "node": ">=0.10.0"
+    "node": ">=4.0.0"
   },
   "scripts": {
     "test": "grunt test"
   },
   "devDependencies": {
-    "amber-dev": "^0.8.2",
-    "grunt": "^0.4.5",
-    "grunt-contrib-clean": "^0.6.0",
-    "grunt-contrib-requirejs": "^0.4.4",
-    "grunt-execute": "^0.2.2",
+    "amber-dev": "^0.10.1",
+    "grunt": "1.0.1",
+    "grunt-contrib-clean": "^1.1.0",
+    "grunt-contrib-requirejs": "^1.0.0",
+    "grunt-exec": "^2.0.0",
     "requirejs": "^2.1.15"
   },
   "keywords": [

+ 96 - 104
src/Axon.js

@@ -1,27 +1,30 @@
-define("axon/Axon", ["amber/boot", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions"], function($boot){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Axon');
+define(["amber/boot", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects"], function($boot){"use strict";
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
+$core.addPackage("Axon");
 $core.packages["Axon"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Axon"].transport = {"type":"amd","amdNamespace":"axon"};
 
-$core.addClass('Axon', $globals.Object, ['factory'], 'Axon');
+$core.addClass("Axon", $globals.Object, ["factory"], "Axon");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.Axon.comment="I represent a pub-sub based on a key (called 'aspect').\x0aI manage aspect-block subscriptions (called 'interests') as well as run blocks of dirtied interests.\x0aThe interest objects are responsible of decision if the change of an aspect is relevant for them.\x0aInterest object must be subclasses of `AxonInterest`.\x0a\x0aMy subclasses must provide implementation for:\x0a\x0a - add:\x0a - do:\x0a - clean";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "addInterest:",
-protocol: 'action',
+protocol: "action",
 fn: function (anInterest){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2;
+var $1;
 $recv(anInterest)._flag();
 $1=$recv(anInterest)._yourself();
-self._add_($1);
-$2=self._dirty_(true);
+$self._add_($1);
+$self._dirty_(true);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"addInterest:",{anInterest:anInterest},$globals.Axon)});
@@ -39,16 +42,16 @@ $globals.Axon);
 $core.addMethod(
 $core.method({
 selector: "changed:",
-protocol: 'action',
+protocol: "action",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 var needsToRun;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 needsToRun=false;
-self._do_((function(each){
+$self._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -57,12 +60,12 @@ if($core.assert($1)){
 $recv(each)._flag();
 needsToRun=true;
 return needsToRun;
-};
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-self._dirty_(needsToRun);
+$self._dirty_(needsToRun);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"changed:",{anAspect:anAspect,needsToRun:needsToRun},$globals.Axon)});
@@ -80,15 +83,15 @@ $globals.Axon);
 $core.addMethod(
 $core.method({
 selector: "changedAll",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var needsToRun;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 needsToRun=false;
-self._do_((function(each){
+$self._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -99,7 +102,7 @@ return needsToRun;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-self._dirty_(needsToRun);
+$self._dirty_(needsToRun);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"changedAll",{needsToRun:needsToRun},$globals.Axon)});
@@ -117,9 +120,9 @@ $globals.Axon);
 $core.addMethod(
 $core.method({
 selector: "dirty:",
-protocol: 'action',
+protocol: "action",
 fn: function (aBoolean){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -128,12 +131,12 @@ $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._run();
+return $self._run();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
 }))._fork();
-};
+}
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"dirty:",{aBoolean:aBoolean},$globals.Axon)});
@@ -151,10 +154,9 @@ $globals.Axon);
 $core.addMethod(
 $core.method({
 selector: "run",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
-function $Error(){return $globals.Error||(typeof Error=="undefined"?nil:Error)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -166,35 +168,35 @@ return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
 needsClean=false;
 needsClean;
-self._do_((function(each){
+$self._do_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx3) {
 //>>excludeEnd("ctx");
 $1=$recv(each)._isFlagged();
 if($core.assert($1)){
 $recv(each)._run();
-};
+}
 $2=$recv(each)._isEnabled();
 if(!$core.assert($2)){
 needsClean=true;
 return needsClean;
-};
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)});
 //>>excludeEnd("ctx");
 }));
 $3=needsClean;
 if($core.assert($3)){
-return self._clean();
-};
+return $self._clean();
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({needsClean:needsClean},$ctx1,1)});
 //>>excludeEnd("ctx");
-}))._on_do_($Error(),(function(){
+}))._on_do_($globals.Error,(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._dirty_(true);
+return $self._dirty_(true);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)});
 //>>excludeEnd("ctx");
@@ -215,17 +217,17 @@ $globals.Axon);
 
 
 
-$core.addClass('SimpleAxon', $globals.Axon, ['queue'], 'Axon');
+$core.addClass("SimpleAxon", $globals.Axon, ["queue"], "Axon");
 $core.addMethod(
 $core.method({
 selector: "add:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aSubscription){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self["@queue"])._add_(aSubscription);
+$recv($self["@queue"])._add_(aSubscription);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"add:",{aSubscription:aSubscription},$globals.SimpleAxon)});
@@ -243,13 +245,13 @@ $globals.SimpleAxon);
 $core.addMethod(
 $core.method({
 selector: "clean",
-protocol: 'bookkeeping',
+protocol: "bookkeeping",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self["@queue"]=$recv(self["@queue"])._select_((function(each){
+$self["@queue"]=$recv($self["@queue"])._select_((function(each){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -275,13 +277,13 @@ $globals.SimpleAxon);
 $core.addMethod(
 $core.method({
 selector: "do:",
-protocol: 'enumeration',
+protocol: "enumeration",
 fn: function (aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self["@queue"])._do_(aBlock);
+$recv($self["@queue"])._do_(aBlock);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},$globals.SimpleAxon)});
@@ -299,22 +301,21 @@ $globals.SimpleAxon);
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
-function $OrderedCollection(){return $globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.SimpleAxon.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.SimpleAxon.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@queue"]=$recv($OrderedCollection())._new();
+$self["@queue"]=$recv($globals.OrderedCollection)._new();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.SimpleAxon)});
@@ -331,17 +332,17 @@ $globals.SimpleAxon);
 
 
 
-$core.addClass('AxonInterest', $globals.Object, ['aspect', 'actionBlock', 'flagged'], 'Axon');
+$core.addClass("AxonInterest", $globals.Object, ["aspect", "actionBlock", "flagged"], "Axon");
 $core.addMethod(
 $core.method({
 selector: "accepts:",
-protocol: 'testing',
+protocol: "testing",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.AxonInterest)});
@@ -359,11 +360,11 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "aspect:block:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anAspect,aBlock){
-var self=this;
-self["@aspect"]=anAspect;
-self["@actionBlock"]=aBlock;
+var self=this,$self=this;
+$self["@aspect"]=anAspect;
+$self["@actionBlock"]=aBlock;
 return self;
 
 },
@@ -379,10 +380,10 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "flag",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-self["@flagged"]=true;
+var self=this,$self=this;
+$self["@flagged"]=true;
 return self;
 
 },
@@ -398,23 +399,23 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.AxonInterest.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.AxonInterest.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@aspect"]=nil;
-self["@actionBlock"]=nil;
-self["@flagged"]=false;
+$self["@aspect"]=nil;
+$self["@actionBlock"]=nil;
+$self["@flagged"]=false;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"initialize",{},$globals.AxonInterest)});
@@ -432,15 +433,13 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "isEnabled",
-protocol: 'testing',
+protocol: "testing",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self["@actionBlock"])._notNil();
-return $1;
+return $recv($self["@actionBlock"])._notNil();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"isEnabled",{},$globals.AxonInterest)});
 //>>excludeEnd("ctx");
@@ -457,12 +456,10 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "isFlagged",
-protocol: 'testing',
+protocol: "testing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@flagged"];
-return $1;
+var self=this,$self=this;
+return $self["@flagged"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -477,10 +474,9 @@ $globals.AxonInterest);
 $core.addMethod(
 $core.method({
 selector: "run",
-protocol: 'action',
+protocol: "action",
 fn: function (){
-var self=this;
-function $AxonOff(){return $globals.AxonOff||(typeof AxonOff=="undefined"?nil:AxonOff)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -488,15 +484,15 @@ $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-self["@flagged"]=false;
-self["@flagged"];
-return $recv(self["@actionBlock"])._value();
+$self["@flagged"]=false;
+$self["@flagged"];
+return $recv($self["@actionBlock"])._value();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
-}))._on_do_($AxonOff(),(function(){
-self["@actionBlock"]=nil;
-return self["@actionBlock"];
+}))._on_do_($globals.AxonOff,(function(){
+$self["@actionBlock"]=nil;
+return $self["@actionBlock"];
 
 }));
 return self;
@@ -515,19 +511,17 @@ $globals.AxonInterest);
 
 
 
-$core.addClass('InterestedInEqual', $globals.AxonInterest, [], 'Axon');
+$core.addClass("InterestedInEqual", $globals.AxonInterest, [], "Axon");
 $core.addMethod(
 $core.method({
 selector: "accepts:",
-protocol: 'testing',
+protocol: "testing",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(anAspect).__eq(self["@aspect"]);
-return $1;
+return $recv(anAspect).__eq($self["@aspect"]);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.InterestedInEqual)});
 //>>excludeEnd("ctx");
@@ -543,25 +537,23 @@ $globals.InterestedInEqual);
 
 
 
-$core.addClass('AxonOff', $globals.Error, [], 'Axon');
+$core.addClass("AxonOff", $globals.Error, [], "Axon");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.AxonOff.comment="Signal me from the subscription block to unsubscribe it.";
 //>>excludeEnd("ide");
 
 
-$core.addClass('AxonizedObject', $globals.Object, ['axon'], 'Axon');
+$core.addClass("AxonizedObject", $globals.Object, ["axon"], "Axon");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.AxonizedObject.comment="I am base class for object using Axon changed:\x0afor event / change logistics,\x0a\x0aSet Axon instance with `axon:` and then use\x0a`self changed: anAspect` to trigger axon's `changed:`.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "axon",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@axon"];
-return $1;
+var self=this,$self=this;
+return $self["@axon"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -576,10 +568,10 @@ $globals.AxonizedObject);
 $core.addMethod(
 $core.method({
 selector: "axon:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anAxon){
-var self=this;
-self["@axon"]=anAxon;
+var self=this,$self=this;
+$self["@axon"]=anAxon;
 return self;
 
 },
@@ -595,13 +587,13 @@ $globals.AxonizedObject);
 $core.addMethod(
 $core.method({
 selector: "changed:",
-protocol: 'action',
+protocol: "action",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._axon())._changed_(anAspect);
+$recv($self._axon())._changed_(anAspect);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"changed:",{anAspect:anAspect},$globals.AxonizedObject)});

+ 134 - 151
src/Trapped-Backend.js

@@ -1,29 +1,32 @@
-define("trapped/Trapped-Backend", ["amber/boot"
+define(["amber/boot"
 //>>excludeStart("imports", pragmas.excludeImports);
 , "lyst/Lyst"
 //>>excludeEnd("imports");
-, "amber_core/Kernel-Objects", "axon/Axon", "amber_core/Kernel-Collections"], function($boot
+, "amber_core/Kernel-Collections", "amber_core/Kernel-Objects", "axon/Axon"], function($boot
 //>>excludeStart("imports", pragmas.excludeImports);
 
 //>>excludeEnd("imports");
 ){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Trapped-Backend');
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
+$core.addPackage("Trapped-Backend");
 $core.packages["Trapped-Backend"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Trapped-Backend"].imports = ["lyst/Lyst"];
 $core.packages["Trapped-Backend"].transport = {"type":"amd","amdNamespace":"trapped"};
 
-$core.addClass('EavModel', $globals.Object, ['getBlock', 'putBlock'], 'Trapped-Backend');
+$core.addClass("EavModel", $globals.Object, ["getBlock", "putBlock"], "Trapped-Backend");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.EavModel.comment="External actor value model.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "getBlock:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aBlock){
-var self=this;
-self["@getBlock"]=aBlock;
+var self=this,$self=this;
+$self["@getBlock"]=aBlock;
 return self;
 
 },
@@ -39,25 +42,25 @@ $globals.EavModel);
 $core.addMethod(
 $core.method({
 selector: "initialize",
-protocol: 'initialization',
+protocol: "initialization",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.EavModel.superclass.fn.prototype._initialize.apply($recv(self), []));
+($globals.EavModel.superclass||$boot.nilAsClass).fn.prototype._initialize.apply($self, []));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
-self["@getBlock"]=(function(){
+$self["@getBlock"]=(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._error_("No getter block.");
+return $self._error_("No getter block.");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx2.sendIdx["error:"]=1;
 //>>excludeEnd("ctx");
@@ -65,11 +68,11 @@ $ctx2.sendIdx["error:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
 });
-self["@putBlock"]=(function(){
+$self["@putBlock"]=(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._error_("No putter block.");
+return $self._error_("No putter block.");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
@@ -91,15 +94,13 @@ $globals.EavModel);
 $core.addMethod(
 $core.method({
 selector: "on:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self["@getBlock"])._value_(anObject);
-return $1;
+return $recv($self["@getBlock"])._value_(anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},$globals.EavModel)});
 //>>excludeEnd("ctx");
@@ -116,15 +117,13 @@ $globals.EavModel);
 $core.addMethod(
 $core.method({
 selector: "on:put:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anObject,anObject2){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self["@putBlock"])._value_value_(anObject,anObject2);
-return $1;
+return $recv($self["@putBlock"])._value_value_(anObject,anObject2);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"on:put:",{anObject:anObject,anObject2:anObject2},$globals.EavModel)});
 //>>excludeEnd("ctx");
@@ -141,10 +140,10 @@ $globals.EavModel);
 $core.addMethod(
 $core.method({
 selector: "putBlock:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (aBlock){
-var self=this;
-self["@putBlock"]=aBlock;
+var self=this,$self=this;
+$self["@putBlock"]=aBlock;
 return self;
 
 },
@@ -159,36 +158,35 @@ $globals.EavModel);
 
 
 
-$core.addClass('InterestedInTrapPath', $globals.AxonInterest, [], 'Trapped-Backend');
+$core.addClass("InterestedInTrapPath", $globals.AxonInterest, [], "Trapped-Backend");
 $core.addMethod(
 $core.method({
 selector: "accepts:",
-protocol: 'testing',
+protocol: "testing",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $3,$4,$2,$1;
-$3=$recv(anAspect)._size();
+var $2,$3,$1;
+$2=$recv(anAspect)._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=1;
 //>>excludeEnd("ctx");
-$4=$recv(self["@aspect"])._size();
+$3=$recv($self["@aspect"])._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=2;
 //>>excludeEnd("ctx");
-$2=$recv($3).__lt_eq($4);
-$1=$recv($2)._and_((function(){
+$1=$recv($2).__lt_eq($3);
+return $recv($1)._and_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(anAspect).__eq($recv(self["@aspect"])._copyFrom_to_((1),$recv(anAspect)._size()));
+return $recv(anAspect).__eq($recv($self["@aspect"])._copyFrom_to_((1),$recv(anAspect)._size()));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-return $1;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.InterestedInTrapPath)});
 //>>excludeEnd("ctx");
@@ -204,44 +202,43 @@ $globals.InterestedInTrapPath);
 
 
 
-$core.addClass('InterestedInTrapPathSubtree', $globals.AxonInterest, [], 'Trapped-Backend');
+$core.addClass("InterestedInTrapPathSubtree", $globals.AxonInterest, [], "Trapped-Backend");
 $core.addMethod(
 $core.method({
 selector: "accepts:",
-protocol: 'testing',
+protocol: "testing",
 fn: function (anAspect){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $3,$4,$2,$6,$7,$5,$1;
-$3=$recv(anAspect)._size();
+var $2,$3,$1,$5,$6,$4;
+$2=$recv(anAspect)._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=1;
 //>>excludeEnd("ctx");
-$4=$recv(self["@aspect"])._size();
+$3=$recv($self["@aspect"])._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=2;
 //>>excludeEnd("ctx");
-$2=$recv($3).__lt_eq($4);
-if($core.assert($2)){
-$6=self["@aspect"];
-$7=$recv(anAspect)._size();
+$1=$recv($2).__lt_eq($3);
+if($core.assert($1)){
+$5=$self["@aspect"];
+$6=$recv(anAspect)._size();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["size"]=3;
 //>>excludeEnd("ctx");
-$5=$recv($6)._copyFrom_to_((1),$7);
+$4=$recv($5)._copyFrom_to_((1),$6);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["copyFrom:to:"]=1;
 //>>excludeEnd("ctx");
-$1=$recv(anAspect).__eq($5);
+return $recv(anAspect).__eq($4);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["="]=1;
 //>>excludeEnd("ctx");
 } else {
-$1=$recv(self["@aspect"]).__eq($recv(anAspect)._copyFrom_to_((1),$recv(self["@aspect"])._size()));
-};
-return $1;
+return $recv($self["@aspect"]).__eq($recv(anAspect)._copyFrom_to_((1),$recv($self["@aspect"])._size()));
+}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"accepts:",{anAspect:anAspect},$globals.InterestedInTrapPathSubtree)});
 //>>excludeEnd("ctx");
@@ -257,13 +254,13 @@ $globals.InterestedInTrapPathSubtree);
 
 
 
-$core.addClass('Isolator', $globals.Object, ['root'], 'Trapped-Backend');
+$core.addClass("Isolator", $globals.Object, ["root"], "Trapped-Backend");
 $core.addMethod(
 $core.method({
 selector: "model:modify:",
-protocol: 'action',
+protocol: "action",
 fn: function (anEavModel,aBlock){
-var self=this;
+var self=this,$self=this;
 var newValue;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -287,9 +284,9 @@ $globals.Isolator);
 $core.addMethod(
 $core.method({
 selector: "model:read:",
-protocol: 'action',
+protocol: "action",
 fn: function (anEavModel,aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
@@ -311,12 +308,10 @@ $globals.Isolator);
 $core.addMethod(
 $core.method({
 selector: "root",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@root"];
-return $1;
+var self=this,$self=this;
+return $self["@root"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -331,10 +326,10 @@ $globals.Isolator);
 $core.addMethod(
 $core.method({
 selector: "root:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anObject){
-var self=this;
-self["@root"]=anObject;
+var self=this,$self=this;
+$self["@root"]=anObject;
 return self;
 
 },
@@ -351,17 +346,15 @@ $globals.Isolator);
 $core.addMethod(
 $core.method({
 selector: "on:",
-protocol: 'instance creation',
+protocol: "instance creation",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1;
-$1=$recv(self._new())._root_(anObject);
-return $1;
+return $recv($self._new())._root_(anObject);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},$globals.Isolator.klass)});
+}, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},$globals.Isolator.a$cls)});
 //>>excludeEnd("ctx");
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -371,22 +364,20 @@ referencedClasses: [],
 //>>excludeEnd("ide");
 messageSends: ["root:", "new"]
 }),
-$globals.Isolator.klass);
+$globals.Isolator.a$cls);
 
 
-$core.addClass('TrappedPosition', $globals.Object, ['path', 'model'], 'Trapped-Backend');
+$core.addClass("TrappedPosition", $globals.Object, ["path", "model"], "Trapped-Backend");
 $core.addMethod(
 $core.method({
 selector: "interestOn:block:",
-protocol: 'private',
+protocol: "private",
 fn: function (anAspect,aBlock){
-var self=this;
-function $InterestedInTrapPathSubtree(){return $globals.InterestedInTrapPathSubtree||(typeof InterestedInTrapPathSubtree=="undefined"?nil:InterestedInTrapPathSubtree)}
-function $InterestedInTrapPath(){return $globals.InterestedInTrapPath||(typeof InterestedInTrapPath=="undefined"?nil:InterestedInTrapPath)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$3,$2,$4;
+var $1,$3,$2;
 $1=$recv($recv(anAspect)._notEmpty())._and_((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -397,7 +388,7 @@ return $recv($recv(anAspect)._last())._isNil();
 //>>excludeEnd("ctx");
 }));
 if($core.assert($1)){
-$3=$recv($InterestedInTrapPathSubtree())._new();
+$3=$recv($globals.InterestedInTrapPathSubtree)._new();
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["new"]=1;
 //>>excludeEnd("ctx");
@@ -407,9 +398,8 @@ $ctx1.sendIdx["aspect:block:"]=1;
 //>>excludeEnd("ctx");
 return $2;
 } else {
-$4=$recv($recv($InterestedInTrapPath())._new())._aspect_block_(anAspect,aBlock);
-return $4;
-};
+return $recv($recv($globals.InterestedInTrapPath)._new())._aspect_block_(anAspect,aBlock);
+}
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"interestOn:block:",{anAspect:anAspect,aBlock:aBlock},$globals.TrappedPosition)});
@@ -427,12 +417,10 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "model",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@model"];
-return $1;
+var self=this,$self=this;
+return $self["@model"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -447,13 +435,13 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "modify:",
-protocol: 'action',
+protocol: "action",
 fn: function (aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._model())._modify_do_(self._path(),aBlock);
+$recv($self._model())._modify_do_($self._path(),aBlock);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"modify:",{aBlock:aBlock},$globals.TrappedPosition)});
@@ -471,12 +459,10 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "path",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (){
-var self=this;
-var $1;
-$1=self["@path"];
-return $1;
+var self=this,$self=this;
+return $self["@path"];
 
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
@@ -491,11 +477,11 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "path:model:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anArray,aTrappedMW){
-var self=this;
-self["@path"]=anArray;
-self["@model"]=aTrappedMW;
+var self=this,$self=this;
+$self["@path"]=anArray;
+$self["@model"]=aTrappedMW;
 return self;
 
 },
@@ -511,13 +497,13 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "read:",
-protocol: 'action',
+protocol: "action",
 fn: function (aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv(self._model())._read_do_(self._path(),aBlock);
+$recv($self._model())._read_do_($self._path(),aBlock);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"read:",{aBlock:aBlock},$globals.TrappedPosition)});
@@ -535,17 +521,17 @@ $globals.TrappedPosition);
 $core.addMethod(
 $core.method({
 selector: "watch:",
-protocol: 'action',
+protocol: "action",
 fn: function (aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$recv($recv(self._model())._axon())._addInterest_(self._interestOn_block_(self._path(),(function(){
+$recv($recv($self._model())._axon())._addInterest_($self._interestOn_block_($self._path(),(function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._read_(aBlock);
+return $self._read_(aBlock);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -566,21 +552,21 @@ $globals.TrappedPosition);
 
 
 
-$core.addClass('Trapper', $globals.AxonizedObject, ['payload'], 'Trapped-Backend');
+$core.addClass("Trapper", $globals.AxonizedObject, ["payload"], "Trapped-Backend");
 //>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.Trapper.comment="A portmanteau of 'Trapped wrapper', I am base class for model objects wrapped by Trapped.\x0a\x0aWrapped object is indexed by #('string-at-index' #selector numeric-at-index) array paths. Operations using this indexing are:\x0a\x0a - `read:do` to get the indexed content\x0a - `modify:do:` to get and modify the indexed content, and\x0a - `watch:do:` to subscribe to changes of the indexed content.\x0a\x0aThe wrapped model can be any smalltalk object.\x0a\x0aMy subclasses need to provide implementation for:\x0a\x0a - read:do:\x0a - modify:do:\x0a\x0aand must issue these calls when initializing:\x0a\x0a - axon: (with a subclass of `Axon`)\x0a - model: (with a wrapped object, after `axon:`)";
+$globals.Trapper.comment="A portmanteau of 'Trapped wrapper', I am base class for model objects wrapped by Trapped.\x0a\x0aWrapped object is indexed by #('string-at-index' #selector numeric-at-index) array paths. Operations using this indexing are:\x0a\x0a - `read:do:` to get the indexed content\x0a - `modify:do:` to get and modify the indexed content, and\x0a - (not any more) `watch:do:` to subscribe to changes of the indexed content.\x0a\x0aThe wrapped model can be any smalltalk object.\x0a\x0aMy subclasses need to provide implementation for:\x0a\x0a - read:do:\x0a - modify:do:\x0a\x0aand must issue these calls when initializing:\x0a\x0a - axon: (with a subclass of `Axon`)\x0a - model: (with a wrapped object, after `axon:`)";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "model:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anObject){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self["@payload"]=anObject;
-$recv(self._axon())._changedAll();
+$self["@payload"]=anObject;
+$recv($self._axon())._changedAll();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"model:",{anObject:anObject},$globals.Trapper)});
@@ -598,13 +584,13 @@ $globals.Trapper);
 $core.addMethod(
 $core.method({
 selector: "modify:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"modify:do:",{path:path,aBlock:aBlock},$globals.Trapper)});
@@ -622,13 +608,13 @@ $globals.Trapper);
 $core.addMethod(
 $core.method({
 selector: "read:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-self._subclassResponsibility();
+$self._subclassResponsibility();
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock},$globals.Trapper)});
@@ -645,27 +631,27 @@ $globals.Trapper);
 
 
 
-$core.addClass('DirectTrapper', $globals.Trapper, [], 'Trapped-Backend');
+$core.addClass("DirectTrapper", $globals.Trapper, [], "Trapped-Backend");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.DirectTrapper.comment="I am Trapper that directly manipulate\x0athe wrapped model object.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "modify:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 var newValue,eavModel;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 eavModel=$recv(path)._asEavModel();
-newValue=$recv(aBlock)._value_($recv(eavModel)._on_(self["@payload"]));
+newValue=$recv(aBlock)._value_($recv(eavModel)._on_($self["@payload"]));
 $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(eavModel)._on_put_(self["@payload"],newValue);
+return $recv(eavModel)._on_put_($self["@payload"],newValue);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -673,7 +659,7 @@ return $recv(eavModel)._on_put_(self["@payload"],newValue);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._changed_(path);
+return $self._changed_(path);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
@@ -695,15 +681,15 @@ $globals.DirectTrapper);
 $core.addMethod(
 $core.method({
 selector: "read:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 var eavModel;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 eavModel=$recv(path)._asEavModel();
-$recv(aBlock)._value_($recv(eavModel)._on_(self["@payload"]));
+$recv(aBlock)._value_($recv(eavModel)._on_($self["@payload"]));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},$globals.DirectTrapper)});
@@ -720,25 +706,24 @@ $globals.DirectTrapper);
 
 
 
-$core.addClass('IsolatingTrapper', $globals.Trapper, [], 'Trapped-Backend');
+$core.addClass("IsolatingTrapper", $globals.Trapper, [], "Trapped-Backend");
 //>>excludeStart("ide", pragmas.excludeIdeData);
 $globals.IsolatingTrapper.comment="I am Trapper that guards access\x0ato the wrapped model object via Isolator.\x0a\x0aIOW, read:do: gets always its own deep copy,\x0amodify:do: is not reentrant\x0aand upon writing the written part is deep-copied as well\x0a(so modifier does not hold the source of truth\x0aand can change it later).\x0a\x0aThis also means, a wrapped object and all its parts\x0amust understand `#deepCopy`.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({
 selector: "model:",
-protocol: 'accessing',
+protocol: "accessing",
 fn: function (anObject){
-var self=this;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 (
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
-$ctx1.supercall = true, 
+$ctx1.supercall = true,
 //>>excludeEnd("ctx");
-$globals.IsolatingTrapper.superclass.fn.prototype._model_.apply($recv(self), [$recv($Isolator())._on_(anObject)]));
+($globals.IsolatingTrapper.superclass||$boot.nilAsClass).fn.prototype._model_.apply($self, [$recv($globals.Isolator)._on_(anObject)]));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.supercall = false;
 //>>excludeEnd("ctx");;
@@ -759,9 +744,9 @@ $globals.IsolatingTrapper);
 $core.addMethod(
 $core.method({
 selector: "modify:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 var eavModel;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
@@ -771,7 +756,7 @@ $recv((function(){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return $recv(self["@payload"])._model_modify_(eavModel,aBlock);
+return $recv($self["@payload"])._model_modify_(eavModel,aBlock);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)});
 //>>excludeEnd("ctx");
@@ -779,7 +764,7 @@ return $recv(self["@payload"])._model_modify_(eavModel,aBlock);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
-return self._changed_(path);
+return $self._changed_(path);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)});
 //>>excludeEnd("ctx");
@@ -801,15 +786,15 @@ $globals.IsolatingTrapper);
 $core.addMethod(
 $core.method({
 selector: "read:do:",
-protocol: 'action',
+protocol: "action",
 fn: function (path,aBlock){
-var self=this;
+var self=this,$self=this;
 var eavModel;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 eavModel=$recv($recv([["root"]]).__comma(path))._asEavModel();
-$recv(self["@payload"])._model_read_(eavModel,aBlock);
+$recv($self["@payload"])._model_read_(eavModel,aBlock);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"read:do:",{path:path,aBlock:aBlock,eavModel:eavModel},$globals.IsolatingTrapper)});
@@ -828,16 +813,15 @@ $globals.IsolatingTrapper);
 $core.addMethod(
 $core.method({
 selector: "asEavModel",
-protocol: '*Trapped-Backend',
+protocol: "*Trapped-Backend",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var model;
-function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2;
-model=$recv($EavModel())._new();
+var $1;
+model=$recv($globals.EavModel)._new();
 $recv(model)._getBlock_((function(anObject){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -850,7 +834,7 @@ return nil;
 }, function($ctx2) {$ctx2.fillBlock({anObject:anObject},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$1=self._isEmpty();
+$1=$self._isEmpty();
 if(!$core.assert($1)){
 $recv(model)._putBlock_((function(anObject,value){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
@@ -864,9 +848,8 @@ return nil;
 }, function($ctx2) {$ctx2.fillBlock({anObject:anObject,value:value},$ctx1,4)});
 //>>excludeEnd("ctx");
 }));
-};
-$2=model;
-return $2;
+}
+return model;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"asEavModel",{model:model},$globals.SequenceableCollection)});
 //>>excludeEnd("ctx");

+ 2 - 2
src/Trapped-Backend.st

@@ -147,9 +147,9 @@ A portmanteau of 'Trapped wrapper', I am base class for model objects wrapped by
 
 Wrapped object is indexed by #('string-at-index' #selector numeric-at-index) array paths. Operations using this indexing are:
 
- - `read:do` to get the indexed content
+ - `read:do:` to get the indexed content
  - `modify:do:` to get and modify the indexed content, and
- - `watch:do:` to subscribe to changes of the indexed content.
+ - (not any more) `watch:do:` to subscribe to changes of the indexed content.
 
 The wrapped model can be any smalltalk object.
 

File diff suppressed because it is too large
+ 195 - 232
src/Trapped-Frontend.js


File diff suppressed because it is too large
+ 187 - 209
src/Trapped-Processors.js


+ 1 - 1
src/Trapped-Processors.st

@@ -469,7 +469,7 @@ modifyTargetByPerforming: aString
 !
 
 primitive: anObject
-	<return anObject === nil ? null : anObject.valueOf()>
+	<inlineJS: 'return anObject === nil ? null : anObject.valueOf()'>
 !
 
 toTargetAttr: aString

+ 85 - 101
src/Trapped-Tests.js

@@ -1,22 +1,24 @@
-define("trapped/Trapped-Tests", ["amber/boot", "amber_core/SUnit"], function($boot){"use strict";
-var $core=$boot.api,nil=$boot.nil,$recv=$boot.asReceiver,$globals=$boot.globals;
-$core.addPackage('Trapped-Tests');
+define(["amber/boot", "amber_core/SUnit"], function($boot){"use strict";
+if(!$boot.nilAsReceiver)$boot.nilAsReceiver=$boot.nil;
+if(!("nilAsValue" in $boot))$boot.nilAsValue=$boot.nilAsReceiver;
+var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
+if(!$boot.nilAsClass)$boot.nilAsClass=$boot.dnu;
+$core.addPackage("Trapped-Tests");
 $core.packages["Trapped-Tests"].innerEval = function (expr) { return eval(expr); };
 $core.packages["Trapped-Tests"].transport = {"type":"amd","amdNamespace":"trapped"};
 
-$core.addClass('IsolatorTest', $globals.TestCase, ['rootModel'], 'Trapped-Tests');
+$core.addClass("IsolatorTest", $globals.TestCase, ["rootModel"], "Trapped-Tests");
 $core.addMethod(
 $core.method({
 selector: "setUp",
-protocol: 'running',
+protocol: "running",
 fn: function (){
-var self=this;
-function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
+var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$2;
-$1=$recv($EavModel())._new();
+var $1;
+$1=$recv($globals.EavModel)._new();
 $recv($1)._getBlock_((function(x){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -26,7 +28,7 @@ return $recv(x)._root();
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$2=$recv($1)._putBlock_((function(x,y){
+$self["@rootModel"]=$recv($1)._putBlock_((function(x,y){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -35,7 +37,6 @@ return $recv(x)._root_(y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
 //>>excludeEnd("ctx");
 }));
-self["@rootModel"]=$2;
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"setUp",{},$globals.IsolatorTest)});
@@ -53,19 +54,17 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testNontrivialModelGetsAppropriateValueForModification",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,model,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$3,$2,$4;
+var $1,$3,$2;
 result=nil;
-isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (5)]], "baz"],"moo","zoo"]));
-$1=$recv($EavModel())._new();
+isolator=$recv($globals.Isolator)._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (5)]], "baz"],"moo","zoo"]));
+$1=$recv($globals.EavModel)._new();
 $recv($1)._getBlock_((function(x){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -86,7 +85,7 @@ $ctx2.sendIdx["at:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$4=$recv($1)._putBlock_((function(x,y){
+model=$recv($1)._putBlock_((function(x,y){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -95,13 +94,12 @@ return $recv($recv($recv(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
 //>>excludeEnd("ctx");
 }));
-model=$4;
 $recv(isolator)._model_modify_(model,(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(1), [(2), (5)]],result);
+$self._assert_equals_([(1), [(2), (5)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testNontrivialModelGetsAppropriateValueForModification",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
@@ -119,19 +117,17 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testNontrivialModelModifiesAppropriateValue",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,model,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-var $1,$3,$2,$4;
+var $1,$3,$2;
 result=nil;
-isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
-$1=$recv($EavModel())._new();
+isolator=$recv($globals.Isolator)._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
+$1=$recv($globals.EavModel)._new();
 $recv($1)._getBlock_((function(x){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
@@ -152,7 +148,7 @@ $ctx2.sendIdx["at:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({x:x},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$4=$recv($1)._putBlock_((function(x,y){
+model=$recv($1)._putBlock_((function(x,y){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -161,7 +157,6 @@ return $recv($recv($recv(x)._root())._at_("foo"))._at_put_((2),y);
 }, function($ctx2) {$ctx2.fillBlock({x:x,y:y},$ctx1,2)});
 //>>excludeEnd("ctx");
 }));
-model=$4;
 $recv(isolator)._model_modify_(model,(function(r){
 return "new";
 
@@ -174,16 +169,16 @@ return result;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["model:read:"]=1;
 //>>excludeEnd("ctx");
-self._assert_equals_("new",result);
+$self._assert_equals_("new",result);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["assert:equals:"]=1;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",["bar", "new", "baz"],"moo","zoo"]),result);
+$self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",["bar", "new", "baz"],"moo","zoo"]),result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testNontrivialModelModifiesAppropriateValue",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
@@ -201,18 +196,16 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testNontrivialModelReturnsAppropriateValue",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,model,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
-function $EavModel(){return $globals.EavModel||(typeof EavModel=="undefined"?nil:EavModel)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
-model=$recv($recv($EavModel())._new())._getBlock_((function(x){
+isolator=$recv($globals.Isolator)._on_($globals.HashedCollection._newFromPairs_(["foo",["bar", [(1), [(2), (3)]], "baz"],"moo","zoo"]));
+model=$recv($recv($globals.EavModel)._new())._getBlock_((function(x){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -229,7 +222,7 @@ result=r;
 return result;
 
 }));
-self._assert_equals_([(1), [(2), (3)]],result);
+$self._assert_equals_([(1), [(2), (3)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testNontrivialModelReturnsAppropriateValue",{isolator:isolator,model:model,result:result},$globals.IsolatorTest)});
@@ -247,17 +240,16 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelExaminesThenModifiesRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -266,12 +258,12 @@ return $recv(r)._second();
 }, function($ctx2) {$ctx2.fillBlock({r:r},$ctx1,1)});
 //>>excludeEnd("ctx");
 }));
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(2), (3)],result);
+$self._assert_equals_([(2), (3)],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelExaminesThenModifiesRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
@@ -289,22 +281,21 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelGetsRootForModification",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(2), [(1), (0)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(2), [(1), (0)]]);
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(2), [(1), (0)]],result);
+$self._assert_equals_([(2), [(1), (0)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelGetsRootForModification",{isolator:isolator,result:result},$globals.IsolatorTest)});
@@ -322,18 +313,17 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result,newValue;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
 newValue=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -352,13 +342,13 @@ $recv(newValue)._at_put_((2),"bar");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=2;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
 $recv(newValue)._at_put_((2),"baz");
-self._assert_equals_([(4), [(2), (3)]],result);
+$self._assert_equals_([(4), [(2), (3)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesInPlaceModifiedRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
@@ -376,19 +366,18 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelModifiesAndDeeplyIsolatesRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result,newValue;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 var $1;
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
 newValue=$globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 return newValue;
 
 }));
@@ -400,13 +389,13 @@ $recv($1)._at_put_((1),"bar");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=1;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
 $recv($recv(newValue)._at_("foo"))._at_put_((3),"baz");
-self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+$self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndDeeplyIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
@@ -424,18 +413,17 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelModifiesAndIsolatesRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result,newValue;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
 newValue=$globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 return newValue;
 
 }));
@@ -443,13 +431,13 @@ $recv(newValue)._at_put_("foo","bar");
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["at:put:"]=1;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
 $recv(newValue)._at_put_("foo","baz");
-self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+$self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesAndIsolatesRoot",{isolator:isolator,result:result,newValue:newValue},$globals.IsolatorTest)});
@@ -467,26 +455,25 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelModifiesRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
-$recv(isolator)._model_modify_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_modify_($self["@rootModel"],(function(r){
 return $globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]);
 
 }));
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
+$self._assert_equals_($globals.HashedCollection._newFromPairs_(["foo",[(4), (5), (6)]]),result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelModifiesRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
@@ -504,17 +491,16 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelReturnsDeeplyIsolatedRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -526,12 +512,12 @@ return $recv($recv(r)._at_((2)))._at_put_((1),(0));
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["model:read:"]=1;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(1), [(2), (3)]],result);
+$self._assert_equals_([(1), [(2), (3)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsDeeplyIsolatedRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
@@ -549,17 +535,16 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelReturnsIsolatedRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (4)]]);
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (4)]]);
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx2) {
 //>>excludeEnd("ctx");
@@ -571,12 +556,12 @@ return $recv(r)._at_put_((2),nil);
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 $ctx1.sendIdx["model:read:"]=1;
 //>>excludeEnd("ctx");
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(1), [(2), (4)]],result);
+$self._assert_equals_([(1), [(2), (4)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsIsolatedRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});
@@ -594,22 +579,21 @@ $globals.IsolatorTest);
 $core.addMethod(
 $core.method({
 selector: "testRootModelReturnsRoot",
-protocol: 'tests',
+protocol: "tests",
 fn: function (){
-var self=this;
+var self=this,$self=this;
 var isolator,result;
-function $Isolator(){return $globals.Isolator||(typeof Isolator=="undefined"?nil:Isolator)}
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
 result=nil;
-isolator=$recv($Isolator())._on_([(1), [(2), (3)]]);
-$recv(isolator)._model_read_(self["@rootModel"],(function(r){
+isolator=$recv($globals.Isolator)._on_([(1), [(2), (3)]]);
+$recv(isolator)._model_read_($self["@rootModel"],(function(r){
 result=r;
 return result;
 
 }));
-self._assert_equals_([(1), [(2), (3)]],result);
+$self._assert_equals_([(1), [(2), (3)]],result);
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"testRootModelReturnsRoot",{isolator:isolator,result:result},$globals.IsolatorTest)});

Some files were not shown because too many files changed in this diff