Sfoglia il codice sorgente

Merge branch 'master' into moka

Nicolas Petton 10 anni fa
parent
commit
25763c3c5b
100 ha cambiato i file con 10804 aggiunte e 8548 eliminazioni
  1. 3 3
      .travis.yml
  2. 95 76
      API-CHANGES.txt
  3. 4 1
      CHANGELOG
  4. 2 2
      LICENSE
  5. 19 3
      README.md
  6. 1 1
      bower.json
  7. 175 102
      cli/js/AmberCli.js
  8. 25 7
      cli/st/AmberCli.st
  9. 405 196
      cli/support/amber-cli.js
  10. 1 1
      cli/support/amberc-cli.js
  11. 309 379
      cli/support/amberc.js
  12. 3 3
      css/helios.css
  13. 1 1
      grunt/tasks/grunt-amberc.js
  14. 1 0
      helios.html
  15. 26 28
      js/Benchfib.js
  16. 191 192
      js/Canvas.js
  17. 184 187
      js/Compiler-AST.js
  18. 242 228
      js/Compiler-Core.js
  19. 53 60
      js/Compiler-Exceptions.js
  20. 168 188
      js/Compiler-IR.js
  21. 179 184
      js/Compiler-Inlining.js
  22. 165 180
      js/Compiler-Interpreter.js
  23. 178 201
      js/Compiler-Semantic.js
  24. 182 165
      js/Compiler-Tests.js
  25. 19 19
      js/Examples.js
  26. 123 148
      js/Helios-Announcements.js
  27. 165 176
      js/Helios-Browser.js
  28. 333 136
      js/Helios-Commands-Browser.js
  29. 171 195
      js/Helios-Commands-Core.js
  30. 355 434
      js/Helios-Commands-Tools.js
  31. 155 164
      js/Helios-Core.js
  32. 167 191
      js/Helios-Debugger.js
  33. 7 7
      js/Helios-Exceptions.js
  34. 1054 0
      js/Helios-Helpers.js
  35. 219 233
      js/Helios-Inspector.js
  36. 158 175
      js/Helios-KeyBindings.js
  37. 95 107
      js/Helios-Layout.js
  38. 162 199
      js/Helios-References.js
  39. 55 53
      js/Helios-Transcript.js
  40. 7 7
      js/Helios-Workspace-Tests.js
  41. 166 173
      js/Helios-Workspace.js
  42. 177 199
      js/IDE.js
  43. 169 192
      js/Kernel-Announcements.js
  44. 227 240
      js/Kernel-Classes.js
  45. 276 130
      js/Kernel-Collections.js
  46. 84 265
      js/Kernel-Exceptions.js
  47. 188 169
      js/Kernel-ImportExport.js
  48. 318 239
      js/Kernel-Infrastructure.js
  49. 194 245
      js/Kernel-Methods.js
  50. 251 244
      js/Kernel-Objects.js
  51. 340 212
      js/Kernel-Tests.js
  52. 22 162
      js/Kernel-Transcript.js
  53. 82 83
      js/SUnit-Tests.js
  54. 159 173
      js/SUnit.js
  55. 61 64
      js/Spaces.js
  56. 3 0
      package.json
  57. 1 1
      st/Benchfib.st
  58. 11 2
      st/Canvas.st
  59. 18 2
      st/Compiler-AST.st
  60. 26 16
      st/Compiler-Core.st
  61. 5 5
      st/Compiler-Exceptions.st
  62. 15 12
      st/Compiler-IR.st
  63. 1 1
      st/Compiler-Inlining.st
  64. 3 3
      st/Compiler-Interpreter.st
  65. 5 4
      st/Compiler-Semantic.st
  66. 25 19
      st/Compiler-Tests.st
  67. 1 1
      st/Examples.st
  68. 1 1
      st/Helios-Announcements.st
  69. 3 3
      st/Helios-Browser.st
  70. 111 1
      st/Helios-Commands-Browser.st
  71. 1 1
      st/Helios-Commands-Core.st
  72. 1 1
      st/Helios-Commands-Tools.st
  73. 61 32
      st/Helios-Core.st
  74. 2 8
      st/Helios-Debugger.st
  75. 1 1
      st/Helios-Exceptions.st
  76. 439 0
      st/Helios-Helpers.st
  77. 2 2
      st/Helios-Inspector.st
  78. 5 2
      st/Helios-KeyBindings.st
  79. 1 1
      st/Helios-Layout.st
  80. 1 7
      st/Helios-References.st
  81. 10 10
      st/Helios-Transcript.st
  82. 1 1
      st/Helios-Workspace-Tests.st
  83. 7 6
      st/Helios-Workspace.st
  84. 129 124
      st/IDE.st
  85. 3 3
      st/Kernel-Announcements.st
  86. 40 43
      st/Kernel-Classes.st
  87. 390 135
      st/Kernel-Collections.st
  88. 1 61
      st/Kernel-Exceptions.st
  89. 42 22
      st/Kernel-ImportExport.st
  90. 272 105
      st/Kernel-Infrastructure.st
  91. 19 26
      st/Kernel-Methods.st
  92. 44 28
      st/Kernel-Objects.st
  93. 525 216
      st/Kernel-Tests.st
  94. 2 55
      st/Kernel-Transcript.st
  95. 1 1
      st/SUnit-Tests.st
  96. 1 1
      st/SUnit.st
  97. 1 1
      st/Spaces.st
  98. 0 21
      support/CodeMirror/amber.css
  99. 0 139
      support/CodeMirror/smalltalk.js
  100. 2 2
      support/_st.js

+ 3 - 3
.travis.yml

@@ -1,6 +1,6 @@
 language: node_js
 node_js:
-  - 0.8
-  - 0.10
+  - "0.8"
+  - "0.10"
 before_script:
-  - npm install -g grunt-cli
+  - npm install -g grunt-cli

+ 95 - 76
API-CHANGES.txt

@@ -3,22 +3,42 @@
 * Package Import-Export renamed to Kernel-ImportExport
 * A dozen of methods moved from Object to ProtoObject
 
-
-+ Package
-  + >>load
-  + >>loadFromNamespace:
-+ Package class
-  + >>load:
-  + >>load:fromNamespace:
-+ PackageTransport
-  + >>load
-+ PackageHandler
-  + >>load:
-+ AmdPackageHandler
-  + >>load:
-
-- HTMLCanvas class
+* HashedCollection >> at:ifAbsentPut: pushed up to SequenceableCollection
+* HashedCollection >> , is now allowed (removed shouldNotImplement)
+* HashedCollection and Dictionary both subclasses of AssociativeCollection
+* Smalltalk class moved to SmalltalkImage class, Smalltalk is now global var
+* Smalltalk current deprecated in favour of Smalltalk
+* Smalltalk at:[put:] deprecated in favour of Smalltalk globals at:[put:]
+* <smalltalk.ClassName> deprecated in favour of <globals.ClassName>
+
++ CompiledMethod >>
+  + defaultProtocol
++ Behavior >>
+  + compile:protocol:
+  + removeProtocolIfEmpty:
++ Package >>
+  + load
+  + loadFromNamespace:
++ Package class >>
+  + load:
+  + load:fromNamespace:
++ PackageTransport >> load
++ PackageHandler >> load:
++ AmdPackageHandler >> load:
++ Set >> removeAll
++ AssociativeCollection class
++ BucketStore class
++ SmalltalkImage >> globals
++ SmalltalkImage >> vm
++ Smalltalk global variable
+
+- CompiledMethod >>
+  - category: (use #protocol:)
+  - defaultCategory
+- Behavior >> compile:category:
+- HTMLCanvas class >>
   - browserVersion
+  - isMSIE
   - isMozilla
   - isOpera
   - isWebkit
@@ -29,21 +49,20 @@
 * Collection >> contains: is deprecated in favor of anySatisfy:
 
 
-+ Announcer
-  + >>on:doOnce:
-+ String
-  + >>uriEncoded
-  + >>uriDecoded
-  + >>uriComponentEncoded
-  + >>uriComponentDecoded
-+ Collection
-  + >>removeAll
-  + >>ifEmpty:ifNotEmpty:
-  + >>ifNotEmpty:ifEmpty:
-  + >>anyOne
-  + >>noneSatisfy:
-  + >>anySatisfy:
-  + >>allSatisfy:
++ Announcer >> on:doOnce:
++ String >>
+  + uriEncoded
+  + uriDecoded
+  + uriComponentEncoded
+  + uriComponentDecoded
++ Collection >>
+  + removeAll
+  + ifEmpty:ifNotEmpty:
+  + ifNotEmpty:ifEmpty:
+  + anyOne
+  + noneSatisfy:
+  + anySatisfy:
+  + allSatisfy:
 
 
 0.12.0:
@@ -56,50 +75,50 @@
   * support transport types and commit channels
 
 
-+ Node
-  + >>nextChild
-  + >>method
-  + >>postCopy
-  + >>isCascadeNode
-  + >>isLastChild
-+ BlockNode
-  + >>nextNode:
-  + >>nextChild
-+ SendNode
-  + >>isCascadeSendNode
-  + >>shouldBeAliased
-+ CompiledMethod>>sendTo:arguments:
-+ Array
-  + >>addFirst:
-  + >>removeLast
-+ Number
-  + >>ceiling
-  + >>floor
-  + >>asNumber
-  + >>//
-  + >>cos
-  + >>sin
-  + >>tan
-  + >>arcCos
-  + >>arcSin
-  + >>arcTan
-  + >>log
-  + >>log:
-  + >>raisedTo:
-  + >>sign
-  + >>**
-  + >>ln
-  + >>e
-+ String
-  + class>>esc
-  + >>asMutator
-  + >>capitalized
-  + >>isCapitalized
-+ JSProxy>>printString
-+ Behavior
-  + >>ownProtocols
-  + >>ownMethods
-+ JSStream>>nextPutSendIndexFor:
++ Node >>
+  + nextChild
+  + method
+  + postCopy
+  + isCascadeNode
+  + isLastChild
++ BlockNode >>
+  + nextNode:
+  + nextChild
++ SendNode >>
+  + isCascadeSendNode
+  + shouldBeAliased
++ CompiledMethod >> sendTo:arguments:
++ Array >>
+  + addFirst:
+  + removeLast
++ Number >>
+  + ceiling
+  + floor
+  + asNumber
+  + //
+  + cos
+  + sin
+  + tan
+  + arcCos
+  + arcSin
+  + arcTan
+  + log
+  + log:
+  + raisedTo:
+  + sign
+  + **
+  + ln
+  + e
++ String class >> esc
++ String >>
+  + asMutator
+  + capitalized
+  + isCapitalized
++ JSProxy >> printString
++ Behavior >>
+  + ownProtocols
+  + ownMethods
++ JSStream >> nextPutSendIndexFor:
 + InterfacingObject class
 + Interpreter class
 + DocumentFragmentTag class
@@ -107,8 +126,8 @@
 + PlatformInterface class
 
 
-- Node>>extent
-- JSStream>>nextPutStatement:with:
+- Node >> extent
+- JSStream >> nextPutStatement:with:
 - Smalltalk.installSuperclass()
 - ClassReferenceNode class (now handled via VariableNode)
 

+ 4 - 1
CHANGELOG

@@ -6,8 +6,11 @@ Highlights:
 * JQuery updated to ~1.10.2; jquery-ui updated to match
 * You can create subclasses of `nil`
 * Amber loads in IE8
+* You can load amber.js asynchronously (it must
+  have id 'amber-path-mapper' in that case)
+* CodeMirror updated to ~3.20.0
 
-Commits: https://github.com/amber-smalltalk/amber/compare/0.12.2...0.12.2
+Commits: https://github.com/amber-smalltalk/amber/compare/0.12.2...0.12.3
 Issues:  https://github.com/amber-smalltalk/amber/issues?milestone=__&state=closed
 
 For the most important API related changes see the file API-CHANGES.txt.

+ 2 - 2
LICENSE

@@ -1,5 +1,5 @@
-Copyright (C) 2011-2013 Nicolas Petton <petton.nicolas@gmail.com>
-Copyright (C) 2011-2013 Amber contributors https://github.com/NicolasPetton/amber/contributors
+Copyright (C) 2011-2014 Nicolas Petton <petton.nicolas@gmail.com>
+Copyright (C) 2011-2014 Amber contributors https://github.com/NicolasPetton/amber/contributors
 
 Parts of Amber take ideas from Clamato (http://clamato.net), written by Avi Bryant.
 

+ 19 - 3
README.md

@@ -18,11 +18,21 @@ Some highlights:
 -    Amber can use Javascript libraries and the current IDE is built on [jQuery](http://www.jquery.com)
 -    You can inline Javascript code and there are many ways to interact between Amber and Javascript
 
+Getting Amber
+-------------
 
-License
--------
+Amber is shipped as a [npm](http://npmjs.org) package for its CLI tools and as a [bower](https://github.com/bower/bower) package for the client-side.
 
-Amber is released under the MIT license. All contributions made for inclusion are considered to be under MIT.
+    # Install the CLI tool `amber`
+    npm install -g amber
+    
+    # Load amber via bower in your project
+    bower install amber
+    
+    # Serve amber on localhost:4000
+    amber serve
+
+The [Getting started](https://github.com/amber-smalltalk/amber/wiki/Getting-started) page shows more details on ways to obtain Amber and start a project.
 
 Building Amber
 --------------
@@ -32,6 +42,12 @@ Please refer to [CONTRIBUTING.md](CONTRIBUTING.md) for further details.
 It explains the Amber development setup and how to contribute.
 
 
+License
+-------
+
+Amber is released under the MIT license. All contributions made for inclusion are considered to be under MIT.
+
+
 More infos
 ----------
 

+ 1 - 1
bower.json

@@ -16,7 +16,7 @@
     "jquery-tabby": "git://github.com/alanhogan/Tabby",
 	"jquery-mousewheel": "git://github.com/brandonaaron/jquery-mousewheel",
     "es5-shim": "~2.1.0",
-    "codemirror": "~3.13.0",
+    "codemirror": "~3.20.0",
     "showdown": "~0.3.1",
     "require-css": "~0.0.8"
   }

+ 175 - 102
cli/js/AmberCli.js

@@ -8,7 +8,7 @@ smalltalk.AmberCli.comment="I am the Amber CLI (CommandLine Interface) tool whic
 smalltalk.addMethod(
 smalltalk.method({
 selector: "commandLineSwitches",
-category: 'commandline',
+protocol: 'commandline',
 fn: function (){
 var self=this;
 var switches;
@@ -40,7 +40,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleArguments:",
-category: 'commandline',
+protocol: 'commandline',
 fn: function (args){
 var self=this;
 var selector;
@@ -63,7 +63,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "help:",
-category: 'commands',
+protocol: 'commands',
 fn: function (args){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -84,7 +84,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "main",
-category: 'startup',
+protocol: 'startup',
 fn: function (){
 var self=this;
 var args,nodeMinorVersion;
@@ -122,7 +122,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "repl:",
-category: 'commands',
+protocol: 'commands',
 fn: function (args){
 var self=this;
 function $Repl(){return smalltalk.Repl||(typeof Repl=="undefined"?nil:Repl)}
@@ -141,7 +141,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "selectorForCommandLineSwitch:",
-category: 'commandline',
+protocol: 'commandline',
 fn: function (aSwitch){
 var self=this;
 var command,selector;
@@ -171,7 +171,7 @@ smalltalk.AmberCli.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "serve:",
-category: 'commands',
+protocol: 'commands',
 fn: function (args){
 var self=this;
 function $FileServer(){return smalltalk.FileServer||(typeof FileServer=="undefined"?nil:FileServer)}
@@ -193,7 +193,7 @@ smalltalk.FileServer.comment="I am the Amber Smalltalk FileServer.\x0aMy runtime
 smalltalk.addMethod(
 smalltalk.method({
 selector: "base64Decode:",
-category: 'private',
+protocol: 'private',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -209,22 +209,22 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "basePath",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@basePath"];
 if(($receiver = $2) == nil || $receiver == null){
-$1="./";
+$1=_st(self._class())._defaultBasePath();
 } else {
 $1=$2;
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"basePath",{},smalltalk.FileServer)})},
 args: [],
-source: "basePath\x0a\x09^basePath ifNil: ['./']",
-messageSends: ["ifNil:"],
+source: "basePath\x0a\x09^basePath ifNil: [self class defaultBasePath]",
+messageSends: ["ifNil:", "defaultBasePath", "class"],
 referencedClasses: []
 }),
 smalltalk.FileServer);
@@ -232,15 +232,16 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "basePath:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@basePath"]=aString;
+self._validateBasePath();
 return self}, function($ctx1) {$ctx1.fill(self,"basePath:",{aString:aString},smalltalk.FileServer)})},
 args: ["aString"],
-source: "basePath: aString\x0a\x09basePath := aString",
-messageSends: [],
+source: "basePath: aString\x0a\x09basePath := aString.\x0a\x09self validateBasePath.",
+messageSends: ["validateBasePath"],
 referencedClasses: []
 }),
 smalltalk.FileServer);
@@ -248,45 +249,42 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "checkDirectoryLayout",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$3,$1,$6,$8,$7,$5,$9;
-$2=self["@fs"];
-$4=self._basePath();
-$ctx1.sendIdx["basePath"]=1;
-$3=_st($4).__comma("index.html");
-$ctx1.sendIdx[","]=1;
-$1=_st($2)._existsSync_($3);
+var $1,$3,$5,$4,$2,$6;
+$1=_st(self["@fs"])._existsSync_(self._withBasePath_("index.html"));
 $ctx1.sendIdx["existsSync:"]=1;
 if(! smalltalk.assert($1)){
 _st(console)._warn_("Warning: project directory does not contain index.html.");
 $ctx1.sendIdx["warn:"]=1;
 _st(console)._warn_("    You can specify the directory containing index.html with --base-path.");
 $ctx1.sendIdx["warn:"]=2;
-};
-_st(console)._warn_("    You can also specify a custom error page with --fallback-page.");
+_st(console)._warn_("    You can also specify a page to be served by default,");
 $ctx1.sendIdx["warn:"]=3;
-$6=self["@fs"];
-$8=self._basePath();
-$ctx1.sendIdx["basePath"]=2;
-$7=_st($8).__comma("st");
-$ctx1.sendIdx[","]=2;
-$5=_st($6)._existsSync_($7);
+_st(console)._warn_("    for all paths that do not map to a file, with --fallback-page.");
+$ctx1.sendIdx["warn:"]=4;
+};
+$3=self["@fs"];
+$5=self._basePath();
+$ctx1.sendIdx["basePath"]=1;
+$4=_st($5).__comma("st");
+$ctx1.sendIdx[","]=1;
+$2=_st($3)._existsSync_($4);
 $ctx1.sendIdx["existsSync:"]=2;
-if(! smalltalk.assert($5)){
+if(! smalltalk.assert($2)){
 _st(console)._warn_("Warning: project directory is missing an \x22st\x22 directory");
-$ctx1.sendIdx["warn:"]=4;
+$ctx1.sendIdx["warn:"]=5;
 };
-$9=_st(self["@fs"])._existsSync_(_st(self._basePath()).__comma("js"));
-if(! smalltalk.assert($9)){
+$6=_st(self["@fs"])._existsSync_(_st(self._basePath()).__comma("js"));
+if(! smalltalk.assert($6)){
 _st(console)._warn_("Warning: project directory is missing a \x22js\x22 directory");
 };
 return self}, function($ctx1) {$ctx1.fill(self,"checkDirectoryLayout",{},smalltalk.FileServer)})},
 args: [],
-source: "checkDirectoryLayout\x0a\x09(fs existsSync: self basePath, 'index.html') ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.].\x0a\x09\x09console warn: '    You can also specify a custom error page with --fallback-page.'.\x0a\x09(fs existsSync: self basePath, 'st') ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory is missing an \x22st\x22 directory'].\x0a\x09(fs existsSync: self basePath, 'js') ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory is missing a \x22js\x22 directory'].",
-messageSends: ["ifFalse:", "existsSync:", ",", "basePath", "warn:"],
+source: "checkDirectoryLayout\x0a\x09(fs existsSync:\x09(self withBasePath: 'index.html')) ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory does not contain index.html.'.\x0a\x09\x09console warn: '    You can specify the directory containing index.html with --base-path.'.\x0a\x09\x09console warn: '    You can also specify a page to be served by default,'.\x0a\x09\x09console warn: '    for all paths that do not map to a file, with --fallback-page.'].\x0a\x09(fs existsSync: self basePath, 'st') ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory is missing an \x22st\x22 directory'].\x0a\x09(fs existsSync: self basePath, 'js') ifFalse: [\x0a\x09\x09console warn: 'Warning: project directory is missing a \x22js\x22 directory'].",
+messageSends: ["ifFalse:", "existsSync:", "withBasePath:", "warn:", ",", "basePath"],
 referencedClasses: []
 }),
 smalltalk.FileServer);
@@ -294,7 +292,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fallbackPage",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -312,7 +310,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fallbackPage:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -328,7 +326,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleGETRequest:respondTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aRequest,aResponse){
 var self=this;
 var uri,filename;
@@ -354,7 +352,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleOPTIONSRequest:respondTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aRequest,aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -381,7 +379,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handlePUTRequest:respondTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aRequest,aResponse){
 var self=this;
 var file,stream;
@@ -437,7 +435,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleRequest:respondTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aRequest,aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -471,7 +469,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "host",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -489,7 +487,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "host:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (hostname){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -505,7 +503,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -538,7 +536,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isAuthenticated:",
-category: 'private',
+protocol: 'private',
 fn: function (aRequest){
 var self=this;
 var header,token,auth,parts;
@@ -605,7 +603,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "password:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aPassword){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -621,7 +619,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "port",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -639,7 +637,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "port:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aNumber){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -655,7 +653,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "require:",
-category: 'private',
+protocol: 'private',
 fn: function (aModuleString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -673,7 +671,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondAuthenticationRequiredTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -692,7 +690,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondCreatedTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -713,7 +711,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondFileNamed:to:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aFilename,aResponse){
 var self=this;
 var type,filename;
@@ -760,7 +758,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondInternalErrorTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -779,7 +777,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondNotCreatedTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -798,7 +796,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondNotFoundTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -817,7 +815,7 @@ _st(aResponse)._write_("<p>Did you forget to put an index.html file into the dir
 $ctx1.sendIdx["write:"]=2;
 _st(aResponse)._write_("<li>create an index.html in the served directory.</li>");
 $ctx1.sendIdx["write:"]=3;
-_st(aResponse)._write_("<li>can also specify the location of a page to display instead of this error page with the \x22--fallback-page\x22 option.</li>");
+_st(aResponse)._write_("<li>can also specify the location of a page to be served whenever path does not resolve to a file with the \x22--fallback-page\x22 option.</li>");
 $ctx1.sendIdx["write:"]=4;
 _st(aResponse)._write_("<li>change the directory to be served with the \x22--base-path\x22 option.</li>");
 $ctx1.sendIdx["write:"]=5;
@@ -825,7 +823,7 @@ _st(aResponse)._write_("</ul></p></body></html>");
 $4=_st(aResponse)._end();
 return self}, function($ctx1) {$ctx1.fill(self,"respondNotFoundTo:",{aResponse:aResponse},smalltalk.FileServer)})},
 args: ["aResponse"],
-source: "respondNotFoundTo: aResponse\x0a\x09self fallbackPage isNil ifFalse: [^self respondFileNamed: self fallbackPage to: aResponse].\x0a\x09aResponse \x0a\x09\x09writeHead: 404 options: #{'Content-Type' -> 'text/html'};\x0a\x09\x09write: '<html><body><p>404 Not found</p>';\x0a\x09\x09write: '<p>Did you forget to put an index.html file into the directory which is served by \x22bin/amber serve\x22? To solve this you can:<ul>';\x0a\x09\x09write: '<li>create an index.html in the served directory.</li>';\x0a\x09\x09write: '<li>can also specify the location of a page to display instead of this error page with the \x22--fallback-page\x22 option.</li>';\x0a\x09\x09write: '<li>change the directory to be served with the \x22--base-path\x22 option.</li>';\x0a\x09\x09write: '</ul></p></body></html>';\x0a\x09\x09end",
+source: "respondNotFoundTo: aResponse\x0a\x09self fallbackPage isNil ifFalse: [^self respondFileNamed: self fallbackPage to: aResponse].\x0a\x09aResponse \x0a\x09\x09writeHead: 404 options: #{'Content-Type' -> 'text/html'};\x0a\x09\x09write: '<html><body><p>404 Not found</p>';\x0a\x09\x09write: '<p>Did you forget to put an index.html file into the directory which is served by \x22bin/amber serve\x22? To solve this you can:<ul>';\x0a\x09\x09write: '<li>create an index.html in the served directory.</li>';\x0a\x09\x09write: '<li>can also specify the location of a page to be served whenever path does not resolve to a file with the \x22--fallback-page\x22 option.</li>';\x0a\x09\x09write: '<li>change the directory to be served with the \x22--base-path\x22 option.</li>';\x0a\x09\x09write: '</ul></p></body></html>';\x0a\x09\x09end",
 messageSends: ["ifFalse:", "isNil", "fallbackPage", "respondFileNamed:to:", "writeHead:options:", "->", "write:", "end"],
 referencedClasses: []
 }),
@@ -834,7 +832,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "respondOKTo:",
-category: 'request handling',
+protocol: 'request handling',
 fn: function (aResponse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -855,7 +853,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "start",
-category: 'starting',
+protocol: 'starting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -901,7 +899,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "startOn:",
-category: 'starting',
+protocol: 'starting',
 fn: function (aPort){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -918,7 +916,7 @@ smalltalk.FileServer);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "username:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aUsername){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -931,10 +929,69 @@ referencedClasses: []
 }),
 smalltalk.FileServer);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "validateBasePath",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$7,$6,$5,$8,$9;
+$1=self["@fs"];
+$2=self._basePath();
+$ctx1.sendIdx["basePath"]=1;
+_st($1)._stat_then_($2,(function(err,stat){
+return smalltalk.withContext(function($ctx2) {
+if(($receiver = err) == nil || $receiver == null){
+$3=_st(stat)._isDirectory();
+if(! smalltalk.assert($3)){
+$4=console;
+$7=self._basePath();
+$ctx2.sendIdx["basePath"]=2;
+$6="Warning: --base-path parameter ".__comma($7);
+$ctx2.sendIdx[","]=2;
+$5=_st($6).__comma(" is not a directory.");
+$ctx2.sendIdx[","]=1;
+return _st($4)._warn_($5);
+$ctx2.sendIdx["warn:"]=1;
+};
+} else {
+$8=console;
+$9=_st("Warning: path at --base-path parameter ".__comma(self._basePath())).__comma(" does not exist.");
+$ctx2.sendIdx[","]=3;
+return _st($8)._warn_($9);
+};
+}, function($ctx2) {$ctx2.fillBlock({err:err,stat:stat},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"validateBasePath",{},smalltalk.FileServer)})},
+args: [],
+source: "validateBasePath\x0a\x09\x22The basePath must be an existing directory. \x22\x0a\x09fs stat: self basePath then: [ :err :stat | err\x0a\x09\x09ifNil: [ stat isDirectory ifFalse: [ console warn: 'Warning: --base-path parameter ' , self basePath , ' is not a directory.' ]]\x0a\x09\x09ifNotNil: [ console warn: 'Warning: path at --base-path parameter ' , self basePath , ' does not exist.'  ]].",
+messageSends: ["stat:then:", "basePath", "ifNil:ifNotNil:", "ifFalse:", "isDirectory", "warn:", ","],
+referencedClasses: []
+}),
+smalltalk.FileServer);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "withBasePath:",
+protocol: 'private',
+fn: function (aBaseRelativePath){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@path"])._join_with_(self._basePath(),aBaseRelativePath);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"withBasePath:",{aBaseRelativePath:aBaseRelativePath},smalltalk.FileServer)})},
+args: ["aBaseRelativePath"],
+source: "withBasePath: aBaseRelativePath\x0a\x09\x22return a file path which is relative to the basePath.\x22\x0a\x09^\x09path join: self basePath with: aBaseRelativePath",
+messageSends: ["join:with:", "basePath"],
+referencedClasses: []
+}),
+smalltalk.FileServer);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "writeData:toFileNamed:",
-category: 'private',
+protocol: 'private',
 fn: function (data,aFilename){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -952,7 +1009,7 @@ smalltalk.FileServer.klass.iVarNames = ['mimeTypes'];
 smalltalk.addMethod(
 smalltalk.method({
 selector: "commandLineSwitches",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 var switches;
@@ -985,7 +1042,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "createServerWithArguments:",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (options){
 var self=this;
 var server,popFront,front,optionName,optionValue,switches;
@@ -1061,10 +1118,26 @@ referencedClasses: ["Array"]
 }),
 smalltalk.FileServer.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "defaultBasePath",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "./";
+}, function($ctx1) {$ctx1.fill(self,"defaultBasePath",{},smalltalk.FileServer.klass)})},
+args: [],
+source: "defaultBasePath\x0a\x09^ './'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.FileServer.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultHost",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -1080,7 +1153,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultMimeTypes",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -1914,7 +1987,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultPort",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -1930,7 +2003,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "main",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 var fileServer,args;
@@ -1967,7 +2040,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "mimeTypeFor:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -1988,7 +2061,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "mimeTypes",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2012,7 +2085,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "printHelp",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2035,7 +2108,7 @@ smalltalk.FileServer.klass);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "selectorForCommandLineSwitch:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aSwitch){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2061,7 +2134,7 @@ smalltalk.Repl.comment="I am a class representing a REPL (Read Evaluate Print Lo
 smalltalk.addMethod(
 smalltalk.method({
 selector: "addVariableNamed:to:",
-category: 'private',
+protocol: 'private',
 fn: function (aString,anObject){
 var self=this;
 var newClass,newObject;
@@ -2084,7 +2157,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "assignNewVariable:do:",
-category: 'private',
+protocol: 'private',
 fn: function (buffer,aBlock){
 var self=this;
 function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
@@ -2134,7 +2207,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "clearScreen",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 var esc,cls;
@@ -2159,7 +2232,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "close",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2175,7 +2248,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "commands",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2193,7 +2266,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "createInterface",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2223,7 +2296,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "encapsulateVariable:withValue:in:",
-category: 'private',
+protocol: 'private',
 fn: function (aString,anObject,aClass){
 var self=this;
 var compiler;
@@ -2255,7 +2328,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "eval:",
-category: 'actions',
+protocol: 'actions',
 fn: function (buffer){
 var self=this;
 function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
@@ -2274,7 +2347,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "eval:on:",
-category: 'actions',
+protocol: 'actions',
 fn: function (buffer,anObject){
 var self=this;
 var result;
@@ -2310,7 +2383,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "executeCommand:",
-category: 'private',
+protocol: 'private',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2339,7 +2412,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
@@ -2361,7 +2434,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "instanceVariableNamesFor:",
-category: 'private',
+protocol: 'private',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2387,7 +2460,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isIdentifier:",
-category: 'private',
+protocol: 'private',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2405,7 +2478,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isVariableDefined:",
-category: 'private',
+protocol: 'private',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2423,7 +2496,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "nextResultName",
-category: 'private',
+protocol: 'private',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2447,7 +2520,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onKeyPress:",
-category: 'private',
+protocol: 'private',
 fn: function (key){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2470,7 +2543,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "parseAssignment:do:",
-category: 'private',
+protocol: 'private',
 fn: function (aString,aBlock){
 var self=this;
 var assignment;
@@ -2504,7 +2577,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "presentResultNamed:withValue:",
-category: 'private',
+protocol: 'private',
 fn: function (varName,value){
 var self=this;
 function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
@@ -2530,7 +2603,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "printWelcome",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
@@ -2558,7 +2631,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "processLine:",
-category: 'private',
+protocol: 'private',
 fn: function (buffer){
 var self=this;
 var show;
@@ -2588,7 +2661,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "prompt",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2604,7 +2677,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setPreviousVariablesFor:from:",
-category: 'private',
+protocol: 'private',
 fn: function (newObject,oldObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2623,7 +2696,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setPrompt",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2639,7 +2712,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setupCommands",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
@@ -2666,7 +2739,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setupHotkeys",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2689,7 +2762,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "subclass:withVariable:",
-category: 'private',
+protocol: 'private',
 fn: function (aClass,varName){
 var self=this;
 function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
@@ -2708,7 +2781,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "subclassNameFor:",
-category: 'private',
+protocol: 'private',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -2745,7 +2818,7 @@ smalltalk.Repl);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "main",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 

+ 25 - 7
cli/st/AmberCli.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'AmberCli'!
+Smalltalk createPackage: 'AmberCli'!
 Object subclass: #AmberCli
 	instanceVariableNames: ''
 	package: 'AmberCli'!
@@ -126,11 +126,12 @@ Adding new commandline parameters to `FileServer` is as easy as adding a new sin
 !FileServer methodsFor: 'accessing'!
 
 basePath
-	^basePath ifNil: ['./']
+	^basePath ifNil: [self class defaultBasePath]
 !
 
 basePath: aString
-	basePath := aString
+	basePath := aString.
+	self validateBasePath.
 !
 
 fallbackPage
@@ -168,10 +169,11 @@ username: aUsername
 !FileServer methodsFor: 'initialization'!
 
 checkDirectoryLayout
-	(fs existsSync: self basePath, 'index.html') ifFalse: [
+	(fs existsSync:	(self withBasePath: 'index.html')) ifFalse: [
 		console warn: 'Warning: project directory does not contain index.html.'.
-		console warn: '    You can specify the directory containing index.html with --base-path.'.].
-		console warn: '    You can also specify a custom error page with --fallback-page.'.
+		console warn: '    You can specify the directory containing index.html with --base-path.'.
+		console warn: '    You can also specify a page to be served by default,'.
+		console warn: '    for all paths that do not map to a file, with --fallback-page.'].
 	(fs existsSync: self basePath, 'st') ifFalse: [
 		console warn: 'Warning: project directory is missing an "st" directory'].
 	(fs existsSync: self basePath, 'js') ifFalse: [
@@ -228,6 +230,18 @@ require: aModuleString
 	^require value: aModuleString
 !
 
+validateBasePath
+	"The basePath must be an existing directory. "
+	fs stat: self basePath then: [ :err :stat | err
+		ifNil: [ stat isDirectory ifFalse: [ console warn: 'Warning: --base-path parameter ' , self basePath , ' is not a directory.' ]]
+		ifNotNil: [ console warn: 'Warning: path at --base-path parameter ' , self basePath , ' does not exist.'  ]].
+!
+
+withBasePath: aBaseRelativePath
+	"return a file path which is relative to the basePath."
+	^	path join: self basePath with: aBaseRelativePath
+!
+
 writeData: data toFileNamed: aFilename
 	console log: aFilename
 ! !
@@ -343,7 +357,7 @@ respondNotFoundTo: aResponse
 		write: '<html><body><p>404 Not found</p>';
 		write: '<p>Did you forget to put an index.html file into the directory which is served by "bin/amber serve"? To solve this you can:<ul>';
 		write: '<li>create an index.html in the served directory.</li>';
-		write: '<li>can also specify the location of a page to display instead of this error page with the "--fallback-page" option.</li>';
+		write: '<li>can also specify the location of a page to be served whenever path does not resolve to a file with the "--fallback-page" option.</li>';
 		write: '<li>change the directory to be served with the "--base-path" option.</li>';
 		write: '</ul></p></body></html>';
 		end
@@ -393,6 +407,10 @@ commandLineSwitches
 	^switches
 !
 
+defaultBasePath
+	^ './'
+!
+
 defaultHost
 	^'127.0.0.1'
 !

File diff suppressed because it is too large
+ 405 - 196
cli/support/amber-cli.js


+ 1 - 1
cli/support/amberc-cli.js

@@ -32,7 +32,7 @@ compiler.main(configuration);
 function handle_options(optionsArray) {
 	var programName = [];
 	var currentItem = optionsArray.shift();
-	var defaults = amberc.createDefaults();
+	var defaults = amberc.createDefaultConfiguration();
 
 	while(undefined !== currentItem) {
 		switch(currentItem) {

+ 309 - 379
cli/support/amberc.js

@@ -6,43 +6,7 @@
  *     var options = amberc.createDefaults();
  *     // edit options entries
  *     compiler.main(options);
- *
- * Execute 'node compiler.js' without arguments or with -h / --help for help.
- */
-
-/**
- * Map the async filter function onto array and evaluate callback, once all have finished.
- * Taken from: http://howtonode.org/control-flow-part-iii
- */
-function async_map(array, filter, callback) {
-	if (0 === array.length) {
-		callback(null, null);
-		return;
-	}
-	var counter = array.length;
-	var new_array = [];
-	array.forEach(function (item, index) {
-		filter(item, function (err, result) {
-			if (err) { callback(err); return; }
-			new_array[index] = result;
-			counter--;
-			if (counter === 0) {
-				callback(null, new_array);
-			}
-		});
-	});
-}
-
-
-/**
- * Always evaluates the callback parameter.
- * Used by Combo blocks to always call the next function,
- * even if all of the other functions did not run.
  */
-function always_resolve(callback) {
-	callback();
-}
-
 
 /**
  * Helper for concatenating Amber generated AMD modules.
@@ -73,7 +37,7 @@ function createConcatenator () {
 		},
 		start: function () {
 			this.add(
-				'var define = (' + require('amdefine') + ')(), requirejs = define.require;',
+				'var define = (' + require('amdefine') + ')(null, function (id) { throw new Error("Dependency not found: " +  id); }), requirejs = define.require;',
 				'define("amber_vm/browser-compatibility", [], {});'
 			);
 		},
@@ -92,38 +56,10 @@ function createConcatenator () {
 	};
 }
 
-/**
- * Combine several async functions and evaluate callback once all of them have finished.
- * Taken from: http://howtonode.org/control-flow
- */
-function Combo(callback) {
-	this.callback = callback;
-	this.items = 0;
-	this.results = [];
-}
-
-Combo.prototype = {
-	add: function () {
-		var self = this,
-		id = this.items;
-		this.items++;
-		return function () {
-			self.check(id, arguments);
-		};
-	},
-	check: function (id, theArguments) {
-		this.results[id] = Array.prototype.slice.call(theArguments);
-		this.items--;
-		if (this.items === 0) {
-			this.callback.apply(this, this.results);
-		}
-	}
-};
 
 var path = require('path'),
-	util = require('util'),
 	fs = require('fs'),
-	exec = require('child_process').exec;
+	Promise = require('es6-promise').Promise;
 
 /**
  * AmberC constructor function.
@@ -135,7 +71,7 @@ function AmberC(amber_dir) {
 	}
 
 	this.amber_dir = amber_dir;
-	this.kernel_libraries = ['boot', 'smalltalk', 'nil', '_st', 'Kernel-Objects', 'Kernel-Classes', 'Kernel-Methods',
+	this.kernel_libraries = ['boot', 'smalltalk', 'globals', 'nil', '_st', 'Kernel-Objects', 'Kernel-Classes', 'Kernel-Methods',
 							'Kernel-Collections', 'Kernel-Infrastructure', 'Kernel-Exceptions', 'Kernel-Transcript',
 							'Kernel-Announcements'];
 	this.compiler_libraries = this.kernel_libraries.concat(['parser', 'Kernel-ImportExport', 'Compiler-Exceptions',
@@ -146,7 +82,7 @@ function AmberC(amber_dir) {
 /**
  * Default values.
  */
-var createDefaults = function(finished_callback){
+var createDefaultConfiguration = function() {
 	return {
 		'load': [],
 		'main': undefined,
@@ -164,23 +100,18 @@ var createDefaults = function(finished_callback){
 		'compiled': [],
 		'program': undefined,
 		'output_dir': undefined,
-		'verbose': false,
-		'finished_callback': finished_callback
+		'verbose': false
 	};
 };
 
 
 /**
  * Main function for executing the compiler.
- * If check_configuration_ok() returns successfully the configuration is set on the current compiler
- * instance and check_for_closure_compiler() gets called.
- * The last step is to call collect_files().
+ * If check_configuration_ok() returns successfully
+ * the configuration is used to trigger the following compilation steps.
  */
 AmberC.prototype.main = function(configuration, finished_callback) {
 	console.time('Compile Time');
-	if (undefined !== finished_callback) {
-		configuration.finished_callback = finished_callback;
-	}
 
 	if (configuration.amd_namespace.length === 0) {
 		configuration.amd_namespace = 'amber_core';
@@ -196,115 +127,105 @@ AmberC.prototype.main = function(configuration, finished_callback) {
 		console.log = function() {};
 	}
 
-	if (this.check_configuration_ok(configuration)) {
-		this.defaults = configuration;
-		this.defaults.smalltalk = {}; // the evaluated compiler will be stored in this variable (see create_compiler)
-		this.collect_files(this.defaults.stFiles, this.defaults.jsFiles)
-	}
+	// the evaluated compiler will be stored in this variable (see create_compiler)
+	configuration.smalltalk = {};
+	configuration.kernel_libraries = this.kernel_libraries;
+	configuration.compiler_libraries = this.compiler_libraries;
+	configuration.amber_dir = this.amber_dir;
+
+	check_configuration(configuration)
+	.then(collect_st_files)
+	.then(collect_js_files)
+	.then(resolve_kernel)
+	.then(create_compiler)
+	.then(compile)
+	.then(category_export)
+	.then(verify)
+	.then(compose_js_files)
+	.then(function () {
+		console.timeEnd('Compile Time');
+	}, function(error) {
+		console.error(error);
+	})
+	.then(function () {
+		console.log = console.ambercLog;
+		finished_callback && finished_callback();
+	});
 };
 
 
 /**
- * Check if the passed in configuration object has sufficient/nonconflicting values
+ * Check if the passed in configuration object has sufficient/nonconflicting values.
+ * Returns a Promise which resolves into the configuration object.
  */
-AmberC.prototype.check_configuration_ok = function(configuration) {
-	if (undefined === configuration) {
-		throw new Error('AmberC.check_configuration_ok(): missing configuration object');
-	}
+function check_configuration(configuration) {
+	return new Promise(function(resolve, reject) {
+		if (undefined === configuration) {
+			reject(Error('AmberC.check_configuration_ok(): missing configuration object'));
+		}
 
-	if (0 === configuration.jsFiles.length && 0 === configuration.stFiles.length) {
-		throw new Error('AmberC.check_configuration_ok(): no files to compile/link specified in configuration object');
-	}
-	return true;
+		if (0 === configuration.jsFiles.length && 0 === configuration.stFiles.length) {
+			reject(Error('AmberC.check_configuration_ok(): no files to compile/link specified in configuration object'));
+		}
+
+		resolve(configuration);
+	});
 };
 
 
 /**
  * Check if the file given as parameter exists in any of the following directories:
  *  1. current local directory
- *  2. defauls.jsLibraryDirs
+ *  2. configuration.jsLibraryDirs
  *  3. $AMBER/js/
  *  3. $AMBER/support/
  *
  * @param filename name of a file without '.js' prefix
- * @param callback gets called on success with path to .js file as parameter
+ * @param configuration the main amberc configuration object
  */
-AmberC.prototype.resolve_js = function(filename, callback) {
+function resolve_js(filename, configuration) {
 	var baseName = path.basename(filename, '.js');
-	var jsFile = baseName + this.defaults.loadsuffix + '.js';
-	var defaults = this.defaults;
-	console.log('Resolving: ' + jsFile);
-	fs.exists(jsFile, function(exists) {
-		if (exists) {
-			callback(jsFile);
-		} else {
-			var amberJsFile = '';
-			// check for specified .js file in any of the directories from jsLibraryDirs
-			var found = defaults.jsLibraryDirs.some(function(directory) {
-				amberJsFile = path.join(directory, jsFile);
-				return fs.existsSync(amberJsFile);
-			});
-			if (found) {
-				callback(amberJsFile);
-			} else {
-				throw(new Error('JavaScript file not found: ' + jsFile));
-			}
-		}
-	});
+	var jsFile = baseName + configuration.loadsuffix + '.js';
+	return resolve_file(jsFile, configuration.jsLibraryDirs);
 };
 
 
 /**
- * Collect libraries and Smalltalk files looking
- * both locally and in $AMBER/js and $AMBER/st.
- * Followed by resolve_libraries().
+ * Check if the file given as parameter exists in any of the following directories:
+ *  1. current local directory
+ *  2. $AMBER/
+ *
+ * @param filename name of a .st file
+ * @param configuration the main amberc configuration object
  */
-AmberC.prototype.collect_files = function(stFiles, jsFiles) {
-	var self = this;
-	var collected_files = new Combo(function() {
-		self.resolve_libraries();
-	});
-	if (0 !== stFiles.length) {
-		self.collect_st_files(stFiles, collected_files.add());
-	}
-	if (0 !== jsFiles.length) {
-		self.collect_js_files(jsFiles, collected_files.add());
-	}
+function resolve_st(filename, configuration) {
+	return resolve_file(filename, [configuration.amber_dir]);
 };
 
 
 /**
- * Resolve st files given by stFiles and add them to defaults.compile.
- * Respective categories get added to defaults.compile_categories.
- * callback is evaluated afterwards.
+ * Resolve the location of a file given as parameter filename.
+ * First check if the file exists at given location,
+ * then check in each of the directories specified in parameter searchDirectories.
  */
-AmberC.prototype.collect_st_files = function(stFiles, callback) {
-	var defaults = this.defaults;
-	var self = this;
-	var collected_st_files = new Combo(function() {
-		Array.prototype.slice.call(arguments).forEach(function(data) {
-			var stFile = data[0];
-			defaults.compile.push(stFile);
-		});
-		callback();
-	});
-
-	stFiles.forEach(function(stFile) {
-		var _callback = collected_st_files.add();
-		console.log('Checking: ' + stFile);
-		var amberStFile = path.join(self.amber_dir, 'st', stFile);
-		fs.exists(stFile, function(exists) {
+function resolve_file(filename, searchDirectories) {
+	return new Promise(function(resolve, reject) {
+		console.log('Resolving: ' + filename);
+		fs.exists(filename, function(exists) {
 			if (exists) {
-				_callback(stFile);
+				resolve(filename);
 			} else {
-				console.log('Checking: ' + amberStFile);
-				fs.exists(amberStFile, function(exists) {
-					if (exists) {
-						_callback(amberStFile);
-					} else {
-						throw(new Error('Smalltalk file not found: ' + amberStFile));
-					}
+				var alternativeFile = '';
+				// check for filename in any of the given searchDirectories
+				var found = searchDirectories.some(function(directory) {
+					alternativeFile = path.join(directory, filename);
+					return fs.existsSync(alternativeFile);
 				});
+				if (found) {
+					resolve(alternativeFile);
+				} else {
+					reject(Error('File not found: ' + alternativeFile));
+				}
 			}
 		});
 	});
@@ -312,308 +233,317 @@ AmberC.prototype.collect_st_files = function(stFiles, callback) {
 
 
 /**
- * Resolve js files given by jsFiles and add them to defaults.libraries.
- * callback is evaluated afterwards.
+ * Resolve st files given by stFiles and add them to configuration.compile.
+ * Returns a Promise which resolves into the configuration object.
  */
-AmberC.prototype.collect_js_files = function(jsFiles, callback) {
-	var self = this;
-	var collected_js_files = new Combo(function() {
-		Array.prototype.slice.call(arguments).forEach(function(file) {
-			self.defaults.libraries.push(file[0]);
-		});
-		callback();
+function collect_st_files(configuration) {
+	return Promise.all(
+		configuration.stFiles.map(function(stFile) {
+			return resolve_st(stFile, configuration);
+		})
+	)
+	.then(function(data) {
+		configuration.compile = configuration.compile.concat(data);
+		return configuration;
 	});
-
-	jsFiles.forEach(function(jsFile) {
-		self.resolve_js(jsFile, collected_js_files.add());
-	});
-};
+}
 
 
 /**
- * Resolve kernel and compiler files.
- * Followed by resolve_init().
+ * Resolve js files given by jsFiles and add them to configuration.libraries.
+ * Returns a Promise which resolves into the configuration object.
  */
-AmberC.prototype.resolve_libraries = function() {
-	// Resolve libraries listed in this.kernel_libraries
-	var self = this;
-	var all_resolved = new Combo(function(resolved_kernel_files, resolved_compiler_files) {
-		self.create_compiler(resolved_compiler_files[0]);
+function collect_js_files(configuration) {
+	return Promise.all(
+		configuration.jsFiles.map(function(file) {
+			return resolve_js(file, configuration);
+		})
+	)
+	.then(function(data) {
+		configuration.libraries = configuration.libraries.concat(data);
+		return configuration;
 	});
-	this.resolve_kernel(all_resolved.add());
-	this.resolve_compiler(all_resolved.add());
-};
+}
 
 
 /**
- * Resolve .js files needed by kernel
- * callback is evaluated afterwards.
+ * Resolve .js files needed by kernel.
+ * Returns a Promise which resolves into the configuration object.
  */
-AmberC.prototype.resolve_kernel = function(callback) {
-	var self = this;
-	var kernel_files = this.kernel_libraries.concat(this.defaults.load);
-	var kernel_resolved = new Combo(function() {
-		var foundLibraries = [];
-		Array.prototype.slice.call(arguments).forEach(function(file) {
-			if (undefined !== file[0]) {
-				foundLibraries.push(file[0]);
-			}
-		});
+function resolve_kernel(configuration) {
+	var kernel_files = configuration.kernel_libraries.concat(configuration.load);
+	return Promise.all(
+		kernel_files.map(function(file) {
+			return resolve_js(file, configuration);
+		})
+	)
+	.then(function(data) {
 		// boot.js and Kernel files need to be used first
 		// otherwise the global smalltalk object is undefined
-		self.defaults.libraries = foundLibraries.concat(self.defaults.libraries);
-		callback(null);
+		configuration.libraries = data.concat(configuration.libraries);
+		return configuration;
 	});
-
-	kernel_files.forEach(function(file) {
-		self.resolve_js(file, kernel_resolved.add());
-	});
-
-	always_resolve(kernel_resolved.add());
-};
-
-
-/**
- * Resolve .js files needed by compiler.
- * callback is evaluated afterwards with resolved files as argument.
- */
-AmberC.prototype.resolve_compiler = function(callback) {
-	// Resolve compiler libraries
-	var compiler_files = this.compiler_libraries.concat(this.defaults.load);
-	var compiler_resolved = new Combo(function() {
-		var compilerFiles = [];
-		Array.prototype.slice.call(arguments).forEach(function(file) {
-			if (undefined !== file[0]) {
-				compilerFiles.push(file[0]);
-			}
-		});
-		callback(compilerFiles);
-	});
-	var self = this;
-	compiler_files.forEach(function(file) {
-		self.resolve_js(file, compiler_resolved.add());
-	});
-
-	always_resolve(compiler_resolved.add());
-};
+}
 
 
 /**
- * Read all .js files needed by compiler and eval() them.
- * The finished Compiler gets stored in defaults.smalltalk.
- * Followed by compile().
+ * Resolve .js files needed by compiler, read and eval() them.
+ * The finished Compiler gets stored in configuration.smalltalk.
+ * Returns a Promise object which resolves into the configuration object.
  */
-AmberC.prototype.create_compiler = function(compilerFilesArray) {
-	var self = this;
-	var compiler_files = new Combo(function() {
+function create_compiler(configuration) {
+	var compiler_files = configuration.compiler_libraries.concat(configuration.load);
+	return Promise.all(
+		compiler_files.map(function(file) {
+			return resolve_js(file, configuration);
+		})
+	)
+	.then(function(compilerFilesArray) {
+		return Promise.all(
+			compilerFilesArray.map(function(file) {
+				return new Promise(function(resolve, reject) {
+					console.log('Loading file: ' + file);
+					fs.readFile(file, function(err, data) {
+						if (err)
+							reject(err);
+						else
+							resolve(data);
+					});
+				});
+			})
+		)
+	})
+	.then(function(files) {
 		var builder = createConcatenator();
 		builder.add('(function() {');
 		builder.start();
 
-		Array.prototype.slice.call(arguments).forEach(function(data) {
+		files.forEach(function(data) {
 			// data is an array where index 0 is the error code and index 1 contains the data
-			builder.add(data[1]);
+			builder.add(data);
 			// matches and returns the "module_id" string in the AMD definition: define("module_id", ...)
-			var match = ('' + data[1]).match(/^define\("([^"]*)"/);
+			var match = ('' + data).match(/^define\("([^"]*)"/);
 			if (match) {
 				builder.addId(match[1]);
 			}
 		});
-		// store the generated smalltalk env in self.defaults.smalltalk
-		builder.finish('self.defaults.smalltalk = smalltalk;');
+		// store the generated smalltalk env in configuration.smalltalk
+		builder.finish('configuration.smalltalk = smalltalk;');
 		builder.add('})();');
+
 		eval(builder.toString());
+
 		console.log('Compiler loaded');
-		self.defaults.smalltalk.ErrorHandler._setCurrent_(self.defaults.smalltalk.RethrowErrorHandler._new());
 
-		if(0 !== self.defaults.jsGlobals.length) {
-			var jsGlobalVariables = self.defaults.smalltalk.globalJsVariables;
-			jsGlobalVariables.push.apply(jsGlobalVariables, self.defaults.jsGlobals);
-		}
+		configuration.smalltalk.ErrorHandler._register_(configuration.smalltalk.RethrowErrorHandler._new());
 
-		self.compile();
-	});
+		if(0 !== configuration.jsGlobals.length) {
+			var jsGlobalVariables = configuration.smalltalk.globalJsVariables;
+			jsGlobalVariables.push.apply(jsGlobalVariables, configuration.jsGlobals);
+		}
 
-	compilerFilesArray.forEach(function(file) {
-		console.log('Loading file: ' + file);
-		fs.readFile(file, compiler_files.add());
+		return configuration;
 	});
-};
+}
 
 
 /**
  * Compile all given .st files by importing them.
- * Followed by category_export().
+ * Returns a Promise object that resolves into the configuration object.
  */
-AmberC.prototype.compile = function() {
-	console.log('Compiling collected .st files');
-	// import .st files
-	var self = this;
-	var imports = new Combo(function() {
-		Array.prototype.slice.call(arguments).forEach(function(code) {
-			if (undefined !== code[0]) {
-				// get element 0 of code since all return values are stored inside an array by Combo
-				self.defaults.smalltalk.Importer._new()._import_(code[0]._stream());
-			}
-		});
-		self.category_export();
-	});
-
-	this.defaults.compile.forEach(function(stFile) {
-		var callback = imports.add();
-		if (/\.st/.test(stFile)) {
-			console.ambercLog('Importing: ' + stFile);
-			fs.readFile(stFile, 'utf8', function(err, data) {
-				if (!err)
-					callback(data);
-				else
-					throw new Error('Could not import: ' + stFile);
+function compile(configuration) {
+	// return function which does the actual work
+	// and use the compile function to reference the configuration object
+	return Promise.all(
+		configuration.compile.map(function(stFile) {
+			return new Promise(function(resolve, reject) {
+				if (/\.st/.test(stFile)) {
+					console.ambercLog('Importing: ' + stFile);
+					fs.readFile(stFile, 'utf8', function(err, data) {
+						if (!err)
+							resolve(data);
+						else
+							reject(Error('Could not import: ' + stFile));
+					});
+				}
 			});
-		}
+		})
+	)
+	.then(function(fileContents) {
+		console.log('Compiling collected .st files');
+		// import/compile content of .st files
+		return Promise.all(
+			fileContents.map(function(code) {
+				return new Promise(function(resolve, reject) {
+					var importer = configuration.smalltalk.Importer._new();
+					try {
+						importer._import_(code._stream());
+						resolve(true);
+					} catch (ex) {
+						reject(Error("Import error in section:\n" +
+							importer._lastSection() + "\n\n" +
+							"while processing chunk:\n" +
+							importer._lastChunk() + "\n\n" +
+							(ex._messageText && ex._messageText() || ex.message || ex))
+						);
+					}
+				});
+			})
+		);
+	})
+	.then(function () {
+		return configuration;
 	});
-	always_resolve(imports.add());
-};
+}
 
 
 /**
  * Export compiled categories to JavaScript files.
- * Followed by verify().
+ * Returns a Promise() that resolves into the configuration object.
  */
-AmberC.prototype.category_export = function() {
-	var defaults = this.defaults;
-	var self = this;
-	// export categories as .js
-	async_map(defaults.compile, function(stFile, callback) {
-		var category = path.basename(stFile, '.st');
-		var jsFilePath = defaults.output_dir;
-		if (undefined === jsFilePath) {
-			jsFilePath = path.dirname(stFile);
-		}
-		var jsFile = category + defaults.suffix_used + '.js';
-		jsFile = path.join(jsFilePath, jsFile);
-		defaults.compiled.push(jsFile);
-		var smalltalk = defaults.smalltalk;
-		var packageObject = smalltalk.Package._named_(category);
-		packageObject._transport()._namespace_(defaults.amd_namespace);
-		fs.writeFile(jsFile, smalltalk.String._streamContents_(function (stream) {
-			smalltalk.AmdExporter._new()._exportPackage_on_(packageObject, stream); }), function(err) {
-				callback(null, null);
+function category_export(configuration) {
+	return Promise.all(
+		configuration.compile.map(function(stFile) {
+			return new Promise(function(resolve, reject) {
+				var category = path.basename(stFile, '.st');
+				var jsFilePath = configuration.output_dir;
+				if (undefined === jsFilePath) {
+					jsFilePath = path.dirname(stFile);
+				}
+				var jsFile = category + configuration.suffix_used + '.js';
+				jsFile = path.join(jsFilePath, jsFile);
+				configuration.compiled.push(jsFile);
+				var smalltalk = configuration.smalltalk;
+				var packageObject = smalltalk.Package._named_(category);
+				packageObject._transport()._namespace_(configuration.amd_namespace);
+				fs.writeFile(jsFile, smalltalk.String._streamContents_(function (stream) {
+					smalltalk.AmdExporter._new()._exportPackage_on_(packageObject, stream);
+				}), function(err) {
+					if (err)
+						reject(err);
+					else
+						resolve(true);
+				});
 			});
-	}, function(err, result){
-		self.verify();
+		})
+	)
+	.then(function() {
+		return configuration;
 	});
-};
+}
 
 
 /**
  * Verify if all .st files have been compiled.
- * Followed by compose_js_files().
+ * Returns a Promise() that resolves into the configuration object.
  */
-AmberC.prototype.verify = function() {
+function verify(configuration) {
 	console.log('Verifying if all .st files were compiled');
-	var self = this;
-	// copy array
-	var compiledFiles = this.defaults.compiled.slice(0);
-
-	async_map(compiledFiles,
-		function(file, callback) {
-			fs.exists(file, function(exists) {
-				if (exists)
-					callback(null, null);
-				else
-					throw(new Error('Compilation failed of: ' + file));
+	return Promise.all(
+		configuration.compiled.map(function(file) {
+			return new Promise(function(resolve, reject) {
+				fs.exists(file, function(exists) {
+					if (exists)
+						resolve(true);
+					else
+						reject(Error('Compilation failed of: ' + file));
+				});
 			});
-		}, function(err, result) {
-			self.compose_js_files();
+		})
+	)
+	.then(function() {
+		return configuration;
 	});
-};
+}
 
 
 /**
  * Synchronous function.
  * Concatenates compiled JavaScript files into one file in the correct order.
- * The name of the produced file is given by defaults.program (set by the last commandline option).
+ * The name of the produced file is given by configuration.program.
+ * Returns a Promise which resolves into the configuration object.
  */
-AmberC.prototype.compose_js_files = function() {
-	var defaults = this.defaults;
-	var programFile = defaults.program;
-	if (undefined === programFile) {
-		return;
-	}
-	if (undefined !== defaults.output_dir) {
-		programFile = path.join(defaults.output_dir, programFile);
-	}
+function compose_js_files(configuration) {
+	return new Promise(function(resolve, reject) {
+		var programFile = configuration.program;
+		if (undefined === programFile) {
+			resolve(configuration);
+			return;
+		}
+		if (undefined !== configuration.output_dir) {
+			programFile = path.join(configuration.output_dir, programFile);
+		}
 
-	var program_files = [];
-	if (0 !== defaults.libraries.length) {
-		console.log('Collecting libraries: ' + defaults.libraries);
-		program_files.push.apply(program_files, defaults.libraries);
-	}
+		var program_files = [];
+		if (0 !== configuration.libraries.length) {
+			console.log('Collecting libraries: ' + configuration.libraries);
+			program_files.push.apply(program_files, configuration.libraries);
+		}
 
-	if (0 !== defaults.compiled.length) {
-		var compiledFiles = defaults.compiled.slice(0);
+		if (0 !== configuration.compiled.length) {
+			var compiledFiles = configuration.compiled.slice(0);
 
-		console.log('Collecting compiled files: ' + compiledFiles);
-		program_files.push.apply(program_files, compiledFiles);
-	}
+			console.log('Collecting compiled files: ' + compiledFiles);
+			program_files.push.apply(program_files, compiledFiles);
+		}
 
-	console.ambercLog('Writing program file: %s.js', programFile);
+		console.ambercLog('Writing program file: %s.js', programFile);
 
-	var fileStream = fs.createWriteStream(programFile + defaults.suffix_used + '.js');
-	fileStream.on('error', function(error) {
-		fileStream.end();
-		console.ambercLog(error);
-	});
+		var fileStream = fs.createWriteStream(programFile + configuration.suffix_used + '.js');
+		fileStream.on('error', function(error) {
+			fileStream.end();
+			console.ambercLog(error);
+			reject(error);
+		});
 
-	fileStream.on('close', function(){
-		return;
-	});
+		fileStream.on('close', function(){
+			resolve(configuration);
+		});
 
-	var builder = createConcatenator();
-	builder.add('#!/usr/bin/env node');
-	builder.start();
-
-	program_files.forEach(function(file) {
-		if(fs.existsSync(file)) {
-			console.log('Adding : ' + file);
-			var buffer = fs.readFileSync(file);
-			// matches and returns the "module_id" string in the AMD define: define("module_id", ...)
-			var match = buffer.toString().match(/^define\("([^"]*)"/);
-			if (match /*&& match[1].slice(0,9) !== "amber_vm/"*/) {
-				builder.addId(match[1]);
+		var builder = createConcatenator();
+		builder.add('#!/usr/bin/env node');
+		builder.start();
+
+		program_files.forEach(function(file) {
+			if(fs.existsSync(file)) {
+				console.log('Adding : ' + file);
+				var buffer = fs.readFileSync(file);
+				// matches and returns the "module_id" string in the AMD define: define("module_id", ...)
+				var match = buffer.toString().match(/^define\("([^"]*)"/);
+				if (match /*&& match[1].slice(0,9) !== "amber_vm/"*/) {
+					builder.addId(match[1]);
+				}
+				builder.add(buffer);
+			} else {
+				fileStream.end();
+				reject(Error('Can not find file ' + file));
 			}
-			builder.add(buffer);
-		} else {
-			fileStream.end();
-			throw(new Error('Can not find file ' + file));
-		}
-	});
+		});
 
-	var mainFunctionOrFile = '';
+		var mainFunctionOrFile = '';
 
-	if (undefined !== defaults.main) {
-		console.log('Adding call to: %s>>main', defaults.main);
-		mainFunctionOrFile += 'smalltalk.' + defaults.main + '._main();';
-	}
+		if (undefined !== configuration.main) {
+			console.log('Adding call to: %s>>main', configuration.main);
+			mainFunctionOrFile += 'smalltalk.' + configuration.main + '._main();';
+		}
 
-	if (undefined !== defaults.mainfile && fs.existsSync(defaults.mainfile)) {
-		console.log('Adding main file: ' + defaults.mainfile);
-		mainFunctionOrFile += '\n' + fs.readFileSync(defaults.mainfile);
-	}
+		if (undefined !== configuration.mainfile && fs.existsSync(configuration.mainfile)) {
+			console.log('Adding main file: ' + configuration.mainfile);
+			mainFunctionOrFile += '\n' + fs.readFileSync(configuration.mainfile);
+		}
 
-	builder.finish(mainFunctionOrFile);
+		builder.finish(mainFunctionOrFile);
 
-	console.log('Writing...');
-	builder.forEach(function (element) {
-		fileStream.write(element);
-		fileStream.write('\n');
+		console.log('Writing...');
+		builder.forEach(function (element) {
+			fileStream.write(element);
+			fileStream.write('\n');
+		});
+		console.log('Done.');
+		fileStream.end();
 	});
-	console.log('Done.');
-	fileStream.end();
-};
+}
 
 
 module.exports.Compiler = AmberC;
-module.exports.createDefaults = createDefaults;
-module.exports.Combo = Combo;
-module.exports.map = async_map;
+module.exports.createDefaultConfiguration = createDefaultConfiguration;

+ 3 - 3
css/helios.css

@@ -38,7 +38,7 @@ html[xmlns] .clearfix {
 }
 #helios .CodeMirror-hints {
   border-radius: 0;
-  font-family: Menlo, Monaco, "Lucida Console", Courier, monospace;
+  font-family: Menlo, Monaco, Consolas, Inconsolata, "Lucida Console", Courier, monospace;
   font-size: 11px;
   line-height: 1em;
   padding: 0;
@@ -49,7 +49,7 @@ html[xmlns] .clearfix {
   padding: 0 10px;
 }
 #helios .CodeMirror pre {
-  font-family: Menlo, Monaco, "Lucida Console", "Ubuntu Mono", Courier, monospace;
+  font-family: Menlo, Monaco, Consolas, Inconsolata, "Lucida Console", "Ubuntu Mono", Courier, monospace;
   line-height: 16px;
   font-size: 13px;
 }
@@ -526,7 +526,7 @@ html[xmlns] .clearfix {
 }
 #helios .key_helper .label {
   padding: 1px 4px;
-  font-family: Menlo, Monaco, "Lucida Console", Courier, monospace;
+  font-family: Menlo, Monaco, Consolas, Inconsolata, "Lucida Console", Courier, monospace;
   background: transparent;
   color: #08C;
   text-shadow: none;

+ 1 - 1
grunt/tasks/grunt-amberc.js

@@ -75,7 +75,7 @@ module.exports = function(grunt) {
 
 
   function generateCompilerConfiguration(data, sourceFiles) {
-    var configuration = amberc.createDefaults();
+    var configuration = amberc.createDefaultConfiguration();
     var parameters = [];
 
     var libraries = data.libraries;

+ 1 - 0
helios.html

@@ -22,6 +22,7 @@
 
                       smalltalk.defaultAmdNamespace = "amber_core";
                       smalltalk.initialize();
+					  smalltalk.HLManager._setup();
                   }
           );
       </script>

+ 26 - 28
js/Benchfib.js

@@ -1,31 +1,31 @@
-define("amber_core/Benchfib", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Benchfib", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Benchfib');
 smalltalk.packages["Benchfib"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
+smalltalk.addClass('Benchfib', globals.Object, [], 'Benchfib');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "main",
-category: 'not yet classified',
+protocol: 'not yet classified',
 fn: function (){
 var self=this;
 var result;
 return smalltalk.withContext(function($ctx1) { 
 result=(0)._tinyBenchmarks();
 _st(console)._log_("0 tinyBenchmarks => ".__comma(result));
-return self}, function($ctx1) {$ctx1.fill(self,"main",{result:result},smalltalk.Benchfib.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"main",{result:result},globals.Benchfib.klass)})},
 args: [],
 source: "main\x0a\x0a\x09| result |\x0a\x09result := 0 tinyBenchmarks.\x0a\x09console log: '0 tinyBenchmarks => ' , result",
 messageSends: ["tinyBenchmarks", "log:", ","],
 referencedClasses: []
 }),
-smalltalk.Benchfib.klass);
+globals.Benchfib.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "benchFib",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -43,22 +43,22 @@ $1=_st($3).__plus((1));
 $ctx1.sendIdx["+"]=1;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"benchFib",{},smalltalk.Number)})},
+}, function($ctx1) {$ctx1.fill(self,"benchFib",{},globals.Number)})},
 args: [],
 source: "benchFib\x0a\x09\x22Handy send-heavy benchmark\x22\x0a\x09\x22(result // seconds to run) = approx calls per second\x22\x0a\x09\x22\x09| r t |\x0a\x09\x09t := Time millisecondsToRun: [r := 26 benchFib].\x0a\x09\x09(r * 1000) // t\x22\x0a\x09\x22138000 on a Mac 8100/100\x22\x0a\x09^ self < 2\x0a\x09\x09ifTrue: [1]\x0a\x09\x09ifFalse: [(self-1) benchFib + (self-2) benchFib + 1]",
 messageSends: ["ifTrue:ifFalse:", "<", "+", "benchFib", "-"],
 referencedClasses: []
 }),
-smalltalk.Number);
+globals.Number);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "benchmark",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var size,flags,prime,k,count;
-function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
+function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 size=(8190);
@@ -100,40 +100,38 @@ return count;
 $ctx1.sendIdx["to:do:"]=1;
 $2=count;
 return $2;
-}, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},smalltalk.Number)})},
+}, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},globals.Number)})},
 args: [],
 source: "benchmark\x0a\x09\x22Handy bytecode-heavy benchmark\x22\x0a\x09\x22(500000 // time to run) = approx bytecodes per second\x22\x0a\x09\x225000000 // (Time millisecondsToRun: [10 benchmark]) * 1000\x22\x0a\x09\x223059000 on a Mac 8100/100\x22\x0a\x09| size flags prime k count |\x0a\x09size := 8190.\x0a\x091 to: self do:\x0a\x09\x09[:iter |\x0a\x09\x09count := 0.\x0a\x09\x09flags := Array new.\x0a\x09\x09size timesRepeat: [ flags add: true].\x0a\x09\x091 to: size do:\x0a\x09\x09\x09[:i | (flags at: i) ifTrue:\x0a\x09\x09\x09\x09[prime := i+1.\x0a\x09\x09\x09\x09k := i + prime.\x0a\x09\x09\x09\x09[k <= size] whileTrue:\x0a\x09\x09\x09\x09\x09[flags at: k put: false.\x0a\x09\x09\x09\x09\x09k := k + prime].\x0a\x09\x09\x09\x09count := count + 1]]].\x0a\x09^ count",
 messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "at:", "+", "whileTrue:", "<=", "at:put:"],
 referencedClasses: ["Array"]
 }),
-smalltalk.Number);
+globals.Number);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "jsbenchFib",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 if (this < 2) {
 return 1;
 } else {
 return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;};
-return self}, function($ctx1) {$ctx1.fill(self,"jsbenchFib",{},smalltalk.Number)})},
+return self},
 args: [],
 source: "jsbenchFib\x0a\x0a\x09<if (this < 2) {\x0areturn 1;\x0a} else {\x0areturn (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;}>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Number);
+globals.Number);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "jsbenchmark",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 
 var size = 8190;
 var count;
@@ -156,22 +154,22 @@ for (var z=0;z<this;z++) {
 	}
 }
 return count;
-return self}, function($ctx1) {$ctx1.fill(self,"jsbenchmark",{},smalltalk.Number)})},
+return self},
 args: [],
 source: "jsbenchmark\x0a\x0a<\x0avar size = 8190;\x0avar count;\x0afor (var z=0;z<this;z++) {\x0a\x09count = 0;\x0a\x09var flags = new Array();\x0a\x09for (var p=0; p<size; p++) {\x0a\x09flags[p] = true;\x0a\x09}\x0a\x09for (var i=1;i<=size;i++) {\x0a\x09\x09if (flags[i-1]) {\x0a\x09\x09\x09var prime = i+1;\x0a\x09\x09\x09var k = i + prime;\x0a\x09\x09\x09while (k <= size) {\x0a\x09\x09\x09\x09flags[k-1] = false;\x0a\x09\x09\x09\x09k = k + prime;\x0a\x09\x09\x09}\x0a\x09\x09\x09count = count + 1;\x0a\x09\x09}\x0a\x09}\x0a}\x0areturn count>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Number);
+globals.Number);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "jstinyBenchmarks",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var t1,t2,r,n1,n2;
-function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
+function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
 return smalltalk.withContext(function($ctx1) { 
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
@@ -221,22 +219,22 @@ $ctx1.sendIdx[","]=2;
 $1=_st($2).__comma(" sends/sec");
 $ctx1.sendIdx[","]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.Number)})},
+}, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},globals.Number)})},
 args: [],
 source: "jstinyBenchmarks\x0a\x09\x220 jstinyBenchmarks\x22\x0a\x0a\x09| t1 t2 r n1 n2 |\x0a\x09n1 := 1.\x0a\x09[t1 := Date millisecondsToRun: [n1 jsbenchmark].\x0a\x09t1 < 1000] whileTrue:[n1 := n1 * 2]. \x22Note: #benchmark's runtime is about O(n)\x22\x0a\x0a\x09n2 := 28.\x0a\x09[t2 := Date millisecondsToRun: [r := n2 jsbenchFib].\x0a\x09t2 < 1000] whileTrue:[n2 := n2 + 1].\x0a\x09\x22Note: #jsbenchFib's runtime is about O(k^n),\x0a\x09\x09where k is the golden number = (1 + 5 sqrt) / 2 = 1.618....\x22\x0a\x0a\x09^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',\x0a\x09\x09((r * 1000) / t2) printString, ' sends/sec'",
 messageSends: ["whileTrue:", "millisecondsToRun:", "jsbenchmark", "<", "*", "jsbenchFib", "+", ",", "printString", "/"],
 referencedClasses: ["Date"]
 }),
-smalltalk.Number);
+globals.Number);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "tinyBenchmarks",
-category: '*Benchfib',
+protocol: '*Benchfib',
 fn: function (){
 var self=this;
 var t1,t2,r,n1,n2;
-function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
+function $Date(){return globals.Date||(typeof Date=="undefined"?nil:Date)}
 return smalltalk.withContext(function($ctx1) { 
 var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
@@ -286,12 +284,12 @@ $ctx1.sendIdx[","]=2;
 $1=_st($2).__comma(" sends/sec");
 $ctx1.sendIdx[","]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.Number)})},
+}, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},globals.Number)})},
 args: [],
 source: "tinyBenchmarks\x0a\x09\x22Report the results of running the two tiny Squeak benchmarks.\x0a\x09ar 9/10/1999: Adjusted to run at least 1 sec to get more stable results\x22\x0a\x09\x220 tinyBenchmarks\x22\x0a\x09\x22On a 292 MHz G3 Mac: 22727272 bytecodes/sec; 984169 sends/sec\x22\x0a\x09\x22On a 400 MHz PII/Win98: 18028169 bytecodes/sec; 1081272 sends/sec\x22\x0a\x09| t1 t2 r n1 n2 |\x0a\x09n1 := 1.\x0a\x09[t1 := Date millisecondsToRun: [n1 benchmark].\x0a\x09t1 < 1000] whileTrue:[n1 := n1 * 2]. \x22Note: #benchmark's runtime is about O(n)\x22\x0a\x0a\x09n2 := 16.\x0a\x09[t2 := Date millisecondsToRun: [r := n2 benchFib].\x0a\x09t2 < 1000] whileTrue:[n2 := n2 + 1].\x0a\x09\x22Note: #benchFib's runtime is about O(k^n),\x0a\x09\x09where k is the golden number = (1 + 5 sqrt) / 2 = 1.618....\x22\x0a\x0a\x09^ ((n1 * 500000 * 1000) / t1) printString, ' bytecodes/sec; ',\x0a\x09\x09((r * 1000) / t2) printString, ' sends/sec'",
 messageSends: ["whileTrue:", "millisecondsToRun:", "benchmark", "<", "*", "benchFib", "+", ",", "printString", "/"],
 referencedClasses: ["Date"]
 }),
-smalltalk.Number);
+globals.Number);
 
 });

File diff suppressed because it is too large
+ 191 - 192
js/Canvas.js


File diff suppressed because it is too large
+ 184 - 187
js/Compiler-AST.js


+ 242 - 228
js/Compiler-Core.js

@@ -1,13 +1,13 @@
-define("amber_core/Compiler-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Compiler-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Compiler-Core');
 smalltalk.packages["Compiler-Core"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
-smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API.";
+smalltalk.addClass('AbstractCodeGenerator', globals.Object, ['currentClass', 'source'], 'Compiler-Core');
+globals.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "classNameFor:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -26,111 +26,85 @@ $1=_st(aClass)._name();
 };
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},globals.AbstractCodeGenerator)})},
 args: ["aClass"],
 source: "classNameFor: aClass\x0a\x09^ aClass isMetaclass\x0a\x09\x09ifTrue: [ aClass instanceClass name, '.klass' ]\x0a\x09\x09ifFalse: [\x0a\x09\x09aClass isNil\x0a\x09\x09\x09ifTrue: [ 'nil' ]\x0a\x09\x09\x09ifFalse: [ aClass name ]]",
 messageSends: ["ifTrue:ifFalse:", "isMetaclass", ",", "name", "instanceClass", "isNil"],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compileNode:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._subclassResponsibility();
-return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode},smalltalk.AbstractCodeGenerator)})},
+return self}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode},globals.AbstractCodeGenerator)})},
 args: ["aNode"],
 source: "compileNode: aNode\x0a\x09self subclassResponsibility",
 messageSends: ["subclassResponsibility"],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "currentClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@currentClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.AbstractCodeGenerator)})},
+},
 args: [],
 source: "currentClass\x0a\x09^ currentClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "currentClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@currentClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.AbstractCodeGenerator)})},
+return self},
 args: ["aClass"],
 source: "currentClass: aClass\x0a\x09currentClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "pseudoVariables",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st($Smalltalk())._current())._pseudoVariableNames();
+$1=_st($Smalltalk())._pseudoVariableNames();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},smalltalk.AbstractCodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"pseudoVariables",{},globals.AbstractCodeGenerator)})},
 args: [],
-source: "pseudoVariables\x0a\x09^ Smalltalk current pseudoVariableNames",
-messageSends: ["pseudoVariableNames", "current"],
+source: "pseudoVariables\x0a\x09^ Smalltalk pseudoVariableNames",
+messageSends: ["pseudoVariableNames"],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.AbstractCodeGenerator);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "safeVariableNameFor:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=_st(_st(_st($Smalltalk())._current())._reservedWords())._includes_(aString);
-if(smalltalk.assert($2)){
-$1=_st(aString).__comma("_");
-} else {
-$1=aString;
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"safeVariableNameFor:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
-args: ["aString"],
-source: "safeVariableNameFor: aString\x0a\x09^ (Smalltalk current reservedWords includes: aString)\x0a\x09\x09ifTrue: [ aString, '_' ]\x0a\x09\x09ifFalse: [ aString ]",
-messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", "current", ","],
-referencedClasses: ["Smalltalk"]
-}),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "source",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -142,38 +116,37 @@ $1="";
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"source",{},globals.AbstractCodeGenerator)})},
 args: [],
 source: "source\x0a\x09^ source ifNil: [ '' ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "source:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@source"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.AbstractCodeGenerator)})},
+return self},
 args: ["aString"],
 source: "source: aString\x0a\x09source := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AbstractCodeGenerator);
+globals.AbstractCodeGenerator);
 
 
 
-smalltalk.addClass('CodeGenerator', smalltalk.AbstractCodeGenerator, [], 'Compiler-Core');
-smalltalk.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation.";
+smalltalk.addClass('CodeGenerator', globals.AbstractCodeGenerator, [], 'Compiler-Core');
+globals.CodeGenerator.comment="I am a basic code generator. I generate a valid JavaScript output, but no not perform any inlining.\x0aSee `InliningCodeGenerator` for an optimized JavaScript code generation.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compileNode:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aNode){
 var self=this;
 var ir,stream;
@@ -189,59 +162,59 @@ _st($2)._visit_(ir);
 $3=_st($2)._contents();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},smalltalk.CodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,ir:ir,stream:stream},globals.CodeGenerator)})},
 args: ["aNode"],
 source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09^ self irTranslator\x0a\x09\x09currentClass: self currentClass;\x0a\x09\x09visit: ir;\x0a\x09\x09contents",
 messageSends: ["visit:", "semanticAnalyzer", "translator", "currentClass:", "irTranslator", "currentClass", "contents"],
 referencedClasses: []
 }),
-smalltalk.CodeGenerator);
+globals.CodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "irTranslator",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (){
 var self=this;
-function $IRJSTranslator(){return smalltalk.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
+function $IRJSTranslator(){return globals.IRJSTranslator||(typeof IRJSTranslator=="undefined"?nil:IRJSTranslator)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st($IRJSTranslator())._new();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"irTranslator",{},smalltalk.CodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"irTranslator",{},globals.CodeGenerator)})},
 args: [],
 source: "irTranslator\x0a\x09^ IRJSTranslator new",
 messageSends: ["new"],
 referencedClasses: ["IRJSTranslator"]
 }),
-smalltalk.CodeGenerator);
+globals.CodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "semanticAnalyzer",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (){
 var self=this;
-function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
+function $SemanticAnalyzer(){return globals.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st($SemanticAnalyzer())._on_(self._currentClass());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},smalltalk.CodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"semanticAnalyzer",{},globals.CodeGenerator)})},
 args: [],
 source: "semanticAnalyzer\x0a\x09^ SemanticAnalyzer on: self currentClass",
 messageSends: ["on:", "currentClass"],
 referencedClasses: ["SemanticAnalyzer"]
 }),
-smalltalk.CodeGenerator);
+globals.CodeGenerator);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "translator",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (){
 var self=this;
-function $IRASTTranslator(){return smalltalk.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
+function $IRASTTranslator(){return globals.IRASTTranslator||(typeof IRASTTranslator=="undefined"?nil:IRASTTranslator)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$1;
 $2=_st($IRASTTranslator())._new();
@@ -250,25 +223,25 @@ _st($2)._theClass_(self._currentClass());
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"translator",{},smalltalk.CodeGenerator)})},
+}, function($ctx1) {$ctx1.fill(self,"translator",{},globals.CodeGenerator)})},
 args: [],
 source: "translator\x0a\x09^ IRASTTranslator new\x0a\x09\x09source: self source;\x0a\x09\x09theClass: self currentClass;\x0a\x09\x09yourself",
 messageSends: ["source:", "new", "source", "theClass:", "currentClass", "yourself"],
 referencedClasses: ["IRASTTranslator"]
 }),
-smalltalk.CodeGenerator);
+globals.CodeGenerator);
 
 
 
-smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
-smalltalk.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`.\x0aThe default code generator is an instance of `InlinedCodeGenerator`";
+smalltalk.addClass('Compiler', globals.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core');
+globals.Compiler.comment="I provide the public interface for compiling Amber source code into JavaScript.\x0a\x0aThe code generator used to produce JavaScript can be plugged with `#codeGeneratorClass`.\x0aThe default code generator is an instance of `InlinedCodeGenerator`";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "codeGeneratorClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
+function $InliningCodeGenerator(){return globals.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@codeGeneratorClass"];
@@ -278,52 +251,51 @@ $1=$InliningCodeGenerator();
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},globals.Compiler)})},
 args: [],
 source: "codeGeneratorClass\x0a\x09^ codeGeneratorClass ifNil: [ InliningCodeGenerator ]",
 messageSends: ["ifNil:"],
 referencedClasses: ["InliningCodeGenerator"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "codeGeneratorClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@codeGeneratorClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass:",{aClass:aClass},smalltalk.Compiler)})},
+return self},
 args: ["aClass"],
 source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compile:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._compileNode_(self._parse_(aString));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},globals.Compiler)})},
 args: ["aString"],
 source: "compile: aString\x0a\x09^ self compileNode: (self parse: aString)",
 messageSends: ["compileNode:", "parse:"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compile:forClass:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -332,21 +304,21 @@ self._currentClass_(aClass);
 self._source_(aString);
 $1=self._compile_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},globals.Compiler)})},
 args: ["aString", "aClass"],
 source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^ self compile: aString",
 messageSends: ["currentClass:", "source:", "compile:"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compileExpression:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
-function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
+function $DoIt(){return globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 self._currentClass_($DoIt());
@@ -355,18 +327,18 @@ $ctx1.sendIdx[","]=1;
 self._source_($1);
 $2=self._compileNode_(self._parse_(self._source()));
 return $2;
-}, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},globals.Compiler)})},
 args: ["aString"],
 source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^ [ ', aString, ' ] value'.\x0a\x09^ self compileNode: (self parse: self source)",
 messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"],
 referencedClasses: ["DoIt"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compileExpression:on:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString,anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -377,18 +349,18 @@ $ctx1.sendIdx[","]=1;
 self._source_($1);
 $2=self._compileNode_(self._parse_(self._source()));
 return $2;
-}, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},globals.Compiler)})},
 args: ["aString", "anObject"],
 source: "compileExpression: aString on: anObject\x0a\x09self currentClass: anObject class.\x0a\x09self source: 'xxxDoIt ^ [ ', aString, ' ] value'.\x0a\x09^ self compileNode: (self parse: self source)",
 messageSends: ["currentClass:", "class", "source:", ",", "compileNode:", "parse:", "source"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "compileNode:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aNode){
 var self=this;
 var generator,result;
@@ -402,94 +374,91 @@ result=_st(generator)._compileNode_(aNode);
 self._unknownVariables_([]);
 $3=result;
 return $3;
-}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},globals.Compiler)})},
 args: ["aNode"],
 source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^ result",
 messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "currentClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@currentClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
+},
 args: [],
 source: "currentClass\x0a\x09^ currentClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "currentClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@currentClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"currentClass:",{aClass:aClass},smalltalk.Compiler)})},
+return self},
 args: ["aClass"],
 source: "currentClass: aClass\x0a\x09currentClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "eval:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return eval(aString);
-return self}, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString},smalltalk.Compiler)})},
+return self},
 args: ["aString"],
 source: "eval: aString\x0a\x09<return eval(aString)>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "evaluateExpression:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
-function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
+function $DoIt(){return globals.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._evaluateExpression_on_(aString,_st($DoIt())._new());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"evaluateExpression:",{aString:aString},globals.Compiler)})},
 args: ["aString"],
 source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09^ self evaluateExpression: aString on: DoIt new",
 messageSends: ["evaluateExpression:on:", "new"],
 referencedClasses: ["DoIt"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "evaluateExpression:on:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString,anObject){
 var self=this;
 var result,method;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 method=self._eval_(self._compileExpression_on_(aString,anObject));
-_st(method)._category_("xxxDoIt");
+_st(method)._protocol_("xxxDoIt");
 $1=_st(anObject)._class();
 $ctx1.sendIdx["class"]=1;
 _st($1)._addCompiledMethod_(method);
@@ -497,56 +466,56 @@ result=_st(anObject)._xxxDoIt();
 _st(_st(anObject)._class())._removeCompiledMethod_(method);
 $2=result;
 return $2;
-}, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"evaluateExpression:on:",{aString:aString,anObject:anObject,result:result,method:method},globals.Compiler)})},
 args: ["aString", "anObject"],
-source: "evaluateExpression: aString on: anObject\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object\x22\x0a\x09| result method |\x0a\x09method := self eval: (self compileExpression: aString on: anObject).\x0a\x09method category: 'xxxDoIt'.\x0a\x09anObject class addCompiledMethod: method.\x0a\x09result := anObject xxxDoIt.\x0a\x09anObject class removeCompiledMethod: method.\x0a\x09^ result",
-messageSends: ["eval:", "compileExpression:on:", "category:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"],
+source: "evaluateExpression: aString on: anObject\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object\x22\x0a\x09| result method |\x0a\x09method := self eval: (self compileExpression: aString on: anObject).\x0a\x09method protocol: 'xxxDoIt'.\x0a\x09anObject class addCompiledMethod: method.\x0a\x09result := anObject xxxDoIt.\x0a\x09anObject class removeCompiledMethod: method.\x0a\x09^ result",
+messageSends: ["eval:", "compileExpression:on:", "protocol:", "addCompiledMethod:", "class", "xxxDoIt", "removeCompiledMethod:"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "install:forClass:category:",
-category: 'compiling',
+selector: "install:forClass:protocol:",
+protocol: 'compiling',
 fn: function (aString,aBehavior,anotherString){
 var self=this;
-function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
+function $ClassBuilder(){return globals.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st($ClassBuilder())._new())._installMethod_forClass_category_(self._eval_(self._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
+$1=_st(_st($ClassBuilder())._new())._installMethod_forClass_protocol_(self._eval_(self._compile_forClass_(aString,aBehavior)),aBehavior,anotherString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"install:forClass:category:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"install:forClass:protocol:",{aString:aString,aBehavior:aBehavior,anotherString:anotherString},globals.Compiler)})},
 args: ["aString", "aBehavior", "anotherString"],
-source: "install: aString forClass: aBehavior category: anotherString\x0a\x09^ ClassBuilder new\x0a\x09\x09installMethod: (self eval: (self compile: aString forClass: aBehavior))\x0a\x09\x09forClass: aBehavior\x0a\x09\x09category: anotherString",
-messageSends: ["installMethod:forClass:category:", "new", "eval:", "compile:forClass:"],
+source: "install: aString forClass: aBehavior protocol: anotherString\x0a\x09^ ClassBuilder new\x0a\x09\x09installMethod: (self eval: (self compile: aString forClass: aBehavior))\x0a\x09\x09forClass: aBehavior\x0a\x09\x09protocol: anotherString",
+messageSends: ["installMethod:forClass:protocol:", "new", "eval:", "compile:forClass:"],
 referencedClasses: ["ClassBuilder"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "parse:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st($Smalltalk())._current())._parse_(aString);
+$1=_st($Smalltalk())._parse_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},globals.Compiler)})},
 args: ["aString"],
-source: "parse: aString\x0a\x09^ Smalltalk current parse: aString",
-messageSends: ["parse:", "current"],
+source: "parse: aString\x0a\x09^ Smalltalk parse: aString",
+messageSends: ["parse:"],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "parseExpression:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -555,62 +524,62 @@ $2=_st("doIt ^ [ ".__comma(aString)).__comma(" ] value");
 $ctx1.sendIdx[","]=1;
 $1=self._parse_($2);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"parseExpression:",{aString:aString},globals.Compiler)})},
 args: ["aString"],
 source: "parseExpression: aString\x0a\x09^ self parse: 'doIt ^ [ ', aString, ' ] value'",
 messageSends: ["parse:", ","],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "recompile:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 _st(_st(_st(aClass)._methodDictionary())._values())._do_displayingProgress_((function(each){
 return smalltalk.withContext(function($ctx2) {
-return self._install_forClass_category_(_st(each)._source(),aClass,_st(each)._category());
+return self._install_forClass_protocol_(_st(each)._source(),aClass,_st(each)._protocol());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),"Recompiling ".__comma(_st(aClass)._name()));
 $1=_st(aClass)._isMetaclass();
 if(! smalltalk.assert($1)){
 self._recompile_(_st(aClass)._class());
 };
-return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler)})},
+return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},globals.Compiler)})},
 args: ["aClass"],
-source: "recompile: aClass\x0a\x09aClass methodDictionary values\x0a\x09\x09do: [ :each | self install: each source forClass: aClass category: each category ]\x0a\x09\x09displayingProgress: 'Recompiling ', aClass name.\x0a\x09\x22self setupClass: aClass.\x22\x0a\x09aClass isMetaclass ifFalse: [ self recompile: aClass class ]",
-messageSends: ["do:displayingProgress:", "values", "methodDictionary", "install:forClass:category:", "source", "category", ",", "name", "ifFalse:", "isMetaclass", "recompile:", "class"],
+source: "recompile: aClass\x0a\x09aClass methodDictionary values\x0a\x09\x09do: [ :each | \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09install: each source \x0a\x09\x09\x09\x09forClass: aClass \x0a\x09\x09\x09\x09protocol: each protocol ]\x0a\x09\x09displayingProgress: 'Recompiling ', aClass name.\x0a\x09aClass isMetaclass ifFalse: [ self recompile: aClass class ]",
+messageSends: ["do:displayingProgress:", "values", "methodDictionary", "install:forClass:protocol:", "source", "protocol", ",", "name", "ifFalse:", "isMetaclass", "recompile:", "class"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "recompileAll",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st($Smalltalk())._current())._classes())._do_displayingProgress_((function(each){
+_st(_st($Smalltalk())._classes())._do_displayingProgress_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return self._recompile_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),"Compiling all classes...");
-return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler)})},
+return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},globals.Compiler)})},
 args: [],
-source: "recompileAll\x0a\x09Smalltalk current classes \x0a\x09\x09do: [ :each | self recompile: each ]\x0a\x09\x09displayingProgress: 'Compiling all classes...'",
-messageSends: ["do:displayingProgress:", "classes", "current", "recompile:"],
+source: "recompileAll\x0a\x09Smalltalk classes \x0a\x09\x09do: [ :each | self recompile: each ]\x0a\x09\x09displayingProgress: 'Compiling all classes...'",
+messageSends: ["do:displayingProgress:", "classes", "recompile:"],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "source",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -622,130 +591,151 @@ $1="";
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
+}, function($ctx1) {$ctx1.fill(self,"source",{},globals.Compiler)})},
 args: [],
 source: "source\x0a\x09^ source ifNil: [ '' ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "source:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@source"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"source:",{aString:aString},smalltalk.Compiler)})},
+return self},
 args: ["aString"],
 source: "source: aString\x0a\x09source := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "unknownVariables",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@unknownVariables"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
+},
 args: [],
 source: "unknownVariables\x0a\x09^ unknownVariables",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "unknownVariables:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aCollection){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@unknownVariables"]=aCollection;
-return self}, function($ctx1) {$ctx1.fill(self,"unknownVariables:",{aCollection:aCollection},smalltalk.Compiler)})},
+return self},
 args: ["aCollection"],
 source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Compiler);
+globals.Compiler);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "recompile:",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._new())._recompile_(aClass);
-return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},smalltalk.Compiler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"recompile:",{aClass:aClass},globals.Compiler.klass)})},
 args: ["aClass"],
 source: "recompile: aClass\x0a\x09self new recompile: aClass",
 messageSends: ["recompile:", "new"],
 referencedClasses: []
 }),
-smalltalk.Compiler.klass);
+globals.Compiler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "recompileAll",
-category: 'compiling',
+protocol: 'compiling',
 fn: function (){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
+_st(_st($Smalltalk())._classes())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return self._recompile_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},globals.Compiler.klass)})},
 args: [],
-source: "recompileAll\x0a\x09Smalltalk current classes do: [ :each |\x0a\x09\x09self recompile: each ]",
-messageSends: ["do:", "classes", "current", "recompile:"],
+source: "recompileAll\x0a\x09Smalltalk classes do: [ :each |\x0a\x09\x09self recompile: each ]",
+messageSends: ["do:", "classes", "recompile:"],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.Compiler.klass);
+globals.Compiler.klass);
+
 
+smalltalk.addClass('DoIt', globals.Object, [], 'Compiler-Core');
+globals.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "foo",
+protocol: 'tests',
+fn: function (){
+var self=this;
+function $Array(){return globals.Array||(typeof Array=="undefined"?nil:Array)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=_st($Array())._new();
+_st($2)._add_((3));
+$ctx1.sendIdx["add:"]=1;
+_st($2)._add_((4));
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"foo",{},globals.DoIt)})},
+args: [],
+source: "foo ^ Array new add: 3; add: 4; yourself",
+messageSends: ["add:", "new", "yourself"],
+referencedClasses: ["Array"]
+}),
+globals.DoIt);
 
-smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core');
-smalltalk.DoIt.comment="`DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`.";
 
 
-smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core');
-smalltalk.NodeVisitor.comment="I am the abstract super class of all AST node visitors.";
+smalltalk.addClass('NodeVisitor', globals.Object, [], 'Compiler-Core');
+globals.NodeVisitor.comment="I am the abstract super class of all AST node visitors.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visit:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aNode)._accept_(self);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visit:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visit: aNode\x0a\x09^ aNode accept: self",
 messageSends: ["accept:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitAll:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -755,265 +745,289 @@ return smalltalk.withContext(function($ctx2) {
 return self._visit_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitAll:",{aCollection:aCollection},globals.NodeVisitor)})},
 args: ["aCollection"],
 source: "visitAll: aCollection\x0a\x09^ aCollection collect: [ :each | self visit: each ]",
 messageSends: ["collect:", "visit:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitAssignmentNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitAssignmentNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitBlockNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitBlockNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitBlockNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitBlockSequenceNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitSequenceNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitBlockSequenceNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitBlockSequenceNode: aNode\x0a\x09^ self visitSequenceNode: aNode",
 messageSends: ["visitSequenceNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitCascadeNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitCascadeNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitCascadeNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitDynamicArrayNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitDynamicArrayNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitDynamicArrayNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitDynamicDictionaryNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitDynamicDictionaryNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitDynamicDictionaryNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitJSStatementNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitJSStatementNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitJSStatementNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitMethodNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitMethodNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitAll_(_st(aNode)._nodes());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitNode: aNode\x0a\x09^ self visitAll: aNode nodes",
 messageSends: ["visitAll:", "nodes"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitReturnNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitReturnNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitReturnNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitSendNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitSendNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitSequenceNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitSequenceNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitSequenceNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitValueNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitValueNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitValueNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "visitVariableNode:",
-category: 'visiting',
+protocol: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._visitNode_(aNode);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.NodeVisitor)})},
+}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},globals.NodeVisitor)})},
 args: ["aNode"],
 source: "visitVariableNode: aNode\x0a\x09^ self visitNode: aNode",
 messageSends: ["visitNode:"],
 referencedClasses: []
 }),
-smalltalk.NodeVisitor);
+globals.NodeVisitor);
+
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asVariableName",
+protocol: '*Compiler-Core',
+fn: function (){
+var self=this;
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=_st(_st($Smalltalk())._reservedWords())._includes_(self);
+if(smalltalk.assert($2)){
+$1=self.__comma("_");
+} else {
+$1=self;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asVariableName",{},globals.String)})},
+args: [],
+source: "asVariableName\x0a\x09^ (Smalltalk reservedWords includes: self)\x0a\x09\x09ifTrue: [ self, '_' ]\x0a\x09\x09ifFalse: [ self ]",
+messageSends: ["ifTrue:ifFalse:", "includes:", "reservedWords", ","],
+referencedClasses: ["Smalltalk"]
+}),
+globals.String);
 
 });

+ 53 - 60
js/Compiler-Exceptions.js

@@ -1,85 +1,83 @@
-define("amber_core/Compiler-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Exceptions"], function(smalltalk,nil,_st){
+define("amber_core/Compiler-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Compiler-Exceptions');
 smalltalk.packages["Compiler-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
-smalltalk.CompilerError.comment="I am the common superclass of all compiling errors.";
+smalltalk.addClass('CompilerError', globals.Error, [], 'Compiler-Exceptions');
+globals.CompilerError.comment="I am the common superclass of all compiling errors.";
 
 
-smalltalk.addClass('ParseError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
-smalltalk.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
+smalltalk.addClass('ParseError', globals.CompilerError, [], 'Compiler-Exceptions');
+globals.ParseError.comment="Instance of ParseError are signaled on any parsing error.\x0aSee `Smalltalk >> #parse:`";
 
 
-smalltalk.addClass('SemanticError', smalltalk.CompilerError, [], 'Compiler-Exceptions');
-smalltalk.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling";
+smalltalk.addClass('SemanticError', globals.CompilerError, [], 'Compiler-Exceptions');
+globals.SemanticError.comment="I represent an abstract semantic error thrown by the SemanticAnalyzer.\x0aSemantic errors can be unknown variable errors, etc.\x0aSee my subclasses for concrete errors.\x0a\x0aThe IDE should catch instances of Semantic error to deal with them when compiling";
 
 
-smalltalk.addClass('InliningError', smalltalk.SemanticError, [], 'Compiler-Exceptions');
-smalltalk.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
+smalltalk.addClass('InliningError', globals.SemanticError, [], 'Compiler-Exceptions');
+globals.InliningError.comment="Instances of InliningError are signaled when using an `InliningCodeGenerator`in a `Compiler`.";
 
 
-smalltalk.addClass('InvalidAssignmentError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
-smalltalk.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned.";
+smalltalk.addClass('InvalidAssignmentError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+globals.InvalidAssignmentError.comment="I get signaled when a pseudo variable gets assigned.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=" Invalid assignment to variable: ".__comma(self._variableName());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.InvalidAssignmentError)})},
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.InvalidAssignmentError)})},
 args: [],
 source: "messageText\x0a\x09^ ' Invalid assignment to variable: ', self variableName",
 messageSends: [",", "variableName"],
 referencedClasses: []
 }),
-smalltalk.InvalidAssignmentError);
+globals.InvalidAssignmentError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@variableName"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.InvalidAssignmentError)})},
+},
 args: [],
 source: "variableName\x0a\x09^ variableName",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.InvalidAssignmentError);
+globals.InvalidAssignmentError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@variableName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.InvalidAssignmentError)})},
+return self},
 args: ["aString"],
 source: "variableName: aString\x0a\x09variableName := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.InvalidAssignmentError);
+globals.InvalidAssignmentError);
 
 
 
-smalltalk.addClass('ShadowingVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
-smalltalk.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope.";
+smalltalk.addClass('ShadowingVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+globals.ShadowingVariableError.comment="I get signaled when a variable in a block or method scope shadows a variable of the same name in an outer scope.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -87,56 +85,54 @@ var $1;
 $1=_st("Variable shadowing error: ".__comma(self._variableName())).__comma(" is already defined");
 $ctx1.sendIdx[","]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.ShadowingVariableError)})},
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.ShadowingVariableError)})},
 args: [],
 source: "messageText\x0a\x09^ 'Variable shadowing error: ', self variableName, ' is already defined'",
 messageSends: [",", "variableName"],
 referencedClasses: []
 }),
-smalltalk.ShadowingVariableError);
+globals.ShadowingVariableError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@variableName"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.ShadowingVariableError)})},
+},
 args: [],
 source: "variableName\x0a\x09^ variableName",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ShadowingVariableError);
+globals.ShadowingVariableError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@variableName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.ShadowingVariableError)})},
+return self},
 args: ["aString"],
 source: "variableName: aString\x0a\x09variableName := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ShadowingVariableError);
+globals.ShadowingVariableError);
 
 
 
-smalltalk.addClass('UnknownVariableError', smalltalk.SemanticError, ['variableName'], 'Compiler-Exceptions');
-smalltalk.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects.";
+smalltalk.addClass('UnknownVariableError', globals.SemanticError, ['variableName'], 'Compiler-Exceptions');
+globals.UnknownVariableError.comment="I get signaled when a variable is not defined.\x0aThe default behavior is to allow it, as this is how Amber currently is able to seamlessly send messages to JavaScript objects.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -144,84 +140,81 @@ var $1;
 $1=_st("Unknown Variable error: ".__comma(self._variableName())).__comma(" is not defined");
 $ctx1.sendIdx[","]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.UnknownVariableError)})},
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.UnknownVariableError)})},
 args: [],
 source: "messageText\x0a\x09^ 'Unknown Variable error: ', self variableName, ' is not defined'",
 messageSends: [",", "variableName"],
 referencedClasses: []
 }),
-smalltalk.UnknownVariableError);
+globals.UnknownVariableError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@variableName"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.UnknownVariableError)})},
+},
 args: [],
 source: "variableName\x0a\x09^ variableName",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.UnknownVariableError);
+globals.UnknownVariableError);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@variableName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.UnknownVariableError)})},
+return self},
 args: ["aString"],
 source: "variableName: aString\x0a\x09variableName := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.UnknownVariableError);
+globals.UnknownVariableError);
 
 
 
-smalltalk.addClass('RethrowErrorHandler', smalltalk.ErrorHandler, [], 'Compiler-Exceptions');
-smalltalk.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.";
+smalltalk.addClass('RethrowErrorHandler', globals.Object, [], 'Compiler-Exceptions');
+globals.RethrowErrorHandler.comment="This class is used in the commandline version of the compiler.\x0aIt uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.\x0aAs a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "basicSignal:",
-category: 'error handling',
+protocol: 'error handling',
 fn: function (anError){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 throw anError;
-return self}, function($ctx1) {$ctx1.fill(self,"basicSignal:",{anError:anError},smalltalk.RethrowErrorHandler)})},
+return self},
 args: ["anError"],
-source: "basicSignal: anError\x0a\x09<throw anError>",
+source: "basicSignal: anError\x0a        <throw anError>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.RethrowErrorHandler);
+globals.RethrowErrorHandler);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handleError:",
-category: 'error handling',
+protocol: 'error handling',
 fn: function (anError){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.RethrowErrorHandler.superclass.fn.prototype._handleError_.apply(_st(self), [anError]);
+globals.RethrowErrorHandler.superclass.fn.prototype._handleError_.apply(_st(self), [anError]);
 self._basicSignal_(anError);
-return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.RethrowErrorHandler)})},
+return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},globals.RethrowErrorHandler)})},
 args: ["anError"],
-source: "handleError: anError\x0a\x09super handleError: anError.\x0a\x09self basicSignal: anError",
+source: "handleError: anError\x0a        super handleError: anError.\x0a        self basicSignal: anError",
 messageSends: ["handleError:", "basicSignal:"],
 referencedClasses: []
 }),
-smalltalk.RethrowErrorHandler);
+globals.RethrowErrorHandler);
 
 
 });

File diff suppressed because it is too large
+ 168 - 188
js/Compiler-IR.js


File diff suppressed because it is too large
+ 179 - 184
js/Compiler-Inlining.js


File diff suppressed because it is too large
+ 165 - 180
js/Compiler-Interpreter.js


File diff suppressed because it is too large
+ 178 - 201
js/Compiler-Semantic.js


File diff suppressed because it is too large
+ 182 - 165
js/Compiler-Tests.js


+ 19 - 19
js/Examples.js

@@ -1,13 +1,13 @@
-define("amber_core/Examples", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Canvas"], function(smalltalk,nil,_st){
+define("amber_core/Examples", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Canvas"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Examples');
 smalltalk.packages["Examples"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Counter', smalltalk.Widget, ['count', 'header'], 'Examples');
-smalltalk.Counter.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter tryExample";
+smalltalk.addClass('Counter', globals.Widget, ['count', 'header'], 'Examples');
+globals.Counter.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter tryExample";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "decrease",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -16,18 +16,18 @@ _st(self["@header"])._contents_((function(html){
 return smalltalk.withContext(function($ctx2) {
 return _st(html)._with_(_st(self["@count"])._asString());
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"decrease",{},smalltalk.Counter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"decrease",{},globals.Counter)})},
 args: [],
 source: "decrease\x0a\x09count := count - 1.\x0a\x09header contents: [ :html | html with: count asString ]",
 messageSends: ["-", "contents:", "with:", "asString"],
 referencedClasses: []
 }),
-smalltalk.Counter);
+globals.Counter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "increase",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -36,35 +36,35 @@ _st(self["@header"])._contents_((function(html){
 return smalltalk.withContext(function($ctx2) {
 return _st(html)._with_(_st(self["@count"])._asString());
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"increase",{},smalltalk.Counter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"increase",{},globals.Counter)})},
 args: [],
 source: "increase\x0a\x09count := count + 1.\x0a\x09header contents: [ :html | html with: count asString ]",
 messageSends: ["+", "contents:", "with:", "asString"],
 referencedClasses: []
 }),
-smalltalk.Counter);
+globals.Counter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Counter.superclass.fn.prototype._initialize.apply(_st(self), []);
+globals.Counter.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@count"]=(0);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Counter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Counter)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09count := 0",
 messageSends: ["initialize"],
 referencedClasses: []
 }),
-smalltalk.Counter);
+globals.Counter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderOn:",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -89,29 +89,29 @@ $6=_st($5)._onClick_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._decrease();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.Counter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.Counter)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09header := html h1\x0a\x09\x09with: count asString;\x0a\x09\x09yourself.\x0a\x09html button\x0a\x09\x09with: '++';\x0a\x09\x09onClick: [ self increase ].\x0a\x09html button\x0a\x09\x09with: '--';\x0a\x09\x09onClick: [ self decrease ]",
 messageSends: ["with:", "h1", "asString", "yourself", "button", "onClick:", "increase", "decrease"],
 referencedClasses: []
 }),
-smalltalk.Counter);
+globals.Counter);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "tryExample",
-category: 'example',
+protocol: 'example',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._new())._appendToJQuery_("body"._asJQuery());
-return self}, function($ctx1) {$ctx1.fill(self,"tryExample",{},smalltalk.Counter.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"tryExample",{},globals.Counter.klass)})},
 args: [],
 source: "tryExample\x0a\x09\x22In order to play with the Counter, just select the\x0a\x09doit below and press the Do it button. Then take a\x0a\x09look in the HTML document above the IDE.\x22\x0a\x0a\x09\x22Counter tryExample\x22\x0a\x09\x09self new appendToJQuery: 'body' asJQuery",
 messageSends: ["appendToJQuery:", "new", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.Counter.klass);
+globals.Counter.klass);
 
 });

+ 123 - 148
js/Helios-Announcements.js

@@ -1,105 +1,100 @@
-define("amber_core/Helios-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Announcements');
 smalltalk.packages["Helios-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLAboutToChange', smalltalk.Object, ['actionBlock'], 'Helios-Announcements');
+smalltalk.addClass('HLAboutToChange', globals.Object, ['actionBlock'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "actionBlock",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@actionBlock"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLAboutToChange)})},
+},
 args: [],
 source: "actionBlock\x0a\x09^ actionBlock",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLAboutToChange);
+globals.HLAboutToChange);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "actionBlock:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aBlock){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@actionBlock"]=aBlock;
-return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLAboutToChange)})},
+return self},
 args: ["aBlock"],
 source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLAboutToChange);
+globals.HLAboutToChange);
 
 
 
-smalltalk.addClass('HLAnnouncement', smalltalk.Object, [], 'Helios-Announcements');
-smalltalk.HLAnnouncement.comment="I am the root of the announcement class hierarchy used in the Helios UI.";
+smalltalk.addClass('HLAnnouncement', globals.Object, [], 'Helios-Announcements');
+globals.HLAnnouncement.comment="I am the root of the announcement class hierarchy used in the Helios UI.";
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "heliosClass",
-category: 'helios',
+protocol: 'helios',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "announcement";
-}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.HLAnnouncement.klass)})},
+},
 args: [],
 source: "heliosClass\x0a\x09^ 'announcement'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLAnnouncement.klass);
+globals.HLAnnouncement.klass);
 
 
-smalltalk.addClass('HLCodeHandled', smalltalk.HLAnnouncement, ['code'], 'Helios-Announcements');
-smalltalk.HLCodeHandled.comment="I am the root class of announcements emitted by `HLCodeWidget`s";
+smalltalk.addClass('HLCodeHandled', globals.HLAnnouncement, ['code'], 'Helios-Announcements');
+globals.HLCodeHandled.comment="I am the root class of announcements emitted by `HLCodeWidget`s";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "code",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@code"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"code",{},smalltalk.HLCodeHandled)})},
+},
 args: [],
 source: "code\x0a\x0a\x09^ code",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCodeHandled);
+globals.HLCodeHandled);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "code:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@code"]=aModel;
-return self}, function($ctx1) {$ctx1.fill(self,"code:",{aModel:aModel},smalltalk.HLCodeHandled)})},
+return self},
 args: ["aModel"],
 source: "code: aModel\x0a\x0a\x09code := aModel",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCodeHandled);
+globals.HLCodeHandled);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:",
-category: 'actions',
+protocol: 'actions',
 fn: function (aCodeModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -109,394 +104,376 @@ _st($2)._code_(aCodeModel);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{aCodeModel:aCodeModel},smalltalk.HLCodeHandled.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{aCodeModel:aCodeModel},globals.HLCodeHandled.klass)})},
 args: ["aCodeModel"],
 source: "on: aCodeModel\x0a\x0a\x09^ self new \x0a    \x09code: aCodeModel;\x0a        yourself",
 messageSends: ["code:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLCodeHandled.klass);
+globals.HLCodeHandled.klass);
 
 
-smalltalk.addClass('HLDoItExecuted', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
-smalltalk.HLDoItExecuted.comment="I am emitted by a `HLCodeWidget` after a DoIt has been executed.";
+smalltalk.addClass('HLDoItExecuted', globals.HLCodeHandled, [], 'Helios-Announcements');
+globals.HLDoItExecuted.comment="I am emitted by a `HLCodeWidget` after a DoIt has been executed.";
 
 
-smalltalk.addClass('HLDoItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
-smalltalk.HLDoItRequested.comment="I am emitted by a `HLCodeWidget` before a DoIt is executed.";
+smalltalk.addClass('HLDoItRequested', globals.HLCodeHandled, [], 'Helios-Announcements');
+globals.HLDoItRequested.comment="I am emitted by a `HLCodeWidget` before a DoIt is executed.";
 
 
-smalltalk.addClass('HLInspectItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
-smalltalk.HLInspectItRequested.comment="I am emitted by a `HLCodeWidget` before an object is inspected.";
+smalltalk.addClass('HLInspectItRequested', globals.HLCodeHandled, [], 'Helios-Announcements');
+globals.HLInspectItRequested.comment="I am emitted by a `HLCodeWidget` before an object is inspected.";
 
 
-smalltalk.addClass('HLPrintItRequested', smalltalk.HLCodeHandled, [], 'Helios-Announcements');
-smalltalk.HLPrintItRequested.comment="I am emitted by a `HLCodeWidget` before an object is printed.";
+smalltalk.addClass('HLPrintItRequested', globals.HLCodeHandled, [], 'Helios-Announcements');
+globals.HLPrintItRequested.comment="I am emitted by a `HLCodeWidget` before an object is printed.";
 
 
-smalltalk.addClass('HLDebuggerAnnouncement', smalltalk.HLAnnouncement, ['context'], 'Helios-Announcements');
+smalltalk.addClass('HLDebuggerAnnouncement', globals.HLAnnouncement, ['context'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@context"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLDebuggerAnnouncement)})},
+},
 args: [],
 source: "context\x0a\x09^ context",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLDebuggerAnnouncement);
+globals.HLDebuggerAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aContext){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@context"]=aContext;
-return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.HLDebuggerAnnouncement)})},
+return self},
 args: ["aContext"],
 source: "context: aContext\x0a\x09context := aContext",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLDebuggerAnnouncement);
+globals.HLDebuggerAnnouncement);
 
 
 
-smalltalk.addClass('HLDebuggerContextSelected', smalltalk.HLDebuggerAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLDebuggerContextSelected', globals.HLDebuggerAnnouncement, [], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@context"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.HLDebuggerContextSelected)})},
+},
 args: [],
 source: "context\x0a\x09^ context",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLDebuggerContextSelected);
+globals.HLDebuggerContextSelected);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aContext){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@context"]=aContext;
-return self}, function($ctx1) {$ctx1.fill(self,"context:",{aContext:aContext},smalltalk.HLDebuggerContextSelected)})},
+return self},
 args: ["aContext"],
 source: "context: aContext\x0a\x09context := aContext",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLDebuggerContextSelected);
+globals.HLDebuggerContextSelected);
 
 
 
-smalltalk.addClass('HLDebuggerStepped', smalltalk.HLDebuggerAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLDebuggerStepped', globals.HLDebuggerAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLDebuggerWhere', smalltalk.HLDebuggerAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLDebuggerWhere', globals.HLDebuggerAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLDiveRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLDiveRequested', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLEditComment', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLEditComment', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLErrorRaised', smalltalk.HLAnnouncement, ['error'], 'Helios-Announcements');
+smalltalk.addClass('HLErrorRaised', globals.HLAnnouncement, ['error'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "error",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@error"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"error",{},smalltalk.HLErrorRaised)})},
+},
 args: [],
 source: "error\x0a\x09^ error",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLErrorRaised);
+globals.HLErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "error:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anError){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@error"]=anError;
-return self}, function($ctx1) {$ctx1.fill(self,"error:",{anError:anError},smalltalk.HLErrorRaised)})},
+return self},
 args: ["anError"],
 source: "error: anError\x0a\x09error := anError",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLErrorRaised);
+globals.HLErrorRaised);
 
 
 
-smalltalk.addClass('HLCompileErrorRaised', smalltalk.HLErrorRaised, [], 'Helios-Announcements');
+smalltalk.addClass('HLCompileErrorRaised', globals.HLErrorRaised, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLParseErrorRaised', smalltalk.HLErrorRaised, ['line', 'column', 'message'], 'Helios-Announcements');
+smalltalk.addClass('HLParseErrorRaised', globals.HLErrorRaised, ['line', 'column', 'message'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "column",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@column"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"column",{},smalltalk.HLParseErrorRaised)})},
+},
 args: [],
 source: "column\x0a\x09^ column",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "column:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anInteger){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@column"]=anInteger;
-return self}, function($ctx1) {$ctx1.fill(self,"column:",{anInteger:anInteger},smalltalk.HLParseErrorRaised)})},
+return self},
 args: ["anInteger"],
 source: "column: anInteger\x0a\x09column := anInteger",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "line",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@line"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"line",{},smalltalk.HLParseErrorRaised)})},
+},
 args: [],
 source: "line\x0a\x09^ line",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "line:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anInteger){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@line"]=anInteger;
-return self}, function($ctx1) {$ctx1.fill(self,"line:",{anInteger:anInteger},smalltalk.HLParseErrorRaised)})},
+return self},
 args: ["anInteger"],
 source: "line: anInteger\x0a\x09line := anInteger",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "message",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@message"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"message",{},smalltalk.HLParseErrorRaised)})},
+},
 args: [],
 source: "message\x0a\x09^ message",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "message:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@message"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"message:",{aString:aString},smalltalk.HLParseErrorRaised)})},
+return self},
 args: ["aString"],
 source: "message: aString\x0a\x09message := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLParseErrorRaised);
+globals.HLParseErrorRaised);
 
 
 
-smalltalk.addClass('HLUnknownVariableErrorRaised', smalltalk.HLErrorRaised, [], 'Helios-Announcements');
+smalltalk.addClass('HLUnknownVariableErrorRaised', globals.HLErrorRaised, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLFocusRequested', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLFocusRequested', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLClassesFocusRequested', smalltalk.HLFocusRequested, [], 'Helios-Announcements');
+smalltalk.addClass('HLClassesFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLMethodsFocusRequested', smalltalk.HLFocusRequested, [], 'Helios-Announcements');
+smalltalk.addClass('HLMethodsFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLPackagesFocusRequested', smalltalk.HLFocusRequested, [], 'Helios-Announcements');
+smalltalk.addClass('HLPackagesFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLProtocolsFocusRequested', smalltalk.HLFocusRequested, [], 'Helios-Announcements');
+smalltalk.addClass('HLProtocolsFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLSourceCodeFocusRequested', smalltalk.HLFocusRequested, [], 'Helios-Announcements');
+smalltalk.addClass('HLSourceCodeFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLInstVarAdded', smalltalk.HLAnnouncement, ['theClass', 'variableName'], 'Helios-Announcements');
+smalltalk.addClass('HLInstVarAdded', globals.HLAnnouncement, ['theClass', 'variableName'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@theClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.HLInstVarAdded)})},
+},
 args: [],
 source: "theClass\x0a\x09^ theClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLInstVarAdded);
+globals.HLInstVarAdded);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@theClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.HLInstVarAdded)})},
+return self},
 args: ["aClass"],
 source: "theClass: aClass\x0a\x09theClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLInstVarAdded);
+globals.HLInstVarAdded);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@variableName"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"variableName",{},smalltalk.HLInstVarAdded)})},
+},
 args: [],
 source: "variableName\x0a\x09^ variableName",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLInstVarAdded);
+globals.HLInstVarAdded);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableName:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@variableName"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"variableName:",{aString:aString},smalltalk.HLInstVarAdded)})},
+return self},
 args: ["aString"],
 source: "variableName: aString\x0a\x09variableName := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLInstVarAdded);
+globals.HLInstVarAdded);
 
 
 
-smalltalk.addClass('HLItemSelected', smalltalk.HLAnnouncement, ['item'], 'Helios-Announcements');
+smalltalk.addClass('HLItemSelected', globals.HLAnnouncement, ['item'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "item",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@item"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"item",{},smalltalk.HLItemSelected)})},
+},
 args: [],
 source: "item\x0a\x09^ item",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLItemSelected);
+globals.HLItemSelected);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "item:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@item"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"item:",{anObject:anObject},smalltalk.HLItemSelected)})},
+return self},
 args: ["anObject"],
 source: "item: anObject\x0a\x09item := anObject",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLItemSelected);
+globals.HLItemSelected);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (anItem){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -506,76 +483,74 @@ _st($2)._item_(anItem);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anItem:anItem},smalltalk.HLItemSelected.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{anItem:anItem},globals.HLItemSelected.klass)})},
 args: ["anItem"],
 source: "on: anItem\x0a\x09^ self new\x0a    \x09item: anItem;\x0a        yourself",
 messageSends: ["item:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLItemSelected.klass);
+globals.HLItemSelected.klass);
 
 
-smalltalk.addClass('HLClassSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+smalltalk.addClass('HLClassSelected', globals.HLItemSelected, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLInstanceVariableSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+smalltalk.addClass('HLInstanceVariableSelected', globals.HLItemSelected, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLMethodSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+smalltalk.addClass('HLMethodSelected', globals.HLItemSelected, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLPackageSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+smalltalk.addClass('HLPackageSelected', globals.HLItemSelected, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLProtocolSelected', smalltalk.HLItemSelected, [], 'Helios-Announcements');
+smalltalk.addClass('HLProtocolSelected', globals.HLItemSelected, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLSaveSourceCode', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLSaveSourceCode', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLSearchReferences', smalltalk.HLAnnouncement, ['searchString'], 'Helios-Announcements');
+smalltalk.addClass('HLSearchReferences', globals.HLAnnouncement, ['searchString'], 'Helios-Announcements');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "searchString",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@searchString"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"searchString",{},smalltalk.HLSearchReferences)})},
+},
 args: [],
 source: "searchString\x0a\x09^ searchString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSearchReferences);
+globals.HLSearchReferences);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "searchString:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@searchString"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"searchString:",{aString:aString},smalltalk.HLSearchReferences)})},
+return self},
 args: ["aString"],
 source: "searchString: aString\x0a\x09searchString := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSearchReferences);
+globals.HLSearchReferences);
 
 
 
-smalltalk.addClass('HLShowCommentToggled', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLShowCommentToggled', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLShowInstanceToggled', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLShowInstanceToggled', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 
-smalltalk.addClass('HLSourceCodeSaved', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
+smalltalk.addClass('HLSourceCodeSaved', globals.HLAnnouncement, [], 'Helios-Announcements');
 
 });

File diff suppressed because it is too large
+ 165 - 176
js/Helios-Browser.js


+ 333 - 136
js/Helios-Commands-Browser.js

@@ -1,357 +1,345 @@
-define("amber_core/Helios-Commands-Browser", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Commands-Tools"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Commands-Browser", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Commands-Tools"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Commands-Browser');
 smalltalk.packages["Helios-Commands-Browser"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLBrowserCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLBrowserCommand', globals.HLToolCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isValidFor:",
-category: 'testing',
+protocol: 'testing',
 fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aModel)._isBrowserModel();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLBrowserCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLBrowserCommand.klass)})},
 args: ["aModel"],
 source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
 messageSends: ["isBrowserModel"],
 referencedClasses: []
 }),
-smalltalk.HLBrowserCommand.klass);
+globals.HLBrowserCommand.klass);
 
 
-smalltalk.addClass('HLBrowserGoToCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLBrowserGoToCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isValidFor:",
-category: 'testing',
+protocol: 'testing',
 fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aModel)._isBrowserModel();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLBrowserGoToCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLBrowserGoToCommand.klass)})},
 args: ["aModel"],
 source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
 messageSends: ["isBrowserModel"],
 referencedClasses: []
 }),
-smalltalk.HLBrowserGoToCommand.klass);
+globals.HLBrowserGoToCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "g";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLBrowserGoToCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'g'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLBrowserGoToCommand.klass);
+globals.HLBrowserGoToCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Go to";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLBrowserGoToCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Go to'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLBrowserGoToCommand.klass);
+globals.HLBrowserGoToCommand.klass);
 
 
-smalltalk.addClass('HLGoToClassesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLGoToClassesCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._focusOnClasses();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToClassesCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToClassesCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnClasses",
 messageSends: ["focusOnClasses", "model"],
 referencedClasses: []
 }),
-smalltalk.HLGoToClassesCommand);
+globals.HLGoToClassesCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToClassesCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToClassesCommand.klass);
+globals.HLGoToClassesCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToClassesCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Classes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToClassesCommand.klass);
+globals.HLGoToClassesCommand.klass);
 
 
-smalltalk.addClass('HLGoToMethodsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLGoToMethodsCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._focusOnMethods();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToMethodsCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToMethodsCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnMethods",
 messageSends: ["focusOnMethods", "model"],
 referencedClasses: []
 }),
-smalltalk.HLGoToMethodsCommand);
+globals.HLGoToMethodsCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "m";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToMethodsCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'm'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToMethodsCommand.klass);
+globals.HLGoToMethodsCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Methods";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToMethodsCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Methods'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToMethodsCommand.klass);
+globals.HLGoToMethodsCommand.klass);
 
 
-smalltalk.addClass('HLGoToPackagesCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLGoToPackagesCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._focusOnPackages();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToPackagesCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToPackagesCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnPackages",
 messageSends: ["focusOnPackages", "model"],
 referencedClasses: []
 }),
-smalltalk.HLGoToPackagesCommand);
+globals.HLGoToPackagesCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "p";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToPackagesCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'p'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToPackagesCommand.klass);
+globals.HLGoToPackagesCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Packages";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToPackagesCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Packages'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToPackagesCommand.klass);
+globals.HLGoToPackagesCommand.klass);
 
 
-smalltalk.addClass('HLGoToProtocolsCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLGoToProtocolsCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._focusOnProtocols();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToProtocolsCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToProtocolsCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnProtocols",
 messageSends: ["focusOnProtocols", "model"],
 referencedClasses: []
 }),
-smalltalk.HLGoToProtocolsCommand);
+globals.HLGoToProtocolsCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "t";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToProtocolsCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 't'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToProtocolsCommand.klass);
+globals.HLGoToProtocolsCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Protocols";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToProtocolsCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Protocols'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToProtocolsCommand.klass);
+globals.HLGoToProtocolsCommand.klass);
 
 
-smalltalk.addClass('HLGoToSourceCodeCommand', smalltalk.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLGoToSourceCodeCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._focusOnSourceCode();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToSourceCodeCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToSourceCodeCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnSourceCode",
 messageSends: ["focusOnSourceCode", "model"],
 referencedClasses: []
 }),
-smalltalk.HLGoToSourceCodeCommand);
+globals.HLGoToSourceCodeCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "s";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 's'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToSourceCodeCommand.klass);
+globals.HLGoToSourceCodeCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Source code";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Source code'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLGoToSourceCodeCommand.klass);
+globals.HLGoToSourceCodeCommand.klass);
 
 
-smalltalk.addClass('HLEditCommentCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLEditCommentCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._editComment();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLEditCommentCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLEditCommentCommand)})},
 args: [],
 source: "execute\x0a\x09self model editComment",
 messageSends: ["editComment", "model"],
 referencedClasses: []
 }),
-smalltalk.HLEditCommentCommand);
+globals.HLEditCommentCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -364,88 +352,303 @@ return smalltalk.withContext(function($ctx2) {
 return _st(_st(self._model())._selectedClass())._notNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLEditCommentCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLEditCommentCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model showComment and: [ self model selectedClass notNil ]",
 messageSends: ["and:", "showComment", "model", "notNil", "selectedClass"],
 referencedClasses: []
 }),
-smalltalk.HLEditCommentCommand);
+globals.HLEditCommentCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "d";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLEditCommentCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'd'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLEditCommentCommand.klass);
+globals.HLEditCommentCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Edit documentation";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLEditCommentCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Edit documentation'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLEditCommentCommand.klass);
+globals.HLEditCommentCommand.klass);
+
+
+smalltalk.addClass('HLGenerateCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
+globals.HLGenerateCommand.comment="I am a group command used to gather all the commands generating code (`accessors`, `initialize`, etc)";
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "h";
+},
+args: [],
+source: "key\x0a\x09^ 'h'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "Generate";
+},
+args: [],
+source: "label\x0a\x09^ 'Generate'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateCommand.klass);
 
 
-smalltalk.addClass('HLToggleCommand', smalltalk.HLBrowserCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLCategorizeUnclassifiedCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
+globals.HLCategorizeUnclassifiedCommand.comment="I am the command used to categorize unclassified methods";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "execute",
+protocol: 'executing',
+fn: function (){
+var self=this;
+var targetClass,unclassified;
+function $HLMethodClassifier(){return globals.HLMethodClassifier||(typeof HLMethodClassifier=="undefined"?nil:HLMethodClassifier)}
+return smalltalk.withContext(function($ctx1) { 
+targetClass=_st(self._model())._selectedClass();
+unclassified=_st(_st(targetClass)._methods())._select_((function(e){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(e)._protocol()).__eq("as yet unclassified");
+}, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
+_st(_st($HLMethodClassifier())._new())._classifyAll_(unclassified);
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,unclassified:unclassified},globals.HLCategorizeUnclassifiedCommand)})},
+args: [],
+source: "execute\x0a\x09| targetClass unclassified |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09unclassified := targetClass methods select:[ :e | e protocol = 'as yet unclassified' ].\x0a\x09\x09\x0a\x09HLMethodClassifier new\x0a\x09\x09classifyAll: unclassified",
+messageSends: ["selectedClass", "model", "select:", "methods", "=", "protocol", "classifyAll:", "new"],
+referencedClasses: ["HLMethodClassifier"]
+}),
+globals.HLCategorizeUnclassifiedCommand);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "c";
+},
+args: [],
+source: "key\x0a\x09^ 'c'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLCategorizeUnclassifiedCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "Categorize";
+},
+args: [],
+source: "label\x0a\x09^ 'Categorize'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLCategorizeUnclassifiedCommand.klass);
+
+
+smalltalk.addClass('HLGenerateAccessorsCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
+globals.HLGenerateAccessorsCommand.comment="I am the command used to generate the `getter` and the `setter` methods depending of the selected class";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "execute",
+protocol: 'executing',
+fn: function (){
+var self=this;
+var targetClass,output,first;
+function $HLInitializeGenerator(){return globals.HLInitializeGenerator||(typeof HLInitializeGenerator=="undefined"?nil:HLInitializeGenerator)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5;
+$1=self._model();
+$ctx1.sendIdx["model"]=1;
+targetClass=_st($1)._selectedClass();
+$2=_st($HLInitializeGenerator())._new();
+_st($2)._class_(targetClass);
+_st($2)._generate();
+$3=_st($2)._output();
+output=$3;
+_st(output)._compile();
+first=_st(_st(output)._sourceCodes())._first();
+$4=self._model();
+_st($4)._selectedProtocol_(_st(output)._protocol());
+_st($4)._selectedMethod_(_st(targetClass).__gt_gt(_st(first)._selector()));
+$5=_st($4)._focusOnSourceCode();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,output:output,first:first},globals.HLGenerateAccessorsCommand)})},
+args: [],
+source: "execute\x0a\x09| targetClass output first |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09output := HLInitializeGenerator new\x0a\x09\x09class: targetClass;\x0a\x09\x09generate;\x0a\x09\x09output.\x0a\x09\x09\x0a\x09output compile.\x0a\x09first := output sourceCodes first.\x0a\x09self model\x0a\x09\x09selectedProtocol: output protocol;\x0a\x09\x09selectedMethod:(targetClass>>first selector);\x0a\x09\x09focusOnSourceCode",
+messageSends: ["selectedClass", "model", "class:", "new", "generate", "output", "compile", "first", "sourceCodes", "selectedProtocol:", "protocol", "selectedMethod:", ">>", "selector", "focusOnSourceCode"],
+referencedClasses: ["HLInitializeGenerator"]
+}),
+globals.HLGenerateAccessorsCommand);
+
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "i";
+},
+args: [],
+source: "key\x0a\x09^ 'i'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateAccessorsCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "Initialize";
+},
+args: [],
+source: "label\x0a\x09^ 'Initialize'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateAccessorsCommand.klass);
+
+
+smalltalk.addClass('HLGenerateInitializeCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
+globals.HLGenerateInitializeCommand.comment="I am the command used to generate the `initialize` method depending of the selected class";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "execute",
+protocol: 'executing',
 fn: function (){
 var self=this;
+var targetClass,output;
+function $HLAccessorsGenerator(){return globals.HLAccessorsGenerator||(typeof HLAccessorsGenerator=="undefined"?nil:HLAccessorsGenerator)}
 return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=self._model();
+$ctx1.sendIdx["model"]=1;
+targetClass=_st($1)._selectedClass();
+$2=_st($HLAccessorsGenerator())._new();
+_st($2)._class_(targetClass);
+_st($2)._generate();
+$3=_st($2)._output();
+output=$3;
+_st(output)._compile();
+_st(self._model())._selectedProtocol_(_st(output)._protocol());
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,output:output},globals.HLGenerateInitializeCommand)})},
+args: [],
+source: "execute\x0a\x09| targetClass output |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09output := HLAccessorsGenerator new\x0a\x09\x09class: targetClass;\x0a\x09\x09generate;\x0a\x09\x09output.\x0a\x09\x09\x0a\x09output compile.\x0a\x09self model selectedProtocol: output protocol",
+messageSends: ["selectedClass", "model", "class:", "new", "generate", "output", "compile", "selectedProtocol:", "protocol"],
+referencedClasses: ["HLAccessorsGenerator"]
+}),
+globals.HLGenerateInitializeCommand);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "a";
+},
+args: [],
+source: "key\x0a\x09^ 'a'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateInitializeCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "Accessors";
+},
+args: [],
+source: "label\x0a\x09^ 'Accessors'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerateInitializeCommand.klass);
+
+
+smalltalk.addClass('HLToggleCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
 return "t";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 't'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleCommand.klass);
+globals.HLToggleCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Toggle";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Toggle'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleCommand.klass);
+globals.HLToggleCommand.klass);
 
 
-smalltalk.addClass('HLToggleClassCommentCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLToggleClassCommentCommand', globals.HLToggleCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -453,147 +656,141 @@ var $1;
 $1=self._model();
 $ctx1.sendIdx["model"]=1;
 _st($1)._showComment_(_st(_st(self._model())._showComment())._not());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassCommentCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLToggleClassCommentCommand)})},
 args: [],
 source: "execute\x0a\x09self model showComment: self model showComment not",
 messageSends: ["showComment:", "model", "not", "showComment"],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassCommentCommand);
+globals.HLToggleClassCommentCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "d";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassCommentCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'd'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassCommentCommand.klass);
+globals.HLToggleClassCommentCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Documentation";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassCommentCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Documentation'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassCommentCommand.klass);
+globals.HLToggleClassCommentCommand.klass);
 
 
-smalltalk.addClass('HLToggleClassSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLToggleClassSideCommand', globals.HLToggleCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._showInstance_(false);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassSideCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLToggleClassSideCommand)})},
 args: [],
 source: "execute\x0a\x09self model showInstance: false",
 messageSends: ["showInstance:", "model"],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassSideCommand);
+globals.HLToggleClassSideCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassSideCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassSideCommand.klass);
+globals.HLToggleClassSideCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassSideCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class side'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleClassSideCommand.klass);
+globals.HLToggleClassSideCommand.klass);
 
 
-smalltalk.addClass('HLToggleInstanceSideCommand', smalltalk.HLToggleCommand, [], 'Helios-Commands-Browser');
+smalltalk.addClass('HLToggleInstanceSideCommand', globals.HLToggleCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._showInstance_(true);
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleInstanceSideCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLToggleInstanceSideCommand)})},
 args: [],
 source: "execute\x0a\x09self model showInstance: true",
 messageSends: ["showInstance:", "model"],
 referencedClasses: []
 }),
-smalltalk.HLToggleInstanceSideCommand);
+globals.HLToggleInstanceSideCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "i";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'i'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleInstanceSideCommand.klass);
+globals.HLToggleInstanceSideCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Instance side";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Instance side'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToggleInstanceSideCommand.klass);
+globals.HLToggleInstanceSideCommand.klass);
 
 });

+ 171 - 195
js/Helios-Commands-Core.js

@@ -1,15 +1,15 @@
-define("amber_core/Helios-Commands-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Commands-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Commands-Core');
 smalltalk.packages["Helios-Commands-Core"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
+smalltalk.addClass('HLCommand', globals.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asActionBinding",
-category: 'converting',
+protocol: 'converting',
 fn: function (){
 var self=this;
-function $HLBindingAction(){return smalltalk.HLBindingAction||(typeof HLBindingAction=="undefined"?nil:HLBindingAction)}
+function $HLBindingAction(){return globals.HLBindingAction||(typeof HLBindingAction=="undefined"?nil:HLBindingAction)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$1;
 $2=_st($HLBindingAction())._on_labelled_(self._keyCode(),self._label());
@@ -17,18 +17,18 @@ _st($2)._command_(self);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},globals.HLCommand)})},
 args: [],
 source: "asActionBinding\x0a\x09^ (HLBindingAction on: self keyCode labelled: self label)\x0a    \x09command: self;\x0a\x09\x09yourself",
 messageSends: ["command:", "on:labelled:", "keyCode", "label", "yourself"],
 referencedClasses: ["HLBindingAction"]
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asBinding",
-category: 'converting',
+protocol: 'converting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -40,338 +40,331 @@ $1=self._asGroupBinding();
 $1=self._asActionBinding();
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asBinding",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"asBinding",{},globals.HLCommand)})},
 args: [],
 source: "asBinding\x0a\x09^ self isBindingGroup\x0a\x09\x09ifTrue: [ self asGroupBinding ]\x0a\x09\x09ifFalse: [ self asActionBinding ]",
 messageSends: ["ifTrue:ifFalse:", "isBindingGroup", "asGroupBinding", "asActionBinding"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asGroupBinding",
-category: 'converting',
+protocol: 'converting',
 fn: function (){
 var self=this;
-function $HLBindingGroup(){return smalltalk.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
+function $HLBindingGroup(){return globals.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st($HLBindingGroup())._on_labelled_(self._keyCode(),self._label());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asGroupBinding",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"asGroupBinding",{},globals.HLCommand)})},
 args: [],
 source: "asGroupBinding\x0a\x09^ HLBindingGroup \x0a\x09\x09on: self keyCode\x0a\x09\x09labelled: self label",
 messageSends: ["on:labelled:", "keyCode", "label"],
 referencedClasses: ["HLBindingGroup"]
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "commandError:",
-category: 'error handling',
+protocol: 'error handling',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._error_(aString);
-return self}, function($ctx1) {$ctx1.fill(self,"commandError:",{aString:aString},smalltalk.HLCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"commandError:",{aString:aString},globals.HLCommand)})},
 args: ["aString"],
 source: "commandError: aString\x0a\x09self error: aString",
 messageSends: ["error:"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultInput",
-category: 'defaults',
+protocol: 'defaults',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "";
-}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},smalltalk.HLCommand)})},
+},
 args: [],
 source: "defaultInput\x0a\x09^ ''",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "documentation",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._class())._documentation();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"documentation",{},globals.HLCommand)})},
 args: [],
 source: "documentation\x0a\x09^ self class documentation",
 messageSends: ["documentation", "class"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCommand)})},
+return self},
 args: [],
 source: "execute",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "input",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@input"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"input",{},smalltalk.HLCommand)})},
+},
 args: [],
 source: "input\x0a\x09^ input",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "input:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 self["@input"]=aString;
 $1=self["@input"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"input:",{aString:aString},smalltalk.HLCommand)})},
+},
 args: ["aString"],
 source: "input: aString\x0a\x09^ input := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=[];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLCommand)})},
+},
 args: [],
 source: "inputCompletion\x0a\x09^ #()",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._label();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},globals.HLCommand)})},
 args: [],
 source: "inputLabel\x0a\x09^ self label",
 messageSends: ["label"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isAction",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._isBindingGroup())._not();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isAction",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isAction",{},globals.HLCommand)})},
 args: [],
 source: "isAction\x0a\x09^ self isBindingGroup not",
 messageSends: ["not", "isBindingGroup"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLCommand)})},
+},
 args: [],
 source: "isActive\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isBindingGroup",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(_st(self._class())._methodDictionary())._includesKey_("execute"))._not();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{},globals.HLCommand)})},
 args: [],
 source: "isBindingGroup\x0a\x09^ (self class methodDictionary includesKey: 'execute') not",
 messageSends: ["not", "includesKey:", "methodDictionary", "class"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return false;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._class())._key();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"key",{},globals.HLCommand)})},
 args: [],
 source: "key\x0a\x09^ self class key",
 messageSends: ["key", "class"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "keyCode",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._key())._asUppercase())._charCodeAt_((1));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"keyCode",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"keyCode",{},globals.HLCommand)})},
 args: [],
 source: "keyCode\x0a\x09^ self key asUppercase charCodeAt: 1",
 messageSends: ["charCodeAt:", "asUppercase", "key"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._class())._label();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"label",{},globals.HLCommand)})},
 args: [],
 source: "label\x0a\x09^ self class label",
 messageSends: ["label", "class"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._class())._menuLabel();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},globals.HLCommand)})},
 args: [],
 source: "menuLabel\x0a\x09^ self class menuLabel",
 messageSends: ["menuLabel", "class"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "registerOn:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aBinding){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aBinding)._add_(self._asBinding());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},globals.HLCommand)})},
 args: ["aBinding"],
 source: "registerOn: aBinding\x0a\x09^ aBinding add: self asBinding",
 messageSends: ["add:", "asBinding"],
 referencedClasses: []
 }),
-smalltalk.HLCommand);
+globals.HLCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "concreteClasses",
-category: 'registration',
+protocol: 'registration',
 fn: function (){
 var self=this;
 var classes;
-function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 classes=_st($OrderedCollection())._new();
@@ -385,118 +378,114 @@ return _st(classes)._addAll_(_st(each)._concreteClasses());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 $2=classes;
 return $2;
-}, function($ctx1) {$ctx1.fill(self,"concreteClasses",{classes:classes},smalltalk.HLCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"concreteClasses",{classes:classes},globals.HLCommand.klass)})},
 args: [],
 source: "concreteClasses\x0a\x09| classes |\x0a\x09\x0a\x09classes := OrderedCollection new.\x0a\x09\x0a\x09self isConcrete\x0a\x09\x09ifTrue: [ classes add: self ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each | \x0a\x09\x09classes addAll: each concreteClasses ].\x0a\x09\x09\x0a\x09^ classes",
 messageSends: ["new", "ifTrue:", "isConcrete", "add:", "do:", "subclasses", "addAll:", "concreteClasses"],
 referencedClasses: ["OrderedCollection"]
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "documentation",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "";
-}, function($ctx1) {$ctx1.fill(self,"documentation",{},smalltalk.HLCommand.klass)})},
+},
 args: [],
 source: "documentation\x0a\x09^ ''",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isConcrete",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._key())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isConcrete",{},smalltalk.HLCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"isConcrete",{},globals.HLCommand.klass)})},
 args: [],
 source: "isConcrete\x0a\x09^ self key notNil",
 messageSends: ["notNil", "key"],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isValidFor:",
-category: 'testing',
+protocol: 'testing',
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLCommand.klass)})},
+},
 args: ["aModel"],
 source: "isValidFor: aModel\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return nil;
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09\x22Answer a single character string or nil if no key\x22\x0a\x09\x0a\x09^ nil",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ ''",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._label();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},globals.HLCommand.klass)})},
 args: [],
 source: "menuLabel\x0a\x09^ self label",
 messageSends: ["label"],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "registerConcreteClassesOn:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aBinding){
 var self=this;
 var newBinding;
@@ -514,143 +503,139 @@ _st(self._subclasses())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._registerConcreteClassesOn_(newBinding);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding,newBinding:newBinding},smalltalk.HLCommand.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding,newBinding:newBinding},globals.HLCommand.klass)})},
 args: ["aBinding"],
 source: "registerConcreteClassesOn: aBinding\x0a\x09| newBinding |\x0a\x09\x0a\x09self isConcrete\x0a\x09\x09ifTrue: [ newBinding := self registerOn: aBinding ]\x0a\x09\x09ifFalse: [ newBinding := aBinding ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each | each registerConcreteClassesOn: newBinding ]",
 messageSends: ["ifTrue:ifFalse:", "isConcrete", "registerOn:", "do:", "subclasses", "registerConcreteClassesOn:"],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "registerOn:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aBinding){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._new())._registerOn_(aBinding);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},globals.HLCommand.klass)})},
 args: ["aBinding"],
 source: "registerOn: aBinding\x0a\x09^ self new registerOn: aBinding",
 messageSends: ["registerOn:", "new"],
 referencedClasses: []
 }),
-smalltalk.HLCommand.klass);
+globals.HLCommand.klass);
 
 
-smalltalk.addClass('HLCloseTabCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLCloseTabCommand', globals.HLCommand, [], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
-function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
+function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
 return smalltalk.withContext(function($ctx1) { 
 _st(_st($HLManager())._current())._removeActiveTab();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCloseTabCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLCloseTabCommand)})},
 args: [],
 source: "execute\x0a\x09HLManager current removeActiveTab",
 messageSends: ["removeActiveTab", "current"],
 referencedClasses: ["HLManager"]
 }),
-smalltalk.HLCloseTabCommand);
+globals.HLCloseTabCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "w";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCloseTabCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'w'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCloseTabCommand.klass);
+globals.HLCloseTabCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Close tab";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCloseTabCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Close tab'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCloseTabCommand.klass);
+globals.HLCloseTabCommand.klass);
 
 
-smalltalk.addClass('HLModelCommand', smalltalk.HLCommand, ['model'], 'Helios-Commands-Core');
+smalltalk.addClass('HLModelCommand', globals.HLCommand, ['model'], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "model",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@model"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLModelCommand)})},
+},
 args: [],
 source: "model\x0a\x09^ model",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLModelCommand);
+globals.HLModelCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "model:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@model"]=aModel;
-return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLModelCommand)})},
+return self},
 args: ["aModel"],
 source: "model: aModel\x0a\x09model := aModel",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLModelCommand);
+globals.HLModelCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "for:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self._new();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"for:",{aModel:aModel},smalltalk.HLModelCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"for:",{aModel:aModel},globals.HLModelCommand.klass)})},
 args: ["aModel"],
 source: "for: aModel\x0a\x09^ self new",
 messageSends: ["new"],
 referencedClasses: []
 }),
-smalltalk.HLModelCommand.klass);
+globals.HLModelCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "registerConcreteClassesOn:for:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aBinding,aModel){
 var self=this;
 var newBinding;
@@ -671,185 +656,179 @@ _st(self._subclasses())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._registerConcreteClassesOn_for_(newBinding,aModel);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:for:",{aBinding:aBinding,aModel:aModel,newBinding:newBinding},smalltalk.HLModelCommand.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:for:",{aBinding:aBinding,aModel:aModel,newBinding:newBinding},globals.HLModelCommand.klass)})},
 args: ["aBinding", "aModel"],
 source: "registerConcreteClassesOn: aBinding for: aModel\x0a\x09| newBinding |\x0a\x09\x0a\x09(self isConcrete and: [ self isValidFor: aModel ])\x0a\x09\x09ifTrue: [ newBinding := self registerOn: aBinding for: aModel ]\x0a\x09\x09ifFalse: [ newBinding := aBinding ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each |\x0a\x09\x09each registerConcreteClassesOn: newBinding for: aModel ]",
 messageSends: ["ifTrue:ifFalse:", "and:", "isConcrete", "isValidFor:", "registerOn:for:", "do:", "subclasses", "registerConcreteClassesOn:for:"],
 referencedClasses: []
 }),
-smalltalk.HLModelCommand.klass);
+globals.HLModelCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "registerOn:for:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aBinding,aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._for_(aModel))._registerOn_(aBinding);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"registerOn:for:",{aBinding:aBinding,aModel:aModel},smalltalk.HLModelCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"registerOn:for:",{aBinding:aBinding,aModel:aModel},globals.HLModelCommand.klass)})},
 args: ["aBinding", "aModel"],
 source: "registerOn: aBinding for: aModel\x0a\x09^ (self for: aModel) registerOn: aBinding",
 messageSends: ["registerOn:", "for:"],
 referencedClasses: []
 }),
-smalltalk.HLModelCommand.klass);
+globals.HLModelCommand.klass);
 
 
-smalltalk.addClass('HLOpenCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLOpenCommand', globals.HLCommand, [], 'Helios-Commands-Core');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "o";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLOpenCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'o'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenCommand.klass);
+globals.HLOpenCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Open";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLOpenCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Open'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenCommand.klass);
+globals.HLOpenCommand.klass);
 
 
-smalltalk.addClass('HLOpenBrowserCommand', smalltalk.HLOpenCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLOpenBrowserCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
-function $HLBrowser(){return smalltalk.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
+function $HLBrowser(){return globals.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st($HLBrowser())._openAsTab();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenBrowserCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLOpenBrowserCommand)})},
 args: [],
 source: "execute\x0a\x09^ HLBrowser openAsTab",
 messageSends: ["openAsTab"],
 referencedClasses: ["HLBrowser"]
 }),
-smalltalk.HLOpenBrowserCommand);
+globals.HLOpenBrowserCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "b";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLOpenBrowserCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'b'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenBrowserCommand.klass);
+globals.HLOpenBrowserCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Browser";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLOpenBrowserCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Browser'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenBrowserCommand.klass);
+globals.HLOpenBrowserCommand.klass);
 
 
-smalltalk.addClass('HLOpenWorkspaceCommand', smalltalk.HLOpenCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLOpenWorkspaceCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
-function $HLWorkspace(){return smalltalk.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
+function $HLWorkspace(){return globals.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st($HLWorkspace())._openAsTab();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenWorkspaceCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLOpenWorkspaceCommand)})},
 args: [],
 source: "execute\x0a\x09^ HLWorkspace openAsTab",
 messageSends: ["openAsTab"],
 referencedClasses: ["HLWorkspace"]
 }),
-smalltalk.HLOpenWorkspaceCommand);
+globals.HLOpenWorkspaceCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "w";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLOpenWorkspaceCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'w'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenWorkspaceCommand.klass);
+globals.HLOpenWorkspaceCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Workspace";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLOpenWorkspaceCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Workspace'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLOpenWorkspaceCommand.klass);
+globals.HLOpenWorkspaceCommand.klass);
 
 
-smalltalk.addClass('HLSwitchTabCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLSwitchTabCommand', globals.HLCommand, [], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 var activeTab;
-function $HLTabSelectionWidget(){return smalltalk.HLTabSelectionWidget||(typeof HLTabSelectionWidget=="undefined"?nil:HLTabSelectionWidget)}
+function $HLTabSelectionWidget(){return globals.HLTabSelectionWidget||(typeof HLTabSelectionWidget=="undefined"?nil:HLTabSelectionWidget)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$3,$1;
 activeTab=self._selectedTab();
@@ -873,102 +852,99 @@ return _st(activeTab)._activate();
 $3=_st($2)._show();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"execute",{activeTab:activeTab},smalltalk.HLSwitchTabCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"execute",{activeTab:activeTab},globals.HLSwitchTabCommand)})},
 args: [],
 source: "execute\x0a\x09| activeTab |\x0a\x09\x0a\x09activeTab := self selectedTab.\x0a\x09\x0a\x09^ HLTabSelectionWidget new\x0a\x09\x09tabs: self tabs;\x0a\x09\x09selectedTab: self selectedTab;\x0a\x09\x09selectCallback: [ :tab | tab activate ];\x0a\x09\x09confirmCallback: [ :tab | tab focus ];\x0a\x09\x09cancelCallback: [ activeTab activate ];\x0a\x09\x09show",
 messageSends: ["selectedTab", "tabs:", "new", "tabs", "selectedTab:", "selectCallback:", "activate", "confirmCallback:", "focus", "cancelCallback:", "show"],
 referencedClasses: ["HLTabSelectionWidget"]
 }),
-smalltalk.HLSwitchTabCommand);
+globals.HLSwitchTabCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "selectedTab",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
+function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st($HLManager())._current())._activeTab();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"selectedTab",{},smalltalk.HLSwitchTabCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"selectedTab",{},globals.HLSwitchTabCommand)})},
 args: [],
 source: "selectedTab\x0a\x09^ HLManager current activeTab",
 messageSends: ["activeTab", "current"],
 referencedClasses: ["HLManager"]
 }),
-smalltalk.HLSwitchTabCommand);
+globals.HLSwitchTabCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "tabs",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
+function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st($HLManager())._current())._tabs();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLSwitchTabCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"tabs",{},globals.HLSwitchTabCommand)})},
 args: [],
 source: "tabs\x0a\x09^ HLManager current tabs",
 messageSends: ["tabs", "current"],
 referencedClasses: ["HLManager"]
 }),
-smalltalk.HLSwitchTabCommand);
+globals.HLSwitchTabCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "s";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLSwitchTabCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 's'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSwitchTabCommand.klass);
+globals.HLSwitchTabCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Switch";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLSwitchTabCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Switch'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSwitchTabCommand.klass);
+globals.HLSwitchTabCommand.klass);
 
 
-smalltalk.addClass('HLViewCommand', smalltalk.HLCommand, [], 'Helios-Commands-Core');
+smalltalk.addClass('HLViewCommand', globals.HLCommand, [], 'Helios-Commands-Core');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "View";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLViewCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'View'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLViewCommand.klass);
+globals.HLViewCommand.klass);
 
 });

+ 355 - 434
js/Helios-Commands-Tools.js

@@ -1,29 +1,28 @@
-define("amber_core/Helios-Commands-Tools", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Commands-Core"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Commands-Tools", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Commands-Core"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Commands-Tools');
 smalltalk.packages["Helios-Commands-Tools"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLToolCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLToolCommand', globals.HLModelCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return nil;
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLToolCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ nil",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLToolCommand);
+globals.HLToolCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "for:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aToolModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -33,477 +32,458 @@ _st($2)._model_(aToolModel);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"for:",{aToolModel:aToolModel},smalltalk.HLToolCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"for:",{aToolModel:aToolModel},globals.HLToolCommand.klass)})},
 args: ["aToolModel"],
 source: "for: aToolModel\x0a\x09^ self new\x0a    \x09model: aToolModel;\x0a        yourself",
 messageSends: ["model:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLToolCommand.klass);
+globals.HLToolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isValidFor:",
-category: 'testing',
+protocol: 'testing',
 fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aModel)._isToolModel();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLToolCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLToolCommand.klass)})},
 args: ["aModel"],
 source: "isValidFor: aModel\x0a\x09^ aModel isToolModel",
 messageSends: ["isToolModel"],
 referencedClasses: []
 }),
-smalltalk.HLToolCommand.klass);
+globals.HLToolCommand.klass);
 
 
-smalltalk.addClass('HLCommitPackageCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLCommitPackageCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Packages";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLCommitPackageCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Packages'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommitPackageCommand);
+globals.HLCommitPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._commitPackage();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCommitPackageCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLCommitPackageCommand)})},
 args: [],
 source: "execute\x0a\x09self model commitPackage",
 messageSends: ["commitPackage", "model"],
 referencedClasses: []
 }),
-smalltalk.HLCommitPackageCommand);
+globals.HLCommitPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLCommitPackageCommand)})},
+},
 args: [],
 source: "isActive\x0a\x09^ true\x0a\x09\x22 slf model isPackageDirty\x22",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommitPackageCommand);
+globals.HLCommitPackageCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "k";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCommitPackageCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'k'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommitPackageCommand.klass);
+globals.HLCommitPackageCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Commit";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCommitPackageCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Commit'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCommitPackageCommand.klass);
+globals.HLCommitPackageCommand.klass);
 
 
-smalltalk.addClass('HLCopyCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLCopyCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCopyCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyCommand.klass);
+globals.HLCopyCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Copy";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCopyCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Copy'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyCommand.klass);
+globals.HLCopyCommand.klass);
 
 
-smalltalk.addClass('HLCopyClassCommand', smalltalk.HLCopyCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLCopyClassCommand', globals.HLCopyCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLCopyClassCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Classes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultInput",
-category: 'defaults',
+protocol: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedClass())._name();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},smalltalk.HLCopyClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},globals.HLCopyClassCommand)})},
 args: [],
 source: "defaultInput\x0a\x09^ self model selectedClass name",
 messageSends: ["name", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "New class name:";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLCopyClassCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'New class name:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._copyClassTo_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLCopyClassCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLCopyClassCommand)})},
 args: [],
 source: "execute\x0a\x09self model copyClassTo: self input",
 messageSends: ["copyClassTo:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedClass())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLCopyClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLCopyClassCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedClass notNil",
 messageSends: ["notNil", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLCopyClassCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand);
+globals.HLCopyClassCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCopyClassCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand.klass);
+globals.HLCopyClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLCopyClassCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand.klass);
+globals.HLCopyClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Copy class...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLCopyClassCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Copy class...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLCopyClassCommand.klass);
+globals.HLCopyClassCommand.klass);
 
 
-smalltalk.addClass('HLFindCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLFindCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "f";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLFindCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'f'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindCommand.klass);
+globals.HLFindCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Find";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLFindCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Find'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindCommand.klass);
+globals.HLFindCommand.klass);
 
 
-smalltalk.addClass('HLFindClassCommand', smalltalk.HLFindCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLFindClassCommand', globals.HLFindCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "select a class";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLFindClassCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'select a class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand);
+globals.HLFindClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._openClassNamed_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLFindClassCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLFindClassCommand)})},
 args: [],
 source: "execute\x0a\x09self model openClassNamed: self input",
 messageSends: ["openClassNamed:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand);
+globals.HLFindClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._model())._availableClassNames();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLFindClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},globals.HLFindClassCommand)})},
 args: [],
 source: "inputCompletion\x0a\x09^ self model availableClassNames",
 messageSends: ["availableClassNames", "model"],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand);
+globals.HLFindClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Find a class";
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLFindClassCommand)})},
+},
 args: [],
 source: "inputLabel\x0a\x09^ 'Find a class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand);
+globals.HLFindClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLFindClassCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand);
+globals.HLFindClassCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isValidFor:",
-category: 'testing',
+protocol: 'testing',
 fn: function (aModel){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(aModel)._isBrowserModel();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},smalltalk.HLFindClassCommand.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLFindClassCommand.klass)})},
 args: ["aModel"],
 source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
 messageSends: ["isBrowserModel"],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand.klass);
+globals.HLFindClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLFindClassCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand.klass);
+globals.HLFindClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLFindClassCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindClassCommand.klass);
+globals.HLFindClassCommand.klass);
 
 
-smalltalk.addClass('HLFindReferencesCommand', smalltalk.HLFindCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLFindReferencesCommand', globals.HLFindCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultInput",
-category: 'defaults',
+protocol: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -526,54 +506,53 @@ method=$receiver;
 $1=_st(method)._selector();
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},smalltalk.HLFindReferencesCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},globals.HLFindReferencesCommand)})},
 args: [],
 source: "defaultInput\x0a\x09^ self model selectedMethod \x0a\x09\x09ifNil: [\x0a\x09\x09\x09self model selectedClass\x0a\x09\x09\x09\x09ifNil: [ '' ]\x0a\x09\x09\x09\x09ifNotNil: [ :class | class name ] ]\x0a\x09\x09ifNotNil: [ :method | method selector ]",
 messageSends: ["ifNil:ifNotNil:", "selectedMethod", "model", "selectedClass", "name", "selector"],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "find references";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLFindReferencesCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'find references'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
-function $HLReferences(){return smalltalk.HLReferences||(typeof HLReferences=="undefined"?nil:HLReferences)}
+function $HLReferences(){return globals.HLReferences||(typeof HLReferences=="undefined"?nil:HLReferences)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st($HLReferences())._new();
 _st($1)._openAsTab();
 $2=_st($1)._search_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLFindReferencesCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLFindReferencesCommand)})},
 args: [],
 source: "execute\x0a\x09HLReferences new \x0a\x09\x09openAsTab;\x0a\x09\x09search: self input",
 messageSends: ["openAsTab", "new", "search:", "input"],
 referencedClasses: ["HLReferences"]
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -583,1324 +562,1266 @@ $ctx1.sendIdx["model"]=1;
 $2=_st($3)._availableClassNames();
 $1=_st($2).__comma(_st(self._model())._allSelectors());
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLFindReferencesCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},globals.HLFindReferencesCommand)})},
 args: [],
 source: "inputCompletion\x0a\x09^ self model availableClassNames, self model allSelectors",
 messageSends: [",", "availableClassNames", "model", "allSelectors"],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Find references of";
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLFindReferencesCommand)})},
+},
 args: [],
 source: "inputLabel\x0a\x09^ 'Find references of'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLFindReferencesCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand);
+globals.HLFindReferencesCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "r";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLFindReferencesCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'r'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand.klass);
+globals.HLFindReferencesCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "References";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLFindReferencesCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'References'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLFindReferencesCommand.klass);
+globals.HLFindReferencesCommand.klass);
 
 
-smalltalk.addClass('HLMoveToCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveToCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "m";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveToCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'm'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveToCommand.klass);
+globals.HLMoveToCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveToCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Move'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveToCommand.klass);
+globals.HLMoveToCommand.klass);
 
 
-smalltalk.addClass('HLMoveClassToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveClassToCommand', globals.HLMoveToCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedClass())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLMoveClassToCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLMoveClassToCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedClass notNil",
 messageSends: ["notNil", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToCommand);
+globals.HLMoveClassToCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveClassToCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToCommand.klass);
+globals.HLMoveClassToCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveClassToCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToCommand.klass);
+globals.HLMoveClassToCommand.klass);
 
 
-smalltalk.addClass('HLMoveClassToPackageCommand', smalltalk.HLMoveClassToCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveClassToPackageCommand', globals.HLMoveClassToCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLMoveClassToPackageCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Classes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "select a package";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLMoveClassToPackageCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'select a package'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._moveClassToPackage_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveClassToPackageCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLMoveClassToPackageCommand)})},
 args: [],
 source: "execute\x0a\x09self model moveClassToPackage: self input",
 messageSends: ["moveClassToPackage:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._model())._availablePackageNames();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLMoveClassToPackageCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},globals.HLMoveClassToPackageCommand)})},
 args: [],
 source: "inputCompletion\x0a\x09^ self model availablePackageNames",
 messageSends: ["availablePackageNames", "model"],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move class to package:";
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLMoveClassToPackageCommand)})},
+},
 args: [],
 source: "inputLabel\x0a\x09^ 'Move class to package:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLMoveClassToPackageCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand);
+globals.HLMoveClassToPackageCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "p";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveClassToPackageCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'p'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand.klass);
+globals.HLMoveClassToPackageCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "to package";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveClassToPackageCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'to package'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand.klass);
+globals.HLMoveClassToPackageCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move to package...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLMoveClassToPackageCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x09\x0a\x09^ 'Move to package...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveClassToPackageCommand.klass);
+globals.HLMoveClassToPackageCommand.klass);
 
 
-smalltalk.addClass('HLMoveMethodToCommand', smalltalk.HLMoveToCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveMethodToCommand', globals.HLMoveToCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Methods";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLMoveMethodToCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Methods'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToCommand);
+globals.HLMoveMethodToCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedMethod())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLMoveMethodToCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLMoveMethodToCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedMethod notNil",
 messageSends: ["notNil", "selectedMethod", "model"],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToCommand);
+globals.HLMoveMethodToCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "m";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'm'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToCommand.klass);
+globals.HLMoveMethodToCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Method";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Method'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToCommand.klass);
+globals.HLMoveMethodToCommand.klass);
 
 
-smalltalk.addClass('HLMoveMethodToClassCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveMethodToClassCommand', globals.HLMoveMethodToCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "select a class";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLMoveMethodToClassCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'select a class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+globals.HLMoveMethodToClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._moveMethodToClass_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLMoveMethodToClassCommand)})},
 args: [],
 source: "execute\x0a\x09self model moveMethodToClass: self input",
 messageSends: ["moveMethodToClass:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+globals.HLMoveMethodToClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._model())._availableClassNames();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLMoveMethodToClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},globals.HLMoveMethodToClassCommand)})},
 args: [],
 source: "inputCompletion\x0a\x09^ self model availableClassNames",
 messageSends: ["availableClassNames", "model"],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+globals.HLMoveMethodToClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move method to class:";
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLMoveMethodToClassCommand)})},
+},
 args: [],
 source: "inputLabel\x0a\x09^ 'Move method to class:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+globals.HLMoveMethodToClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLMoveMethodToClassCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand);
+globals.HLMoveMethodToClassCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand.klass);
+globals.HLMoveMethodToClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "to class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
+},
 args: [],
 source: "label\x09\x0a\x09^ 'to class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand.klass);
+globals.HLMoveMethodToClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move to class...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x09\x0a\x09^ 'Move to class...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToClassCommand.klass);
+globals.HLMoveMethodToClassCommand.klass);
 
 
-smalltalk.addClass('HLMoveMethodToProtocolCommand', smalltalk.HLMoveMethodToCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLMoveMethodToProtocolCommand', globals.HLMoveMethodToCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "select a protocol";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'select a protocol'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand);
+globals.HLMoveMethodToProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._moveMethodToProtocol_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLMoveMethodToProtocolCommand)})},
 args: [],
 source: "execute\x0a\x09self model moveMethodToProtocol: self input",
 messageSends: ["moveMethodToProtocol:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand);
+globals.HLMoveMethodToProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputCompletion",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._model())._availableProtocols();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},globals.HLMoveMethodToProtocolCommand)})},
 args: [],
 source: "inputCompletion\x0a\x09^ self model availableProtocols",
 messageSends: ["availableProtocols", "model"],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand);
+globals.HLMoveMethodToProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inputLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move method to a protocol:";
-}, function($ctx1) {$ctx1.fill(self,"inputLabel",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+},
 args: [],
 source: "inputLabel\x0a\x09^ 'Move method to a protocol:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand);
+globals.HLMoveMethodToProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand);
+globals.HLMoveMethodToProtocolCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "t";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 't'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
+globals.HLMoveMethodToProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "to protocol";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'to protocol'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
+globals.HLMoveMethodToProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Move to protocol...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Move to protocol...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLMoveMethodToProtocolCommand.klass);
+globals.HLMoveMethodToProtocolCommand.klass);
 
 
-smalltalk.addClass('HLRemoveCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRemoveCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "x";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'x'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveCommand.klass);
+globals.HLRemoveCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Remove";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Remove'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveCommand.klass);
+globals.HLRemoveCommand.klass);
 
 
-smalltalk.addClass('HLRemoveClassCommand', smalltalk.HLRemoveCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRemoveClassCommand', globals.HLRemoveCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLRemoveClassCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Classes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand);
+globals.HLRemoveClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._removeClass();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRemoveClassCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLRemoveClassCommand)})},
 args: [],
 source: "execute\x0a\x09self model removeClass",
 messageSends: ["removeClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand);
+globals.HLRemoveClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedClass())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRemoveClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLRemoveClassCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedClass notNil",
 messageSends: ["notNil", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand);
+globals.HLRemoveClassCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveClassCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand.klass);
+globals.HLRemoveClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveClassCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand.klass);
+globals.HLRemoveClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Remove class";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLRemoveClassCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Remove class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveClassCommand.klass);
+globals.HLRemoveClassCommand.klass);
 
 
-smalltalk.addClass('HLRemoveMethodCommand', smalltalk.HLRemoveCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRemoveMethodCommand', globals.HLRemoveCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Methods";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLRemoveMethodCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Methods'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand);
+globals.HLRemoveMethodCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._removeMethod();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRemoveMethodCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLRemoveMethodCommand)})},
 args: [],
 source: "execute\x0a\x09self model removeMethod",
 messageSends: ["removeMethod", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand);
+globals.HLRemoveMethodCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedMethod())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRemoveMethodCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLRemoveMethodCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedMethod notNil",
 messageSends: ["notNil", "selectedMethod", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand);
+globals.HLRemoveMethodCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "m";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveMethodCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'm'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand.klass);
+globals.HLRemoveMethodCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Method";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveMethodCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Method'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand.klass);
+globals.HLRemoveMethodCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Remove method";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLRemoveMethodCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Remove method'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveMethodCommand.klass);
+globals.HLRemoveMethodCommand.klass);
 
 
-smalltalk.addClass('HLRemoveProtocolCommand', smalltalk.HLRemoveCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRemoveProtocolCommand', globals.HLRemoveCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Protocols";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLRemoveProtocolCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Protocols'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand);
+globals.HLRemoveProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._removeProtocol();
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRemoveProtocolCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLRemoveProtocolCommand)})},
 args: [],
 source: "execute\x0a\x09self model removeProtocol",
 messageSends: ["removeProtocol", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand);
+globals.HLRemoveProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedProtocol())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRemoveProtocolCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLRemoveProtocolCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedProtocol notNil",
 messageSends: ["notNil", "selectedProtocol", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand);
+globals.HLRemoveProtocolCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "t";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRemoveProtocolCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 't'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand.klass);
+globals.HLRemoveProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Protocol";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRemoveProtocolCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Protocol'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand.klass);
+globals.HLRemoveProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Remove protocol";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLRemoveProtocolCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Remove protocol'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRemoveProtocolCommand.klass);
+globals.HLRemoveProtocolCommand.klass);
 
 
-smalltalk.addClass('HLRenameCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRenameCommand', globals.HLToolCommand, [], 'Helios-Commands-Tools');
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "r";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRenameCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'r'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameCommand.klass);
+globals.HLRenameCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Rename";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRenameCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Rename'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameCommand.klass);
+globals.HLRenameCommand.klass);
 
 
-smalltalk.addClass('HLRenameClassCommand', smalltalk.HLRenameCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRenameClassCommand', globals.HLRenameCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Classes";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLRenameClassCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Classes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultInput",
-category: 'defaults',
+protocol: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(_st(self._model())._selectedClass())._theNonMetaClass())._name();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},smalltalk.HLRenameClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},globals.HLRenameClassCommand)})},
 args: [],
 source: "defaultInput\x0a\x09^ self model selectedClass theNonMetaClass name",
 messageSends: ["name", "theNonMetaClass", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Rename class to:";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLRenameClassCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'Rename class to:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._renameClassTo_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRenameClassCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLRenameClassCommand)})},
 args: [],
 source: "execute\x0a\x09self model renameClassTo: self input",
 messageSends: ["renameClassTo:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedClass())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRenameClassCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLRenameClassCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedClass notNil",
 messageSends: ["notNil", "selectedClass", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLRenameClassCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand);
+globals.HLRenameClassCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "c";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRenameClassCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 'c'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand.klass);
+globals.HLRenameClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Class";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRenameClassCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Class'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand.klass);
+globals.HLRenameClassCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Rename class...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLRenameClassCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Rename class...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameClassCommand.klass);
+globals.HLRenameClassCommand.klass);
 
 
-smalltalk.addClass('HLRenameProtocolCommand', smalltalk.HLRenameCommand, [], 'Helios-Commands-Tools');
+smalltalk.addClass('HLRenameProtocolCommand', globals.HLRenameCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Protocols";
-}, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.HLRenameProtocolCommand)})},
+},
 args: [],
 source: "category\x0a\x09^ 'Protocols'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "defaultInput",
-category: 'defaults',
+protocol: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._model())._selectedProtocol();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},smalltalk.HLRenameProtocolCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"defaultInput",{},globals.HLRenameProtocolCommand)})},
 args: [],
 source: "defaultInput\x0a\x09^ self model selectedProtocol",
 messageSends: ["selectedProtocol", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "displayLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Rename protocol to:";
-}, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLRenameProtocolCommand)})},
+},
 args: [],
 source: "displayLabel\x0a\x09^ 'Rename protocol to:'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "execute",
-category: 'executing',
+protocol: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._model())._renameProtocolTo_(self._input());
-return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLRenameProtocolCommand)})},
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLRenameProtocolCommand)})},
 args: [],
 source: "execute\x0a\x09self model renameProtocolTo: self input",
 messageSends: ["renameProtocolTo:", "model", "input"],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isActive",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st(self._model())._selectedProtocol())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLRenameProtocolCommand)})},
+}, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLRenameProtocolCommand)})},
 args: [],
 source: "isActive\x0a\x09^ self model selectedProtocol notNil",
 messageSends: ["notNil", "selectedProtocol", "model"],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInputRequired",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isInputRequired",{},smalltalk.HLRenameProtocolCommand)})},
+},
 args: [],
 source: "isInputRequired\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand);
+globals.HLRenameProtocolCommand);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "key",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "t";
-}, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLRenameProtocolCommand.klass)})},
+},
 args: [],
 source: "key\x0a\x09^ 't'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand.klass);
+globals.HLRenameProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "label",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Protocol";
-}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLRenameProtocolCommand.klass)})},
+},
 args: [],
 source: "label\x0a\x09^ 'Protocol'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand.klass);
+globals.HLRenameProtocolCommand.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "menuLabel",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "Rename protocol...";
-}, function($ctx1) {$ctx1.fill(self,"menuLabel",{},smalltalk.HLRenameProtocolCommand.klass)})},
+},
 args: [],
 source: "menuLabel\x0a\x09^ 'Rename protocol...'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLRenameProtocolCommand.klass);
+globals.HLRenameProtocolCommand.klass);
 
 });

File diff suppressed because it is too large
+ 155 - 164
js/Helios-Core.js


File diff suppressed because it is too large
+ 167 - 191
js/Helios-Debugger.js


+ 7 - 7
js/Helios-Exceptions.js

@@ -1,16 +1,16 @@
-define("amber_core/Helios-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Exceptions"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Exceptions"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Exceptions');
 smalltalk.packages["Helios-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
-smalltalk.HLError.comment="I am the abstract superclass of all Helios-specific errors.";
+smalltalk.addClass('HLError', globals.Error, [], 'Helios-Exceptions');
+globals.HLError.comment="I am the abstract superclass of all Helios-specific errors.";
 
 
-smalltalk.addClass('HLChangeForbidden', smalltalk.HLError, [], 'Helios-Exceptions');
-smalltalk.HLChangeForbidden.comment="I get signaled when a (often user) requested change is forbidden. A confirmation message can then be displayed to the user.\x0a\x0aSee `HLModel >> withChangesDo:`.";
+smalltalk.addClass('HLChangeForbidden', globals.HLError, [], 'Helios-Exceptions');
+globals.HLChangeForbidden.comment="I get signaled when a (often user) requested change is forbidden. A confirmation message can then be displayed to the user.\x0a\x0aSee `HLModel >> withChangesDo:`.";
 
 
-smalltalk.addClass('HLListItemNotFound', smalltalk.HLError, [], 'Helios-Exceptions');
-smalltalk.HLListItemNotFound.comment="I get signaled by a `HLListWidget` when a non-existing item in the list is activated.";
+smalltalk.addClass('HLListItemNotFound', globals.HLError, [], 'Helios-Exceptions');
+globals.HLListItemNotFound.comment="I get signaled by a `HLListWidget` when a non-existing item in the list is activated.";
 
 });

+ 1054 - 0
js/Helios-Helpers.js

@@ -0,0 +1,1054 @@
+define("amber_core/Helios-Helpers", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
+smalltalk.addPackage('Helios-Helpers');
+smalltalk.packages["Helios-Helpers"].transport = {"type":"amd","amdNamespace":"amber_core"};
+
+smalltalk.addClass('HLClassifier', globals.Object, ['next', 'method'], 'Helios-Helpers');
+globals.HLClassifier.comment="I am an abstract class implementing a link in a `chain of responsibility` pattern.\x0a\x0aSubclasses are in charge of classifying a method according to multiple strategies.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "classify",
+protocol: 'protocol',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$2;
+$1=self._next();
+$ctx1.sendIdx["next"]=1;
+if(($receiver = $1) == nil || $receiver == null){
+return false;
+} else {
+$1;
+};
+$3=self._doClassify();
+if(smalltalk.assert($3)){
+$2=true;
+} else {
+$2=_st(self._next())._classify();
+};
+return $2;
+}, function($ctx1) {$ctx1.fill(self,"classify",{},globals.HLClassifier)})},
+args: [],
+source: "classify\x0a\x09self next ifNil: [ ^ false ].\x0a\x09\x0a\x09^ self doClassify\x0a\x09\x09ifTrue: [ true ]\x0a\x09\x09ifFalse: [ self next classify ]",
+messageSends: ["ifNil:", "next", "ifTrue:ifFalse:", "doClassify", "classify"],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doClassify",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"doClassify",{},globals.HLClassifier)})},
+args: [],
+source: "doClassify\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "method",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@method"];
+return $1;
+},
+args: [],
+source: "method\x0a\x09^ method",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "method:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+self["@method"]=anObject;
+$1=self._next();
+if(($receiver = $1) == nil || $receiver == null){
+$1;
+} else {
+var nextLink;
+nextLink=$receiver;
+_st(nextLink)._method_(anObject);
+};
+return self}, function($ctx1) {$ctx1.fill(self,"method:",{anObject:anObject},globals.HLClassifier)})},
+args: ["anObject"],
+source: "method: anObject\x0a\x09method := anObject.\x0a\x09self next\x0a\x09\x09ifNotNil: [ :nextLink | nextLink method: anObject ]",
+messageSends: ["ifNotNil:", "next", "method:"],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "next",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@next"];
+return $1;
+},
+args: [],
+source: "next\x0a\x09^ next",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "next:",
+protocol: 'accessing',
+fn: function (anObject){
+var self=this;
+self["@next"]=anObject;
+return self},
+args: ["anObject"],
+source: "next: anObject\x0a\x09next := anObject",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLClassifier);
+
+
+
+smalltalk.addClass('HLAccessorClassifier', globals.HLClassifier, [], 'Helios-Helpers');
+globals.HLAccessorClassifier.comment="I am a classifier checking the method selector matches an instance variable name.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doClassify",
+protocol: 'private',
+fn: function (){
+var self=this;
+var names,selector;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+names=_st(_st(self["@method"])._methodClass())._allInstanceVariableNames();
+selector=_st(self["@method"])._selector();
+$1=_st(_st(selector)._last()).__eq(":");
+if(smalltalk.assert($1)){
+selector=_st(selector)._allButLast();
+selector;
+};
+$2=_st(names)._includes_(selector);
+if(! smalltalk.assert($2)){
+return false;
+};
+_st(self["@method"])._protocol_("accessing");
+return true;
+}, function($ctx1) {$ctx1.fill(self,"doClassify",{names:names,selector:selector},globals.HLAccessorClassifier)})},
+args: [],
+source: "doClassify\x0a\x09| names selector |\x0a\x09\x0a\x09names := method methodClass allInstanceVariableNames.\x0a\x09selector := method selector.\x0a\x09\x0a\x09(selector last = ':')\x0a\x09\x09ifTrue: [ \x22selector might be a setter\x22\x0a\x09\x09\x09selector := selector allButLast ].\x0a\x09\x0a\x09(names includes: selector)\x0a\x09\x09ifFalse: [ ^ false ].\x0a\x09\x09\x0a\x09method protocol: 'accessing'.\x0a\x09^ true.",
+messageSends: ["allInstanceVariableNames", "methodClass", "selector", "ifTrue:", "=", "last", "allButLast", "ifFalse:", "includes:", "protocol:"],
+referencedClasses: []
+}),
+globals.HLAccessorClassifier);
+
+
+
+smalltalk.addClass('HLImplementorClassifier', globals.HLClassifier, [], 'Helios-Helpers');
+globals.HLImplementorClassifier.comment="I am a classifier checking the other implementations of the same selector and choose the protocol the most populated.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doClassify",
+protocol: 'private',
+fn: function (){
+var self=this;
+var currentClass;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$4,$2;
+var $early={};
+try {
+currentClass=_st(self["@method"])._methodClass();
+_st((function(){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(currentClass)._superclass();
+$ctx2.sendIdx["superclass"]=1;
+return _st($1)._isNil();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
+return smalltalk.withContext(function($ctx2) {
+currentClass=_st(currentClass)._superclass();
+currentClass;
+$3=currentClass;
+$4=_st(self["@method"])._selector();
+$ctx2.sendIdx["selector"]=1;
+$2=_st($3)._includesSelector_($4);
+if(smalltalk.assert($2)){
+_st(self["@method"])._protocol_(_st(_st(currentClass).__gt_gt(_st(self["@method"])._selector()))._protocol());
+throw $early=[true];
+};
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+return false;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}, function($ctx1) {$ctx1.fill(self,"doClassify",{currentClass:currentClass},globals.HLImplementorClassifier)})},
+args: [],
+source: "doClassify\x0a\x09| currentClass |\x0a\x09currentClass := method methodClass.\x0a\x09\x0a\x09[ currentClass superclass isNil ] whileFalse: [\x0a\x09\x09currentClass := currentClass superclass.\x0a\x09\x09(currentClass includesSelector: method selector)\x0a\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09method protocol: (currentClass >> method selector) protocol.\x0a\x09\x09\x09\x09^ true ]].\x0a\x09\x0a\x09^ false.",
+messageSends: ["methodClass", "whileFalse:", "isNil", "superclass", "ifTrue:", "includesSelector:", "selector", "protocol:", "protocol", ">>"],
+referencedClasses: []
+}),
+globals.HLImplementorClassifier);
+
+
+
+smalltalk.addClass('HLPrefixClassifier', globals.HLClassifier, ['prefixMapping'], 'Helios-Helpers');
+globals.HLPrefixClassifier.comment="I am classifier checking the method selector to know if it begins with a known prefix.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "buildPrefixDictionary",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+function $Dictionary(){return globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+self["@prefixMapping"]=_st($Dictionary())._new();
+$1=self["@prefixMapping"];
+_st($1)._at_put_("test","tests");
+$ctx1.sendIdx["at:put:"]=1;
+_st($1)._at_put_("bench","benchmarking");
+$ctx1.sendIdx["at:put:"]=2;
+_st($1)._at_put_("copy","copying");
+$ctx1.sendIdx["at:put:"]=3;
+_st($1)._at_put_("initialize","initialization");
+$ctx1.sendIdx["at:put:"]=4;
+_st($1)._at_put_("accept","visitor");
+$ctx1.sendIdx["at:put:"]=5;
+_st($1)._at_put_("visit","visitor");
+$ctx1.sendIdx["at:put:"]=6;
+_st($1)._at_put_("signal","signalling");
+$ctx1.sendIdx["at:put:"]=7;
+_st($1)._at_put_("parse","parsing");
+$ctx1.sendIdx["at:put:"]=8;
+_st($1)._at_put_("add","adding");
+$ctx1.sendIdx["at:put:"]=9;
+_st($1)._at_put_("is","testing");
+$ctx1.sendIdx["at:put:"]=10;
+_st($1)._at_put_("as","converting");
+$ctx1.sendIdx["at:put:"]=11;
+$2=_st($1)._at_put_("new","instance creation");
+return self}, function($ctx1) {$ctx1.fill(self,"buildPrefixDictionary",{},globals.HLPrefixClassifier)})},
+args: [],
+source: "buildPrefixDictionary\x0a\x09prefixMapping := Dictionary new.\x0a\x09prefixMapping \x0a\x09\x09at: 'test' put: 'tests';\x0a\x09 \x09at: 'bench' put: 'benchmarking';\x0a\x09 \x09at: 'copy' put: 'copying';\x0a\x09\x09at: 'initialize' put: 'initialization';\x0a\x09\x09at: 'accept' put: 'visitor';\x0a\x09\x09at: 'visit' put: 'visitor';\x0a\x09\x09at: 'signal' put: 'signalling';\x0a\x09\x09at: 'parse' put: 'parsing';\x0a\x09\x09at: 'add' put: 'adding';\x0a\x09\x09at: 'is' put: 'testing';\x0a\x09\x09at: 'as' put: 'converting';\x0a\x09\x09at: 'new' put: 'instance creation'.",
+messageSends: ["new", "at:put:"],
+referencedClasses: ["Dictionary"]
+}),
+globals.HLPrefixClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doClassify",
+protocol: 'private',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+var $early={};
+try {
+_st(self["@prefixMapping"])._keysAndValuesDo_((function(prefix,protocol){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(_st(self["@method"])._selector())._beginsWith_(prefix);
+if(smalltalk.assert($1)){
+_st(self["@method"])._protocol_(protocol);
+throw $early=[true];
+};
+}, function($ctx2) {$ctx2.fillBlock({prefix:prefix,protocol:protocol},$ctx1,1)})}));
+return false;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}, function($ctx1) {$ctx1.fill(self,"doClassify",{},globals.HLPrefixClassifier)})},
+args: [],
+source: "doClassify\x0a\x09prefixMapping keysAndValuesDo: [ :prefix :protocol |\x0a\x09\x09(method selector beginsWith: prefix)\x0a\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09method protocol: protocol.\x0a\x09\x09\x09\x09^ true ]].\x0a\x09^ false.",
+messageSends: ["keysAndValuesDo:", "ifTrue:", "beginsWith:", "selector", "protocol:"],
+referencedClasses: []
+}),
+globals.HLPrefixClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+globals.HLPrefixClassifier.superclass.fn.prototype._initialize.apply(_st(self), []);
+self._buildPrefixDictionary();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLPrefixClassifier)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x0a\x09self buildPrefixDictionary",
+messageSends: ["initialize", "buildPrefixDictionary"],
+referencedClasses: []
+}),
+globals.HLPrefixClassifier);
+
+
+
+smalltalk.addClass('HLSuperclassClassifier', globals.HLClassifier, [], 'Helios-Helpers');
+globals.HLSuperclassClassifier.comment="I am a classifier checking the superclass chain to find a matching selector.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doClassify",
+protocol: 'private',
+fn: function (){
+var self=this;
+var protocolBag,methods,protocolToUse,counter;
+function $Dictionary(){return globals.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
+function $HLReferencesModel(){return globals.HLReferencesModel||(typeof HLReferencesModel=="undefined"?nil:HLReferencesModel)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1,$4,$3,$5;
+var $early={};
+try {
+protocolBag=_st($Dictionary())._new();
+$ctx1.sendIdx["new"]=1;
+methods=_st(_st($HLReferencesModel())._new())._implementorsOf_(_st(self["@method"])._selector());
+_st(methods)._ifEmpty_ifNotEmpty_((function(){
+return smalltalk.withContext(function($ctx2) {
+throw $early=[false];
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(methods)._do_((function(aMethod){
+var protocol;
+return smalltalk.withContext(function($ctx3) {
+protocol=_st(_st(aMethod)._method())._protocol();
+protocol;
+$2=_st(self["@method"])._methodClass();
+$ctx3.sendIdx["methodClass"]=1;
+$1=_st($2).__eq(_st(aMethod)._methodClass());
+$ctx3.sendIdx["="]=1;
+if(! smalltalk.assert($1)){
+$4=_st(_st(protocol)._first()).__eq("*");
+$ctx3.sendIdx["="]=2;
+$3=_st($4)._or_((function(){
+return smalltalk.withContext(function($ctx4) {
+return _st(protocol).__eq(_st(self["@method"])._defaultProtocol());
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
+if(! smalltalk.assert($3)){
+return _st(protocolBag)._at_put_(protocol,_st(_st(protocolBag)._at_ifAbsent_(protocol,(function(){
+return smalltalk.withContext(function($ctx4) {
+return (0);
+}, function($ctx4) {$ctx4.fillBlock({},$ctx3,7)})}))).__plus((1)));
+};
+};
+}, function($ctx3) {$ctx3.fillBlock({aMethod:aMethod,protocol:protocol},$ctx2,3)})}));
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
+_st(protocolBag)._ifEmpty_((function(){
+return smalltalk.withContext(function($ctx2) {
+throw $early=[false];
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
+protocolToUse=nil;
+counter=(0);
+_st(protocolBag)._keysAndValuesDo_((function(key,value){
+return smalltalk.withContext(function($ctx2) {
+$5=_st(value).__gt(counter);
+if(smalltalk.assert($5)){
+counter=value;
+counter;
+protocolToUse=key;
+return protocolToUse;
+};
+}, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,9)})}));
+_st(self["@method"])._protocol_(protocolToUse);
+return true;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}, function($ctx1) {$ctx1.fill(self,"doClassify",{protocolBag:protocolBag,methods:methods,protocolToUse:protocolToUse,counter:counter},globals.HLSuperclassClassifier)})},
+args: [],
+source: "doClassify\x0a\x09| protocolBag methods protocolToUse counter |\x0a\x09\x0a\x09protocolBag := Dictionary new.\x0a\x09methods := HLReferencesModel new implementorsOf: method selector.\x0a\x09methods\x0a\x09\x09ifEmpty: [ ^ false ]\x0a\x09\x09ifNotEmpty: [\x0a\x09\x09\x09methods \x0a\x09\x09\x09\x09do: [ :aMethod || protocol |\x0a\x09\x09\x09\x09\x09protocol := aMethod method protocol.\x0a\x09\x09\x09\x09\x09(method methodClass = aMethod methodClass)\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09((protocol first = '*') or: [ protocol = method defaultProtocol ])\x0a\x09\x09\x09\x09\x09\x09\x09ifFalse: [ \x0a\x09\x09\x09\x09\x09\x09\x09\x09protocolBag \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09at: protocol \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09put: (protocolBag at: protocol ifAbsent: [ 0 ]) + 1 ] ] ] ].\x0a\x09\x09\x09\x0a\x09protocolBag ifEmpty: [ ^ false ].\x0a\x09protocolToUse := nil.\x0a\x09counter := 0.\x0a\x09protocolBag keysAndValuesDo: [ :key :value | value > counter \x0a\x09\x09ifTrue: [\x0a\x09\x09\x09counter := value.\x0a\x09\x09\x09protocolToUse := key ] ].\x0a\x09method protocol: protocolToUse.\x0a\x09^ true",
+messageSends: ["new", "implementorsOf:", "selector", "ifEmpty:ifNotEmpty:", "do:", "protocol", "method", "ifFalse:", "=", "methodClass", "or:", "first", "defaultProtocol", "at:put:", "+", "at:ifAbsent:", "ifEmpty:", "keysAndValuesDo:", "ifTrue:", ">", "protocol:"],
+referencedClasses: ["Dictionary", "HLReferencesModel"]
+}),
+globals.HLSuperclassClassifier);
+
+
+
+smalltalk.addClass('HLGenerationOutput', globals.Object, ['sourceCodes', 'protocol', 'targetClass'], 'Helios-Helpers');
+globals.HLGenerationOutput.comment="I am a simple data object used to store the result of a generation process.";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "addSourceCode:",
+protocol: 'protocol',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@sourceCodes"])._add_(aString);
+return self}, function($ctx1) {$ctx1.fill(self,"addSourceCode:",{aString:aString},globals.HLGenerationOutput)})},
+args: ["aString"],
+source: "addSourceCode: aString\x0a\x09sourceCodes add: aString",
+messageSends: ["add:"],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "compile",
+protocol: 'protocol',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+_st(self["@sourceCodes"])._do_((function(methodSourceCode){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(self["@targetClass"])._includesSelector_(_st(methodSourceCode)._selector());
+if(! smalltalk.assert($1)){
+return _st(self["@targetClass"])._compile_protocol_(_st(methodSourceCode)._sourceCode(),self["@protocol"]);
+};
+}, function($ctx2) {$ctx2.fillBlock({methodSourceCode:methodSourceCode},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"compile",{},globals.HLGenerationOutput)})},
+args: [],
+source: "compile\x0a\x09sourceCodes do: [ :methodSourceCode |\x0a\x09\x09(targetClass includesSelector: methodSourceCode selector)\x0a\x09\x09\x09ifFalse: [ \x0a\x09\x09\x09\x09targetClass \x0a\x09\x09\x09\x09\x09compile: methodSourceCode sourceCode\x0a\x09\x09\x09\x09\x09protocol: protocol ] ]",
+messageSends: ["do:", "ifFalse:", "includesSelector:", "selector", "compile:protocol:", "sourceCode"],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+return smalltalk.withContext(function($ctx1) { 
+globals.HLGenerationOutput.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@sourceCodes"]=_st($OrderedCollection())._new();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLGenerationOutput)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09sourceCodes := OrderedCollection new",
+messageSends: ["initialize", "new"],
+referencedClasses: ["OrderedCollection"]
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "protocol",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@protocol"];
+return $1;
+},
+args: [],
+source: "protocol\x0a\x09^ protocol",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "protocol:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@protocol"]=aString;
+return self},
+args: ["aString"],
+source: "protocol: aString\x0a\x09protocol := aString",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "sourceCodes",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@sourceCodes"];
+return $1;
+},
+args: [],
+source: "sourceCodes\x0a\x09^ sourceCodes",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "sourceCodes:",
+protocol: 'accessing',
+fn: function (aCollection){
+var self=this;
+self["@sourceCodes"]=aCollection;
+return self},
+args: ["aCollection"],
+source: "sourceCodes: aCollection\x0a\x09sourceCodes := aCollection",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "targetClass",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@targetClass"];
+return $1;
+},
+args: [],
+source: "targetClass\x0a\x09^ targetClass",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "targetClass:",
+protocol: 'accessing',
+fn: function (aClass){
+var self=this;
+self["@targetClass"]=aClass;
+return self},
+args: ["aClass"],
+source: "targetClass: aClass\x0a\x09targetClass := aClass",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGenerationOutput);
+
+
+
+smalltalk.addClass('HLMethodClassifier', globals.Object, ['firstClassifier'], 'Helios-Helpers');
+globals.HLMethodClassifier.comment="I am in charge of categorizing methods following this strategy:\x0a\x0a- is it an accessor?\x0a- is it overriding a superclass method?\x0a- is it starting with a know prefix?\x0a- how are categorized the other implementations?";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "addClassifier:",
+protocol: 'private',
+fn: function (aClassifier){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(aClassifier)._next_(self["@firstClassifier"]);
+self["@firstClassifier"]=aClassifier;
+return self}, function($ctx1) {$ctx1.fill(self,"addClassifier:",{aClassifier:aClassifier},globals.HLMethodClassifier)})},
+args: ["aClassifier"],
+source: "addClassifier: aClassifier\x0a\x09aClassifier next: firstClassifier.\x0a\x09firstClassifier := aClassifier",
+messageSends: ["next:"],
+referencedClasses: []
+}),
+globals.HLMethodClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "classify:",
+protocol: 'protocol',
+fn: function (aMethod){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=self["@firstClassifier"];
+_st($1)._method_(aMethod);
+$2=_st($1)._classify();
+return self}, function($ctx1) {$ctx1.fill(self,"classify:",{aMethod:aMethod},globals.HLMethodClassifier)})},
+args: ["aMethod"],
+source: "classify: aMethod\x0a\x09firstClassifier\x0a\x09\x09method: aMethod;\x0a\x09\x09classify",
+messageSends: ["method:", "classify"],
+referencedClasses: []
+}),
+globals.HLMethodClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "classifyAll:",
+protocol: 'protocol',
+fn: function (aCollectionOfMethods){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(aCollectionOfMethods)._do_((function(method){
+return smalltalk.withContext(function($ctx2) {
+return self._classify_(method);
+}, function($ctx2) {$ctx2.fillBlock({method:method},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"classifyAll:",{aCollectionOfMethods:aCollectionOfMethods},globals.HLMethodClassifier)})},
+args: ["aCollectionOfMethods"],
+source: "classifyAll: aCollectionOfMethods\x0a\x09aCollectionOfMethods do: [ :method |\x0a\x09\x09self classify: method ]",
+messageSends: ["do:", "classify:"],
+referencedClasses: []
+}),
+globals.HLMethodClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+globals.HLMethodClassifier.superclass.fn.prototype._initialize.apply(_st(self), []);
+self._setupClassifiers();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLMethodClassifier)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09self setupClassifiers",
+messageSends: ["initialize", "setupClassifiers"],
+referencedClasses: []
+}),
+globals.HLMethodClassifier);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "setupClassifiers",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+function $HLImplementorClassifier(){return globals.HLImplementorClassifier||(typeof HLImplementorClassifier=="undefined"?nil:HLImplementorClassifier)}
+function $HLPrefixClassifier(){return globals.HLPrefixClassifier||(typeof HLPrefixClassifier=="undefined"?nil:HLPrefixClassifier)}
+function $HLSuperclassClassifier(){return globals.HLSuperclassClassifier||(typeof HLSuperclassClassifier=="undefined"?nil:HLSuperclassClassifier)}
+function $HLAccessorClassifier(){return globals.HLAccessorClassifier||(typeof HLAccessorClassifier=="undefined"?nil:HLAccessorClassifier)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
+$1=_st($HLImplementorClassifier())._new();
+$ctx1.sendIdx["new"]=1;
+self._addClassifier_($1);
+$ctx1.sendIdx["addClassifier:"]=1;
+$2=_st($HLPrefixClassifier())._new();
+$ctx1.sendIdx["new"]=2;
+self._addClassifier_($2);
+$ctx1.sendIdx["addClassifier:"]=2;
+$3=_st($HLSuperclassClassifier())._new();
+$ctx1.sendIdx["new"]=3;
+self._addClassifier_($3);
+$ctx1.sendIdx["addClassifier:"]=3;
+self._addClassifier_(_st($HLAccessorClassifier())._new());
+return self}, function($ctx1) {$ctx1.fill(self,"setupClassifiers",{},globals.HLMethodClassifier)})},
+args: [],
+source: "setupClassifiers\x0a\x09self addClassifier: HLImplementorClassifier new.\x0a\x09self addClassifier: HLPrefixClassifier new.\x0a\x09self addClassifier: HLSuperclassClassifier new.\x0a\x09self addClassifier: HLAccessorClassifier new",
+messageSends: ["addClassifier:", "new"],
+referencedClasses: ["HLImplementorClassifier", "HLPrefixClassifier", "HLSuperclassClassifier", "HLAccessorClassifier"]
+}),
+globals.HLMethodClassifier);
+
+
+
+smalltalk.addClass('HLMethodGenerator', globals.Object, ['output'], 'Helios-Helpers');
+globals.HLMethodGenerator.comment="I am the abstract super class of the method generators.\x0a\x0aMy main method is `generate` which produce an `output` object";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "class:",
+protocol: 'accessing',
+fn: function (aClass){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@output"])._targetClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"class:",{aClass:aClass},globals.HLMethodGenerator)})},
+args: ["aClass"],
+source: "class: aClass\x0a\x09output targetClass: aClass",
+messageSends: ["targetClass:"],
+referencedClasses: []
+}),
+globals.HLMethodGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "generate",
+protocol: 'protocol',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self["@output"])._targetClass();
+if(($receiver = $1) == nil || $receiver == null){
+self._error_("class should not be nil");
+} else {
+$1;
+};
+return self}, function($ctx1) {$ctx1.fill(self,"generate",{},globals.HLMethodGenerator)})},
+args: [],
+source: "generate\x0a\x09output targetClass ifNil: [ self error: 'class should not be nil'].",
+messageSends: ["ifNil:", "targetClass", "error:"],
+referencedClasses: []
+}),
+globals.HLMethodGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+protocol: 'initialization',
+fn: function (){
+var self=this;
+function $HLGenerationOutput(){return globals.HLGenerationOutput||(typeof HLGenerationOutput=="undefined"?nil:HLGenerationOutput)}
+return smalltalk.withContext(function($ctx1) { 
+globals.HLMethodGenerator.superclass.fn.prototype._initialize.apply(_st(self), []);
+self["@output"]=_st($HLGenerationOutput())._new();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLMethodGenerator)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09output := HLGenerationOutput new",
+messageSends: ["initialize", "new"],
+referencedClasses: ["HLGenerationOutput"]
+}),
+globals.HLMethodGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "output",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@output"];
+return $1;
+},
+args: [],
+source: "output\x0a\x09^ output",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLMethodGenerator);
+
+
+
+smalltalk.addClass('HLAccessorsGenerator', globals.HLMethodGenerator, [], 'Helios-Helpers');
+globals.HLAccessorsGenerator.comment="I am a generator used to compile the getters/setters of a class";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "accessorProtocolForObject",
+protocol: 'double-dispatch',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@output"])._protocol_("accessing");
+return self}, function($ctx1) {$ctx1.fill(self,"accessorProtocolForObject",{},globals.HLAccessorsGenerator)})},
+args: [],
+source: "accessorProtocolForObject\x0a\x09output protocol: 'accessing'",
+messageSends: ["protocol:"],
+referencedClasses: []
+}),
+globals.HLAccessorsGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "accessorsForObject",
+protocol: 'double-dispatch',
+fn: function (){
+var self=this;
+var sources;
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+sources=_st($OrderedCollection())._new();
+_st(_st(_st(_st(self["@output"])._targetClass())._instanceVariableNames())._sorted())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+$1=sources;
+_st($1)._add_(self._getterFor_(each));
+$ctx2.sendIdx["add:"]=1;
+$2=_st($1)._add_(self._setterFor_(each));
+return $2;
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+_st(self["@output"])._sourceCodes_(sources);
+return self}, function($ctx1) {$ctx1.fill(self,"accessorsForObject",{sources:sources},globals.HLAccessorsGenerator)})},
+args: [],
+source: "accessorsForObject\x0a\x09| sources |\x0a\x09\x0a\x09sources := OrderedCollection new.\x0a\x09output targetClass instanceVariableNames sorted do: [ :each | \x0a\x09\x09sources \x0a\x09\x09\x09add: (self getterFor: each);\x0a\x09\x09\x09add: (self setterFor: each) ].\x0a\x09output sourceCodes: sources",
+messageSends: ["new", "do:", "sorted", "instanceVariableNames", "targetClass", "add:", "getterFor:", "setterFor:", "sourceCodes:"],
+referencedClasses: ["OrderedCollection"]
+}),
+globals.HLAccessorsGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "generate",
+protocol: 'protocol',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+globals.HLAccessorsGenerator.superclass.fn.prototype._generate.apply(_st(self), []);
+$1=_st(self["@output"])._targetClass();
+_st($1)._accessorsSourceCodesWith_(self);
+$2=_st($1)._accessorProtocolWith_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"generate",{},globals.HLAccessorsGenerator)})},
+args: [],
+source: "generate\x0a\x09super generate.\x0a\x09\x0a\x09output targetClass \x0a\x09\x09accessorsSourceCodesWith: self;\x0a\x09\x09accessorProtocolWith: self",
+messageSends: ["generate", "accessorsSourceCodesWith:", "targetClass", "accessorProtocolWith:"],
+referencedClasses: []
+}),
+globals.HLAccessorsGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "getterFor:",
+protocol: 'private',
+fn: function (anInstanceVariable){
+var self=this;
+function $HLMethodSourceCode(){return globals.HLMethodSourceCode||(typeof HLMethodSourceCode=="undefined"?nil:HLMethodSourceCode)}
+function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=_st($HLMethodSourceCode())._new();
+_st($2)._selector_(anInstanceVariable);
+$3=_st($2)._sourceCode_(_st($String())._streamContents_((function(stream){
+return smalltalk.withContext(function($ctx2) {
+_st(stream).__lt_lt(anInstanceVariable);
+$ctx2.sendIdx["<<"]=1;
+_st(_st(stream)._cr())._tab();
+return _st(_st(stream).__lt_lt("^ ")).__lt_lt(anInstanceVariable);
+$ctx2.sendIdx["<<"]=2;
+}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"getterFor:",{anInstanceVariable:anInstanceVariable},globals.HLAccessorsGenerator)})},
+args: ["anInstanceVariable"],
+source: "getterFor: anInstanceVariable\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector:anInstanceVariable;\x0a\x09\x09sourceCode: (String streamContents: [ :stream |\x0a\x09\x09stream << anInstanceVariable.\x0a\x09\x09stream cr tab.\x0a\x09\x09stream << '^ ' << anInstanceVariable ])",
+messageSends: ["selector:", "new", "sourceCode:", "streamContents:", "<<", "tab", "cr"],
+referencedClasses: ["HLMethodSourceCode", "String"]
+}),
+globals.HLAccessorsGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "setterFor:",
+protocol: 'private',
+fn: function (anInstanceVariable){
+var self=this;
+function $HLMethodSourceCode(){return globals.HLMethodSourceCode||(typeof HLMethodSourceCode=="undefined"?nil:HLMethodSourceCode)}
+function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$3,$1;
+$2=_st($HLMethodSourceCode())._new();
+_st($2)._selector_(_st(anInstanceVariable).__comma(":"));
+$3=_st($2)._sourceCode_(_st($String())._streamContents_((function(stream){
+return smalltalk.withContext(function($ctx2) {
+$4=_st(stream).__lt_lt(anInstanceVariable);
+$ctx2.sendIdx["<<"]=2;
+_st($4).__lt_lt(": anObject");
+$ctx2.sendIdx["<<"]=1;
+_st(_st(stream)._cr())._tab();
+return _st(_st(stream).__lt_lt(anInstanceVariable)).__lt_lt(" := anObject");
+$ctx2.sendIdx["<<"]=3;
+}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"setterFor:",{anInstanceVariable:anInstanceVariable},globals.HLAccessorsGenerator)})},
+args: ["anInstanceVariable"],
+source: "setterFor: anInstanceVariable\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector: anInstanceVariable, ':';\x0a\x09\x09sourceCode: (String streamContents: [ :stream |\x0a\x09\x09stream << anInstanceVariable << ': anObject'.\x0a\x09\x09stream cr tab.\x0a\x09\x09stream << anInstanceVariable << ' := anObject' ])",
+messageSends: ["selector:", "new", ",", "sourceCode:", "streamContents:", "<<", "tab", "cr"],
+referencedClasses: ["HLMethodSourceCode", "String"]
+}),
+globals.HLAccessorsGenerator);
+
+
+
+smalltalk.addClass('HLInitializeGenerator', globals.HLMethodGenerator, [], 'Helios-Helpers');
+globals.HLInitializeGenerator.comment="I am used to double-dispatch the `initialize` method(s) generation.\x0a\x0aUsage:\x0a\x0a    ^ HLInitializeGenerator new\x0a        class: aClass;\x0a        generate;\x0a        output\x0a\x0aI am a disposable object";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "generate",
+protocol: 'protocol',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+globals.HLInitializeGenerator.superclass.fn.prototype._generate.apply(_st(self), []);
+$1=_st(self["@output"])._targetClass();
+_st($1)._initializeSourceCodesWith_(self);
+$2=_st($1)._initializeProtocolWith_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"generate",{},globals.HLInitializeGenerator)})},
+args: [],
+source: "generate\x0a\x09super generate.\x0a\x09\x0a\x09output targetClass \x0a\x09\x09initializeSourceCodesWith: self;\x0a\x09\x09initializeProtocolWith: self",
+messageSends: ["generate", "initializeSourceCodesWith:", "targetClass", "initializeProtocolWith:"],
+referencedClasses: []
+}),
+globals.HLInitializeGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "generateInitializeCodeForObject",
+protocol: 'private',
+fn: function (){
+var self=this;
+function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
+return smalltalk.withContext(function($ctx1) { 
+var $3,$2,$4,$5,$6,$7,$8,$1;
+$1=_st($String())._streamContents_((function(str){
+var instVars,size;
+return smalltalk.withContext(function($ctx2) {
+instVars=_st(_st(_st(self["@output"])._targetClass())._instanceVariableNames())._sorted();
+instVars;
+size=_st(instVars)._size();
+size;
+_st(str).__lt_lt("initialize");
+$ctx2.sendIdx["<<"]=1;
+$3=_st(str)._cr();
+$ctx2.sendIdx["cr"]=1;
+$2=_st($3)._tab();
+$ctx2.sendIdx["tab"]=1;
+_st($2).__lt_lt("super initialize.");
+$ctx2.sendIdx["<<"]=2;
+$4=_st($2)._cr();
+$ctx2.sendIdx["cr"]=2;
+$4;
+$5=_st(str)._cr();
+$ctx2.sendIdx["cr"]=3;
+_st($5)._tab();
+$ctx2.sendIdx["tab"]=2;
+return _st(instVars)._withIndexDo_((function(name,index){
+return smalltalk.withContext(function($ctx3) {
+$6=_st(index).__tild_eq((1));
+$ctx3.sendIdx["~="]=1;
+if(smalltalk.assert($6)){
+_st(_st(str)._cr())._tab();
+};
+$7=_st(str).__lt_lt(name);
+$ctx3.sendIdx["<<"]=4;
+_st($7).__lt_lt(" := nil");
+$ctx3.sendIdx["<<"]=3;
+$8=_st(index).__tild_eq(size);
+if(smalltalk.assert($8)){
+return _st(str).__lt_lt(".");
+};
+}, function($ctx3) {$ctx3.fillBlock({name:name,index:index},$ctx2,2)})}));
+}, function($ctx2) {$ctx2.fillBlock({str:str,instVars:instVars,size:size},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"generateInitializeCodeForObject",{},globals.HLInitializeGenerator)})},
+args: [],
+source: "generateInitializeCodeForObject\x09\x0a\x09^ String streamContents: [ :str || instVars size |\x0a\x09\x09instVars := output targetClass instanceVariableNames sorted.\x0a\x09\x09size := instVars size.\x0a\x09\x09str << 'initialize'.\x0a\x09\x09str cr tab << 'super initialize.';cr.\x0a\x09\x09str cr tab.\x0a\x09\x09instVars withIndexDo: [ :name :index |\x0a\x09\x09\x09index ~= 1 ifTrue: [ str cr tab ].\x0a\x09\x09\x09str << name << ' := nil'.\x0a\x09\x09\x09index ~= size ifTrue: [ str << '.' ] ] ].",
+messageSends: ["streamContents:", "sorted", "instanceVariableNames", "targetClass", "size", "<<", "tab", "cr", "withIndexDo:", "ifTrue:", "~="],
+referencedClasses: ["String"]
+}),
+globals.HLInitializeGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initializeForObject",
+protocol: 'double-dispatch',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@output"])._addSourceCode_(self._initializeMethodForObject());
+return self}, function($ctx1) {$ctx1.fill(self,"initializeForObject",{},globals.HLInitializeGenerator)})},
+args: [],
+source: "initializeForObject\x0a\x09output addSourceCode: self initializeMethodForObject",
+messageSends: ["addSourceCode:", "initializeMethodForObject"],
+referencedClasses: []
+}),
+globals.HLInitializeGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initializeMethodForObject",
+protocol: 'private',
+fn: function (){
+var self=this;
+function $HLMethodSourceCode(){return globals.HLMethodSourceCode||(typeof HLMethodSourceCode=="undefined"?nil:HLMethodSourceCode)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=_st($HLMethodSourceCode())._new();
+_st($2)._selector_("initialize");
+_st($2)._sourceCode_(self._generateInitializeCodeForObject());
+$3=_st($2)._yourself();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"initializeMethodForObject",{},globals.HLInitializeGenerator)})},
+args: [],
+source: "initializeMethodForObject\x09\x0a\x09^ HLMethodSourceCode new\x0a\x09\x09selector: 'initialize';\x0a\x09\x09sourceCode: self generateInitializeCodeForObject;\x0a\x09\x09yourself",
+messageSends: ["selector:", "new", "sourceCode:", "generateInitializeCodeForObject", "yourself"],
+referencedClasses: ["HLMethodSourceCode"]
+}),
+globals.HLInitializeGenerator);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initializeProtocolForObject",
+protocol: 'double-dispatch',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self["@output"])._protocol_("initialization");
+return self}, function($ctx1) {$ctx1.fill(self,"initializeProtocolForObject",{},globals.HLInitializeGenerator)})},
+args: [],
+source: "initializeProtocolForObject\x0a\x09output protocol: 'initialization'",
+messageSends: ["protocol:"],
+referencedClasses: []
+}),
+globals.HLInitializeGenerator);
+
+
+
+smalltalk.addClass('HLMethodSourceCode', globals.Object, ['selector', 'sourceCode'], 'Helios-Helpers');
+globals.HLMethodSourceCode.comment="I am a simple data object keeping track of the information about a method that will be compiled at the end of the generation process";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@selector"];
+return $1;
+},
+args: [],
+source: "selector\x0a\x09^ selector",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLMethodSourceCode);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "selector:",
+protocol: 'accessing',
+fn: function (aSelector){
+var self=this;
+self["@selector"]=aSelector;
+return self},
+args: ["aSelector"],
+source: "selector: aSelector\x0a\x09selector := aSelector",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLMethodSourceCode);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "sourceCode",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+var $1;
+$1=self["@sourceCode"];
+return $1;
+},
+args: [],
+source: "sourceCode\x0a\x09^ sourceCode",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLMethodSourceCode);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "sourceCode:",
+protocol: 'accessing',
+fn: function (aString){
+var self=this;
+self["@sourceCode"]=aString;
+return self},
+args: ["aString"],
+source: "sourceCode: aString\x0a\x09sourceCode := aString",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLMethodSourceCode);
+
+
+});

File diff suppressed because it is too large
+ 219 - 233
js/Helios-Inspector.js


File diff suppressed because it is too large
+ 158 - 175
js/Helios-KeyBindings.js


+ 95 - 107
js/Helios-Layout.js

@@ -1,12 +1,12 @@
-define("amber_core/Helios-Layout", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Core", "amber_core/Canvas", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Layout", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Core", "amber_core/Canvas", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Layout');
 smalltalk.packages["Helios-Layout"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
+smalltalk.addClass('HLContainer', globals.HLWidget, ['splitter'], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderOn:",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -14,53 +14,51 @@ var $1,$2;
 $1=_st(html)._div();
 _st($1)._class_("tool_container");
 $2=_st($1)._with_(self._splitter());
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLContainer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLContainer)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09html div \x0a    \x09class: 'tool_container'; \x0a        with: self splitter",
 messageSends: ["class:", "div", "with:", "splitter"],
 referencedClasses: []
 }),
-smalltalk.HLContainer);
+globals.HLContainer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "splitter",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@splitter"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"splitter",{},smalltalk.HLContainer)})},
+},
 args: [],
 source: "splitter\x0a\x09^ splitter",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLContainer);
+globals.HLContainer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "splitter:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aSplitter){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@splitter"]=aSplitter;
-return self}, function($ctx1) {$ctx1.fill(self,"splitter:",{aSplitter:aSplitter},smalltalk.HLContainer)})},
+return self},
 args: ["aSplitter"],
 source: "splitter: aSplitter\x0a\x09splitter := aSplitter",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLContainer);
+globals.HLContainer);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "with:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aSplitter){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -70,102 +68,97 @@ _st($2)._splitter_(aSplitter);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter},smalltalk.HLContainer.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"with:",{aSplitter:aSplitter},globals.HLContainer.klass)})},
 args: ["aSplitter"],
 source: "with: aSplitter\x0a\x09^ self new \x0a    \x09splitter: aSplitter; \x0a        yourself",
 messageSends: ["splitter:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLContainer.klass);
+globals.HLContainer.klass);
 
 
-smalltalk.addClass('HLSplitter', smalltalk.Widget, ['firstWidget', 'secondWidget', 'firstPane', 'secondPane', 'splitter'], 'Helios-Layout');
+smalltalk.addClass('HLSplitter', globals.Widget, ['firstWidget', 'secondWidget', 'firstPane', 'secondPane', 'splitter'], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "cssClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "splitter";
-}, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLSplitter)})},
+},
 args: [],
 source: "cssClass\x0a\x09^ 'splitter'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "firstWidget",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@firstWidget"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"firstWidget",{},smalltalk.HLSplitter)})},
+},
 args: [],
 source: "firstWidget\x0a\x09^ firstWidget",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "firstWidget:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aWidget){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@firstWidget"]=aWidget;
-return self}, function($ctx1) {$ctx1.fill(self,"firstWidget:",{aWidget:aWidget},smalltalk.HLSplitter)})},
+return self},
 args: ["aWidget"],
 source: "firstWidget: aWidget\x0a\x09firstWidget := aWidget",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isHeliosSplitter",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return true;
-}, function($ctx1) {$ctx1.fill(self,"isHeliosSplitter",{},smalltalk.HLSplitter)})},
+},
 args: [],
 source: "isHeliosSplitter\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "panesCssClass",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "panes";
-}, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},smalltalk.HLSplitter)})},
+},
 args: [],
 source: "panesCssClass\x0a\x09^ 'panes'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderOn:",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -197,83 +190,79 @@ return self["@secondPane"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["with:"]=1;
 self._setupSplitter();
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLSplitter)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09html div class: self panesCssClass; with: [\x0a\x09\x09firstPane := html div class: 'pane'; with: self firstWidget.\x0a    \x09splitter := html div class: self cssClass.\x0a    \x09secondPane := html div class: 'pane'; with: self secondWidget ].\x0a        \x0a\x09self setupSplitter",
 messageSends: ["class:", "div", "panesCssClass", "with:", "firstWidget", "cssClass", "secondWidget", "setupSplitter"],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resize",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"resize",{},smalltalk.HLSplitter)})},
+return self},
 args: [],
 source: "resize",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "secondWidget",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@secondWidget"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"secondWidget",{},smalltalk.HLSplitter)})},
+},
 args: [],
 source: "secondWidget\x0a\x09^ secondWidget",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "secondWidget:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aWidget){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@secondWidget"]=aWidget;
-return self}, function($ctx1) {$ctx1.fill(self,"secondWidget:",{aWidget:aWidget},smalltalk.HLSplitter)})},
+return self},
 args: ["aWidget"],
 source: "secondWidget: aWidget\x0a\x09secondWidget := aWidget",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setupSplitter",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLSplitter)})},
+return self},
 args: [],
 source: "setupSplitter",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.HLSplitter);
+globals.HLSplitter);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "with:with:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aWidget,anotherWidget){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -284,72 +273,72 @@ _st($2)._secondWidget_(anotherWidget);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget},smalltalk.HLSplitter.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"with:with:",{aWidget:aWidget,anotherWidget:anotherWidget},globals.HLSplitter.klass)})},
 args: ["aWidget", "anotherWidget"],
 source: "with: aWidget with: anotherWidget\x0a\x09^ self new\x0a    \x09\x09firstWidget: aWidget;\x0a            secondWidget: anotherWidget;\x0a            yourself",
 messageSends: ["firstWidget:", "new", "secondWidget:", "yourself"],
 referencedClasses: []
 }),
-smalltalk.HLSplitter.klass);
+globals.HLSplitter.klass);
 
 
-smalltalk.addClass('HLHorizontalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
+smalltalk.addClass('HLHorizontalSplitter', globals.HLSplitter, [], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "cssClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(smalltalk.HLHorizontalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
+$1=_st(globals.HLHorizontalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" horizontal");
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLHorizontalSplitter)})},
+}, function($ctx1) {$ctx1.fill(self,"cssClass",{},globals.HLHorizontalSplitter)})},
 args: [],
 source: "cssClass\x0a\x09^ super cssClass, ' horizontal'",
 messageSends: [",", "cssClass"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "panesCssClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(smalltalk.HLHorizontalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" horizontal");
+$1=_st(globals.HLHorizontalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" horizontal");
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},smalltalk.HLHorizontalSplitter)})},
+}, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},globals.HLHorizontalSplitter)})},
 args: [],
 source: "panesCssClass\x0a\x09^ super panesCssClass, ' horizontal'",
 messageSends: [",", "panesCssClass"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resize",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._resize_(_st(_st(self["@splitter"])._asJQuery())._css_("top"));
-return self}, function($ctx1) {$ctx1.fill(self,"resize",{},smalltalk.HLHorizontalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"resize",{},globals.HLHorizontalSplitter)})},
 args: [],
 source: "resize\x0a\x09self resize: (splitter asJQuery css: 'top')",
 messageSends: ["resize:", "css:", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resize:",
-category: 'actions',
+protocol: 'actions',
 fn: function (anInteger){
 var self=this;
 var container,size,offset,percentage;
@@ -390,18 +379,18 @@ $ctx1.sendIdx[","]=2;
 _st($11)._css_put_("top",$12);
 $ctx1.sendIdx["css:put:"]=2;
 _st(_st(self["@secondPane"])._asJQuery())._css_put_("top",_st(_st((100).__minus(percentage))._asString()).__comma("%"));
-return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},smalltalk.HLHorizontalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},globals.HLHorizontalSplitter)})},
 args: ["anInteger"],
 source: "resize: anInteger\x0a\x09| container size offset percentage |\x0a    \x0a    container := firstPane asJQuery parent.\x0a\x09offset := firstPane asJQuery offset top.\x0a    size := container height.\x0a\x09\x0a\x09percentage := (size - (anInteger - offset)) / size * 100.\x0a\x09percentage := 80 min: (percentage max: 20).\x0a\x09\x0a    firstPane asJQuery css: 'bottom' put: percentage asString, '%'.\x0a\x09\x0a\x09splitter asJQuery css: 'top' put: (100 - percentage) asString, '%'.\x0a\x09secondPane asJQuery css: 'top' put: (100 - percentage) asString, '%'",
 messageSends: ["parent", "asJQuery", "top", "offset", "height", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setupSplitter",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -419,94 +408,94 @@ return smalltalk.withContext(function($ctx2) {
 return self._startResizing_(_st(ui)._helper());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
 $ctx1.sendIdx["->"]=4;
-$2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
+$2=globals.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
 return smalltalk.withContext(function($ctx2) {
 return self._resize_(_st(_st(ui)._offset())._top());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
 _st($1)._draggable_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLHorizontalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},globals.HLHorizontalSplitter)})},
 args: [],
 source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a    \x09'axis' -> 'y'. \x0a        'containment' -> splitter asJQuery parent.\x0a        'helper' -> 'clone'.\x0a        'start' -> [ :e :ui | self startResizing: ui helper ].\x0a        'drag' -> [ :e :ui | self resize: ui offset top ] }",
 messageSends: ["draggable:", "asJQuery", "->", "parent", "startResizing:", "helper", "resize:", "top", "offset"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "startResizing:",
-category: 'actions',
+protocol: 'actions',
 fn: function (aSplitter){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(aSplitter)._width_(_st(_st(self["@splitter"])._asJQuery())._width());
-return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},smalltalk.HLHorizontalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},globals.HLHorizontalSplitter)})},
 args: ["aSplitter"],
 source: "startResizing: aSplitter\x0a\x09aSplitter width: splitter asJQuery width",
 messageSends: ["width:", "width", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.HLHorizontalSplitter);
+globals.HLHorizontalSplitter);
 
 
 
-smalltalk.addClass('HLVerticalSplitter', smalltalk.HLSplitter, [], 'Helios-Layout');
+smalltalk.addClass('HLVerticalSplitter', globals.HLSplitter, [], 'Helios-Layout');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "cssClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(smalltalk.HLVerticalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
+$1=_st(globals.HLVerticalSplitter.superclass.fn.prototype._cssClass.apply(_st(self), [])).__comma(" vertical");
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLVerticalSplitter)})},
+}, function($ctx1) {$ctx1.fill(self,"cssClass",{},globals.HLVerticalSplitter)})},
 args: [],
 source: "cssClass\x0a\x09^ super cssClass, ' vertical'",
 messageSends: [",", "cssClass"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "panesCssClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(smalltalk.HLVerticalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" vertical");
+$1=_st(globals.HLVerticalSplitter.superclass.fn.prototype._panesCssClass.apply(_st(self), [])).__comma(" vertical");
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},smalltalk.HLVerticalSplitter)})},
+}, function($ctx1) {$ctx1.fill(self,"panesCssClass",{},globals.HLVerticalSplitter)})},
 args: [],
 source: "panesCssClass\x0a\x09^ super panesCssClass, ' vertical'",
 messageSends: [",", "panesCssClass"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resize",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._resize_(_st(_st(self["@splitter"])._asJQuery())._css_("left"));
-return self}, function($ctx1) {$ctx1.fill(self,"resize",{},smalltalk.HLVerticalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"resize",{},globals.HLVerticalSplitter)})},
 args: [],
 source: "resize\x0a\x09self resize: (splitter asJQuery css: 'left')",
 messageSends: ["resize:", "css:", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resize:",
-category: 'actions',
+protocol: 'actions',
 fn: function (anInteger){
 var self=this;
 var container,size,offset,percentage;
@@ -547,18 +536,18 @@ $ctx1.sendIdx[","]=2;
 _st($11)._css_put_("left",$12);
 $ctx1.sendIdx["css:put:"]=2;
 _st(_st(self["@secondPane"])._asJQuery())._css_put_("left",_st(_st((100).__minus(percentage))._asString()).__comma("%"));
-return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},smalltalk.HLVerticalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"resize:",{anInteger:anInteger,container:container,size:size,offset:offset,percentage:percentage},globals.HLVerticalSplitter)})},
 args: ["anInteger"],
 source: "resize: anInteger\x0a\x09| container size offset percentage |\x0a    \x0a    container := firstPane asJQuery parent.\x0a\x09offset := firstPane asJQuery offset left.\x0a    size := container width.\x0a\x09\x0a\x09percentage := (size - (anInteger - offset)) / size * 100.\x0a\x09percentage := 80 min: (percentage max: 20).\x0a\x09\x0a    firstPane asJQuery css: 'right' put: percentage asString, '%'.\x0a\x09\x0a\x09splitter asJQuery css: 'left' put: (100 - percentage) asString, '%'.\x0a\x09secondPane asJQuery css: 'left' put: (100 - percentage) asString, '%'",
 messageSends: ["parent", "asJQuery", "left", "offset", "width", "*", "/", "-", "min:", "max:", "css:put:", ",", "asString"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setupSplitter",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -576,50 +565,49 @@ return smalltalk.withContext(function($ctx2) {
 return self._startResizing_(_st(ui)._helper());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
 $ctx1.sendIdx["->"]=4;
-$2=smalltalk.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
+$2=globals.HashedCollection._from_([$3,$4,$5,$6,"drag".__minus_gt((function(e,ui){
 return smalltalk.withContext(function($ctx2) {
 return self._resize_(_st(_st(ui)._offset())._left());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
 _st($1)._draggable_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLVerticalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},globals.HLVerticalSplitter)})},
 args: [],
 source: "setupSplitter\x0a\x09splitter asJQuery draggable: #{ \x0a    \x09'axis' -> 'x'. \x0a        'containment' -> splitter asJQuery parent.\x0a        'helper' -> 'clone'.\x0a        'start' -> [ :e :ui | self startResizing: ui helper ].\x0a        'drag' -> [ :e :ui | self resize: (ui offset left) ] }",
 messageSends: ["draggable:", "asJQuery", "->", "parent", "startResizing:", "helper", "resize:", "left", "offset"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "startResizing:",
-category: 'actions',
+protocol: 'actions',
 fn: function (aSplitter){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(aSplitter)._height_(_st(_st(self["@splitter"])._asJQuery())._height());
-return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},smalltalk.HLVerticalSplitter)})},
+return self}, function($ctx1) {$ctx1.fill(self,"startResizing:",{aSplitter:aSplitter},globals.HLVerticalSplitter)})},
 args: ["aSplitter"],
 source: "startResizing: aSplitter\x0a\x09aSplitter height: splitter asJQuery height",
 messageSends: ["height:", "height", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.HLVerticalSplitter);
+globals.HLVerticalSplitter);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isHeliosSplitter",
-category: '*Helios-Layout',
+protocol: '*Helios-Layout',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return false;
-}, function($ctx1) {$ctx1.fill(self,"isHeliosSplitter",{},smalltalk.Object)})},
+},
 args: [],
 source: "isHeliosSplitter\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Object);
+globals.Object);
 
 });

File diff suppressed because it is too large
+ 162 - 199
js/Helios-References.js


+ 55 - 53
js/Helios-Transcript.js

@@ -1,63 +1,63 @@
-define("amber_core/Helios-Transcript", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Helios-Core", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Transcript", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Core", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Transcript');
 smalltalk.packages["Helios-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
-smalltalk.HLTranscript.comment="I am a widget responsible for displaying transcript contents.\x0a\x0a## Transcript API\x0a\x0a    Transcript \x0a        show: 'hello world';\x0a        cr;\x0a        show: anObject.\x0a\x0a    Transcript clear.\x0a\x0aSee the `Transcript` class.";
+smalltalk.addClass('HLTranscript', globals.HLWidget, ['textarea'], 'Helios-Transcript');
+globals.HLTranscript.comment="I am a widget responsible for displaying transcript contents.\x0a\x0a## Transcript API\x0a\x0a    Transcript \x0a        show: 'hello world';\x0a        cr;\x0a        show: anObject.\x0a\x0a    Transcript clear.\x0a\x0aSee the `Transcript` class.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "clear",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(_st(self["@textarea"])._asJQuery())._text_("");
-return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLTranscript)})},
 args: [],
 source: "clear\x0a\x09textarea asJQuery text: ''",
 messageSends: ["text:", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.HLTranscript.superclass.fn.prototype._initialize.apply(_st(self), []);
+globals.HLTranscript.superclass.fn.prototype._initialize.apply(_st(self), []);
 self._register();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLTranscript)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09self register",
 messageSends: ["initialize", "register"],
 referencedClasses: []
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "register",
-category: 'registration',
+protocol: 'registration',
 fn: function (){
 var self=this;
-function $HLTranscriptHandler(){return smalltalk.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
+function $HLTranscriptHandler(){return globals.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
 return smalltalk.withContext(function($ctx1) { 
 _st($HLTranscriptHandler())._register_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"register",{},globals.HLTranscript)})},
 args: [],
 source: "register\x0a\x09HLTranscriptHandler register: self",
 messageSends: ["register:"],
 referencedClasses: ["HLTranscriptHandler"]
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "renderOn:",
-category: 'rendering',
+protocol: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -69,18 +69,18 @@ return smalltalk.withContext(function($ctx2) {
 self["@textarea"]=_st(html)._textarea();
 return self["@textarea"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLTranscript)})},
 args: ["html"],
 source: "renderOn: html\x0a\x09html div\x0a\x09\x09class: 'transcript';\x0a\x09\x09with: [ textarea := html textarea ]",
 messageSends: ["class:", "div", "with:", "textarea"],
 referencedClasses: []
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "show:",
-category: 'actions',
+protocol: 'actions',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -91,42 +91,42 @@ $1;
 } else {
 _st(_st(self["@textarea"])._asJQuery())._append_(_st(aString)._asString());
 };
-return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},globals.HLTranscript)})},
 args: ["aString"],
 source: "show: aString\x0a\x09textarea ifNotNil: [\x0a \x09\x09textarea asJQuery append: aString asString ]",
 messageSends: ["ifNotNil:", "append:", "asJQuery", "asString"],
 referencedClasses: []
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "unregister",
-category: 'registration',
+protocol: 'registration',
 fn: function (){
 var self=this;
-function $HLTranscriptHandler(){return smalltalk.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
+function $HLTranscriptHandler(){return globals.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.HLTranscript.superclass.fn.prototype._unregister.apply(_st(self), []);
+globals.HLTranscript.superclass.fn.prototype._unregister.apply(_st(self), []);
 _st($HLTranscriptHandler())._unregister_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLTranscript)})},
+return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLTranscript)})},
 args: [],
 source: "unregister\x0a\x09super unregister.\x0a\x09HLTranscriptHandler unregister: self",
 messageSends: ["unregister", "unregister:"],
 referencedClasses: ["HLTranscriptHandler"]
 }),
-smalltalk.HLTranscript);
+globals.HLTranscript);
 
 
 
-smalltalk.addClass('HLTranscriptHandler', smalltalk.Object, [], 'Helios-Transcript');
-smalltalk.HLTranscriptHandler.comment="I handle transcript events, dispatching them to all instances of `HLTranscript`.\x0a\x0a## API\x0a\x0aOn class initialization I am automatically registered as the current transcript.";
+smalltalk.addClass('HLTranscriptHandler', globals.Object, [], 'Helios-Transcript');
+globals.HLTranscriptHandler.comment="I handle transcript events, dispatching them to all instances of `HLTranscript`.\x0a\x0a## API\x0a\x0aOn class initialization I am automatically registered as the current transcript.";
 
-smalltalk.HLTranscriptHandler.klass.iVarNames = ['transcripts'];
+globals.HLTranscriptHandler.klass.iVarNames = ['transcripts'];
 smalltalk.addMethod(
 smalltalk.method({
 selector: "clear",
-category: 'registration',
+protocol: 'printing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -134,51 +134,53 @@ _st(self._transcripts())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._clear();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLTranscriptHandler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLTranscriptHandler.klass)})},
 args: [],
 source: "clear\x0a\x09self transcripts do: [ :each |\x0a\x09\x09each clear ]",
 messageSends: ["do:", "transcripts", "clear"],
 referencedClasses: []
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "initialize",
-category: 'initialization',
+selector: "cr",
+protocol: 'printing',
 fn: function (){
 var self=this;
-function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
 return smalltalk.withContext(function($ctx1) { 
-_st($Transcript())._register_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLTranscriptHandler.klass)})},
+_st(self._transcripts())._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._cr();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"cr",{},globals.HLTranscriptHandler.klass)})},
 args: [],
-source: "initialize\x0a\x09Transcript register: self",
-messageSends: ["register:"],
-referencedClasses: ["Transcript"]
+source: "cr\x0a\x09self transcripts do: [ :each | each cr ]",
+messageSends: ["do:", "transcripts", "cr"],
+referencedClasses: []
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "register:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aTranscript){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._transcripts())._add_(aTranscript);
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},globals.HLTranscriptHandler.klass)})},
 args: ["aTranscript"],
 source: "register: aTranscript\x0a\x09self transcripts add: aTranscript",
 messageSends: ["add:", "transcripts"],
 referencedClasses: []
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "show:",
-category: 'registration',
+protocol: 'printing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -186,21 +188,21 @@ _st(self._transcripts())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._show_(aString);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},smalltalk.HLTranscriptHandler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"show:",{aString:aString},globals.HLTranscriptHandler.klass)})},
 args: ["aString"],
 source: "show: aString\x0a\x09self transcripts do: [ :each |\x0a\x09\x09each show: aString ]",
 messageSends: ["do:", "transcripts", "show:"],
 referencedClasses: []
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "transcripts",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@transcripts"];
@@ -211,28 +213,28 @@ $1=self["@transcripts"];
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"transcripts",{},smalltalk.HLTranscriptHandler.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"transcripts",{},globals.HLTranscriptHandler.klass)})},
 args: [],
 source: "transcripts\x0a\x09^ transcripts ifNil: [ transcripts := OrderedCollection new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: ["OrderedCollection"]
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "unregister:",
-category: 'registration',
+protocol: 'registration',
 fn: function (aTranscript){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self._transcripts())._remove_(aTranscript);
-return self}, function($ctx1) {$ctx1.fill(self,"unregister:",{aTranscript:aTranscript},smalltalk.HLTranscriptHandler.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"unregister:",{aTranscript:aTranscript},globals.HLTranscriptHandler.klass)})},
 args: ["aTranscript"],
 source: "unregister: aTranscript\x0a\x09self transcripts remove: aTranscript",
 messageSends: ["remove:", "transcripts"],
 referencedClasses: []
 }),
-smalltalk.HLTranscriptHandler.klass);
+globals.HLTranscriptHandler.klass);
 
 });

+ 7 - 7
js/Helios-Workspace-Tests.js

@@ -1,16 +1,16 @@
-define("amber_core/Helios-Workspace-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/SUnit"], function(smalltalk,nil,_st){
+define("amber_core/Helios-Workspace-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/SUnit"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Helios-Workspace-Tests');
 smalltalk.packages["Helios-Workspace-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
+smalltalk.addClass('HLCodeWidgetTest', globals.TestCase, [], 'Helios-Workspace-Tests');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testKeyMap",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
-function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
-function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
+function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(_st($HLCodeWidget())._pcKeyMap())._isKindOf_($HashedCollection());
@@ -18,13 +18,13 @@ $ctx1.sendIdx["isKindOf:"]=1;
 self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
 self._assert_(_st(_st($HLCodeWidget())._macKeyMap())._isKindOf_($HashedCollection()));
-return self}, function($ctx1) {$ctx1.fill(self,"testKeyMap",{},smalltalk.HLCodeWidgetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testKeyMap",{},globals.HLCodeWidgetTest)})},
 args: [],
 source: "testKeyMap\x0a\x09\x22Key maps are a collection of associations.\x22\x0a\x09self assert: (HLCodeWidget pcKeyMap isKindOf: HashedCollection).\x0a\x09self assert: (HLCodeWidget macKeyMap isKindOf: HashedCollection)",
 messageSends: ["assert:", "isKindOf:", "pcKeyMap", "macKeyMap"],
 referencedClasses: ["HLCodeWidget", "HashedCollection"]
 }),
-smalltalk.HLCodeWidgetTest);
+globals.HLCodeWidgetTest);
 
 
 });

File diff suppressed because it is too large
+ 166 - 173
js/Helios-Workspace.js


File diff suppressed because it is too large
+ 177 - 199
js/IDE.js


+ 169 - 192
js/Kernel-Announcements.js

@@ -1,47 +1,45 @@
-define("amber_core/Kernel-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Kernel-Announcements", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Kernel-Announcements');
 smalltalk.packages["Kernel-Announcements"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
-smalltalk.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
+smalltalk.addClass('AnnouncementSubscription', globals.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
+globals.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "announcementClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@announcementClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"announcementClass",{},smalltalk.AnnouncementSubscription)})},
+},
 args: [],
 source: "announcementClass\x0a\x09^ announcementClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "announcementClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@announcementClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"announcementClass:",{aClass:aClass},smalltalk.AnnouncementSubscription)})},
+return self},
 args: ["aClass"],
 source: "announcementClass: aClass\x0a\x09announcementClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "block",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -49,35 +47,35 @@ var $1;
 self._deprecatedAPI();
 $1=self._valuable();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"block",{},smalltalk.AnnouncementSubscription)})},
+}, function($ctx1) {$ctx1.fill(self,"block",{},globals.AnnouncementSubscription)})},
 args: [],
 source: "block\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09^ self valuable",
 messageSends: ["deprecatedAPI", "valuable"],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "block:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aValuable){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._deprecatedAPI();
 self._valuable_(aValuable);
-return self}, function($ctx1) {$ctx1.fill(self,"block:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
+return self}, function($ctx1) {$ctx1.fill(self,"block:",{aValuable:aValuable},globals.AnnouncementSubscription)})},
 args: ["aValuable"],
 source: "block: aValuable\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09self valuable: aValuable",
 messageSends: ["deprecatedAPI", "valuable:"],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "deliver:",
-category: 'announcing',
+protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -86,25 +84,25 @@ $1=self._handlesAnnouncement_(anAnnouncement);
 if(smalltalk.assert($1)){
 _st(self._valuable())._value_(anAnnouncement);
 };
-return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
+return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement},globals.AnnouncementSubscription)})},
 args: ["anAnnouncement"],
 source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [ self valuable value: anAnnouncement ]",
 messageSends: ["ifTrue:", "handlesAnnouncement:", "value:", "valuable"],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "handlesAnnouncement:",
-category: 'announcing',
+protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $3,$4,$2,$1;
-$3=_st($Smalltalk())._current();
-$ctx1.sendIdx["current"]=1;
+$3=_st($Smalltalk())._globals();
+$ctx1.sendIdx["globals"]=1;
 $4=_st(self._announcementClass())._name();
 $ctx1.sendIdx["name"]=1;
 $2=_st($3)._at_($4);
@@ -114,77 +112,75 @@ return false;
 } else {
 var class_;
 class_=$receiver;
-$1=_st(_st(_st($Smalltalk())._current())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()))._includesBehavior_(class_);
+$1=_st(_st(_st($Smalltalk())._globals())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()))._includesBehavior_(class_);
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
+}, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},globals.AnnouncementSubscription)})},
 args: ["anAnnouncement"],
-source: "handlesAnnouncement: anAnnouncement\x0a\x09\x22anAnnouncement might be announced from within another Amber environment\x22\x0a\x09\x0a\x09^ (Smalltalk current at: self announcementClass name)\x0a\x09\x09ifNil: [ ^ false ]\x0a\x09\x09ifNotNil: [ :class |\x0a\x09\x09(Smalltalk current at: anAnnouncement class theNonMetaClass name) includesBehavior: class ]",
-messageSends: ["ifNil:ifNotNil:", "at:", "current", "name", "announcementClass", "includesBehavior:", "theNonMetaClass", "class"],
+source: "handlesAnnouncement: anAnnouncement\x0a\x09\x22anAnnouncement might be announced from within another Amber environment\x22\x0a\x09\x0a\x09^ (Smalltalk globals at: self announcementClass name)\x0a\x09\x09ifNil: [ ^ false ]\x0a\x09\x09ifNotNil: [ :class |\x0a\x09\x09(Smalltalk globals at: anAnnouncement class theNonMetaClass name) includesBehavior: class ]",
+messageSends: ["ifNil:ifNotNil:", "at:", "globals", "name", "announcementClass", "includesBehavior:", "theNonMetaClass", "class"],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._valuable())._receiver();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AnnouncementSubscription)})},
+}, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.AnnouncementSubscription)})},
 args: [],
 source: "receiver\x0a\x09^ self valuable receiver",
 messageSends: ["receiver", "valuable"],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "valuable",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@valuable"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"valuable",{},smalltalk.AnnouncementSubscription)})},
+},
 args: [],
 source: "valuable\x0a\x09^ valuable",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "valuable:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aValuable){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@valuable"]=aValuable;
-return self}, function($ctx1) {$ctx1.fill(self,"valuable:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
+return self},
 args: ["aValuable"],
 source: "valuable: aValuable\x0a\x09valuable := aValuable",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AnnouncementSubscription);
+globals.AnnouncementSubscription);
 
 
 
-smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
-smalltalk.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a    SystemAnnouncer current\x0a        on: ClassAdded\x0a        do: [ :ann | window alert: ann theClass name, ' added' ].";
+smalltalk.addClass('Announcer', globals.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
+globals.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a    SystemAnnouncer current\x0a        on: ClassAdded\x0a        do: [ :ann | window alert: ann theClass name, ' added' ].";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "announce:",
-category: 'announcing',
+protocol: 'announcing',
 fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -192,39 +188,39 @@ _st(self["@subscriptions"])._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._deliver_(anAnnouncement);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement},globals.Announcer)})},
 args: ["anAnnouncement"],
 source: "announce: anAnnouncement\x0a\x09subscriptions do: [ :each |\x0a\x09\x09each deliver: anAnnouncement ]",
 messageSends: ["do:", "deliver:"],
 referencedClasses: []
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
-function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
+function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.Announcer.superclass.fn.prototype._initialize.apply(_st(self), []);
+globals.Announcer.superclass.fn.prototype._initialize.apply(_st(self), []);
 self["@subscriptions"]=_st($OrderedCollection())._new();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Announcer)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := OrderedCollection new",
 messageSends: ["initialize", "new"],
 referencedClasses: ["OrderedCollection"]
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:do:",
-category: 'subscribing',
+protocol: 'subscribing',
 fn: function (aClass,aBlock){
 var self=this;
-function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
+function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st($AnnouncementSubscription())._new();
@@ -232,22 +228,22 @@ _st($1)._valuable_(aBlock);
 _st($1)._announcementClass_(aClass);
 $2=_st($1)._yourself();
 _st(self["@subscriptions"])._add_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},globals.Announcer)})},
 args: ["aClass", "aBlock"],
 source: "on: aClass do: aBlock\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: aBlock;\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
 messageSends: ["add:", "valuable:", "new", "announcementClass:", "yourself"],
 referencedClasses: ["AnnouncementSubscription"]
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:doOnce:",
-category: 'subscribing',
+protocol: 'subscribing',
 fn: function (aClass,aBlock){
 var self=this;
 var subscription;
-function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
+function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st($AnnouncementSubscription())._new();
@@ -260,22 +256,22 @@ _st(self["@subscriptions"])._remove_(subscription);
 return _st(aBlock)._value_(ann);
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1,1)})}));
 _st(self["@subscriptions"])._add_(subscription);
-return self}, function($ctx1) {$ctx1.fill(self,"on:doOnce:",{aClass:aClass,aBlock:aBlock,subscription:subscription},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"on:doOnce:",{aClass:aClass,aBlock:aBlock,subscription:subscription},globals.Announcer)})},
 args: ["aClass", "aBlock"],
 source: "on: aClass doOnce: aBlock\x0a\x09| subscription |\x0a\x09\x0a\x09subscription := AnnouncementSubscription new\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself.\x0a\x09subscription valuable: [ :ann |\x0a\x09\x09subscriptions remove: subscription.\x0a\x09\x09aBlock value: ann ].\x0a\x0a\x09subscriptions add: subscription",
 messageSends: ["announcementClass:", "new", "yourself", "valuable:", "remove:", "value:", "add:"],
 referencedClasses: ["AnnouncementSubscription"]
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:send:to:",
-category: 'subscribing',
+protocol: 'subscribing',
 fn: function (aClass,aSelector,anObject){
 var self=this;
-function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
-function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
+function $AnnouncementSubscription(){return globals.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
+function $MessageSend(){return globals.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$3,$4,$6,$7,$5,$8,$2;
 $1=self["@subscriptions"];
@@ -293,18 +289,18 @@ _st($3)._announcementClass_(aClass);
 $8=_st($3)._yourself();
 $2=$8;
 _st($1)._add_($2);
-return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},globals.Announcer)})},
 args: ["aClass", "aSelector", "anObject"],
 source: "on: aClass send: aSelector to: anObject\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: (MessageSend new\x0a\x09\x09\x09receiver: anObject;\x0a\x09\x09\x09selector: aSelector;\x0a\x09\x09\x09yourself);\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
 messageSends: ["add:", "valuable:", "new", "receiver:", "selector:", "yourself", "announcementClass:"],
 referencedClasses: ["AnnouncementSubscription", "MessageSend"]
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "unsubscribe:",
-category: 'subscribing',
+protocol: 'subscribing',
 fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -312,460 +308,441 @@ self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._receiver()).__eq(anObject);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},smalltalk.Announcer)})},
+return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},globals.Announcer)})},
 args: ["anObject"],
 source: "unsubscribe: anObject\x0a\x09subscriptions := subscriptions reject: [ :each |\x0a\x09\x09each receiver = anObject ]",
 messageSends: ["reject:", "=", "receiver"],
 referencedClasses: []
 }),
-smalltalk.Announcer);
+globals.Announcer);
 
 
 
-smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
-smalltalk.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`";
+smalltalk.addClass('SystemAnnouncer', globals.Announcer, [], 'Kernel-Announcements');
+globals.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`";
 
-smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
+globals.SystemAnnouncer.klass.iVarNames = ['current'];
 smalltalk.addMethod(
 smalltalk.method({
 selector: "current",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 $2=self["@current"];
 if(($receiver = $2) == nil || $receiver == null){
-self["@current"]=smalltalk.SystemAnnouncer.klass.superclass.fn.prototype._new.apply(_st(self), []);
+self["@current"]=globals.SystemAnnouncer.klass.superclass.fn.prototype._new.apply(_st(self), []);
 $1=self["@current"];
 } else {
 $1=$2;
 };
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.SystemAnnouncer.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"current",{},globals.SystemAnnouncer.klass)})},
 args: [],
 source: "current\x0a\x09^ current ifNil: [ current := super new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: []
 }),
-smalltalk.SystemAnnouncer.klass);
+globals.SystemAnnouncer.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "new",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._shouldNotImplement();
-return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.SystemAnnouncer.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"new",{},globals.SystemAnnouncer.klass)})},
 args: [],
 source: "new\x0a\x09self shouldNotImplement",
 messageSends: ["shouldNotImplement"],
 referencedClasses: []
 }),
-smalltalk.SystemAnnouncer.klass);
+globals.SystemAnnouncer.klass);
 
 
-smalltalk.addClass('SystemAnnouncement', smalltalk.Object, [], 'Kernel-Announcements');
-smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements";
+smalltalk.addClass('SystemAnnouncement', globals.Object, [], 'Kernel-Announcements');
+globals.SystemAnnouncement.comment="I am the superclass of all system announcements";
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "heliosClass",
-category: 'helios',
+protocol: 'helios',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "announcement";
-}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.SystemAnnouncement.klass)})},
+},
 args: [],
 source: "heliosClass\x0a\x09^ 'announcement'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.SystemAnnouncement.klass);
+globals.SystemAnnouncement.klass);
 
 
-smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
-smalltalk.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
+smalltalk.addClass('ClassAnnouncement', globals.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
+globals.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@theClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
+},
 args: [],
 source: "theClass\x0a\x09^ theClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassAnnouncement);
+globals.ClassAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@theClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
+return self},
 args: ["aClass"],
 source: "theClass: aClass\x0a\x09theClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassAnnouncement);
+globals.ClassAnnouncement);
 
 
 
-smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
+smalltalk.addClass('ClassAdded', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+globals.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods";
 
 
-smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
+smalltalk.addClass('ClassCommentChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+globals.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)";
 
 
-smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
+smalltalk.addClass('ClassDefinitionChanged', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+globals.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:";
 
 
-smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
-smalltalk.ClassMigrated.comment="I am emitted when a class is migrated.";
+smalltalk.addClass('ClassMigrated', globals.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
+globals.ClassMigrated.comment="I am emitted when a class is migrated.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@oldClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
+},
 args: [],
 source: "oldClass\x0a\x09^ oldClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassMigrated);
+globals.ClassMigrated);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@oldClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
+return self},
 args: ["aClass"],
 source: "oldClass: aClass\x0a\x09oldClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassMigrated);
+globals.ClassMigrated);
 
 
 
-smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
-smalltalk.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
+smalltalk.addClass('ClassMoved', globals.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
+globals.ClassMoved.comment="I am emitted when a class is moved from one package to another.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldPackage",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@oldPackage"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
+},
 args: [],
 source: "oldPackage\x0a\x09^ oldPackage",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassMoved);
+globals.ClassMoved);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldPackage:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aPackage){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@oldPackage"]=aPackage;
-return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
+return self},
 args: ["aPackage"],
 source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ClassMoved);
+globals.ClassMoved);
 
 
 
-smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
+smalltalk.addClass('ClassRemoved', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+globals.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:";
 
 
-smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
+smalltalk.addClass('ClassRenamed', globals.ClassAnnouncement, [], 'Kernel-Announcements');
+globals.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:";
 
 
-smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
-smalltalk.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
+smalltalk.addClass('MethodAnnouncement', globals.SystemAnnouncement, ['method'], 'Kernel-Announcements');
+globals.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "method",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@method"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
+},
 args: [],
 source: "method\x0a\x09^ method",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodAnnouncement);
+globals.MethodAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "method:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aCompiledMethod){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@method"]=aCompiledMethod;
-return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
+return self},
 args: ["aCompiledMethod"],
 source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodAnnouncement);
+globals.MethodAnnouncement);
 
 
 
-smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
-smalltalk.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
+smalltalk.addClass('MethodAdded', globals.MethodAnnouncement, [], 'Kernel-Announcements');
+globals.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class.";
 
 
-smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
-smalltalk.MethodModified.comment="I am emitted when a `CompiledMethod` is modified (a new method is installed). I hold a reference to the old method being replaced.";
+smalltalk.addClass('MethodModified', globals.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
+globals.MethodModified.comment="I am emitted when a `CompiledMethod` is modified (a new method is installed). I hold a reference to the old method being replaced.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldMethod",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@oldMethod"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
+},
 args: [],
 source: "oldMethod\x0a\x09^ oldMethod",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodModified);
+globals.MethodModified);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldMethod:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aMethod){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@oldMethod"]=aMethod;
-return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
+return self},
 args: ["aMethod"],
 source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodModified);
+globals.MethodModified);
 
 
 
-smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
-smalltalk.MethodMoved.comment="I am emitted when a `CompiledMethod` is moved to another protocol. I hold a refernce to the old protocol of the method.";
+smalltalk.addClass('MethodMoved', globals.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
+globals.MethodMoved.comment="I am emitted when a `CompiledMethod` is moved to another protocol. I hold a refernce to the old protocol of the method.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldProtocol",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@oldProtocol"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
+},
 args: [],
 source: "oldProtocol\x0a\x09^ oldProtocol",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodMoved);
+globals.MethodMoved);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "oldProtocol:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@oldProtocol"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
+return self},
 args: ["aString"],
 source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MethodMoved);
+globals.MethodMoved);
 
 
 
-smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
-smalltalk.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
+smalltalk.addClass('MethodRemoved', globals.MethodAnnouncement, [], 'Kernel-Announcements');
+globals.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class.";
 
 
-smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
-smalltalk.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
+smalltalk.addClass('PackageAnnouncement', globals.SystemAnnouncement, ['package'], 'Kernel-Announcements');
+globals.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "package",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@package"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
+},
 args: [],
 source: "package\x0a\x09^ package",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.PackageAnnouncement);
+globals.PackageAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "package:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aPackage){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@package"]=aPackage;
-return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
+return self},
 args: ["aPackage"],
 source: "package: aPackage\x0a\x09package := aPackage",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.PackageAnnouncement);
+globals.PackageAnnouncement);
 
 
 
-smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
-smalltalk.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
+smalltalk.addClass('PackageAdded', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+globals.PackageAdded.comment="I am emitted when a `Package` is added to the system.";
 
 
-smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
-smalltalk.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
+smalltalk.addClass('PackageRemoved', globals.PackageAnnouncement, [], 'Kernel-Announcements');
+globals.PackageRemoved.comment="I am emitted when a `Package` is removed from the system.";
 
 
-smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
-smalltalk.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
+smalltalk.addClass('ProtocolAnnouncement', globals.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
+globals.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "protocol",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@protocol"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
+},
 args: [],
 source: "protocol\x0a\x09^ protocol",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ProtocolAnnouncement);
+globals.ProtocolAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "protocol:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@protocol"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
+return self},
 args: ["aString"],
 source: "protocol: aString\x0a\x09protocol := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ProtocolAnnouncement);
+globals.ProtocolAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@theClass"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
+},
 args: [],
 source: "theClass\x0a\x09^ theClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ProtocolAnnouncement);
+globals.ProtocolAnnouncement);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aClass){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@theClass"]=aClass;
-return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
+return self},
 args: ["aClass"],
 source: "theClass: aClass\x0a\x09theClass := aClass",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ProtocolAnnouncement);
+globals.ProtocolAnnouncement);
 
 
 
-smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
+smalltalk.addClass('ProtocolAdded', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
+globals.ProtocolAdded.comment="I am emitted when a protocol is added to a class.";
 
 
-smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
-smalltalk.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
+smalltalk.addClass('ProtocolRemoved', globals.ProtocolAnnouncement, [], 'Kernel-Announcements');
+globals.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
 
 });

File diff suppressed because it is too large
+ 227 - 240
js/Kernel-Classes.js


File diff suppressed because it is too large
+ 276 - 130
js/Kernel-Collections.js


+ 84 - 265
js/Kernel-Exceptions.js

@@ -1,283 +1,271 @@
-define("amber_core/Kernel-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Kernel-Exceptions", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Kernel-Exceptions');
 smalltalk.packages["Kernel-Exceptions"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
-smalltalk.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
+smalltalk.addClass('Error', globals.Object, ['messageText'], 'Kernel-Exceptions');
+globals.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return self.context;
-return self}, function($ctx1) {$ctx1.fill(self,"context",{},smalltalk.Error)})},
+return self},
 args: [],
 source: "context\x0a\x09<return self.context>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._messageText_("Errorclass: ".__comma(_st(self._class())._name()));
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Error)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.Error)})},
 args: [],
 source: "initialize\x0a\x09self messageText: 'Errorclass: ', (self class name).",
 messageSends: ["messageText:", ",", "name", "class"],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isSmalltalkError",
-category: 'testing',
+protocol: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return self.smalltalkError === true;
-return self}, function($ctx1) {$ctx1.fill(self,"isSmalltalkError",{},smalltalk.Error)})},
+return self},
 args: [],
 source: "isSmalltalkError\x0a\x09<return self.smalltalkError === true>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "jsStack",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return self.stack;
-return self}, function($ctx1) {$ctx1.fill(self,"jsStack",{},smalltalk.Error)})},
+return self},
 args: [],
 source: "jsStack\x0a\x09<return self.stack>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@messageText"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.Error)})},
+},
 args: [],
 source: "messageText\x0a\x09^ messageText",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aString){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@messageText"]=aString;
-return self}, function($ctx1) {$ctx1.fill(self,"messageText:",{aString:aString},smalltalk.Error)})},
+return self},
 args: ["aString"],
 source: "messageText: aString\x0a\x09messageText := aString",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "resignal",
-category: 'signaling',
+protocol: 'signaling',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 throw(self);
-return self}, function($ctx1) {$ctx1.fill(self,"resignal",{},smalltalk.Error)})},
+return self},
 args: [],
 source: "resignal\x0a\x09\x22Resignal the receiver without changing its exception context\x22\x0a\x09\x0a\x09<throw(self)>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",
-category: 'signaling',
+protocol: 'signaling',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self);
-return self}, function($ctx1) {$ctx1.fill(self,"signal",{},smalltalk.Error)})},
+return self},
 args: [],
 source: "signal\x0a\x09<self.context = smalltalk.getThisContext(); self.smalltalkError = true; throw(self)>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal:",
-category: 'signaling',
+protocol: 'signaling',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._messageText_(aString);
 self._signal();
-return self}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.Error)})},
+return self}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},globals.Error)})},
 args: ["aString"],
 source: "signal: aString\x0a\x09self messageText: aString.\x0a\x09self signal",
 messageSends: ["messageText:", "signal"],
 referencedClasses: []
 }),
-smalltalk.Error);
+globals.Error);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "heliosClass",
-category: 'helios',
+protocol: 'helios',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "exception";
-}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.Error.klass)})},
+},
 args: [],
 source: "heliosClass\x0a\x09^ 'exception'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Error.klass);
+globals.Error.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._new())._signal();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"signal",{},smalltalk.Error.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"signal",{},globals.Error.klass)})},
 args: [],
 source: "signal\x0a\x09^ self new signal",
 messageSends: ["signal", "new"],
 referencedClasses: []
 }),
-smalltalk.Error.klass);
+globals.Error.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "signal:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._new())._signal_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.Error.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},globals.Error.klass)})},
 args: ["aString"],
 source: "signal: aString\x0a\x09^ self new\x0a\x09\x09signal: aString",
 messageSends: ["signal:", "new"],
 referencedClasses: []
 }),
-smalltalk.Error.klass);
+globals.Error.klass);
 
 
-smalltalk.addClass('JavaScriptException', smalltalk.Error, ['exception'], 'Kernel-Exceptions');
-smalltalk.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`";
+smalltalk.addClass('JavaScriptException', globals.Error, ['exception'], 'Kernel-Exceptions');
+globals.JavaScriptException.comment="A JavaScriptException is thrown when a non-Smalltalk exception occurs while in the Smalltalk stack.\x0aSee `boot.js` `inContext()` and `BlockClosure >> on:do:`";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "context:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aMethodContext){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self.context = aMethodContext;
-return self}, function($ctx1) {$ctx1.fill(self,"context:",{aMethodContext:aMethodContext},smalltalk.JavaScriptException)})},
+return self},
 args: ["aMethodContext"],
 source: "context: aMethodContext\x0a\x09\x22Set the context from the outside.\x0a\x09See boot.js `inContext()` exception handling\x22\x0a\x09\x0a\x09<self.context = aMethodContext>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException);
+globals.JavaScriptException);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exception",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@exception"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"exception",{},smalltalk.JavaScriptException)})},
+},
 args: [],
 source: "exception\x0a\x09^ exception",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException);
+globals.JavaScriptException);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exception:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anException){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@exception"]=anException;
-return self}, function($ctx1) {$ctx1.fill(self,"exception:",{anException:anException},smalltalk.JavaScriptException)})},
+return self},
 args: ["anException"],
 source: "exception: anException\x0a\x09exception := anException",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException);
+globals.JavaScriptException);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return 'JavaScript exception: ' + self["@exception"].toString();
-return self}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.JavaScriptException)})},
+return self},
 args: [],
 source: "messageText\x0a\x09<return 'JavaScript exception: ' + self[\x22@exception\x22].toString()>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException);
+globals.JavaScriptException);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (anException){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -287,18 +275,18 @@ _st($2)._exception_(anException);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException},smalltalk.JavaScriptException.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{anException:anException},globals.JavaScriptException.klass)})},
 args: ["anException"],
 source: "on: anException\x0a\x09^ self new\x0a\x09\x09exception: anException;\x0a\x09\x09yourself",
 messageSends: ["exception:", "new", "yourself"],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException.klass);
+globals.JavaScriptException.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:context:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (anException,aMethodContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -309,55 +297,53 @@ _st($2)._context_(aMethodContext);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext},smalltalk.JavaScriptException.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:context:",{anException:anException,aMethodContext:aMethodContext},globals.JavaScriptException.klass)})},
 args: ["anException", "aMethodContext"],
 source: "on: anException context: aMethodContext\x0a\x09^ self new\x0a\x09\x09exception: anException;\x0a\x09\x09context: aMethodContext;\x0a\x09\x09yourself",
 messageSends: ["exception:", "new", "context:", "yourself"],
 referencedClasses: []
 }),
-smalltalk.JavaScriptException.klass);
+globals.JavaScriptException.klass);
 
 
-smalltalk.addClass('MessageNotUnderstood', smalltalk.Error, ['message', 'receiver'], 'Kernel-Exceptions');
-smalltalk.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`.";
+smalltalk.addClass('MessageNotUnderstood', globals.Error, ['message', 'receiver'], 'Kernel-Exceptions');
+globals.MessageNotUnderstood.comment="This exception is provided to support `Object>>doesNotUnderstand:`.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "message",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@message"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"message",{},smalltalk.MessageNotUnderstood)})},
+},
 args: [],
 source: "message\x0a\x09^ message",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MessageNotUnderstood);
+globals.MessageNotUnderstood);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "message:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (aMessage){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@message"]=aMessage;
-return self}, function($ctx1) {$ctx1.fill(self,"message:",{aMessage:aMessage},smalltalk.MessageNotUnderstood)})},
+return self},
 args: ["aMessage"],
 source: "message: aMessage\x0a\x09message := aMessage",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MessageNotUnderstood);
+globals.MessageNotUnderstood);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -365,248 +351,81 @@ var $1;
 $1=_st(_st(_st(self._receiver())._asString()).__comma(" does not understand #")).__comma(_st(self._message())._selector());
 $ctx1.sendIdx[","]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.MessageNotUnderstood)})},
+}, function($ctx1) {$ctx1.fill(self,"messageText",{},globals.MessageNotUnderstood)})},
 args: [],
 source: "messageText\x0a\x09^ self receiver asString, ' does not understand #', self message selector",
 messageSends: [",", "asString", "receiver", "selector", "message"],
 referencedClasses: []
 }),
-smalltalk.MessageNotUnderstood);
+globals.MessageNotUnderstood);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@receiver"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MessageNotUnderstood)})},
+},
 args: [],
 source: "receiver\x0a\x09^ receiver",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MessageNotUnderstood);
+globals.MessageNotUnderstood);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@receiver"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.MessageNotUnderstood)})},
+return self},
 args: ["anObject"],
 source: "receiver: anObject\x0a\x09receiver := anObject",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.MessageNotUnderstood);
+globals.MessageNotUnderstood);
 
 
 
-smalltalk.addClass('NonBooleanReceiver', smalltalk.Error, ['object'], 'Kernel-Exceptions');
-smalltalk.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver.";
+smalltalk.addClass('NonBooleanReceiver', globals.Error, ['object'], 'Kernel-Exceptions');
+globals.NonBooleanReceiver.comment="NonBooleanReceiver exceptions may be thrown when executing inlined methods such as `#ifTrue:` with a non boolean receiver.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "object",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@object"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"object",{},smalltalk.NonBooleanReceiver)})},
+},
 args: [],
 source: "object\x0a\x09^ object",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.NonBooleanReceiver);
+globals.NonBooleanReceiver);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "object:",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@object"]=anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"object:",{anObject:anObject},smalltalk.NonBooleanReceiver)})},
+return self},
 args: ["anObject"],
 source: "object: anObject\x0a\x09object := anObject",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.NonBooleanReceiver);
-
-
-
-smalltalk.addClass('ErrorHandler', smalltalk.Object, [], 'Kernel-Exceptions');
-smalltalk.ErrorHandler.comment="I am used to manage Smalltalk errors.\x0aSee `boot.js` `handleError()` function.\x0a\x0aSubclasses can register themselves as the current handler with\x0a`ErrorHandler class >> register`.\x0a\x0aSubclasses may override `#handleError:` to perform an action on the thrown exception.\x0aThe default behavior is to log the error and the context stack to the JavaScript console.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "handleError:",
-category: 'error handling',
-fn: function (anError){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(anError)._context();
-$ctx1.sendIdx["context"]=1;
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-self._logErrorContext_(_st(anError)._context());
-};
-self._logError_(anError);
-return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.ErrorHandler)})},
-args: ["anError"],
-source: "handleError: anError\x0a\x09anError context ifNotNil: [ self logErrorContext: anError context ].\x0a\x09self logError: anError",
-messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "log:",
-category: 'private',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(console)._log_(aString);
-return self}, function($ctx1) {$ctx1.fill(self,"log:",{aString:aString},smalltalk.ErrorHandler)})},
-args: ["aString"],
-source: "log: aString\x0a\x09console log: aString",
-messageSends: ["log:"],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "logContext:",
-category: 'private',
-fn: function (aContext){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(aContext)._home();
-$ctx1.sendIdx["home"]=1;
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-self._logContext_(_st(aContext)._home());
-};
-self._log_(_st(aContext)._asString());
-return self}, function($ctx1) {$ctx1.fill(self,"logContext:",{aContext:aContext},smalltalk.ErrorHandler)})},
-args: ["aContext"],
-source: "logContext: aContext\x0a\x09aContext home ifNotNil: [\x0a\x09\x09self logContext: aContext home ].\x0a\x09self log: aContext asString",
-messageSends: ["ifNotNil:", "home", "logContext:", "log:", "asString"],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "logError:",
-category: 'private',
-fn: function (anError){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._log_(_st(anError)._messageText());
-return self}, function($ctx1) {$ctx1.fill(self,"logError:",{anError:anError},smalltalk.ErrorHandler)})},
-args: ["anError"],
-source: "logError: anError\x0a\x09self log: anError messageText",
-messageSends: ["log:", "messageText"],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "logErrorContext:",
-category: 'private',
-fn: function (aContext){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-if(($receiver = aContext) == nil || $receiver == null){
-aContext;
-} else {
-$1=_st(aContext)._home();
-$ctx1.sendIdx["home"]=1;
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-self._logContext_(_st(aContext)._home());
-};
-};
-return self}, function($ctx1) {$ctx1.fill(self,"logErrorContext:",{aContext:aContext},smalltalk.ErrorHandler)})},
-args: ["aContext"],
-source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home ]]",
-messageSends: ["ifNotNil:", "home", "logContext:"],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler);
-
-
-smalltalk.ErrorHandler.klass.iVarNames = ['current'];
-smalltalk.addMethod(
-smalltalk.method({
-selector: "current",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@current"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ErrorHandler.klass)})},
-args: [],
-source: "current\x0a\x09^ current",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "register",
-category: 'initialization',
-fn: function (){
-var self=this;
-function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st($ErrorHandler())._setCurrent_(self._new());
-return self}, function($ctx1) {$ctx1.fill(self,"register",{},smalltalk.ErrorHandler.klass)})},
-args: [],
-source: "register\x0a\x09ErrorHandler setCurrent: self new",
-messageSends: ["setCurrent:", "new"],
-referencedClasses: ["ErrorHandler"]
-}),
-smalltalk.ErrorHandler.klass);
+globals.NonBooleanReceiver);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "setCurrent:",
-category: 'accessing',
-fn: function (anHandler){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@current"]=anHandler;
-return self}, function($ctx1) {$ctx1.fill(self,"setCurrent:",{anHandler:anHandler},smalltalk.ErrorHandler.klass)})},
-args: ["anHandler"],
-source: "setCurrent: anHandler\x0a\x09current := anHandler",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.ErrorHandler.klass);
 
 });

File diff suppressed because it is too large
+ 188 - 169
js/Kernel-ImportExport.js


File diff suppressed because it is too large
+ 318 - 239
js/Kernel-Infrastructure.js


File diff suppressed because it is too large
+ 194 - 245
js/Kernel-Methods.js


File diff suppressed because it is too large
+ 251 - 244
js/Kernel-Objects.js


File diff suppressed because it is too large
+ 340 - 212
js/Kernel-Tests.js


+ 22 - 162
js/Kernel-Transcript.js

@@ -1,222 +1,82 @@
-define("amber_core/Kernel-Transcript", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st){
+define("amber_core/Kernel-Transcript", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Kernel-Transcript');
 smalltalk.packages["Kernel-Transcript"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
-smalltalk.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
+smalltalk.addClass('ConsoleTranscript', globals.Object, ['textarea'], 'Kernel-Transcript');
+globals.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "clear",
-category: 'printing',
+protocol: 'printing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.ConsoleTranscript)})},
+return self},
 args: [],
 source: "clear\x0a\x09\x22no op\x22",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ConsoleTranscript);
+globals.ConsoleTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "cr",
-category: 'printing',
+protocol: 'printing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.ConsoleTranscript)})},
+return self},
 args: [],
 source: "cr\x0a\x09\x22no op\x22",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ConsoleTranscript);
+globals.ConsoleTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "open",
-category: 'actions',
+protocol: 'actions',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.ConsoleTranscript)})},
+return self},
 args: [],
 source: "open",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ConsoleTranscript);
+globals.ConsoleTranscript);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "show:",
-category: 'printing',
+protocol: 'printing',
 fn: function (anObject){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 console.log(String(_st(anObject)._asString()));
-return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.ConsoleTranscript)})},
+return self},
 args: ["anObject"],
 source: "show: anObject\x0a\x22Smalltalk objects should have no trouble displaying themselves on the Transcript; Javascript objects don't know how, so must be wrapped in a JSObectProxy.\x22\x0a<console.log(String(_st(anObject)._asString()))>",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ConsoleTranscript);
+globals.ConsoleTranscript);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
-function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
+function $Transcript(){return globals.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
 return smalltalk.withContext(function($ctx1) { 
-_st($Transcript())._register_(self._new());
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ConsoleTranscript.klass)})},
+_st($Transcript())._registerIfNone_(self._new());
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ConsoleTranscript.klass)})},
 args: [],
-source: "initialize\x0a\x09Transcript register: self new",
-messageSends: ["register:", "new"],
+source: "initialize\x0a\x09Transcript registerIfNone: self new",
+messageSends: ["registerIfNone:", "new"],
 referencedClasses: ["Transcript"]
 }),
-smalltalk.ConsoleTranscript.klass);
-
-
-smalltalk.addClass('Transcript', smalltalk.Object, [], 'Kernel-Transcript');
-smalltalk.Transcript.comment="I am a facade for Transcript actions.\x0a\x0aI delegate actions to the currently registered transcript.\x0a\x0a## API\x0a\x0a    Transcript \x0a        show: 'hello world';\x0a        cr;\x0a        show: anObject.";
-
-smalltalk.Transcript.klass.iVarNames = ['current'];
-smalltalk.addMethod(
-smalltalk.method({
-selector: "clear",
-category: 'printing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._current())._clear();
-return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.Transcript.klass)})},
-args: [],
-source: "clear\x0a\x09self current clear",
-messageSends: ["clear", "current"],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "cr",
-category: 'printing',
-fn: function (){
-var self=this;
-function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
-return smalltalk.withContext(function($ctx1) { 
-_st(self._current())._show_(_st($String())._cr());
-return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.Transcript.klass)})},
-args: [],
-source: "cr\x0a\x09self current show: String cr",
-messageSends: ["show:", "current", "cr"],
-referencedClasses: ["String"]
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "current",
-category: 'instance creation',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self["@current"];
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Transcript.klass)})},
-args: [],
-source: "current\x0a\x09^ current",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inspect:",
-category: 'printing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._show_(anObject);
-return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Transcript.klass)})},
-args: ["anObject"],
-source: "inspect: anObject\x0a\x09self show: anObject",
-messageSends: ["show:"],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "new",
-category: 'instance creation',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self._shouldNotImplement();
-return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.Transcript.klass)})},
-args: [],
-source: "new\x0a\x09self shouldNotImplement",
-messageSends: ["shouldNotImplement"],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "open",
-category: 'instance creation',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._current())._open();
-return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.Transcript.klass)})},
-args: [],
-source: "open\x0a\x09self current open",
-messageSends: ["open", "current"],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "register:",
-category: 'instance creation',
-fn: function (aTranscript){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@current"]=aTranscript;
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{aTranscript:aTranscript},smalltalk.Transcript.klass)})},
-args: ["aTranscript"],
-source: "register: aTranscript\x0a\x09current := aTranscript",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "show:",
-category: 'printing',
-fn: function (anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(self._current())._show_(anObject);
-return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.Transcript.klass)})},
-args: ["anObject"],
-source: "show: anObject\x0a\x09self current show: anObject",
-messageSends: ["show:", "current"],
-referencedClasses: []
-}),
-smalltalk.Transcript.klass);
+globals.ConsoleTranscript.klass);
 
 });

+ 82 - 83
js/SUnit-Tests.js

@@ -1,68 +1,68 @@
-define("amber_core/SUnit-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/SUnit"], function(smalltalk,nil,_st){
+define("amber_core/SUnit-Tests", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/SUnit"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('SUnit-Tests');
 smalltalk.packages["SUnit-Tests"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
-smalltalk.ExampleSetTest.comment="ExampleSetTest is taken from Pharo 1.4.\x0a\x0aTHe purpose of this class is to demonstrate a simple use case of the test framework.";
+smalltalk.addClass('ExampleSetTest', globals.TestCase, ['empty', 'full'], 'SUnit-Tests');
+globals.ExampleSetTest.comment="ExampleSetTest is taken from Pharo 1.4.\x0a\x0aTHe purpose of this class is to demonstrate a simple use case of the test framework.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setUp",
-category: 'running',
+protocol: 'running',
 fn: function (){
 var self=this;
-function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
+function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
 return smalltalk.withContext(function($ctx1) { 
 self["@empty"]=_st($Set())._new();
 self["@full"]=_st($Set())._with_with_((5),"abc");
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},globals.ExampleSetTest)})},
 args: [],
 source: "setUp\x0a\x09empty := Set new.\x0a\x09full := Set with: 5 with: #abc",
 messageSends: ["new", "with:with:"],
 referencedClasses: ["Set"]
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testAdd",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self["@empty"])._add_((5));
 self._assert_(_st(self["@empty"])._includes_((5)));
-return self}, function($ctx1) {$ctx1.fill(self,"testAdd",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testAdd",{},globals.ExampleSetTest)})},
 args: [],
 source: "testAdd\x0a\x09empty add: 5.\x0a\x09self assert: (empty includes: 5)",
 messageSends: ["add:", "assert:", "includes:"],
 referencedClasses: []
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testGrow",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self["@empty"])._addAll_((1)._to_((100)));
 self._assert_equals_(_st(self["@empty"])._size(),(100));
-return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testGrow",{},globals.ExampleSetTest)})},
 args: [],
 source: "testGrow\x0a\x09empty addAll: (1 to: 100).\x0a\x09self assert: empty size equals: 100",
 messageSends: ["addAll:", "to:", "assert:equals:", "size"],
 referencedClasses: []
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testIllegal",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
+function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -73,18 +73,18 @@ self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(self["@empty"])._at_put_((5),"abc");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}),$Error());
-return self}, function($ctx1) {$ctx1.fill(self,"testIllegal",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testIllegal",{},globals.ExampleSetTest)})},
 args: [],
 source: "testIllegal\x0a\x09self\x0a\x09\x09should: [ empty at: 5 ]\x0a\x09\x09raise: Error.\x0a\x09self\x0a\x09\x09should: [ empty at: 5 put: #abc ]\x0a\x09\x09raise: Error",
 messageSends: ["should:raise:", "at:", "at:put:"],
 referencedClasses: ["Error"]
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testIncludes",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -94,18 +94,18 @@ $ctx1.sendIdx["includes:"]=1;
 self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
 self._assert_(_st(self["@full"])._includes_("abc"));
-return self}, function($ctx1) {$ctx1.fill(self,"testIncludes",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testIncludes",{},globals.ExampleSetTest)})},
 args: [],
 source: "testIncludes\x0a\x09self assert: (full includes: 5).\x0a\x09self assert: (full includes: #abc)",
 messageSends: ["assert:", "includes:"],
 referencedClasses: []
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testOccurrences",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -120,18 +120,18 @@ self._assert_equals_($2,(1));
 $ctx1.sendIdx["assert:equals:"]=2;
 _st(self["@full"])._add_((5));
 self._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
-return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{},globals.ExampleSetTest)})},
 args: [],
 source: "testOccurrences\x0a\x09self assert: (empty occurrencesOf: 0) equals: 0.\x0a\x09self assert: (full occurrencesOf: 5) equals: 1.\x0a\x09full add: 5.\x0a\x09self assert: (full occurrencesOf: 5) equals: 1",
 messageSends: ["assert:equals:", "occurrencesOf:", "add:"],
 referencedClasses: []
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testRemove",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -141,21 +141,21 @@ $1=_st(self["@full"])._includes_("abc");
 $ctx1.sendIdx["includes:"]=1;
 self._assert_($1);
 self._deny_(_st(self["@full"])._includes_((5)));
-return self}, function($ctx1) {$ctx1.fill(self,"testRemove",{},smalltalk.ExampleSetTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRemove",{},globals.ExampleSetTest)})},
 args: [],
 source: "testRemove\x0a\x09full remove: 5.\x0a\x09self assert: (full includes: #abc).\x0a\x09self deny: (full includes: 5)",
 messageSends: ["remove:", "assert:", "includes:", "deny:"],
 referencedClasses: []
 }),
-smalltalk.ExampleSetTest);
+globals.ExampleSetTest);
 
 
 
-smalltalk.addClass('SUnitAsyncTest', smalltalk.TestCase, ['flag'], 'SUnit-Tests');
+smalltalk.addClass('SUnitAsyncTest', globals.TestCase, ['flag'], 'SUnit-Tests');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeError",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -167,18 +167,18 @@ self["@flag"]="ok";
 self["@flag"];
 return self._error_("Intentional");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._valueWithTimeout_((20));
-return self}, function($ctx1) {$ctx1.fill(self,"fakeError",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeError",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeError\x0a\x09flag := 'bad'.\x0a\x09self timeout: 30.\x0a\x09flag := (self async: [ flag := 'ok'. self error: 'Intentional' ]) valueWithTimeout: 20",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeErrorFailingInTearDown",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -188,18 +188,18 @@ self["@flag"]=_st(self._async_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._error_("Intentional");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._valueWithTimeout_((20));
-return self}, function($ctx1) {$ctx1.fill(self,"fakeErrorFailingInTearDown",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeErrorFailingInTearDown",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeErrorFailingInTearDown\x0a\x09flag := 'bad'.\x0a\x09self timeout: 30.\x0a\x09flag := (self async: [ self error: 'Intentional' ]) valueWithTimeout: 20",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "error:"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeFailure",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -211,18 +211,18 @@ self["@flag"]="ok";
 self["@flag"];
 return self._assert_(false);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._valueWithTimeout_((20));
-return self}, function($ctx1) {$ctx1.fill(self,"fakeFailure",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeFailure",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeFailure\x0a\x09flag := 'bad'.\x0a\x09self timeout: 30.\x0a\x09flag := (self async: [ flag := 'ok'. self assert: false ]) valueWithTimeout: 20",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeMultipleTimeoutFailing",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -240,18 +240,18 @@ return self._finished();
 $ctx1.sendIdx["async:"]=1;
 _st($1)._valueWithTimeout_((20));
 $ctx1.sendIdx["valueWithTimeout:"]=1;
-return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutFailing",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutFailing",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeMultipleTimeoutFailing\x0a\x09self timeout: 100.\x0a\x09(self async: [ \x0a\x09\x09self timeout: 20.\x0a\x09\x09(self async: [ self finished ]) valueWithTimeout: 30\x0a\x09]) valueWithTimeout: 20",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeMultipleTimeoutPassing",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -269,18 +269,18 @@ return self._finished();
 $ctx1.sendIdx["async:"]=1;
 _st($1)._valueWithTimeout_((10));
 $ctx1.sendIdx["valueWithTimeout:"]=1;
-return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutPassing",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutPassing",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeMultipleTimeoutPassing\x0a\x09self timeout: 20.\x0a\x09(self async: [\x0a\x09\x09self timeout: 40.\x0a\x09\x09(self async: [ self finished ]) valueWithTimeout: 20\x0a\x09]) valueWithTimeout: 10",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "fakeTimeout",
-category: 'helpers',
+protocol: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -289,18 +289,18 @@ _st(self._async_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._valueWithTimeout_((20));
-return self}, function($ctx1) {$ctx1.fill(self,"fakeTimeout",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"fakeTimeout",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "fakeTimeout\x0a\x09self timeout: 10.\x0a\x09(self async: [ self finished ]) valueWithTimeout: 20",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "selectorSetOf:",
-category: 'private',
+protocol: 'private',
 fn: function (aCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -310,55 +310,54 @@ return smalltalk.withContext(function($ctx2) {
 return _st(each)._selector();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._asSet();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"selectorSetOf:",{aCollection:aCollection},smalltalk.SUnitAsyncTest)})},
+}, function($ctx1) {$ctx1.fill(self,"selectorSetOf:",{aCollection:aCollection},globals.SUnitAsyncTest)})},
 args: ["aCollection"],
 source: "selectorSetOf: aCollection\x0a\x09^ (aCollection collect: [ :each | each selector ]) asSet",
 messageSends: ["asSet", "collect:", "selector"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setUp",
-category: 'running',
+protocol: 'running',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@flag"]="ok";
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.SUnitAsyncTest)})},
+return self},
 args: [],
 source: "setUp\x0a\x09flag := 'ok'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "tearDown",
-category: 'running',
+protocol: 'running',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._assert_equals_("ok",self["@flag"]);
-return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "tearDown\x0a\x09self assert: 'ok' equals: flag",
 messageSends: ["assert:equals:"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testAsyncErrorsAndFailures",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 var suite,runner,result,assertBlock;
-function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
-function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
+function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
+function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3,$4;
 suite=["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"]._collect_((function(each){
@@ -389,21 +388,21 @@ return _st($4)._ifTrue_(assertBlock);
 };
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1,3)})}));
 _st(runner)._run();
-return self}, function($ctx1) {$ctx1.fill(self,"testAsyncErrorsAndFailures",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testAsyncErrorsAndFailures",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},globals.SUnitAsyncTest)})},
 args: [],
 source: "testAsyncErrorsAndFailures\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeError' 'fakeErrorFailingInTearDown' 'fakeFailure' 'testPass') collect: [ :each | self class selector: each ].\x0a\x09runner := TestSuiteRunner on: suite.\x0a\x09self timeout: 200.\x0a\x09result := runner result.\x0a\x09assertBlock := self async: [\x0a\x09\x09self assert: (self selectorSetOf: result errors) equals: #('fakeError') asSet.\x0a\x09\x09self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.\x0a\x09\x09self finished\x0a\x09].\x0a\x09runner announcer on: ResultAnnouncement do: [ :ann |\x0a\x09\x09ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ] ].\x0a\x09runner run",
 messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "asSet", "failures", "finished", "on:do:", "announcer", "ifTrue:", "==", "=", "runs", "total", "run"],
 referencedClasses: ["TestSuiteRunner", "ResultAnnouncement"]
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testAsyncNeedsTimeout",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
+function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -420,21 +419,21 @@ return smalltalk.withContext(function($ctx3) {
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),$Error());
 self._finished();
-return self}, function($ctx1) {$ctx1.fill(self,"testAsyncNeedsTimeout",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testAsyncNeedsTimeout",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "testAsyncNeedsTimeout\x0a\x09self should: [ self async: [ ] ] raise: Error.\x0a\x09self timeout: 0.\x0a\x09self shouldnt: [ self async: [ ] ] raise: Error.\x0a\x09self finished",
 messageSends: ["should:raise:", "async:", "timeout:", "shouldnt:raise:", "finished"],
 referencedClasses: ["Error"]
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testFinishedNeedsTimeout",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
+function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
 self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -446,18 +445,18 @@ self._shouldnt_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}),$Error());
-return self}, function($ctx1) {$ctx1.fill(self,"testFinishedNeedsTimeout",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testFinishedNeedsTimeout",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "testFinishedNeedsTimeout\x0a\x09self should: [ self finished ] raise: Error.\x0a\x09self timeout: 0.\x0a\x09self shouldnt: [ self finished ] raise: Error.",
 messageSends: ["should:raise:", "finished", "timeout:", "shouldnt:raise:"],
 referencedClasses: ["Error"]
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testIsAsyncReturnsCorrectValues",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -472,18 +471,18 @@ $ctx1.sendIdx["isAsync"]=2;
 self._assert_($2);
 self._finished();
 self._deny_(self._isAsync());
-return self}, function($ctx1) {$ctx1.fill(self,"testIsAsyncReturnsCorrectValues",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testIsAsyncReturnsCorrectValues",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "testIsAsyncReturnsCorrectValues\x0a\x09self deny: self isAsync.\x0a\x09self timeout: 0.\x0a\x09self assert: self isAsync.\x0a\x09self finished.\x0a\x09self deny: self isAsync",
 messageSends: ["deny:", "isAsync", "timeout:", "assert:", "finished"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testPass",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -496,24 +495,24 @@ self._finished();
 self["@flag"]="ok";
 return self["@flag"];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._valueWithTimeout_((5));
-return self}, function($ctx1) {$ctx1.fill(self,"testPass",{},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testPass",{},globals.SUnitAsyncTest)})},
 args: [],
 source: "testPass\x0a\x09flag := 'bad'.\x0a\x09self timeout: 10.\x0a\x09flag := (self async: [ self assert: true. self finished. flag := 'ok' ]) valueWithTimeout: 5",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "assert:", "finished"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testTimeouts",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 var suite,runner,result,assertBlock;
-function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
-function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
-function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
+function $TestSuiteRunner(){return globals.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
+function $Set(){return globals.Set||(typeof Set=="undefined"?nil:Set)}
+function $ResultAnnouncement(){return globals.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$3;
 suite=["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"]._collect_((function(each){
@@ -542,18 +541,18 @@ return _st($3)._ifTrue_(assertBlock);
 };
 }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1,3)})}));
 _st(runner)._run();
-return self}, function($ctx1) {$ctx1.fill(self,"testTimeouts",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testTimeouts",{suite:suite,runner:runner,result:result,assertBlock:assertBlock},globals.SUnitAsyncTest)})},
 args: [],
 source: "testTimeouts\x0a\x09| suite runner result assertBlock |\x0a\x09suite := #('fakeTimeout' 'fakeMultipleTimeoutFailing' 'fakeMultipleTimeoutPassing' 'testPass') collect: [ :each | self class selector: each ].\x0a\x09runner := TestSuiteRunner on: suite.\x0a\x09self timeout: 200.\x0a\x09result := runner result.\x0a\x09assertBlock := self async: [\x0a\x09\x09self assert: (self selectorSetOf: result errors) equals: Set new.\x0a\x09\x09self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.\x0a\x09\x09self finished\x0a\x09].\x0a\x09runner announcer on: ResultAnnouncement do: [ :ann |\x0a\x09\x09ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ] ].\x0a\x09runner run",
 messageSends: ["collect:", "selector:", "class", "on:", "timeout:", "result", "async:", "assert:equals:", "selectorSetOf:", "errors", "new", "failures", "asSet", "finished", "on:do:", "announcer", "ifTrue:", "==", "=", "runs", "total", "run"],
 referencedClasses: ["TestSuiteRunner", "Set", "ResultAnnouncement"]
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testTwoAsyncPassesWithFinishedOnlyOneIsRun",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 var x;
@@ -586,13 +585,13 @@ x=_st(x).__plus((1));
 x;
 return self._assert_equals_(x,(1));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})))._valueWithTimeout_((0));
-return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x},smalltalk.SUnitAsyncTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x},globals.SUnitAsyncTest)})},
 args: [],
 source: "testTwoAsyncPassesWithFinishedOnlyOneIsRun\x0a\x09| x |\x0a\x09flag := 'bad'.\x0a\x09self timeout: 10.\x0a\x09x := 0.\x0a\x09flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.\x0a\x09flag := (self async: [ self finished. flag := 'ok'. x := x+1. self assert: x equals: 1 ]) valueWithTimeout: 0.",
 messageSends: ["timeout:", "valueWithTimeout:", "async:", "finished", "+", "assert:equals:"],
 referencedClasses: []
 }),
-smalltalk.SUnitAsyncTest);
+globals.SUnitAsyncTest);
 
 
 });

File diff suppressed because it is too large
+ 159 - 173
js/SUnit.js


+ 61 - 64
js/Spaces.js

@@ -1,30 +1,30 @@
-define("amber_core/Spaces", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/SUnit"], function(smalltalk,nil,_st){
+define("amber_core/Spaces", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Kernel-Exceptions", "amber_core/SUnit"], function(smalltalk,nil,_st, globals){
 smalltalk.addPackage('Spaces');
 smalltalk.packages["Spaces"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('ObjectSpace', smalltalk.Object, ['frame'], 'Spaces');
-smalltalk.ObjectSpace.comment="I am a connection to another Smalltalk environment.\x0aThe implementation creates an iframe on the same location as the window, and connect to the Amber environment.\x0a\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| space |\x0a\x09\x0a\x09space := ObjectSpace new.\x0a\x09space do: [ smalltalk ] \x22Answers aSmalltalk\x22\x0a\x09(space do: [ smalltalk ]) == smalltalk \x22Answers false\x22\x0a\x09\x0a\x09space release \x22Remove the object space environment\x22";
+smalltalk.addClass('ObjectSpace', globals.Object, ['frame'], 'Spaces');
+globals.ObjectSpace.comment="I am a connection to another Smalltalk environment.\x0aThe implementation creates an iframe on the same location as the window, and connect to the Amber environment.\x0a\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| space |\x0a\x09\x0a\x09space := ObjectSpace new.\x0a\x09space do: [ smalltalk ] \x22Answers aSmalltalk\x22\x0a\x09(space do: [ smalltalk ]) == smalltalk \x22Answers false\x22\x0a\x09\x0a\x09space release \x22Remove the object space environment\x22";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "connectTo:",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (aFrame){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._release();
 self["@frame"]=aFrame;
-return self}, function($ctx1) {$ctx1.fill(self,"connectTo:",{aFrame:aFrame},smalltalk.ObjectSpace)})},
+return self}, function($ctx1) {$ctx1.fill(self,"connectTo:",{aFrame:aFrame},globals.ObjectSpace)})},
 args: ["aFrame"],
 source: "connectTo: aFrame\x0a\x09self release.\x0a\x09frame := aFrame",
 messageSends: ["release"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "create",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -34,18 +34,18 @@ $ctx1.sendIdx["asJQuery"]=1;
 _st($1)._append_("<iframe style=\x22display: none;\x22></iframe>");
 self["@frame"]=_st(_st("iframe"._asJQuery())._get())._last();
 _st(_st(self["@frame"])._contentWindow())._location_(_st(window)._location());
-return self}, function($ctx1) {$ctx1.fill(self,"create",{},smalltalk.ObjectSpace)})},
+return self}, function($ctx1) {$ctx1.fill(self,"create",{},globals.ObjectSpace)})},
 args: [],
 source: "create\x0a\x09'body' asJQuery append: '<iframe style=\x22display: none;\x22></iframe>'.\x0a\x09frame := 'iframe' asJQuery get last.\x0a\x09frame contentWindow location: window location",
 messageSends: ["append:", "asJQuery", "last", "get", "location:", "contentWindow", "location"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "destroy",
-category: 'releasing',
+protocol: 'releasing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -58,21 +58,21 @@ $1;
 };
 _st(_st(self["@frame"])._asJQuery())._remove();
 self._release();
-return self}, function($ctx1) {$ctx1.fill(self,"destroy",{},smalltalk.ObjectSpace)})},
+return self}, function($ctx1) {$ctx1.fill(self,"destroy",{},globals.ObjectSpace)})},
 args: [],
 source: "destroy\x0a\x09frame ifNil: [ ^ self ].\x0a\x09frame asJQuery remove.\x0a\x0a\x09self release",
 messageSends: ["ifNil:", "remove", "asJQuery", "release"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "do:",
-category: 'evaluating',
+protocol: 'evaluating',
 fn: function (aBlock){
 var self=this;
-function $ObjectSpaceConnectionError(){return smalltalk.ObjectSpaceConnectionError||(typeof ObjectSpaceConnectionError=="undefined"?nil:ObjectSpaceConnectionError)}
+function $ObjectSpaceConnectionError(){return globals.ObjectSpaceConnectionError||(typeof ObjectSpaceConnectionError=="undefined"?nil:ObjectSpaceConnectionError)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2,$4,$5,$3;
 $1=self._isConnected();
@@ -85,104 +85,102 @@ $5=_st("(".__comma(_st(aBlock)._compiledSource())).__comma(")()");
 $ctx1.sendIdx[","]=1;
 $3=_st($4)._eval_($5);
 return $3;
-}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},smalltalk.ObjectSpace)})},
+}, function($ctx1) {$ctx1.fill(self,"do:",{aBlock:aBlock},globals.ObjectSpace)})},
 args: ["aBlock"],
 source: "do: aBlock\x0a\x09self isConnected ifFalse: [ ^ ObjectSpaceConnectionError signal ].\x0a\x09^ frame contentWindow eval: '(', aBlock compiledSource, ')()'",
 messageSends: ["ifFalse:", "isConnected", "signal", "eval:", "contentWindow", ",", "compiledSource"],
 referencedClasses: ["ObjectSpaceConnectionError"]
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "frame",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=self["@frame"];
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"frame",{},smalltalk.ObjectSpace)})},
+},
 args: [],
 source: "frame\x0a\x09^ frame",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-smalltalk.ObjectSpace.superclass.fn.prototype._initialize.apply(_st(self), []);
+globals.ObjectSpace.superclass.fn.prototype._initialize.apply(_st(self), []);
 self._create();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ObjectSpace)})},
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.ObjectSpace)})},
 args: [],
 source: "initialize\x0a\x09super initialize.\x0a\x09self create",
 messageSends: ["initialize", "create"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isConnected",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
 $1=_st(self._frame())._notNil();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"isConnected",{},smalltalk.ObjectSpace)})},
+}, function($ctx1) {$ctx1.fill(self,"isConnected",{},globals.ObjectSpace)})},
 args: [],
 source: "isConnected\x0a\x09^ self frame notNil",
 messageSends: ["notNil", "frame"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "release",
-category: 'releasing',
+protocol: 'releasing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 self["@frame"]=nil;
-return self}, function($ctx1) {$ctx1.fill(self,"release",{},smalltalk.ObjectSpace)})},
+return self},
 args: [],
 source: "release\x0a\x09frame := nil",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "whenReadyDo:",
-category: 'events',
+protocol: 'events',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(_st(self["@frame"])._asJQuery())._bind_do_("load",aBlock);
-return self}, function($ctx1) {$ctx1.fill(self,"whenReadyDo:",{aBlock:aBlock},smalltalk.ObjectSpace)})},
+return self}, function($ctx1) {$ctx1.fill(self,"whenReadyDo:",{aBlock:aBlock},globals.ObjectSpace)})},
 args: ["aBlock"],
 source: "whenReadyDo: aBlock\x0a\x09frame asJQuery\x0a\x09\x09bind: 'load'\x0a\x09\x09do: aBlock",
 messageSends: ["bind:do:", "asJQuery"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace);
+globals.ObjectSpace);
 
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "on:",
-category: 'instance creation',
+protocol: 'instance creation',
 fn: function (aFrame){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -192,75 +190,74 @@ _st($2)._connectTo_(aFrame);
 $3=_st($2)._yourself();
 $1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{aFrame:aFrame},smalltalk.ObjectSpace.klass)})},
+}, function($ctx1) {$ctx1.fill(self,"on:",{aFrame:aFrame},globals.ObjectSpace.klass)})},
 args: ["aFrame"],
 source: "on: aFrame\x0a\x09^ self basicNew\x0a\x09\x09connectTo: aFrame;\x0a\x09\x09yourself",
 messageSends: ["connectTo:", "basicNew", "yourself"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpace.klass);
+globals.ObjectSpace.klass);
 
 
-smalltalk.addClass('ObjectSpaceConnectionError', smalltalk.Error, [], 'Spaces');
+smalltalk.addClass('ObjectSpaceConnectionError', globals.Error, [], 'Spaces');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "messageText",
-category: 'accessing',
+protocol: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
 return "The ObjectSpace is not connected";
-}, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.ObjectSpaceConnectionError)})},
+},
 args: [],
 source: "messageText\x0a\x09^ 'The ObjectSpace is not connected'",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.ObjectSpaceConnectionError);
+globals.ObjectSpaceConnectionError);
 
 
 
-smalltalk.addClass('ObjectSpaceTest', smalltalk.TestCase, ['space'], 'Spaces');
+smalltalk.addClass('ObjectSpaceTest', globals.TestCase, ['space'], 'Spaces');
 smalltalk.addMethod(
 smalltalk.method({
 selector: "setUp",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
-function $ObjectSpace(){return smalltalk.ObjectSpace||(typeof ObjectSpace=="undefined"?nil:ObjectSpace)}
+function $ObjectSpace(){return globals.ObjectSpace||(typeof ObjectSpace=="undefined"?nil:ObjectSpace)}
 return smalltalk.withContext(function($ctx1) { 
 self["@space"]=_st($ObjectSpace())._new();
-return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"setUp",{},globals.ObjectSpaceTest)})},
 args: [],
 source: "setUp\x0a\x09space := ObjectSpace new",
 messageSends: ["new"],
 referencedClasses: ["ObjectSpace"]
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "tearDown",
-category: 'initialization',
+protocol: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 _st(self["@space"])._destroy();
-return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"tearDown",{},globals.ObjectSpaceTest)})},
 args: [],
 source: "tearDown\x0a\x09space destroy",
 messageSends: ["destroy"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testConnection",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
-function $ObjectSpaceConnectionError(){return smalltalk.ObjectSpaceConnectionError||(typeof ObjectSpaceConnectionError=="undefined"?nil:ObjectSpaceConnectionError)}
+function $ObjectSpaceConnectionError(){return globals.ObjectSpaceConnectionError||(typeof ObjectSpaceConnectionError=="undefined"?nil:ObjectSpaceConnectionError)}
 return smalltalk.withContext(function($ctx1) { 
 _st(self["@space"])._destroy();
 self._deny_(_st(self["@space"])._isConnected());
@@ -270,40 +267,40 @@ return _st(self["@space"])._do_((function(){
 return smalltalk.withContext(function($ctx3) {
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$ObjectSpaceConnectionError());
-return self}, function($ctx1) {$ctx1.fill(self,"testConnection",{},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testConnection",{},globals.ObjectSpaceTest)})},
 args: [],
 source: "testConnection\x0a\x09space destroy.\x0a\x09self deny: space isConnected.\x0a\x09self should: [ space do: [] ] raise: ObjectSpaceConnectionError",
 messageSends: ["destroy", "deny:", "isConnected", "should:raise:", "do:"],
 referencedClasses: ["ObjectSpaceConnectionError"]
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testCreate",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._assert_(_st(_st(self["@space"])._frame())._notNil());
 $ctx1.sendIdx["assert:"]=1;
 self._assert_(_st(self["@space"])._isConnected());
-return self}, function($ctx1) {$ctx1.fill(self,"testCreate",{},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testCreate",{},globals.ObjectSpaceTest)})},
 args: [],
 source: "testCreate\x0a\x0a\x09self assert: space frame notNil.\x0a\x09self assert: space isConnected",
 messageSends: ["assert:", "notNil", "frame", "isConnected"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testEvaluation",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 var result;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $2,$1;
 _st(self["@space"])._whenReadyDo_((function(){
@@ -321,18 +318,18 @@ self._deny_(_st(_st(result)._class()).__eq($Smalltalk()));
 $ctx2.sendIdx["deny:"]=1;
 return self._deny_(_st(result).__eq_eq(smalltalk));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"testEvaluation",{result:result},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testEvaluation",{result:result},globals.ObjectSpaceTest)})},
 args: [],
 source: "testEvaluation\x0a\x09| result |\x0a\x0a\x09space whenReadyDo: [\x0a\x09\x09result := space do: [ smalltalk ].\x0a\x0a\x09\x09self assert: result class name equals: 'Smalltalk'.\x0a\x09\x09self deny: result class = Smalltalk.\x0a\x09\x09self deny: result == smalltalk ]",
 messageSends: ["whenReadyDo:", "do:", "assert:equals:", "name", "class", "deny:", "=", "=="],
 referencedClasses: ["Smalltalk"]
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testRelease",
-category: 'tests',
+protocol: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
@@ -344,13 +341,13 @@ $ctx1.sendIdx["isNil"]=1;
 self._deny_($1);
 _st(self["@space"])._release();
 self._assert_(_st(_st(self["@space"])._frame())._isNil());
-return self}, function($ctx1) {$ctx1.fill(self,"testRelease",{},smalltalk.ObjectSpaceTest)})},
+return self}, function($ctx1) {$ctx1.fill(self,"testRelease",{},globals.ObjectSpaceTest)})},
 args: [],
 source: "testRelease\x0a\x0a\x09self deny: space frame isNil.\x0a\x0a\x09space release.\x0a\x09\x0a\x09self assert: space frame isNil",
 messageSends: ["deny:", "isNil", "frame", "release", "assert:"],
 referencedClasses: []
 }),
-smalltalk.ObjectSpaceTest);
+globals.ObjectSpaceTest);
 
 
 });

+ 3 - 0
package.json

@@ -32,6 +32,9 @@
   "scripts": {
     "test": "grunt amberc:amber_test_runner && node ./test/amber_test_runner.js"
   },
+  "dependencies": {
+    "es6-promise": "~0.1.1"
+  },
   "devDependencies": {
     "pegjs": "~0.7.0",
     "grunt": "~0.4.0",

+ 1 - 1
st/Benchfib.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Benchfib'!
+Smalltalk createPackage: 'Benchfib'!
 Object subclass: #Benchfib
 	instanceVariableNames: ''
 	package: 'Benchfib'!

+ 11 - 2
st/Canvas.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Canvas'!
+Smalltalk createPackage: 'Canvas'!
 Object subclass: #BrowserInterface
 	instanceVariableNames: ''
 	package: 'Canvas'!
@@ -545,6 +545,15 @@ video
 	^ self tag: 'video'
 ! !
 
+!HTMLCanvas class methodsFor: 'initialization'!
+
+initialize
+	"Allow JS method calls for the jQuery object.
+	See boot.js DNU handling."
+	
+	jQuery basicAt: 'allowJavaScriptCalls' put: true
+! !
+
 !HTMLCanvas class methodsFor: 'instance creation'!
 
 onJQuery: aJQuery
@@ -625,7 +634,7 @@ snippetAt: aString compile: anElement
 		installMethod: ([ :htmlReceiver | htmlReceiver snippet: anElement ]
 			currySelf asCompiledMethod: aString)
 		forClass: HTMLCanvas
-		category: '**snippets'
+		protocol: '**snippets'
 ! !
 
 !HTMLSnippet methodsFor: 'private'!

+ 18 - 2
st/Compiler-AST.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-AST'!
+Smalltalk createPackage: 'Compiler-AST'!
 Object subclass: #Node
 	instanceVariableNames: 'parent position nodes shouldBeInlined shouldBeAliased'
 	package: 'Compiler-AST'!
@@ -162,6 +162,18 @@ isVariableNode
 	^ false
 !
 
+requiresSmalltalkContext
+	"Answer true if the receiver requires a smalltalk context.
+	Only send nodes require a context.
+	
+	If no node requires a context, the method will be compiled without one.
+	See `IRJSTranslator` and `JSStream` for context creation"
+	
+	^ (self nodes 
+		detect: [ :each | each requiresSmalltalkContext ]
+		ifNone: [ nil ]) notNil
+!
+
 stopOnStepping
 	^ false
 !
@@ -563,6 +575,10 @@ isSendNode
 	^ true
 !
 
+requiresSmalltalkContext
+	^ true
+!
+
 shouldBeAliased
 	"Because we keep track of send indexes, some send nodes need additional care for aliasing. 
 	See IRJSVisitor >> visitIRSend:"
@@ -745,6 +761,6 @@ isNode
 ast
 	self source ifEmpty: [ self error: 'Method source is empty' ].
 	
-	^ Smalltalk current parse: self source
+	^ Smalltalk parse: self source
 ! !
 

+ 26 - 16
st/Compiler-Core.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Core'!
+Smalltalk createPackage: 'Compiler-Core'!
 Object subclass: #AbstractCodeGenerator
 	instanceVariableNames: 'currentClass source'
 	package: 'Compiler-Core'!
@@ -25,13 +25,7 @@ currentClass: aClass
 !
 
 pseudoVariables
-	^ Smalltalk current pseudoVariableNames
-!
-
-safeVariableNameFor: aString
-	^ (Smalltalk current reservedWords includes: aString)
-		ifTrue: [ aString, '_' ]
-		ifFalse: [ aString ]
+	^ Smalltalk pseudoVariableNames
 !
 
 source
@@ -173,22 +167,22 @@ evaluateExpression: aString on: anObject
 	"Unlike #eval: evaluate a Smalltalk expression with anObject as the receiver and answer the returned object"
 	| result method |
 	method := self eval: (self compileExpression: aString on: anObject).
-	method category: 'xxxDoIt'.
+	method protocol: 'xxxDoIt'.
 	anObject class addCompiledMethod: method.
 	result := anObject xxxDoIt.
 	anObject class removeCompiledMethod: method.
 	^ result
 !
 
-install: aString forClass: aBehavior category: anotherString
+install: aString forClass: aBehavior protocol: anotherString
 	^ ClassBuilder new
 		installMethod: (self eval: (self compile: aString forClass: aBehavior))
 		forClass: aBehavior
-		category: anotherString
+		protocol: anotherString
 !
 
 parse: aString
-	^ Smalltalk current parse: aString
+	^ Smalltalk parse: aString
 !
 
 parseExpression: aString
@@ -197,14 +191,17 @@ parseExpression: aString
 
 recompile: aClass
 	aClass methodDictionary values
-		do: [ :each | self install: each source forClass: aClass category: each category ]
+		do: [ :each | 
+			self 
+				install: each source 
+				forClass: aClass 
+				protocol: each protocol ]
 		displayingProgress: 'Recompiling ', aClass name.
-	"self setupClass: aClass."
 	aClass isMetaclass ifFalse: [ self recompile: aClass class ]
 !
 
 recompileAll
-	Smalltalk current classes 
+	Smalltalk classes 
 		do: [ :each | self recompile: each ]
 		displayingProgress: 'Compiling all classes...'
 ! !
@@ -216,7 +213,7 @@ recompile: aClass
 !
 
 recompileAll
-	Smalltalk current classes do: [ :each |
+	Smalltalk classes do: [ :each |
 		self recompile: each ]
 ! !
 
@@ -226,6 +223,11 @@ Object subclass: #DoIt
 !DoIt commentStamp!
 `DoIt` is the class used to compile and evaluate expressions. See `Compiler >> evaluateExpression:`.!
 
+!DoIt methodsFor: 'tests'!
+
+foo ^ Array new add: 3; add: 4; yourself
+! !
+
 Object subclass: #NodeVisitor
 	instanceVariableNames: ''
 	package: 'Compiler-Core'!
@@ -298,3 +300,11 @@ visitVariableNode: aNode
 	^ self visitNode: aNode
 ! !
 
+!String methodsFor: '*Compiler-Core'!
+
+asVariableName
+	^ (Smalltalk reservedWords includes: self)
+		ifTrue: [ self, '_' ]
+		ifFalse: [ self ]
+! !
+

+ 5 - 5
st/Compiler-Exceptions.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Exceptions'!
+Smalltalk createPackage: 'Compiler-Exceptions'!
 Error subclass: #CompilerError
 	instanceVariableNames: ''
 	package: 'Compiler-Exceptions'!
@@ -89,7 +89,7 @@ variableName: aString
 	variableName := aString
 ! !
 
-ErrorHandler subclass: #RethrowErrorHandler
+Object subclass: #RethrowErrorHandler
 	instanceVariableNames: ''
 	package: 'Compiler-Exceptions'!
 !RethrowErrorHandler commentStamp!
@@ -100,11 +100,11 @@ As a result Smalltalk errors are not swallowd by the Amber runtime and compilati
 !RethrowErrorHandler methodsFor: 'error handling'!
 
 basicSignal: anError
-	<throw anError>
+        <throw anError>
 !
 
 handleError: anError
-	super handleError: anError.
-	self basicSignal: anError
+        super handleError: anError.
+        self basicSignal: anError
 ! !
 

+ 15 - 12
st/Compiler-IR.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-IR'!
+Smalltalk createPackage: 'Compiler-IR'!
 NodeVisitor subclass: #IRASTTranslator
 	instanceVariableNames: 'source theClass method sequence nextAlias'
 	package: 'Compiler-IR'!
@@ -183,6 +183,7 @@ visitMethodNode: aNode
 		selector: aNode selector;
 		sendIndexes: aNode sendIndexes;
 		superSends: aNode superSends;
+		requiresSmalltalkContext: aNode requiresSmalltalkContext;
 		classReferences: aNode classReferences;
 		scope: aNode scope;
 		yourself).
@@ -473,7 +474,7 @@ accept: aVisitor
 ! !
 
 IRClosureInstruction subclass: #IRMethod
-	instanceVariableNames: 'theClass source selector classReferences sendIndexes superSends internalVariables'
+	instanceVariableNames: 'theClass source selector classReferences sendIndexes superSends requiresSmalltalkContext internalVariables'
 	package: 'Compiler-IR'!
 !IRMethod commentStamp!
 I am a method instruction!
@@ -504,6 +505,14 @@ method
 	^ self
 !
 
+requiresSmalltalkContext
+	^ requiresSmalltalkContext ifNil: [ false ]
+!
+
+requiresSmalltalkContext: anObject
+	requiresSmalltalkContext := anObject
+!
+
 selector
 	^ selector
 !
@@ -953,7 +962,7 @@ visitIRDynamicArray: anIRDynamicArray
 !
 
 visitIRDynamicDictionary: anIRDynamicDictionary
-	self stream nextPutAll: 'smalltalk.HashedCollection._from_(['.
+	self stream nextPutAll: 'globals.HashedCollection._from_(['.
 		anIRDynamicDictionary instructions
 			do: [ :each | self visit: each ]
 			separatedBy: [ self stream nextPutAll: ',' ].
@@ -1126,7 +1135,7 @@ nextPutClassRefFunction: aString
 	stream
 		nextPutAll: 'function $';
 		nextPutAll: aString;
-		nextPutAll: '(){return smalltalk.';
+		nextPutAll: '(){return globals.';
 		nextPutAll: aString;
 		nextPutAll: '||(typeof ';
 		nextPutAll: aString;
@@ -1147,6 +1156,8 @@ nextPutClosureWith: aBlock arguments: anArray
 !
 
 nextPutContextFor: aMethod during: aBlock
+	aMethod requiresSmalltalkContext ifFalse: [ ^ aBlock value ].
+	
 	self
 		nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; lf.
 	aBlock value.
@@ -1281,11 +1292,3 @@ appendToInstruction: anIRInstruction
 	anIRInstruction appendBlock: self
 ! !
 
-!String methodsFor: '*Compiler-IR'!
-
-asVariableName
-	^ (Smalltalk current reservedWords includes: self)
-		ifTrue: [ self, '_' ]
-		ifFalse: [ self ]
-! !
-

+ 1 - 1
st/Compiler-Inlining.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Inlining'!
+Smalltalk createPackage: 'Compiler-Inlining'!
 IRAssignment subclass: #IRInlinedAssignment
 	instanceVariableNames: ''
 	package: 'Compiler-Inlining'!

+ 3 - 3
st/Compiler-Interpreter.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Interpreter'!
+Smalltalk createPackage: 'Compiler-Interpreter'!
 BlockClosure subclass: #AIBlockClosure
 	instanceVariableNames: 'node outerContext'
 	package: 'Compiler-Interpreter'!
@@ -351,7 +351,7 @@ buildAST
 	
 	| ast |
 	
-	ast := Smalltalk current parse: self method source.
+	ast := Smalltalk parse: self method source.
 	(SemanticAnalyzer on: self context receiver class)
 		visit: ast.
 	
@@ -711,7 +711,7 @@ visitVariableNode: aNode
 			ifAbsent: [
 				aNode value isCapitalized
 					ifTrue: [
-						Smalltalk current 
+						Smalltalk globals 
 							at: aNode value 
 							ifAbsent: [ PlatformInterface globals at: aNode value ] ] ] ])
 ! !

+ 5 - 4
st/Compiler-Semantic.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Semantic'!
+Smalltalk createPackage: 'Compiler-Semantic'!
 Object subclass: #LexicalScope
 	instanceVariableNames: 'node instruction temps args outerScope blockIndex'
 	package: 'Compiler-Semantic'!
@@ -163,7 +163,7 @@ nonLocalReturns
 pseudoVars
 	pseudoVars ifNil: [
 		pseudoVars := Dictionary new.
-		Smalltalk current pseudoVariableNames do: [ :each |
+		Smalltalk pseudoVariableNames do: [ :each |
 			pseudoVars at: each put: ((PseudoVar on: each)
 				scope: self methodScope;
 				yourself) ]].
@@ -451,7 +451,7 @@ errorUnknownVariable: aNode
 	| identifier |
 	identifier := aNode value.
 	
-	((Smalltalk current globalJsVariables includes: identifier) not
+	((Smalltalk globalJsVariables includes: identifier) not
 		and: [ self isVariableGloballyUndefined: identifier ])
 			ifTrue: [
 				UnknownVariableError new
@@ -577,7 +577,8 @@ visitSendNode: aNode
 		
 		ifFalse: [ (IRSendInliner inlinedSelectors includes: aNode selector) ifTrue: [
 			aNode shouldBeInlined: true.
-			aNode receiver shouldBeAliased: true ] ].
+			aNode receiver ifNotNil: [ :receiver |
+				receiver shouldBeAliased: true ] ] ].
 
 	self messageSends at: aNode selector ifAbsentPut: [ Set new ].
 	(self messageSends at: aNode selector) add: aNode.

+ 25 - 19
st/Compiler-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Tests'!
+Smalltalk createPackage: 'Compiler-Tests'!
 TestCase subclass: #ASTParsingTest
 	instanceVariableNames: ''
 	package: 'Compiler-Tests'!
@@ -13,7 +13,7 @@ analyze: aNode forClass: aClass
 !ASTParsingTest methodsFor: 'parsing'!
 
 parse: aString
-	^ Smalltalk current parse: aString
+	^ Smalltalk parse: aString
 !
 
 parse: aString forClass: aClass
@@ -136,7 +136,7 @@ should: aString receiver: anObject return: aResult
 	| method result |
 
 	receiver := anObject.
-	method := self compiler install: aString forClass: anObject class category: 'tests'.
+	method := self compiler install: aString forClass: anObject class protocol: 'tests'.
 	result := receiver perform: method selector.
 	anObject class removeCompiledMethod: method.
 	self assert: aResult equals: result
@@ -175,6 +175,12 @@ testCascades
 	self should: 'foo ^ Array new add: 3; add: 4; yourself' return: #(3 4)
 !
 
+testCascadesWithInlining
+	
+	self should: 'foo ^ true ifTrue: [ 1 ] ifFalse: [ 2 ]' return: 1.
+	self should: 'foo ^ false ifTrue: [ 1 ] ifFalse: [ 2 ]' return: 2
+!
+
 testDynamicArrayElementsOrdered
 	self should: 'foo
 	| x |
@@ -303,7 +309,7 @@ testNonLocalReturn
 !
 
 testPascalCaseGlobal
-	self should: 'foo ^Object' return: (smalltalk at: 'Object').
+	self should: 'foo ^Object' return: (Smalltalk globals at: 'Object').
 	self should: 'foo ^NonExistent' return: nil
 !
 
@@ -431,7 +437,7 @@ analyze: aNode forClass: aClass
 !
 
 parse: aString
-	^ Smalltalk current parse: aString
+	^ Smalltalk parse: aString
 !
 
 parse: aString forClass: aClass
@@ -549,7 +555,7 @@ testAssignment
 	| src ast |
 
 	src := 'foo self := 1'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	self should: [analyzer visit: ast] raise: InvalidAssignmentError
 !
 
@@ -557,7 +563,7 @@ testNonLocalReturn
 	| src ast |
 
 	src := 'foo | a | a + 1. ^ a'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	self deny: ast scope hasNonLocalReturn
@@ -567,7 +573,7 @@ testNonLocalReturn2
 	| src ast |
 
 	src := 'foo | a | a + 1. [ [ ^ a] ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	self assert: ast scope hasNonLocalReturn
@@ -577,7 +583,7 @@ testScope
 	| src ast |
 
 	src := 'foo | a | a + 1. [ | b | b := a ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	self deny: ast nodes first nodes last scope == ast scope.
@@ -587,7 +593,7 @@ testScope2
 	| src ast |
 
 	src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	self deny: ast nodes first nodes last nodes first nodes first scope == ast scope.
@@ -597,7 +603,7 @@ testScopeLevel
 	| src ast |
 
 	src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	self assert: ast scope scopeLevel equals: 1.
@@ -608,7 +614,7 @@ testUnknownVariables
 	| src ast |
 
 	src := 'foo | a | b + a'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 
 	self should: [ analyzer visit: ast ] raise: UnknownVariableError
 !
@@ -617,7 +623,7 @@ testUnknownVariablesWithScope
 	| src ast |
 
 	src := 'foo | a b | [ c + 1. [ a + 1. d + 1 ]]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	
 	self should: [ analyzer visit: ast ] raise: UnknownVariableError
 !
@@ -625,35 +631,35 @@ testUnknownVariablesWithScope
 testVariableShadowing
 	| src ast |
 	src := 'foo | a | a + 1'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast
 !
 
 testVariableShadowing2
 	| src ast |
 	src := 'foo | a | a + 1. [ | a | a := 2 ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	self should: [analyzer visit: ast] raise: ShadowingVariableError
 !
 
 testVariableShadowing3
 	| src ast |
 	src := 'foo | a | a + 1. [ | b | b := 2 ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast
 !
 
 testVariableShadowing4
 	| src ast |
 	src := 'foo | a | a + 1. [ [ [ | b | b := 2 ] ] ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast
 !
 
 testVariableShadowing5
 	| src ast |
 	src := 'foo | a | a + 1. [ [ [ | a | a := 2 ] ] ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	self should: [analyzer visit: ast] raise: ShadowingVariableError
 !
 
@@ -661,7 +667,7 @@ testVariablesLookup
 	| src ast |
 
 	src := 'foo | a | a + 1. [ | b | b := a ]'.
-	ast := smalltalk parse: src.
+	ast := Smalltalk parse: src.
 	analyzer visit: ast.
 
 	"Binding for `a` in the message send"

+ 1 - 1
st/Examples.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Examples'!
+Smalltalk createPackage: 'Examples'!
 Widget subclass: #Counter
 	instanceVariableNames: 'count header'
 	package: 'Examples'!

+ 1 - 1
st/Helios-Announcements.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Announcements'!
+Smalltalk createPackage: 'Helios-Announcements'!
 Object subclass: #HLAboutToChange
 	instanceVariableNames: 'actionBlock'
 	package: 'Helios-Announcements'!

+ 3 - 3
st/Helios-Browser.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Browser'!
+Smalltalk createPackage: 'Helios-Browser'!
 HLWidget subclass: #HLBrowser
 	instanceVariableNames: 'model packagesListWidget classesListWidget protocolsListWidget methodsListWidget sourceWidget bottomDiv'
 	package: 'Helios-Browser'!
@@ -488,8 +488,8 @@ toggleShowComment
 setItemsForPackage: aPackage
 	self items: (aPackage 
     	ifNil: [ #() ]
-  		ifNotNil: [ ((aPackage classes 
-        	collect: [ :each | each theNonMetaClass ]) asSet asArray) 
+  		ifNotNil: [ (aPackage classes 
+        	collect: [ :each | each theNonMetaClass ]) 
             	sort: [ :a :b | a name < b name ] ]).
 !
 

+ 111 - 1
st/Helios-Commands-Browser.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Commands-Browser'!
+Smalltalk createPackage: 'Helios-Commands-Browser'!
 HLToolCommand subclass: #HLBrowserCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Browser'!
@@ -155,6 +155,116 @@ label
 	^ 'Edit documentation'
 ! !
 
+HLBrowserCommand subclass: #HLGenerateCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+!HLGenerateCommand commentStamp!
+I am a group command used to gather all the commands generating code (`accessors`, `initialize`, etc)!
+
+!HLGenerateCommand class methodsFor: 'accessing'!
+
+key
+	^ 'h'
+!
+
+label
+	^ 'Generate'
+! !
+
+HLGenerateCommand subclass: #HLCategorizeUnclassifiedCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+!HLCategorizeUnclassifiedCommand commentStamp!
+I am the command used to categorize unclassified methods!
+
+!HLCategorizeUnclassifiedCommand methodsFor: 'executing'!
+
+execute
+	| targetClass unclassified |
+	targetClass := self model selectedClass.
+
+	unclassified := targetClass methods select:[ :e | e protocol = 'as yet unclassified' ].
+		
+	HLMethodClassifier new
+		classifyAll: unclassified
+! !
+
+!HLCategorizeUnclassifiedCommand class methodsFor: 'accessing'!
+
+key
+	^ 'c'
+!
+
+label
+	^ 'Categorize'
+! !
+
+HLGenerateCommand subclass: #HLGenerateAccessorsCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+!HLGenerateAccessorsCommand commentStamp!
+I am the command used to generate the `getter` and the `setter` methods depending of the selected class!
+
+!HLGenerateAccessorsCommand methodsFor: 'executing'!
+
+execute
+	| targetClass output first |
+	targetClass := self model selectedClass.
+
+	output := HLInitializeGenerator new
+		class: targetClass;
+		generate;
+		output.
+		
+	output compile.
+	first := output sourceCodes first.
+	self model
+		selectedProtocol: output protocol;
+		selectedMethod:(targetClass>>first selector);
+		focusOnSourceCode
+! !
+
+!HLGenerateAccessorsCommand class methodsFor: 'accessing'!
+
+key
+	^ 'i'
+!
+
+label
+	^ 'Initialize'
+! !
+
+HLGenerateCommand subclass: #HLGenerateInitializeCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+!HLGenerateInitializeCommand commentStamp!
+I am the command used to generate the `initialize` method depending of the selected class!
+
+!HLGenerateInitializeCommand methodsFor: 'executing'!
+
+execute
+	| targetClass output |
+	targetClass := self model selectedClass.
+
+	output := HLAccessorsGenerator new
+		class: targetClass;
+		generate;
+		output.
+		
+	output compile.
+	self model selectedProtocol: output protocol
+! !
+
+!HLGenerateInitializeCommand class methodsFor: 'accessing'!
+
+key
+	^ 'a'
+!
+
+label
+	^ 'Accessors'
+! !
+
 HLBrowserCommand subclass: #HLToggleCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Browser'!

+ 1 - 1
st/Helios-Commands-Core.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Commands-Core'!
+Smalltalk createPackage: 'Helios-Commands-Core'!
 Object subclass: #HLCommand
 	instanceVariableNames: 'input'
 	package: 'Helios-Commands-Core'!

+ 1 - 1
st/Helios-Commands-Tools.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Commands-Tools'!
+Smalltalk createPackage: 'Helios-Commands-Tools'!
 HLModelCommand subclass: #HLToolCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Tools'!

+ 61 - 32
st/Helios-Core.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Core'!
+Smalltalk createPackage: 'Helios-Core'!
 InterfacingObject subclass: #HLModel
 	instanceVariableNames: 'announcer environment'
 	package: 'Helios-Core'!
@@ -404,7 +404,7 @@ on: anEnvironment
         yourself
 ! !
 
-ProgressHandler subclass: #HLProgressHandler
+Object subclass: #HLProgressHandler
 	instanceVariableNames: ''
 	package: 'Helios-Core'!
 !HLProgressHandler commentStamp!
@@ -1175,18 +1175,6 @@ confirm: aString ifTrue: aBlock
 		show
 !
 
-registerErrorHandler: anErrorHandler
-	self environment registerErrorHandler: anErrorHandler
-!
-
-registerInspector: anInspector
-	self environment registerInspector: anInspector
-!
-
-registerProgressHandler: aProgressHandler
-	self environment registerProgressHandler: aProgressHandler
-!
-
 removeActiveTab
 	self removeTab: self activeTab
 !
@@ -1227,29 +1215,34 @@ request: aString value: valueString do: aBlock
 defaultEnvironment
 	"If helios is loaded from within a frame, answer the parent window environment"
 	
-	| parent parentSmalltalk |
+	| parent parentSmalltalkGlobals |
 	
 	parent := window opener ifNil: [ window parent ].
 	parent ifNil: [ ^ Environment new ].
 	
-	parentSmalltalk := (parent at: 'requirejs') value: 'amber_vm/smalltalk'.
-	parentSmalltalk ifNil: [ ^ Environment new ].
+	parentSmalltalkGlobals := (parent at: 'requirejs') value: 'amber_vm/globals'.
+	parentSmalltalkGlobals ifNil: [ ^ Environment new ].
 	
-	^ (parentSmalltalk at: 'Environment') new
+	^ (parentSmalltalkGlobals at: 'Environment') new
 ! !
 
 !HLManager methodsFor: 'initialization'!
 
-initialize
-	super initialize.
-	
-	HLErrorHandler register.
-	HLProgressHandler register.
-	
-	self registerInspector: HLInspector.
-	self registerErrorHandler: ErrorHandler current.
-	self registerProgressHandler: ProgressHandler current.
-    self keyBinder setupEvents
+setup
+	self registerServices.
+    self keyBinder 
+		setupEvents;
+		setupHelper
+! !
+
+!HLManager methodsFor: 'private'!
+
+registerServices
+	self
+		registerInspector;
+		registerErrorHandler;
+		registerProgressHandler;
+		registerTranscript
 ! !
 
 !HLManager methodsFor: 'rendering'!
@@ -1314,6 +1307,27 @@ show: aTab
 	aTab show; focus
 ! !
 
+!HLManager methodsFor: 'services'!
+
+registerErrorHandler
+	self environment registerErrorHandler: HLErrorHandler new.
+	ErrorHandler register: HLErrorHandler new
+!
+
+registerInspector
+	self environment registerInspector: HLInspector.
+	Inspector register: HLInspector
+!
+
+registerProgressHandler
+	self environment registerProgressHandler: HLProgressHandler new.
+	ProgressHandler register: HLProgressHandler new
+!
+
+registerTranscript
+	self environment registerTranscript: HLTranscriptHandler
+! !
+
 HLManager class instanceVariableNames: 'current'!
 
 !HLManager class methodsFor: 'accessing'!
@@ -1324,8 +1338,10 @@ current
 
 !HLManager class methodsFor: 'initialization'!
 
-initialize
-	self current appendToJQuery: 'body' asJQuery
+setup
+	self current 
+		setup;
+		appendToJQuery: 'body' asJQuery
 ! !
 
 !HLManager class methodsFor: 'instance creation'!
@@ -1371,6 +1387,12 @@ show
 	self appendToJQuery: 'body' asJQuery
 ! !
 
+!HLModalWidget methodsFor: 'private'!
+
+giveFocusToButton: aButton
+	aButton asJQuery focus
+! !
+
 !HLModalWidget methodsFor: 'rendering'!
 
 hasButtons
@@ -1392,7 +1414,7 @@ renderButtonsOn: html
 				with: 'Confirm';
 				onClick: [ self confirm ] ].
 
-	confirmButton asJQuery focus
+	self giveFocusToButton:confirmButton
 !
 
 renderContentOn: html
@@ -1499,12 +1521,19 @@ confirm
 	self actionBlock value: input asJQuery val
 ! !
 
+!HLRequestWidget methodsFor: 'private'!
+
+giveFocusToButton: aButton
+! !
+
 !HLRequestWidget methodsFor: 'rendering'!
 
 renderMainOn: html
 	super renderMainOn: html.
 	input := html textarea.
-	input asJQuery val: self value
+	input asJQuery 
+		val: self value;
+		focus
 ! !
 
 HLModalWidget subclass: #HLProgressWidget

+ 2 - 8
st/Helios-Debugger.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Debugger'!
+Smalltalk createPackage: 'Helios-Debugger'!
 Object subclass: #HLContextInspectorDecorator
 	instanceVariableNames: 'context'
 	package: 'Helios-Debugger'!
@@ -315,7 +315,7 @@ on: aMethodContext
 		yourself
 ! !
 
-ErrorHandler subclass: #HLErrorHandler
+Object subclass: #HLErrorHandler
 	instanceVariableNames: ''
 	package: 'Helios-Debugger'!
 
@@ -341,12 +341,6 @@ onErrorHandled
 		remove
 ! !
 
-!HLErrorHandler class methodsFor: 'error handling'!
-
-handleError: anError
-	^ self new handleError: anError
-! !
-
 HLToolListWidget subclass: #HLStackListWidget
 	instanceVariableNames: ''
 	package: 'Helios-Debugger'!

+ 1 - 1
st/Helios-Exceptions.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Exceptions'!
+Smalltalk createPackage: 'Helios-Exceptions'!
 Error subclass: #HLError
 	instanceVariableNames: ''
 	package: 'Helios-Exceptions'!

+ 439 - 0
st/Helios-Helpers.st

@@ -0,0 +1,439 @@
+Smalltalk createPackage: 'Helios-Helpers'!
+Object subclass: #HLClassifier
+	instanceVariableNames: 'next method'
+	package: 'Helios-Helpers'!
+!HLClassifier commentStamp!
+I am an abstract class implementing a link in a `chain of responsibility` pattern.
+
+Subclasses are in charge of classifying a method according to multiple strategies.!
+
+!HLClassifier methodsFor: 'accessing'!
+
+method
+	^ method
+!
+
+method: anObject
+	method := anObject.
+	self next
+		ifNotNil: [ :nextLink | nextLink method: anObject ]
+!
+
+next
+	^ next
+!
+
+next: anObject
+	next := anObject
+! !
+
+!HLClassifier methodsFor: 'private'!
+
+doClassify
+	self subclassResponsibility
+! !
+
+!HLClassifier methodsFor: 'protocol'!
+
+classify
+	self next ifNil: [ ^ false ].
+	
+	^ self doClassify
+		ifTrue: [ true ]
+		ifFalse: [ self next classify ]
+! !
+
+HLClassifier subclass: #HLAccessorClassifier
+	instanceVariableNames: ''
+	package: 'Helios-Helpers'!
+!HLAccessorClassifier commentStamp!
+I am a classifier checking the method selector matches an instance variable name.!
+
+!HLAccessorClassifier methodsFor: 'private'!
+
+doClassify
+	| names selector |
+	
+	names := method methodClass allInstanceVariableNames.
+	selector := method selector.
+	
+	(selector last = ':')
+		ifTrue: [ "selector might be a setter"
+			selector := selector allButLast ].
+	
+	(names includes: selector)
+		ifFalse: [ ^ false ].
+		
+	method protocol: 'accessing'.
+	^ true.
+! !
+
+HLClassifier subclass: #HLImplementorClassifier
+	instanceVariableNames: ''
+	package: 'Helios-Helpers'!
+!HLImplementorClassifier commentStamp!
+I am a classifier checking the other implementations of the same selector and choose the protocol the most populated.!
+
+!HLImplementorClassifier methodsFor: 'private'!
+
+doClassify
+	| currentClass |
+	currentClass := method methodClass.
+	
+	[ currentClass superclass isNil ] whileFalse: [
+		currentClass := currentClass superclass.
+		(currentClass includesSelector: method selector)
+			ifTrue: [ 
+				method protocol: (currentClass >> method selector) protocol.
+				^ true ]].
+	
+	^ false.
+! !
+
+HLClassifier subclass: #HLPrefixClassifier
+	instanceVariableNames: 'prefixMapping'
+	package: 'Helios-Helpers'!
+!HLPrefixClassifier commentStamp!
+I am classifier checking the method selector to know if it begins with a known prefix.!
+
+!HLPrefixClassifier methodsFor: 'initialization'!
+
+buildPrefixDictionary
+	prefixMapping := Dictionary new.
+	prefixMapping 
+		at: 'test' put: 'tests';
+	 	at: 'bench' put: 'benchmarking';
+	 	at: 'copy' put: 'copying';
+		at: 'initialize' put: 'initialization';
+		at: 'accept' put: 'visitor';
+		at: 'visit' put: 'visitor';
+		at: 'signal' put: 'signalling';
+		at: 'parse' put: 'parsing';
+		at: 'add' put: 'adding';
+		at: 'is' put: 'testing';
+		at: 'as' put: 'converting';
+		at: 'new' put: 'instance creation'.
+!
+
+initialize
+	super initialize.
+
+	self buildPrefixDictionary
+! !
+
+!HLPrefixClassifier methodsFor: 'private'!
+
+doClassify
+	prefixMapping keysAndValuesDo: [ :prefix :protocol |
+		(method selector beginsWith: prefix)
+			ifTrue: [
+				method protocol: protocol.
+				^ true ]].
+	^ false.
+! !
+
+HLClassifier subclass: #HLSuperclassClassifier
+	instanceVariableNames: ''
+	package: 'Helios-Helpers'!
+!HLSuperclassClassifier commentStamp!
+I am a classifier checking the superclass chain to find a matching selector.!
+
+!HLSuperclassClassifier methodsFor: 'private'!
+
+doClassify
+	| protocolBag methods protocolToUse counter |
+	
+	protocolBag := Dictionary new.
+	methods := HLReferencesModel new implementorsOf: method selector.
+	methods
+		ifEmpty: [ ^ false ]
+		ifNotEmpty: [
+			methods 
+				do: [ :aMethod || protocol |
+					protocol := aMethod method protocol.
+					(method methodClass = aMethod methodClass)
+						ifFalse: [
+						((protocol first = '*') or: [ protocol = method defaultProtocol ])
+							ifFalse: [ 
+								protocolBag 
+									at: protocol 
+									put: (protocolBag at: protocol ifAbsent: [ 0 ]) + 1 ] ] ] ].
+			
+	protocolBag ifEmpty: [ ^ false ].
+	protocolToUse := nil.
+	counter := 0.
+	protocolBag keysAndValuesDo: [ :key :value | value > counter 
+		ifTrue: [
+			counter := value.
+			protocolToUse := key ] ].
+	method protocol: protocolToUse.
+	^ true
+! !
+
+Object subclass: #HLGenerationOutput
+	instanceVariableNames: 'sourceCodes protocol targetClass'
+	package: 'Helios-Helpers'!
+!HLGenerationOutput commentStamp!
+I am a simple data object used to store the result of a generation process.!
+
+!HLGenerationOutput methodsFor: 'accessing'!
+
+protocol
+	^ protocol
+!
+
+protocol: aString
+	protocol := aString
+!
+
+sourceCodes
+	^ sourceCodes
+!
+
+sourceCodes: aCollection
+	sourceCodes := aCollection
+!
+
+targetClass
+	^ targetClass
+!
+
+targetClass: aClass
+	targetClass := aClass
+! !
+
+!HLGenerationOutput methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	
+	sourceCodes := OrderedCollection new
+! !
+
+!HLGenerationOutput methodsFor: 'protocol'!
+
+addSourceCode: aString
+	sourceCodes add: aString
+!
+
+compile
+	sourceCodes do: [ :methodSourceCode |
+		(targetClass includesSelector: methodSourceCode selector)
+			ifFalse: [ 
+				targetClass 
+					compile: methodSourceCode sourceCode
+					protocol: protocol ] ]
+! !
+
+Object subclass: #HLMethodClassifier
+	instanceVariableNames: 'firstClassifier'
+	package: 'Helios-Helpers'!
+!HLMethodClassifier commentStamp!
+I am in charge of categorizing methods following this strategy:
+
+- is it an accessor?
+- is it overriding a superclass method?
+- is it starting with a know prefix?
+- how are categorized the other implementations?!
+
+!HLMethodClassifier methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	
+	self setupClassifiers
+!
+
+setupClassifiers
+	self addClassifier: HLImplementorClassifier new.
+	self addClassifier: HLPrefixClassifier new.
+	self addClassifier: HLSuperclassClassifier new.
+	self addClassifier: HLAccessorClassifier new
+! !
+
+!HLMethodClassifier methodsFor: 'private'!
+
+addClassifier: aClassifier
+	aClassifier next: firstClassifier.
+	firstClassifier := aClassifier
+! !
+
+!HLMethodClassifier methodsFor: 'protocol'!
+
+classify: aMethod
+	firstClassifier
+		method: aMethod;
+		classify
+!
+
+classifyAll: aCollectionOfMethods
+	aCollectionOfMethods do: [ :method |
+		self classify: method ]
+! !
+
+Object subclass: #HLMethodGenerator
+	instanceVariableNames: 'output'
+	package: 'Helios-Helpers'!
+!HLMethodGenerator commentStamp!
+I am the abstract super class of the method generators.
+
+My main method is `generate` which produce an `output` object!
+
+!HLMethodGenerator methodsFor: 'accessing'!
+
+class: aClass
+	output targetClass: aClass
+!
+
+output
+	^ output
+! !
+
+!HLMethodGenerator methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	
+	output := HLGenerationOutput new
+! !
+
+!HLMethodGenerator methodsFor: 'protocol'!
+
+generate
+	output targetClass ifNil: [ self error: 'class should not be nil'].
+! !
+
+HLMethodGenerator subclass: #HLAccessorsGenerator
+	instanceVariableNames: ''
+	package: 'Helios-Helpers'!
+!HLAccessorsGenerator commentStamp!
+I am a generator used to compile the getters/setters of a class!
+
+!HLAccessorsGenerator methodsFor: 'double-dispatch'!
+
+accessorProtocolForObject
+	output protocol: 'accessing'
+!
+
+accessorsForObject
+	| sources |
+	
+	sources := OrderedCollection new.
+	output targetClass instanceVariableNames sorted do: [ :each | 
+		sources 
+			add: (self getterFor: each);
+			add: (self setterFor: each) ].
+	output sourceCodes: sources
+! !
+
+!HLAccessorsGenerator methodsFor: 'private'!
+
+getterFor: anInstanceVariable
+	^ HLMethodSourceCode new
+		selector:anInstanceVariable;
+		sourceCode: (String streamContents: [ :stream |
+		stream << anInstanceVariable.
+		stream cr tab.
+		stream << '^ ' << anInstanceVariable ])
+!
+
+setterFor: anInstanceVariable
+	^ HLMethodSourceCode new
+		selector: anInstanceVariable, ':';
+		sourceCode: (String streamContents: [ :stream |
+		stream << anInstanceVariable << ': anObject'.
+		stream cr tab.
+		stream << anInstanceVariable << ' := anObject' ])
+! !
+
+!HLAccessorsGenerator methodsFor: 'protocol'!
+
+generate
+	super generate.
+	
+	output targetClass 
+		accessorsSourceCodesWith: self;
+		accessorProtocolWith: self
+! !
+
+HLMethodGenerator subclass: #HLInitializeGenerator
+	instanceVariableNames: ''
+	package: 'Helios-Helpers'!
+!HLInitializeGenerator commentStamp!
+I am used to double-dispatch the `initialize` method(s) generation.
+
+Usage:
+
+    ^ HLInitializeGenerator new
+        class: aClass;
+        generate;
+        output
+
+I am a disposable object!
+
+!HLInitializeGenerator methodsFor: 'double-dispatch'!
+
+initializeForObject
+	output addSourceCode: self initializeMethodForObject
+!
+
+initializeProtocolForObject
+	output protocol: 'initialization'
+! !
+
+!HLInitializeGenerator methodsFor: 'private'!
+
+generateInitializeCodeForObject	
+	^ String streamContents: [ :str || instVars size |
+		instVars := output targetClass instanceVariableNames sorted.
+		size := instVars size.
+		str << 'initialize'.
+		str cr tab << 'super initialize.';cr.
+		str cr tab.
+		instVars withIndexDo: [ :name :index |
+			index ~= 1 ifTrue: [ str cr tab ].
+			str << name << ' := nil'.
+			index ~= size ifTrue: [ str << '.' ] ] ].
+!
+
+initializeMethodForObject	
+	^ HLMethodSourceCode new
+		selector: 'initialize';
+		sourceCode: self generateInitializeCodeForObject;
+		yourself
+! !
+
+!HLInitializeGenerator methodsFor: 'protocol'!
+
+generate
+	super generate.
+	
+	output targetClass 
+		initializeSourceCodesWith: self;
+		initializeProtocolWith: self
+! !
+
+Object subclass: #HLMethodSourceCode
+	instanceVariableNames: 'selector sourceCode'
+	package: 'Helios-Helpers'!
+!HLMethodSourceCode commentStamp!
+I am a simple data object keeping track of the information about a method that will be compiled at the end of the generation process!
+
+!HLMethodSourceCode methodsFor: 'accessing'!
+
+selector
+	^ selector
+!
+
+selector: aSelector
+	selector := aSelector
+!
+
+sourceCode
+	^ sourceCode
+!
+
+sourceCode: aString
+	sourceCode := aString
+! !
+

+ 2 - 2
st/Helios-Inspector.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Inspector'!
+Smalltalk createPackage: 'Helios-Inspector'!
 HLNavigationListWidget subclass: #HLInspectorDisplayWidget
 	instanceVariableNames: 'model'
 	package: 'Helios-Inspector'!
@@ -25,7 +25,7 @@ renderContentOn: html
 selectionDisplayString
 	|selection|
 	selection := model selection.
-    ^ (model variables keys includes: selection)
+    ^ (model variables includesKey: selection)
     	ifTrue:[ (model instVarObjectAt: selection) printString ]
       	ifFalse:[ '' ]
 ! !

+ 5 - 2
st/Helios-KeyBindings.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-KeyBindings'!
+Smalltalk createPackage: 'Helios-KeyBindings'!
 Object subclass: #HLBinding
 	instanceVariableNames: 'key label'
 	package: 'Helios-KeyBindings'!
@@ -473,7 +473,10 @@ setupEvents
 
 initialize
 	super initialize.
-	helper := HLKeyBinderHelperWidget on: self.
+	helper := HLKeyBinderHelperWidget on: self
+!
+
+setupHelper
 	helper 	
 		renderStart;
 		renderCog

+ 1 - 1
st/Helios-Layout.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Layout'!
+Smalltalk createPackage: 'Helios-Layout'!
 HLWidget subclass: #HLContainer
 	instanceVariableNames: 'splitter'
 	package: 'Helios-Layout'!

+ 1 - 7
st/Helios-References.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-References'!
+Smalltalk createPackage: 'Helios-References'!
 Object subclass: #HLMethodReference
 	instanceVariableNames: 'selector methodClass'
 	package: 'Helios-References'!
@@ -284,12 +284,6 @@ allMethods
 	^ self methodsCache
 !
 
-allSelectors
-	^ (self allMethods 
-		collect: [ :each | each selector ])
-		asSet
-!
-
 classReferencesOf: aString
 	"Answer all methods referencing the class named aString"
 	

+ 10 - 10
st/Helios-Transcript.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Transcript'!
+Smalltalk createPackage: 'Helios-Transcript'!
 HLWidget subclass: #HLTranscript
 	instanceVariableNames: 'textarea'
 	package: 'Helios-Transcript'!
@@ -71,26 +71,26 @@ transcripts
 	^ transcripts ifNil: [ transcripts := OrderedCollection new ]
 ! !
 
-!HLTranscriptHandler class methodsFor: 'initialization'!
-
-initialize
-	Transcript register: self
-! !
-
-!HLTranscriptHandler class methodsFor: 'registration'!
+!HLTranscriptHandler class methodsFor: 'printing'!
 
 clear
 	self transcripts do: [ :each |
 		each clear ]
 !
 
-register: aTranscript
-	self transcripts add: aTranscript
+cr
+	self transcripts do: [ :each | each cr ]
 !
 
 show: aString
 	self transcripts do: [ :each |
 		each show: aString ]
+! !
+
+!HLTranscriptHandler class methodsFor: 'registration'!
+
+register: aTranscript
+	self transcripts add: aTranscript
 !
 
 unregister: aTranscript

+ 1 - 1
st/Helios-Workspace-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Workspace-Tests'!
+Smalltalk createPackage: 'Helios-Workspace-Tests'!
 TestCase subclass: #HLCodeWidgetTest
 	instanceVariableNames: ''
 	package: 'Helios-Workspace-Tests'!

+ 7 - 6
st/Helios-Workspace.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Helios-Workspace'!
+Smalltalk createPackage: 'Helios-Workspace'!
 Object subclass: #HLCodeModel
 	instanceVariableNames: 'announcer environment receiver'
 	package: 'Helios-Workspace'!
@@ -82,7 +82,8 @@ currentLineOrSelection
 
 editorOptions
 	^ #{
-		'theme' -> 'amber'.
+		'theme' -> 'default'.
+		'mode' -> 'text/x-stsrc'.
         'lineNumbers' -> true.
         'enterMode' -> 'flat'.
         'indentWithTabs' -> true.
@@ -207,7 +208,7 @@ setEditorOn: aTextarea
 !HLCodeWidget methodsFor: 'hints'!
 
 messageHintFor: anEditor token: aToken
-	^ ((Smalltalk current at: 'allSelectors') value asArray 
+	^ (Smalltalk vm allSelectors asArray 
 		select: [ :each | each includesSubString: aToken string ])
 		reject: [ :each | each = aToken string ]
 !
@@ -218,10 +219,10 @@ variableHintFor: anEditor token: aToken
 	variables := (anEditor display wrapper asJQuery find: 'span.cm-variable') get
 		collect: [ :each | each asJQuery html ].
 	
-	classNames := Smalltalk current classes collect: [ :each | each name ].
-	pseudoVariables := Smalltalk current pseudoVariableNames.
+	classNames := Smalltalk classes collect: [ :each | each name ].
+	pseudoVariables := Smalltalk pseudoVariableNames.
 	
-	^ ((variables, classNames, pseudoVariables) asSet asArray 
+	^ ((variables, classNames, pseudoVariables) asSet asArray sort
 		select: [ :each | each includesSubString: aToken string ])
 		reject: [ :each | each = aToken string ]
 ! !

+ 129 - 124
st/IDE.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'IDE'!
+Smalltalk createPackage: 'IDE'!
 Widget subclass: #ClassesList
 	instanceVariableNames: 'browser ul nodes'
 	package: 'IDE'!
@@ -149,7 +149,7 @@ on: aClass browser: aBrowser classes: aCollection level: anInteger
 		yourself
 ! !
 
-ErrorHandler subclass: #DebugErrorHandler
+Object subclass: #DebugErrorHandler
 	instanceVariableNames: ''
 	package: 'IDE'!
 
@@ -165,7 +165,7 @@ handleError: anError
 !DebugErrorHandler class methodsFor: 'initialization'!
 
 initialize
-	ErrorHandler current ifNil: [ self register ]
+	ErrorHandler register: self new
 ! !
 
 Widget subclass: #SourceArea
@@ -210,13 +210,14 @@ selection
 
 setEditorOn: aTextarea
 	<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
-		theme: 'amber',
-				lineNumbers: true,
-				enterMode: 'flat',
-				indentWithTabs: true,
-				indentUnit: 4,
-				matchBrackets: true,
-				electricChars: false
+		theme: 'default',
+		mode: 'text/x-stsrc',
+		lineNumbers: true,
+		enterMode: 'flat',
+		indentWithTabs: true,
+		indentUnit: 4,
+		matchBrackets: true,
+		electricChars: false
 	})>
 !
 
@@ -407,7 +408,7 @@ removeBodyMargin
 
 search: aString
 	| searchedClass |
-	searchedClass := Smalltalk current at: aString.
+	searchedClass := Smalltalk globals at: aString.
 		searchedClass isClass
 			ifTrue: [ Browser openOn: searchedClass ]
 			ifFalse: [ ReferencesBrowser search: aString ]
@@ -454,7 +455,7 @@ removeTab: aWidget
 
 initialize
 	super initialize.
-	InspectorHandler register: Inspector.
+	Inspector register: IDEInspector.
 	opened := true.
 	[ :html | html div id: 'amber' ] appendToJQuery: 'body' asJQuery.
 	'body' asJQuery
@@ -668,7 +669,7 @@ classDeclarationTemplate
 !
 
 classes
-	^ ((Smalltalk current classes
+	^ ((Smalltalk classes
 	select: [ :each | each category = selectedPackage ])
 	sort: [ :a :b | a name < b name ]) asSet
 !
@@ -727,14 +728,14 @@ methods
 		ifNil: [ #() ]
 		ifNotNil: [ klass methodDictionary values ]]
 	ifNotNil: [
-		klass methodDictionary values select: [ :each |
-		each category = selectedProtocol ]]) sort: [ :a :b | a selector < b selector ]
+		klass methodsInProtocol: selectedProtocol ]) 
+				sort: [ :a :b | a selector < b selector ]
 !
 
 packages
 	| packages |
 	packages := Array new.
-	Smalltalk current classes do: [ :each |
+	Smalltalk classes do: [ :each |
 	(packages includes: each category) ifFalse: [
 		packages add: each category ]].
 	^ packages sort
@@ -789,15 +790,17 @@ addNewClass
 			self
 			resetClassesList;
 			updateClassesList.
-		self selectClass: (Smalltalk current at: className) ]
+		self selectClass: (Smalltalk globals at: className) ]
 !
 
 addNewProtocol
 	| newProtocol |
+	
 	newProtocol := self prompt: 'New method protocol'.
+	
 	(newProtocol notNil and: [ newProtocol notEmpty ]) ifTrue: [
-	selectedMethod category: newProtocol.
-	self setMethodProtocol: newProtocol ]
+		selectedMethod protocol: newProtocol.
+		self setMethodProtocol: newProtocol ]
 !
 
 cancelChanges
@@ -849,7 +852,7 @@ compileMethodDefinition
 compileMethodDefinitionFor: aClass
 	| compiler method source node |
 	source := sourceArea val.
-	selectedProtocol ifNil: [ selectedProtocol := selectedMethod category ].
+	selectedProtocol ifNil: [ selectedProtocol := selectedMethod protocol ].
 	compiler := Compiler new.
 	compiler source: source.
 	node := compiler parse: source.
@@ -863,7 +866,7 @@ compileMethodDefinitionFor: aClass
 		(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [
 			self addInstanceVariableNamed: each toClass: aClass.
 			^ self compileMethodDefinitionFor: aClass ]] ].
-	ClassBuilder new installMethod: method forClass: aClass category: selectedProtocol.
+	ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.
 	self updateMethodsList.
 	self selectMethod: method
 !
@@ -876,7 +879,7 @@ copyClass
 			self
 			resetClassesList;
 			updateClassesList.
-		self selectClass: (Smalltalk current at: className) ]
+		self selectClass: (Smalltalk globals at: className) ]
 !
 
 disableSaveButton
@@ -907,7 +910,7 @@ hideMethodButtons
 removeClass
 	(self confirm: 'Do you really want to remove ', selectedClass name, '?')
 	ifTrue: [
-		Smalltalk current removeClass: selectedClass.
+		Smalltalk removeClass: selectedClass.
 		self resetClassesList.
 		self selectClass: nil ]
 !
@@ -926,7 +929,7 @@ removePackage
 
 	(self confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')
 	ifTrue: [
-		Smalltalk current removePackage: selectedPackage.
+		Smalltalk removePackage: selectedPackage.
 		self updateCategoriesList ]
 !
 
@@ -946,13 +949,13 @@ renamePackage
 	newName := self prompt: 'Rename package ', selectedPackage.
 	newName ifNotNil: [
 	newName notEmpty ifTrue: [
-	Smalltalk current renamePackage: selectedPackage to: newName.
+	Smalltalk renamePackage: selectedPackage to: newName.
 	self updateCategoriesList ]]
 !
 
 search: aString
 	self cancelChanges ifTrue: [ | searchedClass |
-		searchedClass := Smalltalk current at: aString.
+		searchedClass := Smalltalk globals at: aString.
 		searchedClass isClass
 			ifTrue: [ self class openOn: searchedClass ]
 			ifFalse: [ self searchReferencesOf: aString ]]
@@ -1021,7 +1024,7 @@ setMethodProtocol: aString
 	(self protocols includes: aString)
 		ifFalse: [ self addNewProtocol ]
 		ifTrue: [
-		selectedMethod category: aString.
+		selectedMethod protocol: aString.
 		selectedProtocol := aString.
 		selectedMethod := selectedMethod.
 		self
@@ -1512,81 +1515,11 @@ updateVariablesList
 		ifNotNil: [ inspectButton removeAt: 'disabled' ]
 ! !
 
-TabWidget subclass: #IDETranscript
-	instanceVariableNames: 'textarea'
-	package: 'IDE'!
-
-!IDETranscript methodsFor: 'accessing'!
-
-label
-	^ 'Transcript'
-! !
-
-!IDETranscript methodsFor: 'actions'!
-
-clear
-	textarea asJQuery val: ''
-!
-
-cr
-	textarea asJQuery val: textarea asJQuery val, String cr.
-!
-
-open
-	TabManager current
-	open;
-	selectTab: self
-!
-
-show: anObject
-	textarea ifNil: [ self open ].
-	textarea asJQuery val: textarea asJQuery val, anObject asString.
-! !
-
-!IDETranscript methodsFor: 'rendering'!
-
-renderBoxOn: html
-	textarea := html textarea.
-	textarea
-	class: 'amber_transcript';
-	at: 'spellcheck' put: 'false'
-!
-
-renderButtonsOn: html
-	html button
-	with: 'Clear transcript';
-	onClick: [ self clear ]
-! !
-
-IDETranscript class instanceVariableNames: 'current'!
-
-!IDETranscript class methodsFor: 'initialization'!
-
-initialize
-	Transcript register: self current
-! !
-
-!IDETranscript class methodsFor: 'instance creation'!
-
-current
-	^ current ifNil: [ current := super new ]
-!
-
-new
-	self shouldNotImplement
-!
-
-open
-	TabManager current
-	open;
-	selectTab: self current
-! !
-
-TabWidget subclass: #Inspector
+TabWidget subclass: #IDEInspector
 	instanceVariableNames: 'label variables object selectedVariable variablesList valueTextarea diveButton sourceArea'
 	package: 'IDE'!
 
-!Inspector methodsFor: 'accessing'!
+!IDEInspector methodsFor: 'accessing'!
 
 label
 	^ label ifNil: [ 'Inspector (nil)' ]
@@ -1616,7 +1549,7 @@ variables
 	^ variables
 ! !
 
-!Inspector methodsFor: 'actions'!
+!IDEInspector methodsFor: 'actions'!
 
 dive
 	(self variables at: self selectedVariable) inspect
@@ -1635,7 +1568,7 @@ refresh
 		updateValueTextarea
 ! !
 
-!Inspector methodsFor: 'rendering'!
+!IDEInspector methodsFor: 'rendering'!
 
 renderBottomPanelOn: html
 	html div
@@ -1672,7 +1605,7 @@ renderTopPanelOn: html
 		class: 'top';
 		with: [
 			variablesList := html ul class: 'amber_column variables'.
-			valueTextarea := html textarea class: 'amber_column value'; at: 'readonly' put: 'readonly'.
+			valueTextarea := html textarea class: 'amber_column value'; at: 'readonly' put: 'readonly'; yourself.
 			html div class: 'amber_tabs inspector'; with: [
 				html button
 					class: 'amber_button inspector refresh';
@@ -1688,13 +1621,13 @@ renderTopPanelOn: html
 		updateValueTextarea.
 ! !
 
-!Inspector methodsFor: 'testing'!
+!IDEInspector methodsFor: 'testing'!
 
 canBeClosed
 	^ true
 ! !
 
-!Inspector methodsFor: 'updating'!
+!IDEInspector methodsFor: 'updating'!
 
 selectVariable: aString
 	self selectedVariable: aString.
@@ -1718,7 +1651,7 @@ updateValueTextarea
 
 updateVariablesList
 	variablesList contents: [ :html |
-		self variables keys do: [ :each || li |
+		self variables keysDo: [ :each || li |
 			li := html li.
 			li
 				with: each;
@@ -1727,7 +1660,7 @@ updateVariablesList
 				li class: 'selected' ]] ]
 ! !
 
-!Inspector class methodsFor: 'instance creation'!
+!IDEInspector class methodsFor: 'instance creation'!
 
 inspect: anObject
 	^ self new
@@ -1742,6 +1675,76 @@ on: anObject
 		yourself
 ! !
 
+TabWidget subclass: #IDETranscript
+	instanceVariableNames: 'textarea'
+	package: 'IDE'!
+
+!IDETranscript methodsFor: 'accessing'!
+
+label
+	^ 'Transcript'
+! !
+
+!IDETranscript methodsFor: 'actions'!
+
+clear
+	textarea asJQuery val: ''
+!
+
+cr
+	textarea asJQuery val: textarea asJQuery val, String cr.
+!
+
+open
+	TabManager current
+	open;
+	selectTab: self
+!
+
+show: anObject
+	textarea ifNil: [ self open ].
+	textarea asJQuery val: textarea asJQuery val, anObject asString.
+! !
+
+!IDETranscript methodsFor: 'rendering'!
+
+renderBoxOn: html
+	textarea := html textarea.
+	textarea
+	class: 'amber_transcript';
+	at: 'spellcheck' put: 'false'
+!
+
+renderButtonsOn: html
+	html button
+	with: 'Clear transcript';
+	onClick: [ self clear ]
+! !
+
+IDETranscript class instanceVariableNames: 'current'!
+
+!IDETranscript class methodsFor: 'initialization'!
+
+initialize
+	Transcript register: self current
+! !
+
+!IDETranscript class methodsFor: 'instance creation'!
+
+current
+	^ current ifNil: [ current := super new ]
+!
+
+new
+	self shouldNotImplement
+!
+
+open
+	TabManager current
+		open;
+		selectTab: self current
+! !
+
 TabWidget subclass: #ProgressBar
 	instanceVariableNames: 'percent progressDiv div'
 	package: 'IDE'!
@@ -1786,7 +1789,7 @@ TabWidget subclass: #ReferencesBrowser
 !ReferencesBrowser methodsFor: 'accessing'!
 
 classesAndMetaclasses
-	^ Smalltalk current classes, (Smalltalk current classes collect: [ :each | each class ])
+	^ Smalltalk classes, (Smalltalk classes collect: [ :each | each class ])
 !
 
 implementors
@@ -1838,14 +1841,14 @@ searchMethodSource
 	| regex |
 	regex := selector allButFirst.
 	self classesAndMetaclasses do: [ :each |
-		each methodDictionary values do: [ :value |
+		each methodDictionary valuesDo: [ :value |
 			(value source match: regex) ifTrue: [
 				self matches add: value ]] ]
 !
 
 searchReferencedClasses
 	self classesAndMetaclasses do: [ :each |
-		each methodDictionary values do: [ :value |
+		each methodDictionary valuesDo: [ :value |
 			(value referencedClasses includes: selector) ifTrue: [
 				self referencedClasses add: value ]] ]
 !
@@ -2340,45 +2343,47 @@ inspectOn: anInspector
 	anInspector setLabel: label
 ! !
 
-!HashedCollection methodsFor: '*IDE'!
+!MethodContext methodsFor: '*IDE'!
 
 inspectOn: anInspector
 	| variables |
 	variables := Dictionary new.
 	variables at: '#self' put: self.
-	variables at: '#keys' put: self keys.
-	self keysAndValuesDo: [ :key :value |
-		variables at: key put: value ].
+	variables at: '#home' put: self home.
+	variables at: '#receiver' put: self receiver.
+	variables at: '#selector' put: self selector.
+	variables at: '#temps' put: self temps.
+	self class instanceVariableNames do: [ :each |
+		variables at: each put: (self instVarAt: each) ].
 	anInspector
 		setLabel: self printString;
 		setVariables: variables
 ! !
 
-!Set methodsFor: '*IDE'!
+!AssociativeCollection methodsFor: '*IDE'!
 
 inspectOn: anInspector
 	| variables |
 	variables := Dictionary new.
 	variables at: '#self' put: self.
-	elements withIndexDo: [ :each :i |
-		variables at: i put: each ].
+	variables at: '#keys' put: self keys.
+	self keysAndValuesDo: [ :key :value |
+		variables at: key put: value ].
 	anInspector
 		setLabel: self printString;
 		setVariables: variables
 ! !
 
-!MethodContext methodsFor: '*IDE'!
+!Set methodsFor: '*IDE'!
 
 inspectOn: anInspector
-	| variables |
+	| variables i |
 	variables := Dictionary new.
 	variables at: '#self' put: self.
-	variables at: '#home' put: self home.
-	variables at: '#receiver' put: self receiver.
-	variables at: '#selector' put: self selector.
-	variables at: '#temps' put: self temps.
-	self class instanceVariableNames do: [ :each |
-		variables at: each put: (self instVarAt: each) ].
+	i := 1.
+	self do: [ :each |
+		variables at: i put: each.
+		i := i + 1 ].
 	anInspector
 		setLabel: self printString;
 		setVariables: variables

+ 3 - 3
st/Kernel-Announcements.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Announcements'!
+Smalltalk createPackage: 'Kernel-Announcements'!
 Object subclass: #AnnouncementSubscription
 	instanceVariableNames: 'valuable announcementClass'
 	package: 'Kernel-Announcements'!
@@ -52,10 +52,10 @@ deliver: anAnnouncement
 handlesAnnouncement: anAnnouncement
 	"anAnnouncement might be announced from within another Amber environment"
 	
-	^ (Smalltalk current at: self announcementClass name)
+	^ (Smalltalk globals at: self announcementClass name)
 		ifNil: [ ^ false ]
 		ifNotNil: [ :class |
-		(Smalltalk current at: anAnnouncement class theNonMetaClass name) includesBehavior: class ]
+		(Smalltalk globals at: anAnnouncement class theNonMetaClass name) includesBehavior: class ]
 ! !
 
 Object subclass: #Announcer

+ 40 - 43
st/Kernel-Classes.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Classes'!
+Smalltalk createPackage: 'Kernel-Classes'!
 Object subclass: #Behavior
 	instanceVariableNames: ''
 	package: 'Kernel-Classes'!
@@ -119,7 +119,7 @@ methodAt: aString
 !
 
 methodDictionary
-	<var dict = smalltalk.HashedCollection._new();
+	<var dict = globals.HashedCollection._new();
 	var methods = self.methods;
 	Object.keys(methods).forEach(function(i) {
 		if(methods[i].selector) {
@@ -145,7 +145,7 @@ methodsFor: aString stamp: aStamp
 !
 
 methodsInProtocol: aString
-	^ self methodDictionary values select: [ :each | each protocol = aString ]
+	^ self methods select: [ :each | each protocol = aString ]
 !
 
 name
@@ -180,6 +180,12 @@ prototype
 	<return self.fn.prototype>
 !
 
+removeProtocolIfEmpty: aString
+	self methods
+		detect: [ :each | each protocol = aString ]
+		ifNone: [ self organization removeElement: aString ]
+!
+
 selectors
 	^ self methodDictionary keys
 !
@@ -219,10 +225,8 @@ addCompiledMethod: aMethod
 	self basicAddCompiledMethod: aMethod.
 	
 	oldMethod ifNotNil: [
-		(self methods
-			select: [ :each | each protocol = oldMethod protocol ])
-			ifEmpty: [ self organization removeElement: oldMethod protocol ] ].
-
+		self removeProtocolIfEmpty: oldMethod protocol ].
+	
 	announcement := oldMethod
 		ifNil: [
 			MethodAdded new
@@ -240,14 +244,14 @@ addCompiledMethod: aMethod
 !
 
 compile: aString
-	^ self compile: aString category: ''
+	^ self compile: aString protocol: ''
 !
 
-compile: aString category: anotherString
+compile: aString protocol: anotherString
 	^ Compiler new
 		install: aString
 		forClass: self
-		category: anotherString
+		protocol: anotherString
 !
 
 recompile
@@ -257,9 +261,7 @@ recompile
 removeCompiledMethod: aMethod
 	self basicRemoveCompiledMethod: aMethod.
 	
-	self methods
-		detect: [ :each | each protocol = aMethod protocol ]
-		ifNone: [ self organization removeElement: aMethod protocol ].
+	self removeProtocolIfEmpty: aMethod protocol.
 	
 	SystemAnnouncer current
 		announce: (MethodRemoved new
@@ -277,16 +279,16 @@ allSubclassesDo: aBlock
 !
 
 protocolsDo: aBlock
-	"Execute aBlock for each method category with
-	its collection of methods in the sort order of category name."
+	"Execute aBlock for each method protocol with
+	its collection of methods in the sort order of protocol name."
 
-	| methodsByCategory |
-	methodsByCategory := HashedCollection new.
-	self methodDictionary values do: [ :m |
-		(methodsByCategory at: m category ifAbsentPut: [ Array new ])
+	| methodsByProtocol |
+	methodsByProtocol := HashedCollection new.
+	self methodDictionary valuesDo: [ :m |
+		(methodsByProtocol at: m protocol ifAbsentPut: [ Array new ])
 			add: m ].
-	self protocols do: [ :category |
-		aBlock value: category value: (methodsByCategory at: category) ]
+	self protocols do: [ :protocol |
+		aBlock value: protocol value: (methodsByProtocol at: protocol) ]
 ! !
 
 !Behavior methodsFor: 'instance creation'!
@@ -312,7 +314,7 @@ basicRemoveCompiledMethod: aMethod
 !Behavior methodsFor: 'testing'!
 
 canUnderstand: aSelector
-	^ (self methodDictionary keys includes: aSelector asString) or: [
+	^ (self includesSelector: aSelector asString) or: [
 		self superclass notNil and: [ self superclass canUnderstand: aSelector ]]
 !
 
@@ -424,7 +426,7 @@ subclass: aString instanceVariableNames: aString2 package: aString3
 !Class methodsFor: 'converting'!
 
 asJavascript
-	^ 'smalltalk.', self name
+	^ 'globals.', self name
 ! !
 
 !Class methodsFor: 'printing'!
@@ -486,7 +488,7 @@ theNonMetaClass
 !Metaclass methodsFor: 'converting'!
 
 asJavascript
-	^ 'smalltalk.', self instanceClass name, '.klass'
+	^ 'globals.', self instanceClass name, '.klass'
 ! !
 
 !Metaclass methodsFor: 'printing'!
@@ -522,8 +524,8 @@ instanceVariableNamesFor: aString
 addSubclassOf: aClass named: className instanceVariableNames: aCollection package: packageName
 	| theClass thePackage |
 	
-	theClass := Smalltalk current at: className.
-	thePackage := self createPackageNamed: packageName.
+	theClass := Smalltalk globals at: className.
+	thePackage := Package named: packageName.
 	
 	theClass ifNotNil: [
 		theClass package: thePackage.
@@ -585,7 +587,7 @@ migrateClassNamed: className superclass: aClass instanceVariableNames: aCollecti
 	| oldClass newClass tmp |
 	
 	tmp := 'new*', className.
-	oldClass := Smalltalk current at: className.
+	oldClass := Smalltalk globals at: className.
 	
 	newClass := self
 		addSubclassOf: aClass
@@ -658,21 +660,21 @@ copyClass: aClass to: anotherClass
 
 	anotherClass comment: aClass comment.
 
-	aClass methodDictionary values do: [ :each |
-		Compiler new install: each source forClass: anotherClass category: each category ].
+	aClass methodDictionary valuesDo: [ :each |
+		Compiler new install: each source forClass: anotherClass protocol: each protocol ].
 
 	self basicClass: anotherClass class instanceVariables: aClass class instanceVariableNames.
 
-	aClass class methodDictionary values do: [ :each |
-		Compiler new install: each source forClass: anotherClass class category: each category ].
+	aClass class methodDictionary valuesDo: [ :each |
+		Compiler new install: each source forClass: anotherClass class protocol: each protocol ].
 
 	self setupClass: anotherClass
 ! !
 
 !ClassBuilder methodsFor: 'method definition'!
 
-installMethod: aCompiledMethod forClass: aBehavior category: aString
-	aCompiledMethod category: aString.
+installMethod: aCompiledMethod forClass: aBehavior protocol: aString
+	aCompiledMethod protocol: aString.
 	aBehavior addCompiledMethod: aCompiledMethod.
 	self setupClass: aBehavior.
 	^ aCompiledMethod
@@ -683,7 +685,7 @@ installMethod: aCompiledMethod forClass: aBehavior category: aString
 basicAddSubclassOf: aClass named: aString instanceVariableNames: aCollection package: packageName
 	<
 		smalltalk.addClass(aString, aClass, aCollection, packageName);
-		return smalltalk[aString]
+		return globals[aString]
 	>
 !
 
@@ -703,8 +705,8 @@ basicRemoveClass: aClass
 
 basicRenameClass: aClass to: aString
 	<
-		smalltalk[aString] = aClass;
-		delete smalltalk[aClass.className];
+		globals[aString] = aClass;
+		delete globals[aClass.className];
 		aClass.className = aString;
 	>
 !
@@ -717,14 +719,9 @@ basicSwapClassNames: aClass with: anotherClass
 	>
 !
 
-createPackageNamed: aString
-	^ Package named: aString ifAbsent: [
-		Smalltalk current createPackage: aString ]
-!
-
 rawRenameClass: aClass to: aString
 	<
-		smalltalk[aString] = aClass;
+		globals[aString] = aClass;
 	>
 ! !
 
@@ -766,7 +763,7 @@ initialize
 !ClassCategoryReader methodsFor: 'private'!
 
 compileMethod: aString
-	Compiler new install: aString forClass: class category: category
+	Compiler new install: aString forClass: class protocol: category
 ! !
 
 Object subclass: #ClassCommentReader

+ 390 - 135
st/Kernel-Collections.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Collections'!
+Smalltalk createPackage: 'Kernel-Collections'!
 Object subclass: #Association
 	instanceVariableNames: 'key value'
 	package: 'Kernel-Collections'!
@@ -50,6 +50,94 @@ key: aKey value: aValue
 		yourself
 ! !
 
+Object subclass: #BucketStore
+	instanceVariableNames: 'buckets hashBlock'
+	package: 'Kernel-Collections'!
+!BucketStore commentStamp!
+I am an helper class for hash-based stores.
+
+I hold buckets which are selected by a hash, specified using `#hashBlock:`.
+The hash can be any object, and
+it is used as a JS property (that is, in ES5
+its toString() value counts).
+
+## API
+I maintain a list of buckets. Client code can use this API:
+ - `#bucketOfElement:` (to ask a bucket for element, I can return JS null if n/a)
+ - `#do:` (to enumerate all elements of all buckets)
+ - `#removeAll` (to remove all buckets)
+
+Client code itself should add/remove elements
+in a bucket. The `nil` object should not be put into any bucket.
+
+Types of buckets are the responsibility of subclasses via `#newBucket`.!
+
+!BucketStore methodsFor: 'accessing'!
+
+bucketOfElement: anObject
+	<
+		var hash = self['@hashBlock'](anObject);
+		if (!!hash) return null;
+		var buckets = self['@buckets'],
+			bucket = buckets[hash];
+		if (!!bucket) { bucket = buckets[hash] = self._newBucket(); }
+		return bucket;
+	>
+!
+
+hashBlock: aBlock
+	hashBlock := aBlock
+! !
+
+!BucketStore methodsFor: 'adding/removing'!
+
+removeAll
+	<self['@buckets'] = Object.create(null);>
+! !
+
+!BucketStore methodsFor: 'enumerating'!
+
+do: aBlock
+	<
+		var buckets = self['@buckets'];
+		var keys = Object.keys(buckets);
+		for (var i = 0; i < keys.length; ++i) { buckets[keys[i]]._do_(aBlock); }
+	>
+! !
+
+!BucketStore methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	self removeAll
+! !
+
+!BucketStore methodsFor: 'private'!
+
+newBucket
+	self subclassResponsibility
+! !
+
+!BucketStore class methodsFor: 'instance creation'!
+
+hashBlock: aBlock
+	^ self new
+		hashBlock: aBlock;
+		yourself
+! !
+
+BucketStore subclass: #ArrayBucketStore
+	instanceVariableNames: ''
+	package: 'Kernel-Collections'!
+!ArrayBucketStore commentStamp!
+I am a concrete `BucketStore` with buckets being instance of `Array`.!
+
+!ArrayBucketStore methodsFor: 'private'!
+
+newBucket
+	^ #()
+! !
+
 Object subclass: #Collection
 	instanceVariableNames: ''
 	package: 'Kernel-Collections'!
@@ -374,7 +462,12 @@ at: anIndex ifAbsent: aBlock
 	If it is present, answer the value stored at anIndex.
 	Otherwise, answer the value of aBlock."
 
-	self subclassReponsibility
+	self subclassResponsibility
+!
+
+at: aKey ifAbsentPut: aBlock
+	^ self at: aKey ifAbsent: [
+		self at: aKey put: aBlock value ]
 !
 
 at: anIndex ifPresent: aBlock
@@ -396,7 +489,7 @@ at: anIndex ifPresent: aBlock ifAbsent: anotherBlock
 at: anIndex put: anObject
 	"Store anObject under the given index in the receiver."
 
-	self subclassReponsibility
+	self subclassResponsibility
 !
 
 indexOf: anObject
@@ -427,18 +520,16 @@ withIndexDo: aBlock
 	"Calls aBlock with every value from self
 	and with its index as the second argument"
 
-	self subclassReponsibility
+	self subclassResponsibility
 ! !
 
-IndexableCollection subclass: #HashedCollection
+IndexableCollection subclass: #AssociativeCollection
 	instanceVariableNames: ''
 	package: 'Kernel-Collections'!
-!HashedCollection commentStamp!
-I am a traditional JavaScript object, or a Smalltalk `Dictionary`.
+!AssociativeCollection commentStamp!
+I am a base class for object-indexed collections (Dictionary et.al.).!
 
-Unlike a `Dictionary`, I can only have strings as keys.!
-
-!HashedCollection methodsFor: 'accessing'!
+!AssociativeCollection methodsFor: 'accessing'!
 
 associations
 	| associations |
@@ -447,33 +538,21 @@ associations
 	^ associations
 !
 
-at: aKey ifAbsent: aBlock
-	^ (self includesKey: aKey)
-		ifTrue: [ self basicAt: aKey ]
-		ifFalse: aBlock
-!
-
-at: aKey ifAbsentPut: aBlock
-	^ self at: aKey ifAbsent: [
-		self at: aKey put: aBlock value ]
-!
-
 at: aKey ifPresent: aBlock ifAbsent: anotherBlock
 	"Lookup the given key in the receiver.
-	If it is present, answer the value of evaluating the oneArgBlock with the value associated with the key,
-	otherwise answer the value of absentBlock."
+	If it is present, answer the value of evaluating the oneArgBlock 
+	with the value associated with the key, otherwise answer the value 
+	of absentBlock."
+	
 	^ (self includesKey: aKey)
 		ifTrue: [ aBlock value: (self at: aKey) ]
-		ifFalse: anotherBlock
-!
-
-at: aKey put: aValue
-	^ self basicAt: aKey put: aValue
+		ifFalse: [ anotherBlock value ]
 !
 
 indexOf: anObject ifAbsent: aBlock
-
-	^ self keys detect: [ :each | (self at: each) = anObject ] ifNone: aBlock
+	^ self keys 
+		detect: [ :each | (self at: each) = anObject ] 
+		ifNone: aBlock
 !
 
 keyAtValue: anObject
@@ -485,7 +564,7 @@ keyAtValue: anObject ifAbsent: aBlock
 !
 
 keys
-	<return Object.keys(self)>
+	self subclassResponsibility
 !
 
 size
@@ -493,22 +572,18 @@ size
 !
 
 values
-	<
-		return self._keys().map(function(key){
-			return self._at_(key);
-		});
-	>
+	self subclassResponsibility
 ! !
 
-!HashedCollection methodsFor: 'adding/removing'!
+!AssociativeCollection methodsFor: 'adding/removing'!
 
 add: anAssociation
 	self at: anAssociation key put: anAssociation value
 !
 
-addAll: aHashedCollection
-	super addAll: aHashedCollection associations.
-	^ aHashedCollection
+addAll: anAssociativeCollection
+	super addAll: anAssociativeCollection associations.
+	^ anAssociativeCollection
 !
 
 remove: aKey ifAbsent: aBlock
@@ -524,38 +599,36 @@ removeKey: aKey
 !
 
 removeKey: aKey ifAbsent: aBlock
-	^ (self includesKey: aKey)
-		ifFalse: [ aBlock value ]
-		ifTrue: [ self basicDelete: aKey ]
+	self subclassResponsibility
 ! !
 
-!HashedCollection methodsFor: 'comparing'!
+!AssociativeCollection methodsFor: 'comparing'!
 
-= aHashedCollection
-	self class = aHashedCollection class ifFalse: [ ^ false ].
-	self size = aHashedCollection size ifFalse: [ ^ false ].
-	^ self associations = aHashedCollection associations
+= anAssocitativeCollection
+	self class = anAssocitativeCollection class ifFalse: [ ^ false ].
+	self size = anAssocitativeCollection size ifFalse: [ ^ false ].
+	^ self associations = anAssocitativeCollection associations
 ! !
 
-!HashedCollection methodsFor: 'converting'!
+!AssociativeCollection methodsFor: 'converting'!
 
 asDictionary
 	^ Dictionary from: self associations
 !
 
+asHashedCollection
+	^ HashedCollection from: self associations
+!
+
 asJSON
-	| c |
-	c := self class new.
+	| hash |
+	hash := HashedCollection new.
 	self keysAndValuesDo: [ :key :value |
-		c at: key put: value asJSON ].
-	^ c
+		hash at: key put: value asJSON ].
+	^ hash
 ! !
 
-!HashedCollection methodsFor: 'copying'!
-
-, aCollection
-	self shouldNotImplement
-!
+!AssociativeCollection methodsFor: 'copying'!
 
 deepCopy
 	| copy |
@@ -573,7 +646,7 @@ shallowCopy
 	^ copy
 ! !
 
-!HashedCollection methodsFor: 'enumerating'!
+!AssociativeCollection methodsFor: 'enumerating'!
 
 associationsDo: aBlock
 	self keysAndValuesDo: [ :key :value |
@@ -606,7 +679,7 @@ keysAndValuesDo: aBlock
 !
 
 keysDo: aBlock
-	self keys do: aBlock
+	self subclassResponsibility
 !
 
 select: aBlock
@@ -618,14 +691,14 @@ select: aBlock
 !
 
 valuesDo: aBlock
-	self values do: [ :value | aBlock value: value ]
+	self subclassResponsibility
 !
 
 withIndexDo: aBlock
 	self keysAndValuesDo: [ :key :value | aBlock value: value value: key ]
 ! !
 
-!HashedCollection methodsFor: 'printing'!
+!AssociativeCollection methodsFor: 'printing'!
 
 printOn: aStream
 	super printOn: aStream.
@@ -637,13 +710,13 @@ printOn: aStream
 	aStream nextPutAll: ')'
 ! !
 
-!HashedCollection methodsFor: 'testing'!
+!AssociativeCollection methodsFor: 'testing'!
 
 includesKey: aKey
-	<return self.hasOwnProperty(aKey)>
+	self subclassResponsibility
 ! !
 
-!HashedCollection class methodsFor: 'instance creation'!
+!AssociativeCollection class methodsFor: 'instance creation'!
 
 from: aCollection
 	| newCollection |
@@ -673,7 +746,7 @@ newFromPairs: aCollection
 	^ newCollection
 ! !
 
-HashedCollection subclass: #Dictionary
+AssociativeCollection subclass: #Dictionary
 	instanceVariableNames: 'keys values'
 	package: 'Kernel-Collections'!
 !Dictionary commentStamp!
@@ -746,16 +819,6 @@ removeKey: aKey ifAbsent: aBlock
 	>
 ! !
 
-!Dictionary methodsFor: 'converting'!
-
-asHashedCollection
-	^ HashedCollection from: self associations
-!
-
-asJSON
-	^ self asHashedCollection asJSON
-! !
-
 !Dictionary methodsFor: 'enumerating'!
 
 keysAndValuesDo: aBlock
@@ -796,6 +859,63 @@ includesKey: aKey
 	< return self._positionOfKey_(aKey) >>= 0; >
 ! !
 
+AssociativeCollection subclass: #HashedCollection
+	instanceVariableNames: ''
+	package: 'Kernel-Collections'!
+!HashedCollection commentStamp!
+I am a traditional JavaScript object, or a Smalltalk `Dictionary`.
+
+Unlike a `Dictionary`, I can only have strings as keys.!
+
+!HashedCollection methodsFor: 'accessing'!
+
+at: aKey ifAbsent: aBlock
+	^ (self includesKey: aKey)
+		ifTrue: [ self basicAt: aKey ]
+		ifFalse: [ aBlock value ]
+!
+
+at: aKey put: aValue
+	^ self basicAt: aKey put: aValue
+!
+
+keys
+	<return Object.keys(self)>
+!
+
+values
+	<
+		return self._keys().map(function(key){
+			return self._at_(key);
+		});
+	>
+! !
+
+!HashedCollection methodsFor: 'adding/removing'!
+
+removeKey: aKey ifAbsent: aBlock
+	^ self
+		at: aKey
+		ifPresent: [ :removed | self basicDelete: aKey. removed ]
+		ifAbsent: [ aBlock value ]
+! !
+
+!HashedCollection methodsFor: 'enumerating'!
+
+keysDo: aBlock
+	self keys do: aBlock
+!
+
+valuesDo: aBlock
+	self values do: aBlock
+! !
+
+!HashedCollection methodsFor: 'testing'!
+
+includesKey: aKey
+	<return self.hasOwnProperty(aKey)>
+! !
+
 IndexableCollection subclass: #SequenceableCollection
 	instanceVariableNames: ''
 	package: 'Kernel-Collections'!
@@ -821,11 +941,13 @@ first
 	^ self at: 1
 !
 
-first: n
-	"Answer the first n elements of the receiver.
-	Raise an error if there are not enough elements."
+first: aNumber
+	"Answer the first `aNumber` elements of the receiver.
+	Raise an error if there are not enough elements in the receiver."
+
+	self size < aNumber ifTrue: [ self error: 'Invalid number of elements' ].
 
-	^ self copyFrom: 1 to: n
+	^ self copyFrom: 1 to: aNumber
 !
 
 fourth
@@ -836,7 +958,7 @@ indexOf: anObject ifAbsent: aBlock
 	<
 		self = self._numericallyIndexable();
 		for(var i=0; i < self.length; i++) {
-			if(self[i].__eq(anObject)) {return i+1}
+			if(_st(self[i]).__eq(anObject)) {return i+1}
 		};
 		return aBlock._value();
 	>
@@ -853,7 +975,7 @@ indexOf: anObject startingAt: start ifAbsent: aBlock
 	<
 		self = self._numericallyIndexable();
 		for(var i=start - 1; i < self.length; i++){
-			if(self[i].__eq(anObject)) {return i+1}
+			if(_st(self[i]).__eq(anObject)) {return i+1}
 		}
 		return aBlock._value();
 	>
@@ -863,6 +985,15 @@ last
 	^ self at: self size
 !
 
+last: aNumber
+	"Answer the last aNumber elements of the receiver.
+	Raise an error if there are not enough elements in the receiver."
+
+	self size < aNumber ifTrue: [ self error: 'Invalid number of elements' ].
+
+	^ self copyFrom: self size - aNumber + 1 to: self size
+!
+
 second
 	^ self at: 2
 !
@@ -1006,6 +1137,16 @@ writeStream
 
 !SequenceableCollection methodsFor: 'testing'!
 
+beginsWith: prefix
+	self size < prefix size ifTrue: [ ^ false ].
+	^ (self first: prefix size) = prefix
+!
+
+endsWith: suffix
+	self size < suffix size ifTrue: [ ^ false ].
+	^ (self last: suffix size) = suffix
+!
+
 includes: anObject
 	^ (self indexOf: anObject ifAbsent: [ nil ]) notNil
 ! !
@@ -1039,13 +1180,18 @@ I am directly mapped to JavaScript Number.
 
 at: anIndex ifAbsent: aBlock
 	<
-		if((anIndex < 1) || (self.length < anIndex)) {return aBlock._value()};
-		return self[anIndex - 1];
+		return anIndex >>= 1 && anIndex <= self.length
+			? self[anIndex - 1]
+			: aBlock._value()
 	>
 !
 
 at: anIndex ifPresent: aBlock ifAbsent: anotherBlock
-	<return anIndex < 1 || self.length < anIndex ? anotherBlock._value() : aBlock._value_(self[anIndex - 1]);>
+	<
+		return anIndex >>= 1 && anIndex <= self.length
+			? aBlock._value_(self[anIndex - 1])
+			: anotherBlock._value()
+	>
 !
 
 at: anIndex put: anObject
@@ -1067,15 +1213,11 @@ addFirst: anObject
 !
 
 remove: anObject ifAbsent: aBlock
-	<
-		for(var i=0;i<self.length;i++) {
-			if(_st(self[i]).__eq(anObject)) {
-				self.splice(i,1);
-				return self;
-			}
-		};
-		aBlock._value();
-	>
+	| index |
+	index := self indexOf: anObject ifAbsent: [ 0 ].
+	^ index = 0
+		ifFalse: [ self removeIndex: index. anObject ]
+		ifTrue: [ aBlock value ]
 !
 
 removeAll
@@ -1108,6 +1250,7 @@ reversed
 
 collect: aBlock
 	"Optimized version"
+	
 	<return self.map(function(each) {return aBlock._value_(each)})>
 !
 
@@ -1294,18 +1437,18 @@ asciiValue
 !
 
 at: anIndex ifAbsent: aBlock
-	<return String(self).charAt(anIndex - 1) || aBlock._value()>
+	<return String(self)[anIndex - 1] || aBlock._value()>
 !
 
 at: anIndex ifPresent: aBlock ifAbsent: anotherBlock
 	<
-		var result = String(self).charAt(anIndex - 1);
+		var result = String(self)[anIndex - 1];
 		return result ? aBlock._value_(result) : anotherBlock._value();
 	>
 !
 
 charCodeAt: anInteger
-	< return self.charCodeAt(anInteger - 1) >
+	<return self.charCodeAt(anInteger - 1)>
 !
 
 identityHash
@@ -1328,11 +1471,10 @@ size
 
 = aString
 	<
-		if(typeof aString === 'undefined') { return false }
-		if(!!aString._isString || !! aString._isString()) {
-			return false;
-		}
-		return String(self) === String(aString)
+		return aString !!= null &&
+			typeof aString._isString === "function" &&
+			aString._isString() &&
+			String(self) === String(aString)
 	>
 !
 
@@ -1497,7 +1639,6 @@ trimBoth
 !
 
 trimBoth: separators
-
 	^ (self trimLeft: separators) trimRight: separators
 !
 
@@ -1506,7 +1647,6 @@ trimLeft
 !
 
 trimLeft: separators
-
 	^ self replaceRegexp: (RegularExpression fromString: '^[', separators, ']+' flag: 'g') with: ''
 !
 
@@ -1515,7 +1655,6 @@ trimRight
 !
 
 trimRight: separators
-
 	^ self replaceRegexp: (RegularExpression fromString: '[', separators, ']+$' flag: 'g') with: ''
 ! !
 
@@ -1601,7 +1740,7 @@ tokenize: aString
 !String methodsFor: 'testing'!
 
 includesSubString: subString
-	< return self.indexOf(subString) !!= -1 >
+	<return self.indexOf(subString) !!= -1>
 !
 
 isCapitalized
@@ -1681,38 +1820,74 @@ randomNotIn: aString
 ! !
 
 Collection subclass: #Set
-	instanceVariableNames: 'elements'
+	instanceVariableNames: 'defaultBucket slowBucketStores fastBuckets size'
 	package: 'Kernel-Collections'!
 !Set commentStamp!
-I represent an unordered set of objects without duplicates.!
+I represent an unordered set of objects without duplicates.
+
+## Implementation notes
+
+I put elements into different stores based on their type.
+The goal is to store some elements into native JS object property names to be fast.
+
+If an unboxed element has typeof 'string', 'boolean' or 'number', or an element is nil, null or undefined,
+I store it as a property name in an empty (== Object.create(null)) JS object, different for each type
+(for simplicity, nil/null/undefined is treated as one and included with the two booleans).
+
+If element happen to be an object, I try to store them in `ArrayBucketStore`. I have two of them by default,
+one hashed using the Smalltalk class name, the other one using the JS constructor name. It is possible to have more or less
+instances of `ArrayBucketStores`, see `#initializeSlowBucketStores`.
+
+As a last resort, if none of the `ArrayBucketStore` instances can find a suitable bucket, the `defaultBucket` is used,
+which is an `Array`.!
 
 !Set methodsFor: 'accessing'!
 
 size
-	^ elements size
+	^ size
 ! !
 
 !Set methodsFor: 'adding/removing'!
 
 add: anObject
-	<
-		var found;
-		for(var i=0; i < self['@elements'].length; i++) {
-			if(_st(anObject).__eq(self['@elements'][i])) {
-				found = true;
-				break;
-			}
-		}
-		if(!!found) {self['@elements'].push(anObject)}
-	>
+	| bucket |
+	bucket := self bucketsOfElement: anObject.
+	^ bucket second
+		ifNil: [
+			| object slowBucket |
+			object := bucket first.
+			slowBucket := bucket third.
+			slowBucket 
+				indexOf: object 
+				ifAbsent: [ 
+					slowBucket add: object. 
+					size := size + 1 ].
+			object ]
+		ifNotNil: [ :primitiveBucket | 
+			self 
+				add: bucket first 
+				in: primitiveBucket ]
 !
 
-remove: anObject
-	elements remove: anObject
+remove: anObject ifAbsent: aBlock
+	| bucket |
+	bucket := self bucketsOfElement: anObject.
+	^ bucket second
+		ifNil: [ bucket third remove: bucket first ifAbsent: [ ^aBlock value ]. size := size - 1 ]
+		ifNotNil: [ :primitiveBucket | self remove: bucket first in: primitiveBucket ]
 !
 
-remove: anObject ifAbsent: aBlock
-	elements remove: anObject ifAbsent: aBlock
+removeAll
+	<
+		self['@fastBuckets'] = {
+			'boolean': { store: Object.create(null), fn: function (x) { return {'true': true, 'false': false, 'null': null}[x]; } },
+			'number': { store: Object.create(null), fn: Number },
+			'string': { store: Object.create(null) }
+		};
+		self['@slowBucketStores'].forEach(function (x) { x._removeAll(); });
+		self['@defaultBucket']._removeAll();
+		self['@size'] = 0;
+	>
 ! !
 
 !Set methodsFor: 'comparing'!
@@ -1724,24 +1899,34 @@ remove: anObject ifAbsent: aBlock
 	^ true
 ! !
 
-!Set methodsFor: 'converting'!
-
-asArray
-	^ elements copy
-! !
-
 !Set methodsFor: 'enumerating'!
 
 collect: aBlock
-	^ self class withAll: (elements collect: aBlock)
+	| collection |
+	collection := self class new.
+	self do: [ :each | collection add: (aBlock value: each) ].
+	^ collection
 !
 
 detect: aBlock ifNone: anotherBlock
-	^ elements detect: aBlock ifNone: anotherBlock
+	self do: [ :each | (aBlock value: each) ifTrue: [ ^each ] ].
+	^ anotherBlock value
 !
 
 do: aBlock
-	elements do: aBlock
+	<
+		var el, keys, i;
+		el = self['@fastBuckets'];
+		keys = Object.keys(el);
+		for (i = 0; i < keys.length; ++i) {
+			var fastBucket = el[keys[i]], fn = fastBucket.fn, store = Object.keys(fastBucket.store);
+			if (fn) { for (var j = 0; j < store.length; ++j) { aBlock._value_(fn(store[j])); } }
+			else { store._do_(aBlock); }
+		}
+		el = self['@slowBucketStores'];
+		for (i = 0; i < el.length; ++i) { el[i]._do_(aBlock); }
+		self['@defaultBucket']._do_(aBlock);
+	>
 !
 
 select: aBlock
@@ -1749,7 +1934,7 @@ select: aBlock
 	collection := self class new.
 	self do: [ :each |
 		(aBlock value: each) ifTrue: [
-			collection add: each ]].
+			collection add: each ] ].
 	^ collection
 ! !
 
@@ -1757,7 +1942,18 @@ select: aBlock
 
 initialize
 	super initialize.
-	elements := #()
+	
+	defaultBucket := #().
+	self
+		initializeSlowBucketStores;
+		removeAll
+!
+
+initializeSlowBucketStores
+	slowBucketStores := {
+		ArrayBucketStore hashBlock: [ :x | self classNameOf: x ].
+		ArrayBucketStore hashBlock: [ :x | self jsConstructorNameOf: x ]
+	}
 ! !
 
 !Set methodsFor: 'printing'!
@@ -1772,10 +1968,69 @@ printOn: aStream
 	aStream nextPutAll: ')'
 ! !
 
+!Set methodsFor: 'private'!
+
+add: anObject in: anotherObject
+	<
+		if (anObject in anotherObject.store) { return false; }
+		self['@size']++;
+		return anotherObject.store[anObject] = true;
+	>
+!
+
+bucketsOfElement: anObject
+	"Find the appropriate bucket for `anObject`.
+	For optimization purposes, directly answer an array with: 
+	- the object to be store
+	- the primitive bucket
+	- the slow bucket"
+	
+	<
+		var type, bucket, prim = anObject == null ? (anObject = nil) : anObject.valueOf();
+		if ((type = typeof prim) === "object") {
+			if (anObject !!== nil) {
+				bucket = null;
+				self['@slowBucketStores'].some(function (store) {
+					return bucket = store._bucketOfElement_(anObject);
+				});
+				return [ anObject, null, bucket || self['@defaultBucket'] ];
+			}
+			
+			// include nil to well-known objects under 'boolean' fastBucket
+			prim = null;
+			type = 'boolean';
+		}
+		return [ prim, self['@fastBuckets'][type] ];
+	>
+!
+
+classNameOf: anObject
+	"Answer the class name of `anObject`, or `undefined` 
+	if `anObject` is not an Smalltalk object"
+	
+	<return anObject.klass && anObject.klass.className>
+!
+
+includes: anObject in: anotherObject
+	<return anObject in anotherObject.store>
+!
+
+jsConstructorNameOf: anObject
+	<return anObject.constructor && anObject.constructor.name>
+!
+
+remove: anObject in: anotherObject
+	<if (delete anotherObject.store[anObject]) self['@size']-->
+! !
+
 !Set methodsFor: 'testing'!
 
 includes: anObject
-	^ elements includes: anObject
+	| bucket |
+	bucket := self bucketsOfElement: anObject.
+	^ bucket second
+		ifNil: [ bucket third includes: bucket first ]
+		ifNotNil: [ :primitiveBucket | self includes: bucket first in: primitiveBucket ]
 ! !
 
 Object subclass: #Queue

+ 1 - 61
st/Kernel-Exceptions.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Exceptions'!
+Smalltalk createPackage: 'Kernel-Exceptions'!
 Object subclass: #Error
 	instanceVariableNames: 'messageText'
 	package: 'Kernel-Exceptions'!
@@ -161,63 +161,3 @@ object: anObject
 	object := anObject
 ! !
 
-Object subclass: #ErrorHandler
-	instanceVariableNames: ''
-	package: 'Kernel-Exceptions'!
-!ErrorHandler commentStamp!
-I am used to manage Smalltalk errors.
-See `boot.js` `handleError()` function.
-
-Subclasses can register themselves as the current handler with
-`ErrorHandler class >> register`.
-
-Subclasses may override `#handleError:` to perform an action on the thrown exception.
-The default behavior is to log the error and the context stack to the JavaScript console.!
-
-!ErrorHandler methodsFor: 'error handling'!
-
-handleError: anError
-	anError context ifNotNil: [ self logErrorContext: anError context ].
-	self logError: anError
-! !
-
-!ErrorHandler methodsFor: 'private'!
-
-log: aString
-	console log: aString
-!
-
-logContext: aContext
-	aContext home ifNotNil: [
-		self logContext: aContext home ].
-	self log: aContext asString
-!
-
-logError: anError
-	self log: anError messageText
-!
-
-logErrorContext: aContext
-	aContext ifNotNil: [
-		aContext home ifNotNil: [
-			self logContext: aContext home ]]
-! !
-
-ErrorHandler class instanceVariableNames: 'current'!
-
-!ErrorHandler class methodsFor: 'accessing'!
-
-current
-	^ current
-!
-
-setCurrent: anHandler
-	current := anHandler
-! !
-
-!ErrorHandler class methodsFor: 'initialization'!
-
-register
-	ErrorHandler setCurrent: self new
-! !
-

+ 42 - 22
st/Kernel-ImportExport.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-ImportExport'!
+Smalltalk createPackage: 'Kernel-ImportExport'!
 Object subclass: #AbstractExporter
 	instanceVariableNames: ''
 	package: 'Kernel-ImportExport'!
@@ -32,7 +32,7 @@ extensionProtocolsOfPackage: aPackage
 	Therefore sorting (dependency resolution) does not matter here.
 	Not sorting improves the speed by a number of magnitude."
 	
-	Smalltalk current classes do: [ :each |
+	Smalltalk classes do: [ :each |
 		{each. each class} do: [ :behavior |
 			(behavior protocols includes: extensionName) ifTrue: [
 				result add: (ExportMethodProtocol name: extensionName theClass: behavior) ] ] ].
@@ -79,7 +79,7 @@ extensionCategoriesOfPackage: aPackage
 	| name map result |
 	name := aPackage name.
 	result := OrderedCollection new.
-	(Package sortedClasses: Smalltalk current classes) do: [ :each |
+	(Package sortedClasses: Smalltalk classes) do: [ :each |
 		{each. each class} do: [ :aClass |
 			map := Dictionary new.
 			aClass protocolsDo: [ :category :methods |
@@ -190,7 +190,7 @@ exportPackage: aPackage on: aStream
 
 exportPackageDefinitionOf: aPackage on: aStream
 	aStream
-		nextPutAll: 'Smalltalk current createPackage: ''', aPackage name, '''!!';
+		nextPutAll: 'Smalltalk createPackage: ''', aPackage name, '''!!';
 		lf
 !
 
@@ -234,7 +234,7 @@ ownMethodsOfClass: aClass
 	"Issue #143: sort methods alphabetically"
 
 	^ ((aClass methodDictionary values) sorted: [ :a :b | a selector <= b selector ])
-		reject: [ :each | (each category match: '^\*') ]
+		reject: [ :each | (each protocol match: '^\*') ]
 !
 
 ownMethodsOfMetaClass: aClass
@@ -261,7 +261,7 @@ exportDefinitionOf: aClass on: aStream
 		lf;
 		nextPutAll: 'smalltalk.addClass(';
 		nextPutAll: '''', (self classNameFor: aClass), ''', ';
-		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
+		nextPutAll: 'globals.', (self classNameFor: aClass superclass);
 		nextPutAll: ', ['.
 	aClass instanceVariableNames
 		do: [ :each | aStream nextPutAll: '''', each, '''' ]
@@ -273,7 +273,7 @@ exportDefinitionOf: aClass on: aStream
 	aClass comment notEmpty ifTrue: [
 		aStream
 			lf;
-		nextPutAll: 'smalltalk.';
+		nextPutAll: 'globals.';
 		nextPutAll: (self classNameFor: aClass);
 		nextPutAll: '.comment=';
 		nextPutAll: aClass comment asJavascript;
@@ -285,7 +285,7 @@ exportMetaDefinitionOf: aClass on: aStream
 	aStream lf.
 	aClass class instanceVariableNames isEmpty ifFalse: [
 		aStream
-		nextPutAll: 'smalltalk.', (self classNameFor: aClass class);
+		nextPutAll: 'globals.', (self classNameFor: aClass class);
 		nextPutAll: '.iVarNames = ['.
 		aClass class instanceVariableNames
 		do: [ :each | aStream nextPutAll: '''', each, '''' ]
@@ -299,7 +299,7 @@ exportMethod: aMethod on: aStream
 		"nextPutAll: aMethod selector asSelector asJavascript, ',';lf;"
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
-		nextPutAll: 'category: ''', aMethod category, ''',';lf;
+		nextPutAll: 'protocol: ''', aMethod protocol, ''',';lf;
 		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;
 		nextPutAll: 'args: ', aMethod arguments asJavascript, ','; lf;
 		nextPutAll: 'source: ', aMethod source asJavascript, ',';lf;
@@ -308,7 +308,7 @@ exportMethod: aMethod on: aStream
 	aStream
 		lf;
 		nextPutAll: '}),';lf;
-		nextPutAll: 'smalltalk.', (self classNameFor: aMethod methodClass);
+		nextPutAll: 'globals.', (self classNameFor: aMethod methodClass);
 		nextPutAll: ');';lf;lf
 !
 
@@ -384,8 +384,8 @@ exportPackagePrologueOf: aPackage on: aStream
 		nextPutAll: '/';
 		nextPutAll: aPackage name;
 		nextPutAll: '", ';
-		nextPutAll: (#('amber_vm/smalltalk' 'amber_vm/nil' 'amber_vm/_st'), (self amdNamesOfPackages: aPackage loadDependencies)) asJavascript;
-		nextPutAll: ', function(smalltalk,nil,_st){';
+		nextPutAll: (#('amber_vm/smalltalk' 'amber_vm/nil' 'amber_vm/_st' 'amber_vm/globals'), (self amdNamesOfPackages: aPackage loadDependencies)) asJavascript;
+		nextPutAll: ', function(smalltalk,nil,_st, globals){';
 		lf
 ! !
 
@@ -404,7 +404,7 @@ amdNamespaceOfPackage: aPackage
 ! !
 
 Object subclass: #ChunkParser
-	instanceVariableNames: 'stream'
+	instanceVariableNames: 'stream last'
 	package: 'Kernel-ImportExport'!
 !ChunkParser commentStamp!
 I am responsible for parsing aStream contents in the chunk format.
@@ -417,6 +417,10 @@ I am responsible for parsing aStream contents in the chunk format.
 
 !ChunkParser methodsFor: 'accessing'!
 
+last
+	^ last
+!
+
 stream: aStream
 	stream := aStream
 ! !
@@ -441,9 +445,9 @@ nextChunk
 				char = '!!' ifTrue: [
 						stream peek = '!!'
 								ifTrue: [ stream next "skipping the escape double" ]
-								ifFalse: [ ^ result contents trimBoth "chunk end marker found" ]].
+								ifFalse: [ ^ last := result contents trimBoth "chunk end marker found" ]].
 				result nextPut: char ].
-	^ nil "a chunk needs to end with !!"
+	^ last := nil "a chunk needs to end with !!"
 ! !
 
 !ChunkParser class methodsFor: 'instance creation'!
@@ -494,7 +498,7 @@ name: aString theClass: aClass
 ! !
 
 Object subclass: #Importer
-	instanceVariableNames: ''
+	instanceVariableNames: 'lastSection lastChunk'
 	package: 'Kernel-ImportExport'!
 !Importer commentStamp!
 I can import Amber code from a string in the chunk format.
@@ -503,22 +507,38 @@ I can import Amber code from a string in the chunk format.
 
     Importer new import: aString!
 
+!Importer methodsFor: 'accessing'!
+
+lastChunk
+	^ lastChunk
+!
+
+lastSection
+	^ lastSection
+! !
+
 !Importer methodsFor: 'fileIn'!
 
 import: aStream
 	| chunk result parser lastEmpty |
 	parser := ChunkParser on: aStream.
 	lastEmpty := false.
+	lastSection := 'n/a, not started'.
+	lastChunk := nil.
+	[
 	[ chunk := parser nextChunk.
 	chunk isNil ] whileFalse: [
 		chunk isEmpty
 			ifTrue: [ lastEmpty := true ]
 			ifFalse: [
+				lastSection := chunk.
 				result := Compiler new evaluateExpression: chunk.
 				lastEmpty
 						ifTrue: [
 									lastEmpty := false.
-									result scanFrom: parser ]] ]
+									result scanFrom: parser ]] ].
+	lastSection := 'n/a, finished'
+	] on: Error do: [:e | lastChunk := parser last. e signal ].
 ! !
 
 InterfacingObject subclass: #PackageHandler
@@ -640,7 +660,7 @@ namespaceFor: aPackage
 !AmdPackageHandler methodsFor: 'loading'!
 
 load: aPackage
-	Smalltalk current amdRequire
+	Smalltalk amdRequire
 		ifNil: [ self error: 'AMD loader not present' ]
 		ifNotNil: [ :require |
 			require value: (Array new: (self namespaceFor: aPackage), '/', aPackage name ) ]
@@ -649,7 +669,7 @@ load: aPackage
 !AmdPackageHandler methodsFor: 'private'!
 
 toUrl: aString
-	^ Smalltalk current amdRequire
+	^ Smalltalk amdRequire
 		ifNil: [ self error: 'AMD loader not present' ]
 		ifNotNil: [ :require | (require basicAt: 'toUrl') value: aString ]
 ! !
@@ -657,11 +677,11 @@ toUrl: aString
 !AmdPackageHandler class methodsFor: 'commit paths'!
 
 defaultNamespace
-	^ Smalltalk current defaultAmdNamespace
+	^ Smalltalk defaultAmdNamespace
 !
 
 defaultNamespace: aString
-	Smalltalk current defaultAmdNamespace: aString
+	Smalltalk defaultAmdNamespace: aString
 ! !
 
 Object subclass: #PackageTransport
@@ -815,7 +835,7 @@ asJSON
 !AmdPackageTransport methodsFor: 'defaults'!
 
 defaultNamespace
-	^ Smalltalk current defaultAmdNamespace
+	^ Smalltalk defaultAmdNamespace
 ! !
 
 !AmdPackageTransport methodsFor: 'initialization'!

+ 272 - 105
st/Kernel-Infrastructure.st

@@ -1,30 +1,45 @@
-Smalltalk current createPackage: 'Kernel-Infrastructure'!
-Object subclass: #InspectorHandler
+Smalltalk createPackage: 'Kernel-Infrastructure'!
+Object subclass: #ConsoleErrorHandler
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
-!InspectorHandler commentStamp!
-I am responsible for inspecting object.
+!ConsoleErrorHandler commentStamp!
+I am manage Smalltalk errors, displaying the stack in the console.!
 
-My class-side `inspector` inst var holds the current inspector I'm delegating object inspection to.
+!ConsoleErrorHandler methodsFor: 'error handling'!
 
-The default inspector object is the transcript.!
+handleError: anError
+	anError context ifNotNil: [ self logErrorContext: anError context ].
+	self logError: anError
+! !
+
+!ConsoleErrorHandler methodsFor: 'private'!
+
+log: aString
+	console log: aString
+!
 
-InspectorHandler class instanceVariableNames: 'inspector'!
+logContext: aContext
+	aContext home ifNotNil: [
+		self logContext: aContext home ].
+	self log: aContext asString
+!
 
-!InspectorHandler class methodsFor: 'accessing'!
+logError: anError
+	self log: anError messageText
+!
 
-inspector
-	^ inspector ifNil: [ inspector := Transcript ]
+logErrorContext: aContext
+	aContext ifNotNil: [
+		aContext home ifNotNil: [
+			self logContext: aContext home ]]
 ! !
 
-!InspectorHandler class methodsFor: 'registration'!
+ConsoleErrorHandler class instanceVariableNames: 'current'!
 
-inspect: anObject
-	^ self inspector inspect: anObject
-!
+!ConsoleErrorHandler class methodsFor: 'initialization'!
 
-register: anInspector
-	inspector := anInspector
+initialize
+	ErrorHandler registerIfNone: self new
 ! !
 
 Object subclass: #InterfacingObject
@@ -72,16 +87,16 @@ Typical use cases include IDEs, remote access and restricting browsing.!
 !Environment methodsFor: 'accessing'!
 
 allSelectors
-	^ (Smalltalk current at: 'allSelectors') value
+	^ Smalltalk vm allSelectors
 !
 
 availableClassNames
-	^ Smalltalk current classes 
+	^ Smalltalk classes 
 		collect: [ :each | each name ]
 !
 
 availablePackageNames
-	^ Smalltalk current packages 
+	^ Smalltalk packages 
 		collect: [ :each | each name ]
 !
 
@@ -90,7 +105,7 @@ availableProtocolsFor: aClass
 	
 	protocols := aClass protocols.
 	aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].
-	^ protocols asSet asArray
+	^ protocols asSet asArray sort
 !
 
 classBuilder
@@ -98,12 +113,12 @@ classBuilder
 !
 
 classNamed: aString
-	^ (Smalltalk current at: aString asSymbol)
+	^ (Smalltalk globals at: aString asSymbol)
 		ifNil: [ self error: 'Invalid class name' ]
 !
 
 classes
-	^ Smalltalk current classes
+	^ Smalltalk classes
 !
 
 doItReceiver
@@ -111,11 +126,11 @@ doItReceiver
 !
 
 packages
-	^ Smalltalk current packages
+	^ Smalltalk packages
 !
 
 systemAnnouncer
-	^ (Smalltalk current at: #SystemAnnouncer) current
+	^ (Smalltalk globals at: #SystemAnnouncer) current
 ! !
 
 !Environment methodsFor: 'actions'!
@@ -125,7 +140,7 @@ commitPackage: aPackage
 !
 
 copyClass: aClass to: aClassName
-	(Smalltalk current at: aClassName)
+	(Smalltalk globals at: aClassName)
 		ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].
 		
 	ClassBuilder new copyClass: aClass named: aClassName
@@ -140,7 +155,7 @@ eval: aString on: aReceiver
 !
 
 inspect: anObject
-	InspectorHandler inspector inspect: anObject
+	Inspector inspect: anObject
 !
 
 moveClass: aClass toPackage: aPackageName
@@ -156,35 +171,22 @@ moveClass: aClass toPackage: aPackageName
 moveMethod: aMethod toClass: aClassName
 	| destinationClass |
 	
-	destinationClass := Smalltalk current at: aClassName asSymbol.
-	destinationClass ifNil: [ self error: 'Invalid class name' ].
+	destinationClass := self classNamed: aClassName.
 	destinationClass == aMethod methodClass ifTrue: [ ^ self ].
 	
 	destinationClass 
 		compile: aMethod source
-		category: aMethod protocol.
+		protocol: aMethod protocol.
 	aMethod methodClass 
 		removeCompiledMethod: aMethod
 !
 
 moveMethod: aMethod toProtocol: aProtocol
-	aMethod category: aProtocol
-!
-
-registerErrorHandler: anErrorHandler
-	ErrorHandler setCurrent: anErrorHandler
-!
-
-registerInspector: anInspector
-	InspectorHandler register: anInspector
-!
-
-registerProgressHandler: aProgressHandler
-	ProgressHandler setCurrent: aProgressHandler
+	aMethod protocol: aProtocol
 !
 
 removeClass: aClass
-	Smalltalk current removeClass: aClass
+	Smalltalk removeClass: aClass
 !
 
 removeMethod: aMethod
@@ -192,21 +194,19 @@ removeMethod: aMethod
 !
 
 removeProtocol: aString from: aClass
-	(aClass methods
-		select: [ :each | each protocol = aString ])
+	(aClass methodsInProtocol: aString)
 		do: [ :each | aClass removeCompiledMethod: each ]
 !
 
 renameClass: aClass to: aClassName
-	(Smalltalk current at: aClassName)
+	(Smalltalk globals at: aClassName)
 		ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].
 		
 	ClassBuilder new renameClass: aClass to: aClassName
 !
 
 renameProtocol: aString to: anotherString in: aClass
-	(aClass methods
-		select: [ :each | each protocol = aString ])
+	(aClass methodsInProtocol: aString)
 		do: [ :each | each protocol: anotherString ]
 !
 
@@ -229,13 +229,15 @@ compileClassComment: aString for: aClass
 !
 
 compileClassDefinition: aString
-	self eval: aString on: DoIt new
+	[ self eval: aString on: DoIt new ]
+		on: Error
+		do: [ :error | self alert: error messageText ]
 !
 
 compileMethod: sourceCode for: class protocol: protocol
 	^ class
 		compile: sourceCode
-		category: protocol
+		protocol: protocol
 ! !
 
 !Environment methodsFor: 'error handling'!
@@ -249,6 +251,24 @@ evaluate: aBlock on: anErrorClass do: exceptionBlock
  			ifFalse: [ exception signal ] ]
 ! !
 
+!Environment methodsFor: 'services'!
+
+registerErrorHandler: anErrorHandler
+	ErrorHandler register: anErrorHandler
+!
+
+registerInspector: anInspector
+	Inspector register: anInspector
+!
+
+registerProgressHandler: aProgressHandler
+	ProgressHandler register: aProgressHandler
+!
+
+registerTranscript: aTranscript
+	Transcript register: aTranscript
+! !
+
 ProtoObject subclass: #JSObjectProxy
 	instanceVariableNames: 'jsObject'
 	package: 'Kernel-Infrastructure'!
@@ -327,6 +347,13 @@ lookupProperty: aString
 	<return aString in self._jsObject() ? aString : nil>
 ! !
 
+!JSObjectProxy methodsFor: 'comparing'!
+
+= anObject
+	anObject class == self class ifFalse: [ ^ false ].
+	^ self compareJSObjectWith: anObject jsObject
+! !
+
 !JSObjectProxy methodsFor: 'enumerating'!
 
 asJSON
@@ -359,6 +386,12 @@ printString
 	>
 ! !
 
+!JSObjectProxy methodsFor: 'private'!
+
+compareJSObjectWith: aJSObject
+ 	<return self["@jsObject"] === aJSObject>
+! !
+
 !JSObjectProxy methodsFor: 'proxy'!
 
 addObjectVariablesTo: aDictionary
@@ -401,6 +434,26 @@ on: aJSObject
 		yourself
 ! !
 
+Object subclass: #NullProgressHandler
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+!NullProgressHandler commentStamp!
+I am the default progress handler. I do not display any progress, and simply iterate over the collection.!
+
+!NullProgressHandler methodsFor: 'progress handling'!
+
+do: aBlock on: aCollection displaying: aString
+	aCollection do: aBlock
+! !
+
+NullProgressHandler class instanceVariableNames: 'current'!
+
+!NullProgressHandler class methodsFor: 'initialization'!
+
+initialize
+	ProgressHandler registerIfNone: self new
+! !
+
 Object subclass: #Organizer
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
@@ -529,7 +582,7 @@ transport: aPackageTransport
 !Package methodsFor: 'classes'!
 
 classes
-	^ self organization elements asSet asArray
+	^ self organization elements
 !
 
 setupClasses
@@ -566,7 +619,7 @@ loadDependencyClasses
 	starCategoryName := '*', self name.
 	^ (self classes collect: [ :each | each superclass ]) asSet
 		remove: nil ifAbsent: [];
-		addAll: (Smalltalk current classes select: [ :each | each protocols, each class protocols includes: starCategoryName ]);
+		addAll: (Smalltalk classes select: [ :each | each protocols, each class protocols includes: starCategoryName ]);
 		yourself
 ! !
 
@@ -591,14 +644,14 @@ Package class instanceVariableNames: 'defaultCommitPathJs defaultCommitPathSt'!
 !Package class methodsFor: 'accessing'!
 
 named: aPackageName
-	^ Smalltalk current 
+	^ Smalltalk 
 		packageAt: aPackageName
 		ifAbsent: [ 
-			Smalltalk current createPackage: aPackageName ]
+			Smalltalk createPackage: aPackageName ]
 !
 
 named: aPackageName ifAbsent: aBlock
-	^ Smalltalk current packageAt: aPackageName ifAbsent: aBlock
+	^ Smalltalk packageAt: aPackageName ifAbsent: aBlock
 !
 
 named: aPackageName transport: aTransport
@@ -706,54 +759,136 @@ initialize
 	]
 ! !
 
-Object subclass: #ProgressHandler
+Object subclass: #Service
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+!Service commentStamp!
+I implement the basic behavior for class registration to a service.
+
+See the `Transcript` class for a concrete service.
+
+## API
+
+Use class-side methods `#register:` and `#registerIfNone:` to register classes to a specific service.!
+
+Service class instanceVariableNames: 'current'!
+
+!Service class methodsFor: 'accessing'!
+
+current
+	^ current
+! !
+
+!Service class methodsFor: 'instance creation'!
+
+new
+	self shouldNotImplement
+! !
+
+!Service class methodsFor: 'registration'!
+
+register: anObject
+	current := anObject
+!
+
+registerIfNone: anObject
+	self current ifNil: [ self register: anObject ]
+! !
+
+Service subclass: #ErrorHandler
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+!ErrorHandler commentStamp!
+I am the service used to handle Smalltalk errors.
+See `boot.js` `handleError()` function.
+
+Registered service instances must implement `#handleError:` to perform an action on the thrown exception.!
+
+!ErrorHandler class methodsFor: 'error handling'!
+
+handleError: anError
+	self current handleError: anError
+! !
+
+Service subclass: #Inspector
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+!Inspector commentStamp!
+I am the service responsible for inspecting objects.
+
+The default inspector object is the transcript.!
+
+!Inspector class methodsFor: 'inspecting'!
+
+inspect: anObject
+	^ self current inspect: anObject
+! !
+
+Service subclass: #ProgressHandler
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
 !ProgressHandler commentStamp!
 I am used to manage progress in collection iterations, see `SequenceableCollection >> #do:displayingProgress:`.
 
-Subclasses of can register themselves as the current handler with
-`ProgressHandler class >> register`.
+Registered instances must implement `#do:on:displaying:`.
 
-The default behavior is to simply iterate over the collection.!
+The default behavior is to simply iterate over the collection, using `NullProgressHandler`.!
 
-!ProgressHandler methodsFor: 'progress handling'!
+!ProgressHandler class methodsFor: 'progress handling'!
 
 do: aBlock on: aCollection displaying: aString
-	aCollection do: aBlock
+	self current do: aBlock on: aCollection displaying: aString
 ! !
 
-ProgressHandler class instanceVariableNames: 'current'!
+Service subclass: #Transcript
+	instanceVariableNames: ''
+	package: 'Kernel-Infrastructure'!
+!Transcript commentStamp!
+I am a facade for Transcript actions.
 
-!ProgressHandler class methodsFor: 'accessing'!
+I delegate actions to the currently registered transcript.
 
-current
-	^ current ifNil: [ current := self new ]
-!
+## API
+
+    Transcript 
+        show: 'hello world';
+        cr;
+        show: anObject.!
+
+!Transcript class methodsFor: 'instance creation'!
 
-setCurrent: anHandler
-	current := anHandler
+open
+	self current open
 ! !
 
-!ProgressHandler class methodsFor: 'initialization'!
+!Transcript class methodsFor: 'printing'!
 
-initialize
-	self register
+clear
+	self current clear
+!
+
+cr
+	self current show: String cr
 !
 
-register
-	ProgressHandler setCurrent: self new
+inspect: anObject
+	self show: anObject
+!
+
+show: anObject
+	self current show: anObject
 ! !
 
-Object subclass: #Smalltalk
+Object subclass: #SmalltalkImage
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
-!Smalltalk commentStamp!
-I represent the global JavaScript variable `smalltalk` declared in `js/boot.js`.
+!SmalltalkImage commentStamp!
+I represent the Smalltalk system, wrapping
+operations of variable `smalltalk` declared in `js/boot.js`.
 
 ## API
 
-I have only one instance, accessed with class-side method `#current`.
+I have only one instance, accessed with global variable `Smalltalk`.
 
 The `smalltalk` object holds all class and packages defined in the system.
 
@@ -776,24 +911,37 @@ Packages can be accessed using the following methods:
 The `#parse:` method is used to parse Amber source code.
 It requires the `Compiler` package and the `js/parser.js` parser file in order to work.!
 
-!Smalltalk methodsFor: 'accessing'!
+!SmalltalkImage methodsFor: 'accessing'!
 
 at: aString
-	^ self basicAt: aString
+	self deprecatedAPI.
+	^ self globals at: aString
 !
 
 at: aKey ifAbsent: aBlock
 	^ (self includesKey: aKey)
 		ifTrue: [ self at: aKey ]
-		ifFalse: aBlock
+		ifFalse: [ aBlock value ]
 !
 
 at: aString put: anObject
-	^ self basicAt: aString put: anObject
+	self deprecatedAPI.
+	^ self globals at: aString put: anObject
+!
+
+current
+	"Backward compatibility for Smalltalk current ..."
+	self deprecatedAPI.
+	^ self
+!
+
+globals
+	"Future compatibility to be able to use Smalltalk globals at: ..."
+	<return globals>
 !
 
 includesKey: aKey
-	<return self.hasOwnProperty(aKey)>
+	<return smalltalk.hasOwnProperty(aKey)>
 !
 
 parse: aString
@@ -813,38 +961,43 @@ pseudoVariableNames
 !
 
 readJSObject: anObject
-	<return self.readJSObject(anObject)>
+	<return smalltalk.readJSObject(anObject)>
 !
 
 reservedWords
 	"JavaScript reserved words"
-	<return self.reservedWords>
+	<return smalltalk.reservedWords>
 !
 
 version
 	"Answer the version string of Amber"
 	
 	^ '0.13.0-pre'
+!
+
+vm
+	"Future compatibility to be able to use Smalltalk vm ..."
+	<return smalltalk>
 ! !
 
-!Smalltalk methodsFor: 'accessing amd'!
+!SmalltalkImage methodsFor: 'accessing amd'!
 
 amdRequire
-	^ self at: 'amdRequire'
+	^ self vm at: 'amdRequire'
 !
 
 defaultAmdNamespace
-	^ self at: 'defaultAmdNamespace'
+	^ self vm defaultAmdNamespace
 !
 
 defaultAmdNamespace: aString
-	self at: 'defaultAmdNamespace' put: aString
+	self vm defaultAmdNamespace: aString
 ! !
 
-!Smalltalk methodsFor: 'classes'!
+!SmalltalkImage methodsFor: 'classes'!
 
 classes
-	<return self.classes()>
+	<return smalltalk.classes()>
 !
 
 removeClass: aClass
@@ -858,7 +1011,7 @@ removeClass: aClass
 			yourself)
 ! !
 
-!Smalltalk methodsFor: 'error handling'!
+!SmalltalkImage methodsFor: 'error handling'!
 
 asSmalltalkException: anObject
 	"A JavaScript exception may be thrown.
@@ -873,7 +1026,7 @@ parseError: anException parsing: aString
 	^ ParseError new messageText: 'Parse error on line ', (anException basicAt: 'line') ,' column ' , (anException basicAt: 'column') ,' : Unexpected character ', (anException basicAt: 'found')
 ! !
 
-!Smalltalk methodsFor: 'globals'!
+!SmalltalkImage methodsFor: 'globals'!
 
 addGlobalJsVariable: aString
 	self globalJsVariables add: aString
@@ -885,10 +1038,10 @@ deleteGlobalJsVariable: aString
 
 globalJsVariables
 	"Array of global JavaScript variables"
-	<return self.globalJsVariables>
+	<return smalltalk.globalJsVariables>
 ! !
 
-!Smalltalk methodsFor: 'packages'!
+!SmalltalkImage methodsFor: 'packages'!
 
 createPackage: packageName
 	| package announcement |
@@ -904,7 +1057,7 @@ createPackage: packageName
 !
 
 packageAt: packageName
-	<return self.packages[ packageName]>
+	<return smalltalk.packages[packageName]>
 !
 
 packageAt: packageName ifAbsent: aBlock
@@ -915,8 +1068,8 @@ packages
 	"Return all Package instances in the system."
 
 	<
-		return Object.keys(self.packages).map(function(k) {
-			return self.packages[k];
+		return Object.keys(smalltalk.packages).map(function(k) {
+			return smalltalk.packages[k];
 		})
 	>
 !
@@ -942,7 +1095,7 @@ renamePackage: packageName to: newName
 	self deletePackage: packageName.
 ! !
 
-!Smalltalk methodsFor: 'private'!
+!SmalltalkImage methodsFor: 'private'!
 
 basicCreatePackage: packageName
 	"Create and bind a new bare package with given name and return it."
@@ -964,17 +1117,17 @@ createPackage: packageName properties: aDict
 deleteClass: aClass
 	"Deletes a class by deleting its binding only. Use #removeClass instead"
 	
-	<self.removeClass(aClass)>
+	<smalltalk.removeClass(aClass)>
 !
 
 deletePackage: packageName
 	"Deletes a package by deleting its binding, but does not check if it contains classes etc.
 	To remove a package, use #removePackage instead."
 
-	<delete self.packages[ packageName]>
+	<delete smalltalk.packages[packageName]>
 ! !
 
-!Smalltalk methodsFor: 'testing'!
+!SmalltalkImage methodsFor: 'testing'!
 
 isSmalltalkObject: anObject
 	"Consider anObject a Smalltalk object if it has a 'klass' property.
@@ -983,17 +1136,31 @@ isSmalltalkObject: anObject
 	<return typeof anObject.klass !!== 'undefined'>
 ! !
 
-!Smalltalk class methodsFor: 'accessing'!
+SmalltalkImage class instanceVariableNames: 'current'!
+
+!SmalltalkImage class methodsFor: 'initialization'!
+
+initialize
+	globals at: 'Smalltalk' put: self current
+! !
+
+!SmalltalkImage class methodsFor: 'instance creation'!
 
 current
-	<return smalltalk>
+	^ current ifNil: [ current := super new ] ifNotNil: [ self deprecatedAPI. current ]
+!
+
+new
+	self shouldNotImplement
 ! !
 
 !SequenceableCollection methodsFor: '*Kernel-Infrastructure'!
 
 do: aBlock displayingProgress: aString
-	ProgressHandler current
-		do: aBlock on: self displaying: aString
+	ProgressHandler 
+		do: aBlock 
+		on: self 
+		displaying: aString
 ! !
 
 !String methodsFor: '*Kernel-Infrastructure'!

+ 19 - 26
st/Kernel-Methods.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Methods'!
+Smalltalk createPackage: 'Kernel-Methods'!
 Object subclass: #BlockClosure
 	instanceVariableNames: ''
 	package: 'Kernel-Methods'!
@@ -86,7 +86,7 @@ on: anErrorClass do: aBlock
 	Convert all JS exceptions to JavaScriptException instances."
 	
 	^ self try: self catch: [ :error | | smalltalkError |
-		smalltalkError := Smalltalk current asSmalltalkException: error.
+		smalltalkError := Smalltalk asSmalltalkException: error.
 		(smalltalkError isKindOf: anErrorClass)
 		ifTrue: [ aBlock value: smalltalkError ]
 		ifFalse: [ smalltalkError resignal ] ]
@@ -178,14 +178,14 @@ fork
 valueWithInterval: aNumber
 	<
 		var interval = setInterval(self, aNumber);
-		return smalltalk.Timeout._on_(interval);
+		return globals.Timeout._on_(interval);
 	>
 !
 
 valueWithTimeout: aNumber
 	<
 		var timeout = setTimeout(self, aNumber);
-		return smalltalk.Timeout._on_(timeout);
+		return globals.Timeout._on_(timeout);
 	>
 ! !
 
@@ -219,25 +219,7 @@ arguments
 !
 
 category
-	^ (self basicAt: 'category') ifNil: [ self defaultCategory ]
-!
-
-category: aString
-	| oldProtocol |
-	oldProtocol := self protocol.
-	self basicAt: 'category' put: aString.
-
-	SystemAnnouncer current announce: (MethodMoved new
-		method: self;
-		oldProtocol: oldProtocol;
-		yourself).
-
-	self methodClass ifNotNil: [
-		self methodClass organization addElement: aString.
-	
-		(self methodClass methods
-			select: [ :each | each protocol = oldProtocol ])
-			ifEmpty: [ self methodClass organization removeElement: oldProtocol ] ]
+	^ self protocol
 !
 
 fn
@@ -257,11 +239,22 @@ methodClass
 !
 
 protocol
-	^ self category
+	^ (self basicAt: 'protocol') ifNil: [ self defaultProtocol ]
 !
 
 protocol: aString
-	self category: aString
+	| oldProtocol |
+	oldProtocol := self protocol.
+	self basicAt: 'protocol' put: aString.
+
+	SystemAnnouncer current announce: (MethodMoved new
+		method: self;
+		oldProtocol: oldProtocol;
+		yourself).
+
+	self methodClass ifNotNil: [ :methodClass |
+		methodClass organization addElement: aString.
+		methodClass removeProtocolIfEmpty: oldProtocol ]
 !
 
 referencedClasses
@@ -286,7 +279,7 @@ source: aString
 
 !CompiledMethod methodsFor: 'defaults'!
 
-defaultCategory
+defaultProtocol
 	^ 'as yet unclassified'
 ! !
 

+ 44 - 28
st/Kernel-Objects.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Objects'!
+Smalltalk createPackage: 'Kernel-Objects'!
 nil subclass: #ProtoObject
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
@@ -35,6 +35,24 @@ yourself
 	^ self
 ! !
 
+!ProtoObject methodsFor: 'comparing'!
+
+= anObject
+	^ self == anObject
+!
+
+== anObject
+	^ self identityHash = anObject identityHash
+!
+
+~= anObject
+	^ (self = anObject) = false
+!
+
+~~ anObject
+	^ (self == anObject) = false
+! !
+
 !ProtoObject methodsFor: 'converting'!
 
 asString
@@ -58,7 +76,7 @@ initialize
 !ProtoObject methodsFor: 'inspecting'!
 
 inspect
-	InspectorHandler inspect: self
+	Inspector inspect: self
 !
 
 inspectOn: anInspector
@@ -164,24 +182,6 @@ value
 	<return self.valueOf()>
 ! !
 
-!Object methodsFor: 'comparing'!
-
-= anObject
-	^ self == anObject
-!
-
-== anObject
-	^ self identityHash = anObject identityHash
-!
-
-~= anObject
-	^ (self = anObject) = false
-!
-
-~~ anObject
-	^ (self == anObject) = false
-! !
-
 !Object methodsFor: 'converting'!
 
 -> anObject
@@ -389,11 +389,27 @@ respondsTo: aSelector
 
 !Object class methodsFor: 'helios'!
 
+accessorProtocolWith: aGenerator
+	aGenerator accessorProtocolForObject
+!
+
+accessorsSourceCodesWith: aGenerator
+	aGenerator accessorsForObject
+!
+
 heliosClass
 	"Should be an Helios extension. Unfortunately, since helios can browse remote
 	environments, we can't extend base classes"
 	
 	^ 'class'
+!
+
+initializeProtocolWith: aGenerator
+	aGenerator initializeProtocolForObject
+!
+
+initializeSourceCodesWith: aGenerator
+	aGenerator initializeForObject
 ! !
 
 !Object class methodsFor: 'initialization'!
@@ -420,10 +436,10 @@ I am directly mapped to JavaScript Boolean. The `true` and `false` objects are t
 
 = aBoolean
 	<
-		if(!! aBoolean._isBoolean || !! aBoolean._isBoolean()) {
-			return false;
-		}
-		return Boolean(self == true) == aBoolean
+		return aBoolean !!= null &&
+			typeof aBoolean._isBoolean === "function" &&
+			aBoolean._isBoolean() &&
+			Boolean(self == true) == aBoolean
 	>
 !
 
@@ -819,10 +835,10 @@ negated
 
 = aNumber
 	<
-		if(!! aNumber._isNumber || !! aNumber._isNumber()) {
-			return false;
-		}
-		return Number(self) == aNumber
+		return aNumber !!= null &&
+			typeof aNumber._isNumber === "function" &&
+			aNumber._isNumber() &&
+			Number(self) == aNumber
 	>
 !
 

File diff suppressed because it is too large
+ 525 - 216
st/Kernel-Tests.st


+ 2 - 55
st/Kernel-Transcript.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Transcript'!
+Smalltalk createPackage: 'Kernel-Transcript'!
 Object subclass: #ConsoleTranscript
 	instanceVariableNames: 'textarea'
 	package: 'Kernel-Transcript'!
@@ -30,59 +30,6 @@ show: anObject
 !ConsoleTranscript class methodsFor: 'initialization'!
 
 initialize
-	Transcript register: self new
-! !
-
-Object subclass: #Transcript
-	instanceVariableNames: ''
-	package: 'Kernel-Transcript'!
-!Transcript commentStamp!
-I am a facade for Transcript actions.
-
-I delegate actions to the currently registered transcript.
-
-## API
-
-    Transcript 
-        show: 'hello world';
-        cr;
-        show: anObject.!
-
-Transcript class instanceVariableNames: 'current'!
-
-!Transcript class methodsFor: 'instance creation'!
-
-current
-	^ current
-!
-
-new
-	self shouldNotImplement
-!
-
-open
-	self current open
-!
-
-register: aTranscript
-	current := aTranscript
-! !
-
-!Transcript class methodsFor: 'printing'!
-
-clear
-	self current clear
-!
-
-cr
-	self current show: String cr
-!
-
-inspect: anObject
-	self show: anObject
-!
-
-show: anObject
-	self current show: anObject
+	Transcript registerIfNone: self new
 ! !
 

+ 1 - 1
st/SUnit-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'SUnit-Tests'!
+Smalltalk createPackage: 'SUnit-Tests'!
 TestCase subclass: #ExampleSetTest
 	instanceVariableNames: 'empty full'
 	package: 'SUnit-Tests'!

+ 1 - 1
st/SUnit.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'SUnit'!
+Smalltalk createPackage: 'SUnit'!
 Object subclass: #ResultAnnouncement
 	instanceVariableNames: 'result'
 	package: 'SUnit'!

+ 1 - 1
st/Spaces.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Spaces'!
+Smalltalk createPackage: 'Spaces'!
 Object subclass: #ObjectSpace
 	instanceVariableNames: 'frame'
 	package: 'Spaces'!

+ 0 - 21
support/CodeMirror/amber.css

@@ -1,21 +0,0 @@
-.cm-s-amber span.cm-keyword {color: #7F0000; font-weight: bold;}
-.cm-s-amber span.cm-className {font-weight: bold;}
-.cm-s-amber span.cm-assignment {font-weight: bold;}
-.cm-s-amber span.cm-return {font-weight: bold;}
-.cm-s-amber span.cm-atom {color: #219;}
-.cm-s-amber span.cm-number {color: #7F0000;}
-.cm-s-amber span.cm-def {color: #00f;}
-.cm-s-amber span.cm-variable {color: grey;}
-.cm-s-amber span.cm-variable-2 {color: #05a;}
-.cm-s-amber span.cm-variable-3 {color: #0a5;}
-.cm-s-amber span.cm-property {color: black;}
-.cm-s-amber span.cm-operator {color: #00007F;}
-.cm-s-amber span.cm-comment {color: #007F00;}
-.cm-s-amber span.cm-string {color: #7F007F;}
-.cm-s-amber span.cm-meta {color: #555;}
-.cm-s-amber span.cm-error {color: #f00;}
-.cm-s-amber span.cm-qualifier {color: #555;}
-.cm-s-amber span.cm-builtin {color: #30a;}
-.cm-s-amber span.cm-bracket {color: #cc7;}
-.cm-s-amber span.cm-tag {color: #170;}
-.cm-s-amber span.cm-attribute {color: #00c;}

+ 0 - 139
support/CodeMirror/smalltalk.js

@@ -1,139 +0,0 @@
-CodeMirror.defineMode('smalltalk', function(config, modeConfig) {
-
-	var specialChars = /[+\-/\\*~<>=@%|&?!.:;^]/;
-	var keywords = /true|false|nil|self|super|thisContext/;
-
-	var Context = function(tokenizer, parent) {
-		this.next = tokenizer;
-		this.parent = parent;
-	};
-
-	var Token = function(name, context, eos) {
-		this.name = name;
-		this.context = context;
-		this.eos = eos;
-	};
-
-	var State = function() {
-		this.context = new Context(next, null);
-		this.expectVariable = true;
-		this.indentation = 0;
-		this.userIndentationDelta = 0;
-	};
-
-	State.prototype.userIndent = function(indentation) {
-		this.userIndentationDelta = indentation > 0 ? (indentation / config.indentUnit - this.indentation) : 0;
-	};
-
-	var next = function(stream, context, state) {
-		var token = new Token(null, context, false);
-		var aChar = stream.next();
-
-		if (aChar === '"') {
-			token = nextComment(stream, new Context(nextComment, context));
-
-		} else if (aChar === '\'') {
-			token = nextString(stream, new Context(nextString, context));
-
-		} else if (aChar === '#') {
-			stream.eatWhile(/[^ .]/);
-			token.name = 'string-2';
-
-		} else if (aChar === '$') {
-			stream.eatWhile(/[^ ]/);
-			token.name = 'string-2';
-
-		} else if (aChar === '|' && state.expectVariable) {
-			token.context = new Context(nextTemporaries, context);
-
-		} else if (/[\[\]{}()]/.test(aChar)) {
-			token.name = 'bracket';
-			token.eos = /[\[{(]/.test(aChar);
-
-			if (aChar === '[') {
-				state.indentation++;
-			} else if (aChar === ']') {
-				state.indentation = Math.max(0, state.indentation - 1);
-			}
-
-		} else if (specialChars.test(aChar)) {
-			stream.eatWhile(specialChars);
-			token.name = 'operator';
-			token.eos = aChar !== ';'; // ; cascaded message expression
-
-		} else if (/\d/.test(aChar)) {
-			stream.eatWhile(/[\w\d]/);
-			token.name = 'number';
-
-		} else if (/[\w_]/.test(aChar)) {
-			stream.eatWhile(/[\w\d_]/);
-			token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null;
-
-		} else {
-			token.eos = state.expectVariable;
-		}
-
-		return token;
-	};
-
-	var nextComment = function(stream, context) {
-		stream.eatWhile(/[^"]/);
-		return new Token('comment', stream.eat('"') ? context.parent : context, true);
-	};
-
-	var nextString = function(stream, context) {
-		stream.eatWhile(/[^']/);
-		return new Token('string', stream.eat('\'') ? context.parent : context, false);
-	};
-
-	var nextTemporaries = function(stream, context, state) {
-		var token = new Token(null, context, false);
-		var aChar = stream.next();
-
-		if (aChar === '|') {
-			token.context = context.parent;
-			token.eos = true;
-
-		} else {
-			stream.eatWhile(/[^|]/);
-			token.name = 'variable';
-		}
-
-		return token;
-	};
-
-	return {
-		startState: function() {
-			return new State;
-		},
-
-		token: function(stream, state) {
-			state.userIndent(stream.indentation());
-
-			if (stream.eatSpace()) {
-				return null;
-			}
-
-			var token = state.context.next(stream, state.context, state);
-			state.context = token.context;
-			state.expectVariable = token.eos;
-
-			state.lastToken = token;
-			return token.name;
-		},
-
-		blankLine: function(state) {
-			state.userIndent(0);
-		},
-
-		indent: function(state, textAfter) {
-			var i = state.context.next === next && textAfter && textAfter.charAt(0) === ']' ? -1 : state.userIndentationDelta;
-			return (state.indentation + i) * config.indentUnit;
-		},
-
-		electricChars: ']'
-	};
-
-});
-
-CodeMirror.defineMIME('text/x-stsrc', {name: 'smalltalk'});

+ 2 - 2
support/_st.js

@@ -9,10 +9,10 @@
  * otherwise unchanged
  */
 
-define("amber_vm/_st", ["./smalltalk", "./nil"], function (smalltalk, nil) {
+define("amber_vm/_st", ["./globals", "./nil"], function (globals, nil) {
     return function (o) {
         if (o == null) { return nil; }
         if (o.klass) { return o; }
-        return smalltalk.JSObjectProxy._on_(o);
+        return globals.JSObjectProxy._on_(o);
     };
 });

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