Browse Source

Merge branch 'master' into moka

Nicolas Petton 11 năm trước cách đây
mục cha
commit
d69c7945a2
92 tập tin đã thay đổi với 6407 bổ sung5678 xóa
  1. 67 0
      API-CHANGES.txt
  2. 94 21
      CHANGELOG
  3. 4 17
      Gruntfile.js
  4. 1 1
      bin/amber
  5. 1 1
      bin/amber.bat
  6. 2 172
      bin/amberc
  7. 1 1
      bin/amberc.bat
  8. 0 27
      bin/release.sh
  9. 0 17
      bin/setversion.sh
  10. 1 1
      bower.json
  11. 246 106
      cli/js/AmberCli.js
  12. 21 19
      cli/st/AmberCli.st
  13. 471 131
      cli/support/amber-cli.js
  14. 188 0
      cli/support/amberc-cli.js
  15. 29 21
      cli/support/amberc.js
  16. 34 0
      cli/support/release-worker.sh
  17. 9 0
      cli/support/release.sh
  18. 21 0
      cli/support/setversion.sh
  19. 17 7
      grunt/tasks/grunt-amberc.js
  20. BIN
      images/package.png
  21. 30 38
      js/Benchfib.js
  22. 112 113
      js/Canvas.js
  23. 195 97
      js/Compiler-AST.js
  24. 40 44
      js/Compiler-Core.js
  25. 4 6
      js/Compiler-Exceptions.js
  26. 219 255
      js/Compiler-IR.js
  27. 178 233
      js/Compiler-Inlining.js
  28. 160 157
      js/Compiler-Interpreter.js
  29. 113 77
      js/Compiler-Semantic.js
  30. 216 261
      js/Compiler-Tests.js
  31. 3 3
      js/Examples.js
  32. 179 203
      js/Helios-Browser.js
  33. 4 9
      js/Helios-Commands-Browser.js
  34. 4 6
      js/Helios-Commands-Core.js
  35. 4 7
      js/Helios-Commands-Tools.js
  36. 208 286
      js/Helios-Core.js
  37. 111 79
      js/Helios-Debugger.js
  38. 6 0
      js/Helios-Exceptions.js
  39. 16 24
      js/Helios-Inspector.js
  40. 32 48
      js/Helios-KeyBindings.js
  41. 34 48
      js/Helios-Layout.js
  42. 42 64
      js/Helios-References.js
  43. 4 5
      js/Helios-Workspace-Tests.js
  44. 165 190
      js/Helios-Workspace.js
  45. 176 212
      js/IDE.js
  46. 227 306
      js/Importer-Exporter.js
  47. 3 6
      js/Kernel-Announcements.js
  48. 168 219
      js/Kernel-Classes.js
  49. 137 161
      js/Kernel-Collections.js
  50. 23 28
      js/Kernel-Exceptions.js
  51. 225 104
      js/Kernel-Infrastructure.js
  52. 56 52
      js/Kernel-Methods.js
  53. 153 180
      js/Kernel-Objects.js
  54. 233 273
      js/Kernel-Tests.js
  55. 1 1
      js/Kernel-Transcript.js
  56. 52 65
      js/SUnit-Tests.js
  57. 41 51
      js/SUnit.js
  58. 10 18
      js/Spaces.js
  59. 3 3
      package.json
  60. 129 154
      st/Canvas.st
  61. 74 38
      st/Compiler-AST.st
  62. 26 26
      st/Compiler-Core.st
  63. 26 22
      st/Compiler-IR.st
  64. 23 11
      st/Compiler-Interpreter.st
  65. 17 1
      st/Compiler-Semantic.st
  66. 15 0
      st/Compiler-Tests.st
  67. 8 8
      st/Examples.st
  68. 15 6
      st/Helios-Browser.st
  69. 17 37
      st/Helios-Core.st
  70. 16 1
      st/Helios-Debugger.st
  71. 12 0
      st/Helios-Exceptions.st
  72. 5 5
      st/Helios-Inspector.st
  73. 1 1
      st/Helios-KeyBindings.st
  74. 11 22
      st/Helios-References.st
  75. 24 11
      st/Helios-Workspace.st
  76. 214 214
      st/IDE.st
  77. 62 40
      st/Importer-Exporter.st
  78. 1 1
      st/Kernel-Announcements.st
  79. 45 45
      st/Kernel-Classes.st
  80. 172 172
      st/Kernel-Collections.st
  81. 10 10
      st/Kernel-Exceptions.st
  82. 89 43
      st/Kernel-Infrastructure.st
  83. 22 18
      st/Kernel-Methods.st
  84. 115 115
      st/Kernel-Objects.st
  85. 291 126
      st/Kernel-Tests.st
  86. 1 1
      st/Kernel-Transcript.st
  87. 8 8
      st/SUnit-Tests.st
  88. 38 39
      st/SUnit.st
  89. 29 13
      support/amber.js
  90. 8 1
      support/boot.js
  91. 88 14
      test/Test.js
  92. 1 1
      test/Test.st

+ 67 - 0
API-CHANGES.txt

@@ -1,3 +1,70 @@
+0.12.0:
+
+* SmalltalkMethodContext.prototype.fillBlock() takes a third 'index' parameter
+* Existing classes moved to new KernelInfrastructure package
+* ImporterExporter
+  * are now StreamExporters
+  * aware of AMD namespaces
+  * 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:
++ InterfacingObject class
++ Interpreter class
++ DocumentFragmentTag class
++ AbstractExporter class
++ PlatformInterface class
+
+
+- Node>>extent
+- JSStream>>nextPutStatement:with:
+- Smalltalk.installSuperclass()
+- ClassReferenceNode class (now handled via VariableNode)
+
+
 0.11.0:
 
 * AnnouncementSubscription use #valuable: instead of #block: (deprecated)

+ 94 - 21
CHANGELOG

@@ -1,30 +1,103 @@
  2013 - Release 0.12.0
 ===============================
 
-Some numbers about this release:
+After 3 months of work we are pleased to announce the 0.12.0 release of Amber.
 
-*  commits
-*  committers
-* increasing the number of core committers to 
-*  unit tests added to the kernel
-*  unit tests in total
+Besides the usual bug fixes a lot of new features have emerged.
 
-Commits
-https://github.com/amber-smalltalk/amber/compare/0.11.0...0.12.0
-Issues
-https://github.com/amber-smalltalk/amber/issues?direction=desc&milestone=8&page=1&sort=updated&state=closed
+The biggest change is the switch to RequireJS to specify Amber package dependencies
+and for loading the packages as AMD modules.
+Amber is now additionally available as Bower [2] component.
+Bower is also used to manage required JavaScript libraries which don't have to be kept
+around in the repository anymore.
 
-* Helios IDE, release candidate
-* Use of require [1] to load amber packages in the browser
-* Restructuring of boot.js, use of the brickz[2] reconfigurable micro composition system
-* Enhanced REPL
+The repository layout was restructured to provide a cleaner separation of different Amber parts:
+* Smalltalk code is located in 'st'
+* Compiled Amber packages are located in 'js'
+* Supporting JavaScript code is located in 'support'
 
-[1] http://requirejs.org/
-[2] https://github.com/amber-smalltalk/brikz
+Together with the RequireJS changes the specifying their dependencies the Brickz [3]
+reconfigurable micro composition system was introduced.
+This is used for
 
-For API related changes see the file API-CHANGES.txt.
+On the Smalltalk side support has been added for writing exponential numbers of the form 2e5.
+
+Helios (the new IDE) is progressing nicely and has seen a lot of improvements.
+One of the great parts is the new stepping debugger which is also making progress.
+To try Helios, open the helios.html page or
+evaluate in any other amber page `require('amber/helpers').popupHelios()`.
+
+The last enhancements target the commandline compiler which can be used as
+`amberc` (an executable script) or as a Grunt task.
+The following features have been added:
+ * generation of shebang line (#!/usr/bin/env node)
+ * specification of target namespace (`-n` flag; `amd_namespace` option in Grunt)
+ * specification of additional library directories (`-L` flag; `library_dirs` option in Grunt)
+The following features have been removed:
+ * creation of *.deploy.js files (`-d` flag; `deploy` option in Grunt)
+ * optimization passes via Closure compiler (`-o`/`-O` flags; `closure_jar` option in Grunt)
+   The same behavior can be achieved by using specific Grunt tasks
+
+Additionally, the Grunt task now handles the -v/--verbose flag which triggers the same behavior
+as the `verbose` option which can be specified in the Gruntfile.
+
+
+Some numbers about this release (starting from 0.11.0):
+
+* 660 commits
+* 10 committers
+* 66 unit tests added
+* 152 issues were closed
+* 379 unit tests in total
+
+
+Commits: https://github.com/amber-smalltalk/amber/compare/0.11.0...0.12.0
+Issues: https://github.com/amber-smalltalk/amber/issues?direction=desc&milestone=8&page=1&sort=updated&state=closed
+
+For the most important API related changes see the file API-CHANGES.txt.
+
+
+* Installing Amber from NPM
+
+To install Amber from NPM, run
 
+    npm install amber
+
+* Installing Amber from Bower
+
+To install Amber from Bower, run
+
+    bower install amber
+
+* Migration from Amber 0.11.0
+
+First, the loading of JavaScript files must be adapted. The custom loader has been replaced with
+requirejs for loading files in the browser. New loader code is thouroughly
+explained in [4].
+
+After updating the loader part, `.st` files need to be recompiled
+into new AMD `.js` files. During loader changes, a namespace was choosen and will be needed for recompilation.
+
+Go to your directory with `.st` files and issue this from the shell:
 
+```sh
+<path-to-amber>/bin/amberc -l SUnit,Canvas -n <chosen-namespace> -D <path-for-compiled-js-files> *.st
+```
+
+In windows, use `\` as path separator, the rest is identical.
+
+The `-l SUnit,Canvas` is just a general guess, if your code depends on more (or less) non-kernel packages from amber, list them here accordingly.
+
+This migrate scenario only covers simple deployments with your project's code and amber.
+If your project is more complicated, using libraries and packages from multiple sources,
+it is hard to give general advices to migrate - you must do it library by library,
+giving each location its own namespace, and `-L` option of `amberc`
+comes handy when integrating; ask on the mailing list if problems arise.
+
+[1] http://requirejs.org/
+[2] http://bower.io/
+[3] https://github.com/amber-smalltalk/brikz
+[4] https://github.com/amber-smalltalk/amber/wiki/How-to-load-amber
 
 
 09th July 2013 - Release 0.11.0
@@ -54,7 +127,7 @@ evaluate in any other amber page `amber.loadHelios()`.
 The compiler also received some improvements, especially
 regarding message send optimisations and super sends.
 
-Here's the list of commits and closed issues: 
+Here's the list of commits and closed issues:
 https://github.com/amber-smalltalk/amber/compare/0.10.0...0.11.0
 https://github.com/amber-smalltalk/amber/issues?direction=desc&milestone=6&page=1&sort=updated&state=closed
 
@@ -65,7 +138,7 @@ branch on GitHub.
 * Installing Amber from NPM
 
 To install amber from NPM, run
-    
+
     npm install amber
 
 
@@ -169,8 +242,8 @@ Example code and ports
 - Ported ProfStef interactive tutorial, available on Amber homepage but also in examples directory.
 - Included the ESUG presentation as an example also in the examples directory.
 - Several new examples running on Node.js and webOS included, all with Makefiles.
- 
- 
+
+
 Various other things
 
 - Issue tracker on github now used as primary source, closed a bunch of reported issues.

+ 4 - 17
Gruntfile.js

@@ -53,12 +53,6 @@ module.exports = function(grunt) {
         src: ['st/Kernel-Objects.st', 'st/Kernel-Classes.st', 'st/Kernel-Methods.st', 'st/Kernel-Collections.st',
               'st/Kernel-Infrastructure.st', 'st/Kernel-Exceptions.st', 'st/Kernel-Transcript.st', 'st/Kernel-Announcements.st']
       },
-      amber_compiler: {
-        output_dir : 'js',
-        src: ['st/Importer-Exporter.st', 'st/Compiler-Exceptions.st', 'st/Compiler-Core.st', 'st/Compiler-AST.st',
-              'st/Compiler-IR.st', 'st/Compiler-Inlining.st', 'st/Compiler-Semantic.st', 'st/Compiler-Interpreter.st'],
-        output_name: 'Compiler'
-      },
       amber_canvas: {
         output_dir : 'js',
         src: ['st/Canvas.st', 'st/SUnit.st']
@@ -77,28 +71,21 @@ module.exports = function(grunt) {
         src: ['test/Test.st'],
         libraries: [
         'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
-        'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser',
+        'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser',
         'SUnit', 'Importer-Exporter',
         'Kernel-Tests', 'Compiler-Tests', 'SUnit-Tests'],
+        main_class: 'NodeTestRunner',
         output_name: 'test/amber_test_runner'
       },
-      amber_dev: {
-        src: [
-              'Compiler-Exceptions.js', 'Compiler-Core.js', 'Compiler-AST.js',
-              'Compiler-IR.js', 'Compiler-Inlining.js', 'Compiler-Semantic.js',
-              'Canvas.js', 'IDE.js', 'SUnit.js',
-              'Kernel-Tests.js', 'Compiler-Tests.js', 'SUnit-Tests.js'],
-        output_name: 'js/amber_dev'
-      },
       amber_cli: {
         output_dir: 'cli/js',
         src: ['cli/st/AmberCli.st'],
         libraries: [
             'Compiler-Exceptions', 'Compiler-Core', 'Compiler-AST',
-            'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', '@parser'
+            'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic', 'Compiler-Interpreter', 'parser'
         ],
         main_class: 'AmberCli',
-        output_name: '../../bin/amber-cli',
+        output_name: '../support/amber-cli',
         amd_namespace: 'amber_cli'
       }
     },

+ 1 - 1
bin/amber

@@ -1,2 +1,2 @@
 #!/bin/bash
-node `dirname $0`/amber-cli.js $@
+node `dirname $0`/../cli/support/amber-cli.js $@

+ 1 - 1
bin/amber.bat

@@ -1 +1 @@
-@node "%~dp0\amber-cli.js" %*
+@node "%~dp0\..\cli\support\amber-cli.js" %*

+ 2 - 172
bin/amberc

@@ -1,172 +1,2 @@
-#!/usr/bin/env node
-
-var path = require('path');
-var amberc = require('./amberc.js');
-
-// get parameters passed to the command line script
-// discard the first two parameters which are the node binary and the script name
-var parameters = process.argv.slice(2);
-
-// check if at least one parameter was passed to the script
-if (1 > parameters.length) {
-	print_usage();
-	process.exit();
-}
-
-
-// Get Amber root directory from the location of this script so that
-// we can find the st and js directories etc.
-var amber_dir = path.normalize(path.join(path.dirname(process.argv[1]), '..'));
-
-var compiler = new amberc.Compiler(amber_dir);
-
-var configuration = handle_options(parameters, amber_dir);
-
-compiler.main(configuration);
-
-
-/**
- * Process given program options and update defaults values.
- * Followed by check_for_closure_compiler() and then collect_files().
- */
-function handle_options(optionsArray, amber_dir) {
-	var programName = [];
-	var currentItem = optionsArray.shift();
-	var defaults = amberc.createDefaults(amber_dir);
-
-	while(undefined !== currentItem) {
-		switch(currentItem) {
-			case '-l':
-				defaults.load.push.apply(defaults.load, optionsArray.shift().split(','));
-				break;
-			case '-g':
-				defaults.jsGlobals.push.apply(defaults.jsGlobals, optionsArray.shift().split(','));
-				break;
-			case '-m':
-				defaults.main = optionsArray.shift();
-				break;
-			case '-M':
-				defaults.mainfile = optionsArray.shift();
-				break;
-			case '-n':
-				defaults.amd_namespace = optionsArray.shift();
-				break;
-			case '-D':
-				defaults.output_dir = optionsArray.shift();
-				break;
-			case '-s':
-				defaults.suffix = optionsArray.shift();
-				defaults.suffix_used = defaults.suffix;
-				break;
-			case '-S':
-				defaults.loadsuffix = optionsArray.shift();
-				defaults.suffix_used = defaults.suffix;
-				break;
-			case '-v':
-				defaults.verbose = true;
-				break;
-			case '-h':
-			case '--help':
-			case '?':
-				print_usage();
-				break;
-			default:
-				var fileSuffix = path.extname(currentItem);
-				switch (fileSuffix) {
-					case '.st':
-						defaults.stFiles.push(currentItem);
-						break;
-					case '.js':
-						defaults.jsFiles.push(currentItem);
-						break;
-					default:
-						// Will end up being the last non js/st argument
-						programName.push(currentItem);
-						break;
-				};
-		};
-		currentItem = optionsArray.shift();
-	}
-
-	if(1 < programName.length) {
-		throw new Error('More than one name for ProgramName given: ' + programName);
-	} else {
-		defaults.program = programName[0];
-	}
-	return defaults;
-};
-
-
-// print available flags
-function print_usage() {
-	console.log('Usage: amberc [-l lib1,lib2...] [-i init_file] [-m main_class] [-M main_file]');
-	console.log('          [-o] [-O|-A] [-d] [-s suffix] [-S suffix] [file1 [file2 ...]] [Program]');
-	console.log('');
-	console.log('   amberc compiles Amber files - either separately or into a complete runnable');
-	console.log('   program. If no .st files are listed only a linking stage is performed.');
-	console.log('   Files listed will be handled using the following rules:');
-	console.log('');
-	console.log('   *.js');
-	console.log('     Files are linked (concatenated) in listed order.');
-	console.log('     If not found we look in $AMBER/js/');
-	console.log('');
-	console.log('   *.st');
-	console.log('     Files are compiled into .js files before concatenation.');
-	console.log('     If not found we look in $AMBER/st/.');
-	console.log('');
-	console.log('     NOTE: Each .st file is currently considered to be a fileout of a single class');
-	console.log('     category of the same name as the file!');
-	console.log('');
-	console.log('   If no <Program> is specified each given .st file will be compiled into');
-	console.log('   a matching .js file. Otherwise a <Program>.js file is linked together based on');
-	console.log('   the given options:');
-	console.log('  -l library1,library2');
-	console.log('     Add listed JavaScript libraries in listed order.');
-	console.log('     Libraries are not separated by spaces or end with .js.');
-	console.log('');
-	console.log('  -g jsGlobal1,jsGlobal2');
-	console.log('     Comma separated list of JS global variable names.');
-	console.log('     The names are added to a list containing "window", "document" and others.');
-	console.log('');
-	console.log('  -m main_class');
-	console.log('     Add a call to the class method main_class>>main at the end of <Program>.');
-	console.log('');
-	console.log('  -M main_file');
-	console.log('     Add <main_file> at the end of <Program.js> acting as #main.');
-	console.log('');
-	console.log('  -n amd_namespace');
-	console.log('     Export packages with <amd_namespace> as the require.js namespace.');
-	console.log('     Default value is "amber_core".');
-	console.log('');
-	console.log('  -D');
-	console.log('     Specifies the output directory for all generated .js files.');
-	console.log('     The hierarchy of the input files is not maintaned.');
-	console.log('     If this option is omitted all generated .js files are placed next to their input files');
-	console.log('');
-	console.log('  -s suffix');
-	console.log('     Add <suffix> to compiled .js files. File.st is then compiled into');
-	console.log('     File.<suffix>.js.');
-	console.log('');
-	console.log('  -S suffix');
-	console.log('     Use <suffix> for all libraries accessed using -l. This makes it possible');
-	console.log('     to have multiple flavors of Amber and libraries in the same place.');
-	console.log('');
-	console.log('');
-	console.log('     Example invocations:');
-	console.log('');
-	console.log('     Just compile Kernel-Objects.st to Kernel-Objects.js:');
-	console.log('');
-	console.log('        amberc Kernel-Objects.st');
-	console.log('');
-	console.log('     Compile Hello.st to Hello.js and create complete program called Program.js.');
-	console.log('     Additionally add a call to the class method Hello>>main:');
-	console.log('');
-	console.log('        amberc -m Hello Hello.st Program');
-	console.log('');
-	console.log('     Compile Cat1.st and Cat2.st files into corresponding .js files.');
-	console.log('     Link them with myboot.js and myKernel.js and add myinit.js as custom');
-	console.log('     initializer file. Add main.js last which contains the startup code');
-	console.log('      and merge everything into a complete program named Program.js:');
-	console.log('');
-	console.log('        amberc -M main.js -i myinit.js myboot.js myKernel.js Cat1.st Cat2.st Program');
-};
+#!/bin/bash
+node `dirname $0`/../cli/support/amberc-cli.js $@

+ 1 - 1
bin/amberc.bat

@@ -1 +1 @@
-@node "%~dp0\amberc" %*
+@node "%~dp0\..\cli\support\amberc-cli.js" %*

+ 0 - 27
bin/release.sh

@@ -1,27 +0,0 @@
-#!/bin/sh
-cd `dirname "$0"`/..
-echo git reset --hard
-echo git checkout master
-echo -n "Which version are you going to publish [0 to skip]? "
-VER=`head -n 1`
-if [ "$VER" = "0" ]; then :; else
-	echo "Publishing version $VER"
-	bin/setversion.sh "$VER"
-	cp package.json package.json.bak
-	sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
-	rm package.json.bak
-	echo git commit -a -m "Release version $VER"
-	echo git tag -a "$VER"
-	echo bower upload
-	echo npm upload
-fi
-echo -n "Which version are you going to work on? "
-VERF=`head -n 1`
-VER="${VER}-pre"
-echo "Setting version $VER"
-bin/setversion.sh "$VER"
-cp package.json package.json.bak
-sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
-rm package.json.bak
-echo git commit -a -m "Working on $VERF"
-echo git push --tags

+ 0 - 17
bin/setversion.sh

@@ -1,17 +0,0 @@
-#!/bin/sh
-cd `dirname "$0"`
-cd ../st
-rm -f *.js
-cp Kernel-Infrastructure.st Kernel-Infrastructure.st.bak
-sed -e "/^version\$/,/^\! \!\$/ s/\^ '[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}'\$/^ '$1'/" Kernel-Infrastructure.st.bak >Kernel-Infrastructure.st
-rm Kernel-Infrastructure.st.bak
-cd ..
-bin/amberc -d -l Kernel-Objects,Kernel-Collections Kernel-Infrastructure.st
-cd st
-mv *.js ../js
-cd ..
-for F in *.json; do
-  cp $F $F.bak
-  sed -e 's/"version": "[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}"/"version": "'"$1"'"/' $F.bak >$F
-  rm $F.bak
-done

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "amber",
-  "version": "0.12.0-pre",
+  "version": "0.13.0-pre",
   "main": "support/amber.js",
   "ignore": [
     "**/.*",

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 246 - 106
cli/js/AmberCli.js


+ 21 - 19
cli/st/AmberCli.st

@@ -913,6 +913,14 @@ prompt
 
 !Repl methodsFor: 'actions'!
 
+clearScreen
+	| esc cls |
+	esc := String fromCharCode: 27.
+	cls := esc, '[2J', esc, '[0;0f'.
+	process stdout write: cls.
+	interface prompt
+!
+
 close
 	process stdin destroy
 !
@@ -936,11 +944,16 @@ eval: buffer on: anObject
 			result := Compiler new evaluateExpression: buffer on: anObject]
 		catch: [:e |
 			e isSmalltalkError
-			    ifTrue: [ErrorHandler new handleError: e]
-			    ifFalse: [process stdout write: e jsStack]]].
+			    ifTrue: [ e resignal ]
+			    ifFalse: [ process stdout write: e jsStack ]]].
 	^ result
 !
 
+printWelcome
+	Transcript show: 'Welcome to Amber version ', Smalltalk current version, ' (NodeJS ', process versions node, ').'.
+	Transcript show: 'Type :q to exit.'; cr.
+!
+
 setPrompt
 	interface setPrompt: self prompt
 ! !
@@ -983,18 +996,12 @@ assignNewVariable: buffer do: aBlock
 	^ self parseAssignment: buffer do: [ :name :expr || varName value |
 		varName := name ifNil: [self nextResultName].
 		session := self addVariableNamed: varName to: session.
-		value := self eval: varName, ' := ', (expr ifNil: [buffer]) on: session.
+		[ value := self eval: varName, ' := ', (expr ifNil: [buffer]) on: session ]
+			on: Error
+			do: [ :e | ErrorHandler new logError: e. value := nil].
 		aBlock value: varName value: value]
 !
 
-clearScreen
-	| esc cls |
-	esc := String fromCharCode: 27.
-	cls := esc, '[2J', esc, '[0;0f'.
-	process stdout write: cls.
-	interface prompt
-!
-
 encapsulateVariable: aString withValue: anObject in: aClass
 	"Add getter and setter for given variable to session."
 	| compiler |
@@ -1022,7 +1029,7 @@ instanceVariableNamesFor: aClass
 !
 
 isIdentifier: aString
-	^ aString match: '^[a-z_]\w+$' asRegexp
+	^ aString match: '^[a-z_]\w*$' asRegexp
 !
 
 isVariableDefined: aString
@@ -1047,8 +1054,8 @@ parseAssignment: aString do: aBlock
 	| assignment |
 	assignment := (aString tokenize: ':=') collect: [:s | s trimBoth].
 	^ (assignment size = 2 and: [self isIdentifier: assignment first])
-		ifTrue: [aBlock value: assignment first value: assignment last]
-		ifFalse: [aBlock value: nil value: nil]
+		ifTrue: [ aBlock value: assignment first value: assignment last ]
+		ifFalse: [ aBlock value: nil value: nil ]
 !
 
 presentResultNamed: varName withValue: value
@@ -1056,11 +1063,6 @@ presentResultNamed: varName withValue: value
 	interface prompt
 !
 
-printWelcome
-	Transcript show: 'Welcome to Amber version ', Smalltalk current version, ' (NodeJS ', process versions node, ').'.
-	Transcript show: 'Type :q to exit.'; cr.
-!
-
 processLine: buffer
 	"Processes lines entered through the readline interface."
 	| show |

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 471 - 131
cli/support/amber-cli.js


+ 188 - 0
cli/support/amberc-cli.js

@@ -0,0 +1,188 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var amberc = require('./amberc.js');
+
+// get parameters passed to the command line script
+// discard the first two parameters which are the node binary and the script name
+var parameters = process.argv.slice(2);
+
+// check if at least one parameter was passed to the script
+if (1 > parameters.length) {
+	print_usage();
+	process.exit();
+}
+
+
+// Get Amber root directory from the location of this script so that
+// we can find the st and js directories etc.
+var amber_dir = path.normalize(path.join(path.dirname(process.argv[1]), '..', '..'));
+
+var compiler = new amberc.Compiler(amber_dir);
+
+var configuration = handle_options(parameters);
+
+compiler.main(configuration);
+
+
+/**
+ * Process given program options and update defaults values.
+ * Followed by check_for_closure_compiler() and then collect_files().
+ */
+function handle_options(optionsArray) {
+	var programName = [];
+	var currentItem = optionsArray.shift();
+	var defaults = amberc.createDefaults();
+
+	while(undefined !== currentItem) {
+		switch(currentItem) {
+			case '-l':
+				defaults.load.push.apply(defaults.load, optionsArray.shift().split(','));
+				break;
+			case '-L':
+				defaults.jsLibraryDirs.push.apply(defaults.jsLibraryDirs, optionsArray.shift().split(','));
+				break;
+			case '-g':
+				defaults.jsGlobals.push.apply(defaults.jsGlobals, optionsArray.shift().split(','));
+				break;
+			case '-m':
+				defaults.main = optionsArray.shift();
+				break;
+			case '-M':
+				defaults.mainfile = optionsArray.shift();
+				break;
+			case '-n':
+				defaults.amd_namespace = optionsArray.shift();
+				break;
+			case '-D':
+				defaults.output_dir = optionsArray.shift();
+				break;
+			case '-s':
+				defaults.suffix = optionsArray.shift();
+				defaults.suffix_used = defaults.suffix;
+				break;
+			case '-S':
+				defaults.loadsuffix = optionsArray.shift();
+				defaults.suffix_used = defaults.suffix;
+				break;
+			case '-v':
+				defaults.verbose = true;
+				break;
+			case '-h':
+			case '--help':
+			case '?':
+				print_usage();
+				break;
+			default:
+				var fileSuffix = path.extname(currentItem);
+				switch (fileSuffix) {
+					case '.st':
+						defaults.stFiles.push(currentItem);
+						break;
+					case '.js':
+						defaults.jsFiles.push(currentItem);
+						break;
+					default:
+						// Will end up being the last non js/st argument
+						programName.push(currentItem);
+						break;
+				};
+		};
+		currentItem = optionsArray.shift();
+	}
+
+	if(1 < programName.length) {
+		throw new Error('More than one name for ProgramName given: ' + programName);
+	} else {
+		defaults.program = programName[0];
+	}
+	return defaults;
+};
+
+
+// print available flags
+function print_usage() {
+	var usage = [
+		'Usage: amberc [-l lib1,lib2...] [-g jsGlobal1,jsGlobla2] [-m main_class] [-M main_file]',
+		'          [-n namespace] [-D output_dir] [-v] [-s suffix] [-S suffix] [file1 [file2 ...]] [Program]',
+		'',
+		'   amberc compiles Amber files - either separately or into a complete runnable',
+		'   program. If no .st files are listed only a linking stage is performed.',
+		'   Files listed will be handled using the following rules:',
+		'',
+		'   *.js',
+		'     Files are linked (concatenated) in listed order.',
+		'     If not found we look in $AMBER/js/',
+		'',
+		'   *.st',
+		'     Files are compiled into .js files before concatenation.',
+		'     If not found we look in $AMBER/st/.',
+		'',
+		'     NOTE: Each .st file is currently considered to be a fileout of a single class',
+		'     category of the same name as the file!',
+		'',
+		'   If no <Program> is specified each given .st file will be compiled into',
+		'   a matching .js file. Otherwise a <Program>.js file is linked together based on',
+		'   the given options:',
+		'',
+		'  -l library1,library2',
+		'     Add listed JavaScript libraries in listed order.',
+		'     Libraries are not separated by spaces or end with .js.',
+		'',
+		'  -L directory1,directory2',
+		'     Add listed directories to the library search path.',
+		'     The order of processing is:',
+		'     1. current directory',
+		'     2. directories specified by -L',
+		'     3. $AMBER',
+		'',
+		'  -g jsGlobal1,jsGlobal2',
+		'     Comma separated list of JS global variable names.',
+		'     The names are added to a list containing "window", "document" and others.',
+		'',
+		'  -m main_class',
+		'     Add a call to the class method main_class>>main at the end of <Program>.',
+		'',
+		'  -M main_file',
+		'     Add <main_file> at the end of <Program.js> acting as #main.',
+		'',
+		'  -n amd_namespace',
+		'     Export packages with <amd_namespace> as the require.js namespace.',
+		'     Default value is "amber_core".',
+		'',
+		'  -v',
+		'     Produce a more verbose output.',
+		'',
+		'  -D',
+		'     Specifies the output directory for all generated .js files.',
+		'     The hierarchy of the input files is not maintaned.',
+		'     If this option is omitted all generated .js files are placed next to their input files',
+		'',
+		'  -s suffix',
+		'     Add <suffix> to compiled .js files. File.st is then compiled into',
+		'     File.<suffix>.js.',
+		'',
+		'  -S suffix',
+		'     Use <suffix> for all libraries accessed using -l. This makes it possible',
+		'     to have multiple flavors of Amber and libraries in the same place.',
+		'',
+		'',
+		'     Example invocations:',
+		'',
+		'     Just compile Kernel-Objects.st to Kernel-Objects.js:',
+		'',
+		'        amberc Kernel-Objects.st',
+		'',
+		'     Compile Hello.st to Hello.js and create complete program called Program.js.',
+		'     Additionally add a call to the class method Hello>>main:',
+		'',
+		'        amberc -m Hello Hello.st Program',
+		'',
+		'     Compile Cat1.st and Cat2.st files into corresponding .js files.',
+		'     Link them with myboot.js and myKernel.js',
+		'     and merge everything into a complete program named Program.js:',
+		'',
+		'        amberc -M main.js myboot.js myKernel.js Cat1.st Cat2.st Program',
+	];
+	usage.forEach(function (line) { console.log(line); });
+};

+ 29 - 21
bin/amberc.js → cli/support/amberc.js

@@ -126,14 +126,17 @@ var path = require('path'),
 /**
  * AmberC constructor function.
  * amber_dir: points to the location of an amber installation
- * closure_jar: location of compiler.jar (can be left undefined)
  */
 function AmberC(amber_dir) {
+	if (undefined === amber_dir || !fs.existsSync(amber_dir)) {
+		throw new Error('amber_dir needs to be a valid directory');
+	}
+
 	this.amber_dir = amber_dir;
-	this.kernel_libraries = ['@boot', '@smalltalk', '@nil', '@_st', 'Kernel-Objects', 'Kernel-Classes', 'Kernel-Methods',
+	this.kernel_libraries = ['boot', 'smalltalk', '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', 'Importer-Exporter', 'Compiler-Exceptions',
+	this.compiler_libraries = this.kernel_libraries.concat(['parser', 'Importer-Exporter', 'Compiler-Exceptions',
 							'Compiler-Core', 'Compiler-AST', 'Compiler-Exceptions', 'Compiler-IR', 'Compiler-Inlining', 'Compiler-Semantic']);
 }
 
@@ -141,11 +144,7 @@ function AmberC(amber_dir) {
 /**
  * Default values.
  */
-var createDefaults = function(amber_dir, finished_callback){
-	if (undefined === amber_dir) {
-		throw new Error('createDefaults() function needs a valid amber_dir parameter');
-	}
-
+var createDefaults = function(finished_callback){
 	return {
 		'load': [],
 		'main': undefined,
@@ -158,6 +157,7 @@ var createDefaults = function(amber_dir, finished_callback){
 		'loadsuffix': '',
 		'suffix_used': '',
 		'libraries': [],
+		'jsLibraryDirs': [],
 		'compile': [],
 		'compiled': [],
 		'program': undefined,
@@ -184,6 +184,11 @@ AmberC.prototype.main = function(configuration, finished_callback) {
 		configuration.amd_namespace = 'amber_core';
 	}
 
+	if (undefined !== configuration.jsLibraryDirs) {
+		configuration.jsLibraryDirs.push(path.join(this.amber_dir, 'js'));
+		configuration.jsLibraryDirs.push(path.join(this.amber_dir, 'support'));
+	}
+
 	console.ambercLog = console.log;
 	if (false === configuration.verbose) {
 		console.log = function() {};
@@ -213,32 +218,35 @@ AmberC.prototype.check_configuration_ok = function(configuration) {
 
 
 /**
- * Check if the file given as parameter exists in the local directory or in $AMBER/js/.
- * '.js' is appended first.
+ * Check if the file given as parameter exists in any of the following directories:
+ *  1. current local directory
+ *  2. defauls.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
  */
 AmberC.prototype.resolve_js = function(filename, callback) {
-	var special = filename[0] == "@";
-	if (special) {
-		filename = filename.slice(1);
-	}
 	var baseName = path.basename(filename, '.js');
 	var jsFile = baseName + this.defaults.loadsuffix + '.js';
-	var amberJsFile = path.join(this.amber_dir, special?'support':'js', jsFile);
+	var defaults = this.defaults;
 	console.log('Resolving: ' + jsFile);
 	fs.exists(jsFile, function(exists) {
 		if (exists) {
 			callback(jsFile);
 		} else {
-			fs.exists(amberJsFile, function(exists) {
-				if (exists) {
-					callback(amberJsFile);
-				} else {
-					throw(new Error('JavaScript file not found: ' + jsFile));
-				}
+			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));
+			}
 		}
 	});
 };

+ 34 - 0
cli/support/release-worker.sh

@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# ATTENTION: Be logged into npm before running this script,
+# as a user with write access to amber npm package.
+
+git reset --hard
+git checkout master
+git clean -d -x -f
+npm install
+echo -n "Which version are you going to publish [0 to skip]? "
+VER=`head -n 1`
+if [ "$VER" = "0" ]; then :; else
+	echo "Publishing version $VER"
+	cli/support/setversion.sh "$VER"
+	cp package.json package.json.bak
+	sed -e 's@/amber.git.*"@/amber.git#'"$VER"'"@' package.json.bak >package.json
+	rm package.json.bak
+	git add package.json
+	git commit -a -m "Release version $VER"
+	git tag -a "$VER" -m "Release version $VER"
+# bower does not publish explicitly but implictly via semver tag
+	echo npm publish
+fi
+echo -n "Which version are you going to work on? "
+VERF=`head -n 1`
+VER="${VERF}-pre"
+echo "Setting version $VER"
+cli/support/setversion.sh "$VER"
+cp package.json package.json.bak
+sed -e 's@/amber.git.*"@/amber.git"@' package.json.bak >package.json
+rm package.json.bak
+git add package.json
+git commit -a -m "Working on $VERF"
+git push --tags

+ 9 - 0
cli/support/release.sh

@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# ATTENTION: Be logged into npm before running this script,
+# as a user with write access to amber npm package.
+
+cd `dirname "$0"`
+cp release-worker.sh /tmp
+cd ../..
+exec sh /tmp/release-worker.sh

+ 21 - 0
cli/support/setversion.sh

@@ -0,0 +1,21 @@
+#!/bin/sh
+
+VERSION=$1
+cd `dirname "$0"`/../..
+AMBER_BASE=`pwd`
+
+cd $AMBER_BASE/st
+# replace version number
+cp Kernel-Infrastructure.st Kernel-Infrastructure.st.bak
+sed -e "/^version\$/,/^\! \!\$/ s/\^ '[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}'\$/^ '$VERSION'/" Kernel-Infrastructure.st.bak >Kernel-Infrastructure.st
+rm Kernel-Infrastructure.st.bak
+
+# compile Kernel-Infrastructure
+cd $AMBER_BASE
+bin/amberc -D js -l Kernel-Objects,Kernel-Collections st/Kernel-Infrastructure.st
+# set version in all json files (bower, npm)
+for F in *.json; do
+  cp $F $F.bak
+  sed -e 's/"version": "[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-pre\)\{0,1\}"/"version": "'"$VERSION"'"/' $F.bak >$F
+  rm $F.bak
+done

+ 17 - 7
grunt/tasks/grunt-amberc.js

@@ -2,7 +2,7 @@ module.exports = function(grunt) {
 
   var path = require('path');
   var fs = require('fs');
-  var amberc = require('../../bin/amberc.js');
+  var amberc = require('../../cli/support/amberc.js');
 
   /**
      A full example entry for a Gruntfile.js is available below.
@@ -15,11 +15,15 @@ module.exports = function(grunt) {
 
      amberc: {
        options: {
-         amber_dir: process.cwd(),     // REQUIRED
-         verbose: true                 // optional
+         amber_dir: process.cwd(),                // REQUIRED
+         library_dirs: ['dir1', '/usr/local/js'], // optional
+         verbose: true                            // optional
        },
        helloWorld: {
-         options: {                             // the 'options' object is optional
+         // this 'options' object is optional as well as all parameters inside it
+         // they can be used to override the global 'options'
+         options: {
+           library_dirs: ['dir1', '/usr/local/js'], // optional
            verbose: true
          },
          src: ['projects/HelloWorld/st/HelloWorld.st'], // REQUIRED
@@ -42,9 +46,11 @@ module.exports = function(grunt) {
 
     var options = this.options({
       amber_dir: undefined,
+      library_dirs: [],
       verbose: grunt.option('verbose') || false
     });
     this.data.verbose = options.verbose;
+    this.data.library_dirs = options.library_dirs;
 
     // mark required properties
     this.requiresConfig('amberc.options.amber_dir');
@@ -57,7 +63,7 @@ module.exports = function(grunt) {
     var compiler = new amberc.Compiler(grunt.config('amberc.options.amber_dir'));
 
     // generate the amberc configuration out of the given target properties
-    var configuration = generateCompilerConfiguration(this.data, this.filesSrc, grunt.config('amberc.options.amber_dir'));
+    var configuration = generateCompilerConfiguration(this.data, this.filesSrc);
 
     // run the compiler and call the async callback once finished
     var self = this;
@@ -68,14 +74,18 @@ module.exports = function(grunt) {
   });
 
 
-  function generateCompilerConfiguration(data, sourceFiles, amber_dir) {
-    var configuration = amberc.createDefaults(amber_dir);
+  function generateCompilerConfiguration(data, sourceFiles) {
+    var configuration = amberc.createDefaults();
     var parameters = [];
 
     var libraries = data.libraries;
     if (undefined !== libraries) {
       configuration.load = libraries;
     }
+    var library_dirs = data.library_dirs;
+    if (undefined !== library_dirs) {
+      configuration.jsLibraryDirs = library_dirs;
+    }
     var mainClass = data.main_class;
     if (undefined !== mainClass) {
       configuration.main = mainClass;

BIN
images/package.png


+ 30 - 38
js/Benchfib.js

@@ -29,7 +29,7 @@ category: '*Benchfib',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$5,$4,$7,$6,$3,$1;
+var $2,$5,$4,$3,$1;
 $2=self.__lt((2));
 if(smalltalk.assert($2)){
 $1=(1);
@@ -38,9 +38,7 @@ $5=self.__minus((1));
 $ctx1.sendIdx["-"]=1;
 $4=_st($5)._benchFib();
 $ctx1.sendIdx["benchFib"]=1;
-$7=self.__minus((2));
-$6=_st($7)._benchFib();
-$3=_st($4).__plus($6);
+$3=_st($4).__plus(_st(self.__minus((2)))._benchFib());
 $1=_st($3).__plus((1));
 $ctx1.sendIdx["+"]=1;
 };
@@ -62,9 +60,9 @@ var self=this;
 var size,flags,prime,k,count;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
+var $1,$2;
 size=(8190);
-$1=(1)._to_do_(self,(function(iter){
+(1)._to_do_(self,(function(iter){
 return smalltalk.withContext(function($ctx2) {
 count=(0);
 count;
@@ -76,8 +74,8 @@ return _st(flags)._add_(true);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 return (1)._to_do_(size,(function(i){
 return smalltalk.withContext(function($ctx3) {
-$2=_st(flags)._at_(i);
-if(smalltalk.assert($2)){
+$1=_st(flags)._at_(i);
+if(smalltalk.assert($1)){
 prime=_st(i).__plus((1));
 $ctx3.sendIdx["+"]=1;
 prime;
@@ -100,8 +98,8 @@ return count;
 }, function($ctx3) {$ctx3.fillBlock({i:i},$ctx2,3)})}));
 }, function($ctx2) {$ctx2.fillBlock({iter:iter},$ctx1,1)})}));
 $ctx1.sendIdx["to:do:"]=1;
-$3=count;
-return $3;
+$2=count;
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count},smalltalk.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",
@@ -175,9 +173,9 @@ var self=this;
 var t1,t2,r,n1,n2;
 function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$9,$8,$7,$6,$5,$12,$11,$10,$4,$3;
+var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
-$1=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 t1=_st($Date())._millisecondsToRun_((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -195,7 +193,7 @@ return n1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
 $ctx1.sendIdx["whileTrue:"]=1;
 n2=(28);
-$2=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 t2=_st($Date())._millisecondsToRun_((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -209,23 +207,20 @@ return smalltalk.withContext(function($ctx2) {
 n2=_st(n2).__plus((1));
 return n2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
-$9=_st(n1).__star((500000));
+$7=_st(n1).__star((500000));
 $ctx1.sendIdx["*"]=3;
-$8=_st($9).__star((1000));
+$6=_st($7).__star((1000));
 $ctx1.sendIdx["*"]=2;
-$7=_st($8).__slash(t1);
+$5=_st($6).__slash(t1);
 $ctx1.sendIdx["/"]=1;
-$6=_st($7)._printString();
+$4=_st($5)._printString();
 $ctx1.sendIdx["printString"]=1;
-$5=_st($6).__comma(" bytecodes/sec; ");
-$12=_st(r).__star((1000));
-$11=_st($12).__slash(t2);
-$10=_st($11)._printString();
-$4=_st($5).__comma($10);
+$3=_st($4).__comma(" bytecodes/sec; ");
+$2=_st($3).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString());
 $ctx1.sendIdx[","]=2;
-$3=_st($4).__comma(" sends/sec");
+$1=_st($2).__comma(" sends/sec");
 $ctx1.sendIdx[","]=1;
-return $3;
+return $1;
 }, function($ctx1) {$ctx1.fill(self,"jstinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.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'",
@@ -243,9 +238,9 @@ var self=this;
 var t1,t2,r,n1,n2;
 function $Date(){return smalltalk.Date||(typeof Date=="undefined"?nil:Date)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$9,$8,$7,$6,$5,$12,$11,$10,$4,$3;
+var $7,$6,$5,$4,$3,$2,$1;
 n1=(1);
-$1=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 t1=_st($Date())._millisecondsToRun_((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -263,7 +258,7 @@ return n1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
 $ctx1.sendIdx["whileTrue:"]=1;
 n2=(16);
-$2=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 t2=_st($Date())._millisecondsToRun_((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -277,23 +272,20 @@ return smalltalk.withContext(function($ctx2) {
 n2=_st(n2).__plus((1));
 return n2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
-$9=_st(n1).__star((500000));
+$7=_st(n1).__star((500000));
 $ctx1.sendIdx["*"]=3;
-$8=_st($9).__star((1000));
+$6=_st($7).__star((1000));
 $ctx1.sendIdx["*"]=2;
-$7=_st($8).__slash(t1);
+$5=_st($6).__slash(t1);
 $ctx1.sendIdx["/"]=1;
-$6=_st($7)._printString();
+$4=_st($5)._printString();
 $ctx1.sendIdx["printString"]=1;
-$5=_st($6).__comma(" bytecodes/sec; ");
-$12=_st(r).__star((1000));
-$11=_st($12).__slash(t2);
-$10=_st($11)._printString();
-$4=_st($5).__comma($10);
+$3=_st($4).__comma(" bytecodes/sec; ");
+$2=_st($3).__comma(_st(_st(_st(r).__star((1000))).__slash(t2))._printString());
 $ctx1.sendIdx[","]=2;
-$3=_st($4).__comma(" sends/sec");
+$1=_st($2).__comma(" sends/sec");
 $ctx1.sendIdx[","]=1;
-return $3;
+return $1;
 }, function($ctx1) {$ctx1.fill(self,"tinyBenchmarks",{t1:t1,t2:t2,r:r,n1:n1,n2:n2},smalltalk.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'",

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 112 - 113
js/Canvas.js


+ 195 - 97
js/Compiler-AST.js

@@ -65,7 +65,7 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.Node)})},
 args: [],
-source: "isBlockNode\x0a\x09^false",
+source: "isBlockNode\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -81,7 +81,7 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.Node)})},
 args: [],
-source: "isBlockSequenceNode\x0a\x09^false",
+source: "isBlockSequenceNode\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -113,7 +113,7 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.Node)})},
 args: [],
-source: "isImmutable\x0a\x09^false",
+source: "isImmutable\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -169,6 +169,31 @@ referencedClasses: []
 }),
 smalltalk.Node);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isReferenced",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $4,$3,$2,$1;
+$4=self._parent();
+$ctx1.sendIdx["parent"]=1;
+$3=_st($4)._isSequenceNode();
+$2=_st($3)._or_((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(self._parent())._isAssignmentNode();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+$1=_st($2)._not();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isReferenced",{},smalltalk.Node)})},
+args: [],
+source: "isReferenced\x0a\x09\x22Answer true if the receiver is referenced by other nodes.\x0a\x09Do not take sequences or assignments into account\x22\x0a\x09\x0a\x09^ (self parent isSequenceNode or: [\x0a\x09\x09self parent isAssignmentNode ]) not",
+messageSends: ["not", "or:", "isSequenceNode", "parent", "isAssignmentNode"],
+referencedClasses: []
+}),
+smalltalk.Node);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isReturnNode",
@@ -179,7 +204,7 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isReturnNode",{},smalltalk.Node)})},
 args: [],
-source: "isReturnNode\x0a\x09^false",
+source: "isReturnNode\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -195,7 +220,23 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isSendNode",{},smalltalk.Node)})},
 args: [],
-source: "isSendNode\x0a\x09^false",
+source: "isSendNode\x0a\x09^ false",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Node);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isSequenceNode",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return false;
+}, function($ctx1) {$ctx1.fill(self,"isSequenceNode",{},smalltalk.Node)})},
+args: [],
+source: "isSequenceNode\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -211,7 +252,23 @@ return smalltalk.withContext(function($ctx1) {
 return false;
 }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.Node)})},
 args: [],
-source: "isValueNode\x0a\x09^false",
+source: "isValueNode\x0a\x09^ false",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Node);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isVariableNode",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return false;
+}, function($ctx1) {$ctx1.fill(self,"isVariableNode",{},smalltalk.Node)})},
+args: [],
+source: "isVariableNode\x0a\x09^ false",
 messageSends: [],
 referencedClasses: []
 }),
@@ -249,16 +306,14 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$5,$4,$1;
+var $3,$2,$1;
 $3=self._nodes();
 $ctx1.sendIdx["nodes"]=1;
 $2=_st($3)._isEmpty();
 if(smalltalk.assert($2)){
 $1=self;
 } else {
-$5=self._nodes();
-$4=_st($5)._first();
-$1=_st($4)._nextChild();
+$1=_st(_st(self._nodes())._first())._nextChild();
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"nextChild",{},smalltalk.Node)})},
@@ -302,20 +357,17 @@ fn: function (aNode){
 var self=this;
 var next;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2,$5;
+var $1,$2;
 var $early={};
 try {
 $1=self._nodes();
 $ctx1.sendIdx["nodes"]=1;
-$4=self._nodes();
-$3=_st($4)._indexOf_(aNode);
-$2=_st($3).__plus((1));
-next=_st($1)._at_ifAbsent_($2,(function(){
+next=_st($1)._at_ifAbsent_(_st(_st(self._nodes())._indexOf_(aNode)).__plus((1)),(function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$5=_st(next)._nextChild();
-return $5;
+$2=_st(next)._nextChild();
+return $2;
 }
 catch(e) {if(e===$early)return e[0]; throw e}
 }, function($ctx1) {$ctx1.fill(self,"nextNode:",{aNode:aNode,next:next},smalltalk.Node)})},
@@ -345,7 +397,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.Node)})},
 args: [],
-source: "nodes\x0a\x09^nodes ifNil: [nodes := Array new]",
+source: "nodes\x0a\x09^ nodes ifNil: [ nodes := Array new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: ["Array"]
 }),
@@ -572,12 +624,11 @@ category: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=_st(self._shouldBeAliased())._or_((function(){
+var $1;
+$1=_st(_st(self._shouldBeAliased())._or_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._shouldBeInlined();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$1=_st($2)._or_((function(){
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._or_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(self._nodes())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx3) {
@@ -591,7 +642,7 @@ $ctx1.sendIdx["or:"]=1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"subtreeNeedsAliasing",{},smalltalk.Node)})},
 args: [],
-source: "subtreeNeedsAliasing\x0a\x09^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a\x09\x09(self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]",
+source: "subtreeNeedsAliasing\x0a\x09^ (self shouldBeAliased or: [ self shouldBeInlined ]) or: [\x0a\x09\x09(self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]",
 messageSends: ["or:", "shouldBeAliased", "shouldBeInlined", "~=", "detect:ifNone:", "nodes", "subtreeNeedsAliasing"],
 referencedClasses: []
 }),
@@ -647,7 +698,7 @@ $1=self["@left"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"left",{},smalltalk.AssignmentNode)})},
 args: [],
-source: "left\x0a\x09^left",
+source: "left\x0a\x09^ left",
 messageSends: [],
 referencedClasses: []
 }),
@@ -701,7 +752,7 @@ $1=self["@right"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"right",{},smalltalk.AssignmentNode)})},
 args: [],
-source: "right\x0a\x09^right",
+source: "right\x0a\x09^ right",
 messageSends: [],
 referencedClasses: []
 }),
@@ -724,6 +775,27 @@ referencedClasses: []
 }),
 smalltalk.AssignmentNode);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "shouldBeAliased",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(smalltalk.AssignmentNode.superclass.fn.prototype._shouldBeAliased.apply(_st(self), []))._or_((function(){
+return smalltalk.withContext(function($ctx2) {
+return self._isReferenced();
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},smalltalk.AssignmentNode)})},
+args: [],
+source: "shouldBeAliased\x0a\x09^ super shouldBeAliased or: [ self isReferenced ]",
+messageSends: ["or:", "shouldBeAliased", "isReferenced"],
+referencedClasses: []
+}),
+smalltalk.AssignmentNode);
+
 
 
 smalltalk.addClass('BlockNode', smalltalk.Node, ['parameters', 'scope'], 'Compiler-AST');
@@ -756,7 +828,7 @@ return smalltalk.withContext(function($ctx1) {
 return true;
 }, function($ctx1) {$ctx1.fill(self,"isBlockNode",{},smalltalk.BlockNode)})},
 args: [],
-source: "isBlockNode\x0a\x09^true",
+source: "isBlockNode\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
@@ -813,7 +885,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"parameters",{},smalltalk.BlockNode)})},
 args: [],
-source: "parameters\x0a\x09^parameters ifNil: [parameters := Array new]",
+source: "parameters\x0a\x09^ parameters ifNil: [ parameters := Array new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: ["Array"]
 }),
@@ -940,7 +1012,7 @@ $1=self["@receiver"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.CascadeNode)})},
 args: [],
-source: "receiver\x0a\x09^receiver",
+source: "receiver\x0a\x09^ receiver",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1061,7 +1133,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.JSStatementNode)})},
 args: [],
-source: "source\x0a\x09^source ifNil: ['']",
+source: "source\x0a\x09^ source ifNil: [ '' ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -1122,7 +1194,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.MethodNode)})},
 args: [],
-source: "arguments\x0a\x09^arguments ifNil: [#()]",
+source: "arguments\x0a\x09^ arguments ifNil: [ #() ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -1185,19 +1257,14 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$9,$8,$7,$6,$5,$1;
+var $4,$3,$2,$1;
 $4=self._source();
 $ctx1.sendIdx["source"]=1;
 $3=_st($4)._lines();
 $ctx1.sendIdx["lines"]=1;
 $2=_st($3)._size();
 $ctx1.sendIdx["size"]=1;
-$9=self._source();
-$8=_st($9)._lines();
-$7=_st($8)._last();
-$6=_st($7)._size();
-$5=_st($6).__plus((1));
-$1=_st($2).__at($5);
+$1=_st($2).__at(_st(_st(_st(_st(self._source())._lines())._last())._size()).__plus((1)));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"extent",{},smalltalk.MethodNode)})},
 args: [],
@@ -1287,7 +1354,7 @@ $1=self["@selector"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.MethodNode)})},
 args: [],
-source: "selector\x0a\x09^selector",
+source: "selector\x0a\x09^ selector",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1355,7 +1422,7 @@ $1=self["@source"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.MethodNode)})},
 args: [],
-source: "source\x0a\x09^source",
+source: "source\x0a\x09^ source",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1541,7 +1608,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.SendNode)})},
 args: [],
-source: "arguments\x0a\x09^arguments ifNil: [arguments := #()]",
+source: "arguments\x0a\x09^ arguments ifNil: [ arguments := #() ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -1594,7 +1661,7 @@ $3=$5;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"cascadeNodeWithMessages:",{aCollection:aCollection,first:first},smalltalk.SendNode)})},
 args: ["aCollection"],
-source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself.\x0a\x09^CascadeNode new\x0a\x09\x09receiver: self receiver;\x0a\x09\x09nodes: (Array with: first), aCollection;\x0a\x09\x09yourself",
+source: "cascadeNodeWithMessages: aCollection\x0a\x09| first |\x0a\x09first := SendNode new\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself.\x0a\x09^ CascadeNode new\x0a\x09\x09receiver: self receiver;\x0a\x09\x09nodes: (Array with: first), aCollection;\x0a\x09\x09yourself",
 messageSends: ["selector:", "new", "selector", "arguments:", "arguments", "yourself", "receiver:", "receiver", "nodes:", ",", "with:"],
 referencedClasses: ["SendNode", "CascadeNode", "Array"]
 }),
@@ -1676,7 +1743,7 @@ fn: function (){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$6,$7,$5,$8,$9,$10,$4;
+var $1,$3,$2,$5,$6,$4;
 $1=self._receiver();
 $ctx1.sendIdx["receiver"]=1;
 if(($receiver = $1) == nil || $receiver == null){
@@ -1687,14 +1754,10 @@ return $2;
 } else {
 $1;
 };
-$6=$Array();
-$7=self._receiver();
-$5=_st($6)._with_($7);
-$8=$5;
-$9=self._arguments();
-_st($8)._addAll_($9);
-$10=_st($5)._yourself();
-$4=$10;
+$5=_st($Array())._with_(self._receiver());
+_st($5)._addAll_(self._arguments());
+$6=_st($5)._yourself();
+$4=$6;
 return $4;
 }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.SendNode)})},
 args: [],
@@ -1716,7 +1779,7 @@ $1=self["@receiver"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SendNode)})},
 args: [],
-source: "receiver\x0a\x09^receiver",
+source: "receiver\x0a\x09^ receiver",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1755,7 +1818,7 @@ $1=self["@selector"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.SendNode)})},
 args: [],
-source: "selector\x0a\x09^selector",
+source: "selector\x0a\x09^ selector",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1783,17 +1846,26 @@ selector: "shouldBeAliased",
 category: 'testing',
 fn: function (){
 var self=this;
+var sends;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
+sends=_st(_st(_st(self._method())._sendIndexes())._at_(self._selector()))._size();
 $1=_st(smalltalk.SendNode.superclass.fn.prototype._shouldBeAliased.apply(_st(self), []))._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(_st(self._method())._sendIndexes())._at_(self._selector()))._size()).__gt((1));
+return _st(_st(_st(sends).__gt((1)))._and_((function(){
+return smalltalk.withContext(function($ctx3) {
+return _st(self._index()).__lt(sends);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._and_((function(){
+return smalltalk.withContext(function($ctx3) {
+return self._isReferenced();
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
+$ctx2.sendIdx["and:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{},smalltalk.SendNode)})},
+}, function($ctx1) {$ctx1.fill(self,"shouldBeAliased",{sends:sends},smalltalk.SendNode)})},
 args: [],
-source: "shouldBeAliased\x0a\x09^ super shouldBeAliased or: [\x0a\x09\x09(self method sendIndexes at: self selector) size > 1 ]",
-messageSends: ["or:", "shouldBeAliased", ">", "size", "at:", "sendIndexes", "method", "selector"],
+source: "shouldBeAliased\x0a\x09\x22Because we keep track of send indexes, some send nodes need additional care for aliasing. \x0a\x09See IRJSVisitor >> visitIRSend:\x22\x0a\x09\x0a\x09| sends |\x0a\x09\x0a\x09sends := (self method sendIndexes at: self selector) size.\x0a\x09\x0a\x09^ super shouldBeAliased or: [\x0a\x09\x09(sends > 1 and: [ self index < sends ]) and: [ self isReferenced ] ]",
+messageSends: ["size", "at:", "sendIndexes", "method", "selector", "or:", "shouldBeAliased", "and:", ">", "<", "index", "isReferenced"],
 referencedClasses: []
 }),
 smalltalk.SendNode);
@@ -1861,7 +1933,7 @@ fn: function (anObject){
 var self=this;
 function $SendNode(){return smalltalk.SendNode||(typeof SendNode=="undefined"?nil:SendNode)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$6,$4,$7,$1;
+var $2,$3,$5,$4,$6,$1;
 $2=_st($SendNode())._new();
 _st($2)._position_(self._position());
 $3=$2;
@@ -1870,18 +1942,17 @@ $ctx1.sendIdx["receiver"]=1;
 if(($receiver = $5) == nil || $receiver == null){
 $4=anObject;
 } else {
-$6=self._receiver();
-$4=_st($6)._valueForReceiver_(anObject);
+$4=_st(self._receiver())._valueForReceiver_(anObject);
 };
 _st($3)._receiver_($4);
 _st($2)._selector_(self._selector());
 _st($2)._arguments_(self._arguments());
-$7=_st($2)._yourself();
-$1=$7;
+$6=_st($2)._yourself();
+$1=$6;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"valueForReceiver:",{anObject:anObject},smalltalk.SendNode)})},
 args: ["anObject"],
-source: "valueForReceiver: anObject\x0a\x09^SendNode new\x0a\x09\x09position: self position;\x0a\x09\x09receiver: (self receiver\x0a\x09\x09ifNil: [anObject]\x0a\x09\x09ifNotNil: [self receiver valueForReceiver: anObject]);\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself",
+source: "valueForReceiver: anObject\x0a\x09^ SendNode new\x0a\x09\x09position: self position;\x0a\x09\x09receiver: (self receiver\x0a\x09\x09ifNil: [ anObject ] \x0a\x09\x09ifNotNil: [ self receiver valueForReceiver: anObject ]);\x0a\x09\x09selector: self selector;\x0a\x09\x09arguments: self arguments;\x0a\x09\x09yourself",
 messageSends: ["position:", "new", "position", "receiver:", "ifNil:ifNotNil:", "receiver", "valueForReceiver:", "selector:", "selector", "arguments:", "arguments", "yourself"],
 referencedClasses: ["SendNode"]
 }),
@@ -1912,7 +1983,7 @@ smalltalk.SequenceNode);
 smalltalk.addMethod(
 smalltalk.method({
 selector: "asBlockSequenceNode",
-category: 'testing',
+category: 'converting',
 fn: function (){
 var self=this;
 function $BlockSequenceNode(){return smalltalk.BlockSequenceNode||(typeof BlockSequenceNode=="undefined"?nil:BlockSequenceNode)}
@@ -1927,12 +1998,28 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asBlockSequenceNode",{},smalltalk.SequenceNode)})},
 args: [],
-source: "asBlockSequenceNode\x0a\x09^BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09nodes: self nodes;\x0a\x09\x09temps: self temps;\x0a\x09\x09yourself",
+source: "asBlockSequenceNode\x0a\x09^ BlockSequenceNode new\x0a\x09\x09position: self position;\x0a\x09\x09nodes: self nodes;\x0a\x09\x09temps: self temps;\x0a\x09\x09yourself",
 messageSends: ["position:", "new", "position", "nodes:", "nodes", "temps:", "temps", "yourself"],
 referencedClasses: ["BlockSequenceNode"]
 }),
 smalltalk.SequenceNode);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isSequenceNode",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"isSequenceNode",{},smalltalk.SequenceNode)})},
+args: [],
+source: "isSequenceNode\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.SequenceNode);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "scope",
@@ -1984,7 +2071,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"temps",{},smalltalk.SequenceNode)})},
 args: [],
-source: "temps\x0a\x09^temps ifNil: [#()]",
+source: "temps\x0a\x09^ temps ifNil: [ #() ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -2038,7 +2125,7 @@ return smalltalk.withContext(function($ctx1) {
 return true;
 }, function($ctx1) {$ctx1.fill(self,"isBlockSequenceNode",{},smalltalk.BlockSequenceNode)})},
 args: [],
-source: "isBlockSequenceNode\x0a\x09^true",
+source: "isBlockSequenceNode\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2094,7 +2181,7 @@ return smalltalk.withContext(function($ctx1) {
 return true;
 }, function($ctx1) {$ctx1.fill(self,"isValueNode",{},smalltalk.ValueNode)})},
 args: [],
-source: "isValueNode\x0a\x09^true",
+source: "isValueNode\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2112,7 +2199,7 @@ $1=self["@value"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.ValueNode)})},
 args: [],
-source: "value\x0a\x09^value",
+source: "value\x0a\x09^ value",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2134,27 +2221,6 @@ referencedClasses: []
 }),
 smalltalk.ValueNode);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "xxxDoIt",
-category: 'xxxDoIt',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return self._stack();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._value();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"xxxDoIt",{},smalltalk.ValueNode)})},
-args: [],
-source: "xxxDoIt ^[self stack] value",
-messageSends: ["value", "stack"],
-referencedClasses: []
-}),
-smalltalk.ValueNode);
-
 
 
 smalltalk.addClass('VariableNode', smalltalk.ValueNode, ['assigned', 'binding'], 'Compiler-AST');
@@ -2212,7 +2278,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"assigned",{},smalltalk.VariableNode)})},
 args: [],
-source: "assigned\x0a\x09^assigned ifNil: [false]",
+source: "assigned\x0a\x09^ assigned ifNil: [ false ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -2285,6 +2351,24 @@ referencedClasses: []
 }),
 smalltalk.VariableNode);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isArgument",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._binding())._isArgVar();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"isArgument",{},smalltalk.VariableNode)})},
+args: [],
+source: "isArgument\x0a\x09^ self binding isArgVar",
+messageSends: ["isArgVar", "binding"],
+referencedClasses: []
+}),
+smalltalk.VariableNode);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isImmutable",
@@ -2293,12 +2377,28 @@ fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._binding())._isPseudoVar();
+$1=_st(self._binding())._isImmutable();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.VariableNode)})},
 args: [],
-source: "isImmutable\x0a\x09^ self binding isPseudoVar",
-messageSends: ["isPseudoVar", "binding"],
+source: "isImmutable\x0a\x09^ self binding isImmutable",
+messageSends: ["isImmutable", "binding"],
+referencedClasses: []
+}),
+smalltalk.VariableNode);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isVariableNode",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"isVariableNode",{},smalltalk.VariableNode)})},
+args: [],
+source: "isVariableNode\x0a\x09^ true",
+messageSends: [],
 referencedClasses: []
 }),
 smalltalk.VariableNode);
@@ -2328,16 +2428,14 @@ fn: function (){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
+var $1,$2;
 $1=self._source();
 $ctx1.sendIdx["source"]=1;
 _st($1)._ifEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._error_("Method source is empty");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$3=_st($Smalltalk())._current();
-$4=self._source();
-$2=_st($3)._parse_($4);
+$2=_st(_st($Smalltalk())._current())._parse_(self._source());
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"ast",{},smalltalk.CompiledMethod)})},
 args: [],

+ 40 - 44
js/Compiler-Core.js

@@ -28,7 +28,7 @@ $1=_st(aClass)._name();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"classNameFor:",{aClass:aClass},smalltalk.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]]",
+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: []
 }),
@@ -62,7 +62,7 @@ $1=self["@currentClass"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.AbstractCodeGenerator)})},
 args: [],
-source: "currentClass\x0a\x09^currentClass",
+source: "currentClass\x0a\x09^ currentClass",
 messageSends: [],
 referencedClasses: []
 }),
@@ -121,7 +121,7 @@ $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]",
+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"]
 }),
@@ -144,7 +144,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.AbstractCodeGenerator)})},
 args: [],
-source: "source\x0a\x09^source ifNil: ['']",
+source: "source\x0a\x09^ source ifNil: [ '' ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -178,17 +178,17 @@ fn: function (aNode){
 var self=this;
 var ir,stream;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
-$1=_st(self._semanticAnalyzer())._visit_(aNode);
+var $2,$3,$1;
+_st(self._semanticAnalyzer())._visit_(aNode);
 $ctx1.sendIdx["visit:"]=1;
 ir=_st(self._translator())._visit_(aNode);
 $ctx1.sendIdx["visit:"]=2;
-$3=self._irTranslator();
-_st($3)._currentClass_(self._currentClass());
-_st($3)._visit_(ir);
-$4=_st($3)._contents();
-$2=$4;
-return $2;
+$2=self._irTranslator();
+_st($2)._currentClass_(self._currentClass());
+_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)})},
 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",
@@ -280,7 +280,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.Compiler)})},
 args: [],
-source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [InliningCodeGenerator]",
+source: "codeGeneratorClass\x0a\x09^ codeGeneratorClass ifNil: [ InliningCodeGenerator ]",
 messageSends: ["ifNil:"],
 referencedClasses: ["InliningCodeGenerator"]
 }),
@@ -314,7 +314,7 @@ $1=self._compileNode_(self._parse_(aString));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"compile:",{aString:aString},smalltalk.Compiler)})},
 args: ["aString"],
-source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)",
+source: "compile: aString\x0a\x09^ self compileNode: (self parse: aString)",
 messageSends: ["compileNode:", "parse:"],
 referencedClasses: []
 }),
@@ -334,7 +334,7 @@ $1=self._compile_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"compile:forClass:",{aString:aString,aClass:aClass},smalltalk.Compiler)})},
 args: ["aString", "aClass"],
-source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString",
+source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^ self compile: aString",
 messageSends: ["currentClass:", "source:", "compile:"],
 referencedClasses: []
 }),
@@ -348,17 +348,16 @@ fn: function (aString){
 var self=this;
 function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
+var $1,$2;
 self._currentClass_($DoIt());
-$2="doIt ^[".__comma(aString);
-$1=_st($2).__comma("] value");
+$1=_st("doIt ^ [ ".__comma(aString)).__comma(" ] value");
 $ctx1.sendIdx[","]=1;
 self._source_($1);
-$3=self._compileNode_(self._parse_(self._source()));
-return $3;
+$2=self._compileNode_(self._parse_(self._source()));
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"compileExpression:",{aString:aString},smalltalk.Compiler)})},
 args: ["aString"],
-source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)",
+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"]
 }),
@@ -371,17 +370,16 @@ category: 'compiling',
 fn: function (aString,anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
+var $1,$2;
 self._currentClass_(_st(anObject)._class());
-$2="xxxDoIt ^[".__comma(aString);
-$1=_st($2).__comma("] value");
+$1=_st("xxxDoIt ^ [ ".__comma(aString)).__comma(" ] value");
 $ctx1.sendIdx[","]=1;
 self._source_($1);
-$3=self._compileNode_(self._parse_(self._source()));
-return $3;
+$2=self._compileNode_(self._parse_(self._source()));
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"compileExpression:on:",{aString:aString,anObject:anObject},smalltalk.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)",
+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: []
 }),
@@ -406,7 +404,7 @@ $3=result;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"compileNode:",{aNode:aNode,generator:generator,result:result},smalltalk.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",
+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: []
 }),
@@ -424,7 +422,7 @@ $1=self["@currentClass"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"currentClass",{},smalltalk.Compiler)})},
 args: [],
-source: "currentClass\x0a\x09^currentClass",
+source: "currentClass\x0a\x09^ currentClass",
 messageSends: [],
 referencedClasses: []
 }),
@@ -489,20 +487,19 @@ fn: function (aString,anObject){
 var self=this;
 var result,method;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1,$2;
 method=self._eval_(self._compileExpression_on_(aString,anObject));
 _st(method)._category_("xxxDoIt");
 $1=_st(anObject)._class();
 $ctx1.sendIdx["class"]=1;
 _st($1)._addCompiledMethod_(method);
 result=_st(anObject)._xxxDoIt();
-$2=_st(anObject)._class();
-_st($2)._removeCompiledMethod_(method);
-$3=result;
-return $3;
+_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)})},
 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",
+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:"],
 referencedClasses: []
 }),
@@ -540,7 +537,7 @@ $1=_st(_st($Smalltalk())._current())._parse_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString},smalltalk.Compiler)})},
 args: ["aString"],
-source: "parse: aString\x0a\x09^Smalltalk current parse: aString",
+source: "parse: aString\x0a\x09^ Smalltalk current parse: aString",
 messageSends: ["parse:", "current"],
 referencedClasses: ["Smalltalk"]
 }),
@@ -553,15 +550,14 @@ category: 'compiling',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1;
-$3="doIt ^[".__comma(aString);
-$2=_st($3).__comma("] value");
+var $2,$1;
+$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)})},
 args: ["aString"],
-source: "parseExpression: aString\x0a\x09^self parse: 'doIt ^[', aString, '] value'",
+source: "parseExpression: aString\x0a\x09^ self parse: 'doIt ^ [ ', aString, ' ] value'",
 messageSends: ["parse:", ","],
 referencedClasses: []
 }),
@@ -605,7 +601,7 @@ 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)})},
 args: [],
-source: "recompileAll\x0a\x09Smalltalk current classes \x0a\x09\x09do: [:each | self recompile: each ]\x0a\x09\x09displayingProgress: 'Compiling all classes...'",
+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:"],
 referencedClasses: ["Smalltalk"]
 }),
@@ -628,7 +624,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Compiler)})},
 args: [],
-source: "source\x0a\x09^source ifNil: ['']",
+source: "source\x0a\x09^ source ifNil: [ '' ]",
 messageSends: ["ifNil:"],
 referencedClasses: []
 }),
@@ -662,7 +658,7 @@ $1=self["@unknownVariables"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"unknownVariables",{},smalltalk.Compiler)})},
 args: [],
-source: "unknownVariables\x0a\x09^unknownVariables",
+source: "unknownVariables\x0a\x09^ unknownVariables",
 messageSends: [],
 referencedClasses: []
 }),
@@ -715,7 +711,7 @@ return self._recompile_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"recompileAll",{},smalltalk.Compiler.klass)})},
 args: [],
-source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]",
+source: "recompileAll\x0a\x09Smalltalk current classes do: [ :each |\x0a\x09\x09self recompile: each ]",
 messageSends: ["do:", "classes", "current", "recompile:"],
 referencedClasses: ["Smalltalk"]
 }),

+ 4 - 6
js/Compiler-Exceptions.js

@@ -83,9 +83,8 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2="Variable shadowing error: ".__comma(self._variableName());
-$1=_st($2).__comma(" is already defined");
+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)})},
@@ -141,9 +140,8 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2="Unknown Variable error: ".__comma(self._variableName());
-$1=_st($2).__comma(" is not defined");
+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)})},

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 219 - 255
js/Compiler-IR.js


+ 178 - 233
js/Compiler-Inlining.js

@@ -341,7 +341,7 @@ category: 'testing',
 fn: function (anIRAssignment){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$6,$5,$1;
+var $4,$3,$2,$1;
 $1=_st(_st(_st(anIRAssignment)._isInlined())._not())._and_((function(){
 return smalltalk.withContext(function($ctx2) {
 $4=_st(anIRAssignment)._instructions();
@@ -351,9 +351,7 @@ $ctx2.sendIdx["last"]=1;
 $2=_st($3)._isSend();
 return _st($2)._and_((function(){
 return smalltalk.withContext(function($ctx3) {
-$6=_st(anIRAssignment)._instructions();
-$5=_st($6)._last();
-return self._shouldInlineSend_($5);
+return self._shouldInlineSend_(_st(_st(anIRAssignment)._instructions())._last());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["and:"]=1;
@@ -373,7 +371,7 @@ category: 'testing',
 fn: function (anIRReturn){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$6,$5,$1;
+var $4,$3,$2,$1;
 $1=_st(_st(_st(anIRReturn)._isInlined())._not())._and_((function(){
 return smalltalk.withContext(function($ctx2) {
 $4=_st(anIRReturn)._instructions();
@@ -383,9 +381,7 @@ $ctx2.sendIdx["first"]=1;
 $2=_st($3)._isSend();
 return _st($2)._and_((function(){
 return smalltalk.withContext(function($ctx3) {
-$6=_st(anIRReturn)._instructions();
-$5=_st($6)._first();
-return self._shouldInlineSend_($5);
+return self._shouldInlineSend_(_st(_st(anIRReturn)._instructions())._first());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["and:"]=1;
@@ -429,7 +425,7 @@ var self=this;
 var localReturn;
 function $IRReturn(){return smalltalk.IRReturn||(typeof IRReturn=="undefined"?nil:IRReturn)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$5,$6,$7,$8,$9,$10,$11;
+var $2,$1,$4,$3,$5,$6,$7,$8,$9;
 $2=_st(anIRNonLocalReturn)._scope();
 $ctx1.sendIdx["scope"]=1;
 $1=_st($2)._canInlineNonLocalReturns();
@@ -441,22 +437,20 @@ $5=_st(anIRNonLocalReturn)._scope();
 $ctx1.sendIdx["scope"]=3;
 _st($3)._removeNonLocalReturn_($5);
 $6=_st($IRReturn())._new();
-$7=$6;
-$8=_st(anIRNonLocalReturn)._scope();
-_st($7)._scope_($8);
-$9=_st($6)._yourself();
-localReturn=$9;
+_st($6)._scope_(_st(anIRNonLocalReturn)._scope());
+$7=_st($6)._yourself();
+localReturn=$7;
 localReturn;
 _st(_st(anIRNonLocalReturn)._instructions())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(localReturn)._add_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 _st(anIRNonLocalReturn)._replaceWith_(localReturn);
-$10=localReturn;
-return $10;
+$8=localReturn;
+return $8;
 };
-$11=smalltalk.IRInliner.superclass.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
-return $11;
+$9=smalltalk.IRInliner.superclass.fn.prototype._visitIRNonLocalReturn_.apply(_st(self), [anIRNonLocalReturn]);
+return $9;
 }, function($ctx1) {$ctx1.fill(self,"transformNonLocalReturn:",{anIRNonLocalReturn:anIRNonLocalReturn,localReturn:localReturn},smalltalk.IRInliner)})},
 args: ["anIRNonLocalReturn"],
 source: "transformNonLocalReturn: anIRNonLocalReturn\x0a\x09\x22Replace a non local return into a local return\x22\x0a\x0a\x09| localReturn |\x0a\x09anIRNonLocalReturn scope canInlineNonLocalReturns ifTrue: [\x0a\x09\x09anIRNonLocalReturn scope methodScope removeNonLocalReturn: anIRNonLocalReturn scope.\x0a\x09\x09localReturn := IRReturn new\x0a\x09\x09\x09scope: anIRNonLocalReturn scope;\x0a\x09\x09\x09yourself.\x0a\x09\x09anIRNonLocalReturn instructions do: [ :each |\x0a\x09\x09\x09localReturn add: each ].\x0a\x09\x09anIRNonLocalReturn replaceWith: localReturn.\x0a\x09\x09^ localReturn ].\x0a\x09^ super visitIRNonLocalReturn: anIRNonLocalReturn",
@@ -602,7 +596,7 @@ category: 'visiting',
 fn: function (anIRInlinedIfFalse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6;
+var $1,$2,$4,$3;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutIf_with_((function(){
@@ -616,13 +610,10 @@ $ctx2.sendIdx["instructions"]=1;
 $3=_st($4)._first();
 self._visit_($3);
 $ctx2.sendIdx["visit:"]=1;
-$5=self._stream();
-return _st($5)._nextPutAll_(")");
+return _st(self._stream())._nextPutAll_(")");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$7=_st(anIRInlinedIfFalse)._instructions();
-$6=_st($7)._last();
-return self._visit_($6);
+return self._visit_(_st(_st(anIRInlinedIfFalse)._instructions())._last());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfFalse:",{anIRInlinedIfFalse:anIRInlinedIfFalse},smalltalk.IRInliningJSTranslator)})},
 args: ["anIRInlinedIfFalse"],
@@ -639,7 +630,7 @@ category: 'visiting',
 fn: function (anIRInlinedIfNil){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6;
+var $1,$2,$4,$3;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutIf_with_((function(){
@@ -653,13 +644,10 @@ $ctx2.sendIdx["instructions"]=1;
 $3=_st($4)._first();
 self._visit_($3);
 $ctx2.sendIdx["visit:"]=1;
-$5=self._stream();
-return _st($5)._nextPutAll_(") == nil || $receiver == null");
+return _st(self._stream())._nextPutAll_(") == nil || $receiver == null");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$7=_st(anIRInlinedIfNil)._instructions();
-$6=_st($7)._last();
-return self._visit_($6);
+return self._visit_(_st(_st(anIRInlinedIfNil)._instructions())._last());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNil:",{anIRInlinedIfNil:anIRInlinedIfNil},smalltalk.IRInliningJSTranslator)})},
 args: ["anIRInlinedIfNil"],
@@ -676,7 +664,7 @@ category: 'visiting',
 fn: function (anIRInlinedIfNilIfNotNil){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6,$9,$8;
+var $1,$2,$4,$3,$6,$5;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutIfElse_with_with_((function(){
@@ -690,20 +678,17 @@ $ctx2.sendIdx["instructions"]=1;
 $3=_st($4)._first();
 self._visit_($3);
 $ctx2.sendIdx["visit:"]=1;
-$5=self._stream();
-return _st($5)._nextPutAll_(") == nil || $receiver == null");
+return _st(self._stream())._nextPutAll_(") == nil || $receiver == null");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$7=_st(anIRInlinedIfNilIfNotNil)._instructions();
+$6=_st(anIRInlinedIfNilIfNotNil)._instructions();
 $ctx2.sendIdx["instructions"]=2;
-$6=_st($7)._second();
-return self._visit_($6);
+$5=_st($6)._second();
+return self._visit_($5);
 $ctx2.sendIdx["visit:"]=2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$9=_st(anIRInlinedIfNilIfNotNil)._instructions();
-$8=_st($9)._third();
-return self._visit_($8);
+return self._visit_(_st(_st(anIRInlinedIfNilIfNotNil)._instructions())._third());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfNilIfNotNil:",{anIRInlinedIfNilIfNotNil:anIRInlinedIfNilIfNotNil},smalltalk.IRInliningJSTranslator)})},
 args: ["anIRInlinedIfNilIfNotNil"],
@@ -720,7 +705,7 @@ category: 'visiting',
 fn: function (anIRInlinedIfTrue){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6;
+var $1,$2,$4,$3;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutIf_with_((function(){
@@ -734,13 +719,10 @@ $ctx2.sendIdx["instructions"]=1;
 $3=_st($4)._first();
 self._visit_($3);
 $ctx2.sendIdx["visit:"]=1;
-$5=self._stream();
-return _st($5)._nextPutAll_(")");
+return _st(self._stream())._nextPutAll_(")");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$7=_st(anIRInlinedIfTrue)._instructions();
-$6=_st($7)._last();
-return self._visit_($6);
+return self._visit_(_st(_st(anIRInlinedIfTrue)._instructions())._last());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrue:",{anIRInlinedIfTrue:anIRInlinedIfTrue},smalltalk.IRInliningJSTranslator)})},
 args: ["anIRInlinedIfTrue"],
@@ -757,7 +739,7 @@ category: 'visiting',
 fn: function (anIRInlinedIfTrueIfFalse){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6,$9,$8;
+var $1,$2,$4,$3,$6,$5;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutIfElse_with_with_((function(){
@@ -771,20 +753,17 @@ $ctx2.sendIdx["instructions"]=1;
 $3=_st($4)._first();
 self._visit_($3);
 $ctx2.sendIdx["visit:"]=1;
-$5=self._stream();
-return _st($5)._nextPutAll_(")");
+return _st(self._stream())._nextPutAll_(")");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$7=_st(anIRInlinedIfTrueIfFalse)._instructions();
+$6=_st(anIRInlinedIfTrueIfFalse)._instructions();
 $ctx2.sendIdx["instructions"]=2;
-$6=_st($7)._second();
-return self._visit_($6);
+$5=_st($6)._second();
+return self._visit_($5);
 $ctx2.sendIdx["visit:"]=2;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$9=_st(anIRInlinedIfTrueIfFalse)._instructions();
-$8=_st($9)._third();
-return self._visit_($8);
+return self._visit_(_st(_st(anIRInlinedIfTrueIfFalse)._instructions())._third());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedIfTrueIfFalse:",{anIRInlinedIfTrueIfFalse:anIRInlinedIfTrueIfFalse},smalltalk.IRInliningJSTranslator)})},
 args: ["anIRInlinedIfTrueIfFalse"],
@@ -801,15 +780,14 @@ category: 'visiting',
 fn: function (anIRInlinedReturn){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 $1=self._stream();
 $ctx1.sendIdx["stream"]=1;
 _st($1)._nextPutStatementWith_((function(){
 return smalltalk.withContext(function($ctx2) {
 return self._visit_(_st(_st(anIRInlinedReturn)._instructions())._last());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$2=self._stream();
-_st($2)._nextPutNonLocalReturnWith_((function(){
+_st(self._stream())._nextPutNonLocalReturnWith_((function(){
 return smalltalk.withContext(function($ctx2) {
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"visitIRInlinedNonLocalReturn:",{anIRInlinedReturn:anIRInlinedReturn},smalltalk.IRInliningJSTranslator)})},
@@ -909,24 +887,23 @@ function $IRInlinedIfNilIfNotNil(){return smalltalk.IRInlinedIfNilIfNotNil||(typ
 function $IRClosure(){return smalltalk.IRClosure||(typeof IRClosure=="undefined"?nil:IRClosure)}
 function $IRBlockSequence(){return smalltalk.IRBlockSequence||(typeof IRBlockSequence=="undefined"?nil:IRBlockSequence)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$6,$8,$9,$7,$10,$4,$1;
+var $2,$4,$5,$7,$8,$6,$9,$3,$1;
 $2=_st($IRInlinedIfNilIfNotNil())._new();
 $ctx1.sendIdx["new"]=1;
-$3=anIRInstruction;
-$5=_st($IRClosure())._new();
+$4=_st($IRClosure())._new();
 $ctx1.sendIdx["new"]=2;
-_st($5)._scope_(_st(_st(anIRInstruction)._scope())._copy());
-$6=$5;
-$8=_st($IRBlockSequence())._new();
-_st($8)._add_(_st(_st(self._send())._instructions())._first());
-$9=_st($8)._yourself();
+_st($4)._scope_(_st(_st(anIRInstruction)._scope())._copy());
+$5=$4;
+$7=_st($IRBlockSequence())._new();
+_st($7)._add_(_st(_st(self._send())._instructions())._first());
+$8=_st($7)._yourself();
 $ctx1.sendIdx["yourself"]=1;
-$7=$9;
-_st($6)._add_($7);
+$6=$8;
+_st($5)._add_($6);
 $ctx1.sendIdx["add:"]=1;
-$10=_st($5)._yourself();
-$4=$10;
-$1=self._inlinedSend_with_with_($2,$3,$4);
+$9=_st($4)._yourself();
+$3=$9;
+$1=self._inlinedSend_with_with_($2,anIRInstruction,$3);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ifNil:",{anIRInstruction:anIRInstruction},smalltalk.IRSendInliner)})},
 args: ["anIRInstruction"],
@@ -1060,81 +1037,79 @@ function $IRAssignment(){return smalltalk.IRAssignment||(typeof IRAssignment=="u
 function $IRVariable(){return smalltalk.IRVariable||(typeof IRVariable=="undefined"?nil:IRVariable)}
 function $AliasVar(){return smalltalk.AliasVar||(typeof AliasVar=="undefined"?nil:AliasVar)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1,$4,$6,$8,$9,$7,$10,$12,$13,$15,$17,$18,$19,$20,$16,$14,$21,$23,$25,$26,$27,$28,$24,$22,$29,$11,$5,$30,$32,$31,$35,$34,$36,$33,$37,$40,$39,$38,$41,$42,$43;
+var $1,$2,$3,$5,$6,$4,$7,$9,$10,$12,$14,$15,$16,$17,$13,$11,$18,$20,$22,$23,$21,$19,$24,$8,$26,$25,$29,$28,$30,$27,$31,$34,$33,$32,$35;
 inlinedClosure=self._inlinedClosure();
-$2=inlinedClosure;
-$3=_st(anIRClosure)._scope();
+$1=inlinedClosure;
+$2=_st(anIRClosure)._scope();
 $ctx1.sendIdx["scope"]=1;
-$1=_st($2)._scope_($3);
+_st($1)._scope_($2);
 $ctx1.sendIdx["scope:"]=1;
-$4=_st(_st(anIRClosure)._tempDeclarations())._do_((function(each){
+_st(_st(anIRClosure)._tempDeclarations())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(inlinedClosure)._add_(each);
 $ctx2.sendIdx["add:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $ctx1.sendIdx["do:"]=1;
 sequence=self._inlinedSequence();
-$5=_st(_st(anIRClosure)._arguments())._do_((function(each){
+_st(_st(anIRClosure)._arguments())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$6=inlinedClosure;
-$8=_st($IRTempDeclaration())._new();
+$3=inlinedClosure;
+$5=_st($IRTempDeclaration())._new();
 $ctx2.sendIdx["new"]=1;
-_st($8)._name_(each);
+_st($5)._name_(each);
 $ctx2.sendIdx["name:"]=1;
-$9=_st($8)._yourself();
+$6=_st($5)._yourself();
 $ctx2.sendIdx["yourself"]=1;
-$7=$9;
-_st($6)._add_($7);
+$4=$6;
+_st($3)._add_($4);
 $ctx2.sendIdx["add:"]=2;
-$10=sequence;
-$12=_st($IRAssignment())._new();
+$7=sequence;
+$9=_st($IRAssignment())._new();
 $ctx2.sendIdx["new"]=2;
-$13=$12;
-$15=_st($IRVariable())._new();
+$10=$9;
+$12=_st($IRVariable())._new();
 $ctx2.sendIdx["new"]=3;
-$17=_st($AliasVar())._new();
+$14=_st($AliasVar())._new();
 $ctx2.sendIdx["new"]=4;
-$18=$17;
-$19=_st(inlinedClosure)._scope();
+$15=$14;
+$16=_st(inlinedClosure)._scope();
 $ctx2.sendIdx["scope"]=2;
-_st($18)._scope_($19);
+_st($15)._scope_($16);
 $ctx2.sendIdx["scope:"]=2;
-_st($17)._name_(each);
+_st($14)._name_(each);
 $ctx2.sendIdx["name:"]=2;
-$20=_st($17)._yourself();
+$17=_st($14)._yourself();
 $ctx2.sendIdx["yourself"]=2;
-$16=$20;
-$14=_st($15)._variable_($16);
+$13=$17;
+$11=_st($12)._variable_($13);
 $ctx2.sendIdx["variable:"]=1;
-_st($13)._add_($14);
+_st($10)._add_($11);
 $ctx2.sendIdx["add:"]=4;
-$21=$12;
-$23=_st($IRVariable())._new();
+$18=$9;
+$20=_st($IRVariable())._new();
 $ctx2.sendIdx["new"]=5;
-$25=_st($AliasVar())._new();
-$26=$25;
-$27=_st(inlinedClosure)._scope();
-_st($26)._scope_($27);
-_st($25)._name_("$receiver");
-$28=_st($25)._yourself();
+$22=_st($AliasVar())._new();
+_st($22)._scope_(_st(inlinedClosure)._scope());
+_st($22)._name_("$receiver");
+$23=_st($22)._yourself();
 $ctx2.sendIdx["yourself"]=3;
-$24=$28;
-$22=_st($23)._variable_($24);
-_st($21)._add_($22);
+$21=$23;
+$19=_st($20)._variable_($21);
+_st($18)._add_($19);
 $ctx2.sendIdx["add:"]=5;
-$29=_st($12)._yourself();
-$11=$29;
-return _st($10)._add_($11);
+$24=_st($9)._yourself();
+$8=$24;
+return _st($7)._add_($8);
 $ctx2.sendIdx["add:"]=3;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 $ctx1.sendIdx["do:"]=2;
-$30=_st(inlinedClosure)._add_(sequence);
+_st(inlinedClosure)._add_(sequence);
 $ctx1.sendIdx["add:"]=6;
-$32=_st(anIRClosure)._instructions();
+$26=_st(anIRClosure)._instructions();
 $ctx1.sendIdx["instructions"]=2;
-$31=_st($32)._last();
+$25=_st($26)._last();
 $ctx1.sendIdx["last"]=1;
-statements=_st($31)._instructions();
+statements=_st($25)._instructions();
 $ctx1.sendIdx["instructions"]=1;
 _st(statements)._ifNotEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -1143,31 +1118,29 @@ return smalltalk.withContext(function($ctx3) {
 return _st(sequence)._add_(each);
 $ctx3.sendIdx["add:"]=7;
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,4)})}));
-$35=_st(statements)._last();
+$29=_st(statements)._last();
 $ctx2.sendIdx["last"]=2;
-$34=_st($35)._isReturn();
-$33=_st($34)._and_((function(){
+$28=_st($29)._isReturn();
+$27=_st($28)._and_((function(){
 return smalltalk.withContext(function($ctx3) {
-$36=_st(statements)._last();
+$30=_st(statements)._last();
 $ctx3.sendIdx["last"]=3;
-return _st($36)._isBlockReturn();
+return _st($30)._isBlockReturn();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
-if(smalltalk.assert($33)){
-$37=sequence;
-$40=_st(statements)._last();
+if(smalltalk.assert($27)){
+$31=sequence;
+$34=_st(statements)._last();
 $ctx2.sendIdx["last"]=4;
-$39=_st($40)._instructions();
-$38=_st($39)._first();
-return _st($37)._add_($38);
+$33=_st($34)._instructions();
+$32=_st($33)._first();
+return _st($31)._add_($32);
 $ctx2.sendIdx["add:"]=8;
 } else {
-$41=sequence;
-$42=_st(statements)._last();
-return _st($41)._add_($42);
+return _st(sequence)._add_(_st(statements)._last());
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
-$43=inlinedClosure;
-return $43;
+$35=inlinedClosure;
+return $35;
 }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,sequence:sequence,statements:statements},smalltalk.IRSendInliner)})},
 args: ["anIRClosure"],
 source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure sequence statements |\x0a\x0a\x09inlinedClosure := self inlinedClosure.\x0a\x09inlinedClosure scope: anIRClosure scope.\x0a\x0a\x09\x22Add the possible temp declarations\x22\x0a\x09anIRClosure tempDeclarations do: [ :each |\x0a\x09\x09\x09inlinedClosure add: each ].\x0a\x0a\x09\x22Add a block sequence\x22\x0a\x09sequence := self inlinedSequence.\x0a\x0a\x09\x22Map the closure arguments to the receiver of the message send\x22\x0a\x09anIRClosure arguments do: [ :each |\x0a\x09\x09inlinedClosure add: (IRTempDeclaration new name: each; yourself).\x0a\x09\x09sequence add: (IRAssignment new\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: each; yourself));\x0a\x09\x09\x09add: (IRVariable new variable: (AliasVar new scope: inlinedClosure scope; name: '$receiver'; yourself));\x0a\x09\x09\x09yourself) ].\x0a\x09\x09\x09\x0a\x09\x22To ensure the correct order of the closure instructions: first the temps then the sequence\x22\x0a\x09inlinedClosure add: sequence.\x0a\x0a\x09\x22Get all the statements\x22\x0a\x09statements := anIRClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements allButLast do: [ :each | sequence add: each ].\x0a\x0a\x09\x09\x22Inlined closures don't have implicit local returns\x22\x0a\x09\x09(statements last isReturn and: [ statements last isBlockReturn ])\x0a\x09\x09\x09ifTrue: [ sequence add: statements last instructions first ]\x0a\x09\x09\x09ifFalse: [ sequence add: statements last ] ].\x0a\x0a\x09^ inlinedClosure",
@@ -1183,15 +1156,12 @@ category: 'inlining',
 fn: function (anIRSend){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$6,$5,$4,$1;
+var $3,$2,$1;
 self._send_(anIRSend);
 $3=self._send();
 $ctx1.sendIdx["send"]=1;
 $2=_st($3)._selector();
-$6=self._send();
-$5=_st($6)._instructions();
-$4=_st($5)._allButFirst();
-$1=self._perform_withArguments_($2,$4);
+$1=self._perform_withArguments_($2,_st(_st(self._send())._instructions())._allButFirst());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"inlineSend:",{anIRSend:anIRSend},smalltalk.IRSendInliner)})},
 args: ["anIRSend"],
@@ -1228,30 +1198,26 @@ fn: function (inlinedSend,anIRInstruction){
 var self=this;
 var inlinedClosure;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$5,$6,$9,$8,$7,$10,$11,$12;
-$2=_st(anIRInstruction)._isClosure();
-if(! smalltalk.assert($2)){
-$1=self._inliningError_("Message argument should be a block");
+var $1,$2,$5,$4,$3,$6;
+$1=_st(anIRInstruction)._isClosure();
+if(! smalltalk.assert($1)){
+self._inliningError_("Message argument should be a block");
 $ctx1.sendIdx["inliningError:"]=1;
 };
-$4=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
-if(! smalltalk.assert($4)){
-$3=self._inliningError_("Inlined block should have zero argument");
+$2=_st(_st(_st(anIRInstruction)._arguments())._size()).__eq((0));
+if(! smalltalk.assert($2)){
+self._inliningError_("Inlined block should have zero argument");
 };
 inlinedClosure=_st(self._translator())._visit_(self._inlineClosure_(anIRInstruction));
-$5=inlinedSend;
-$6=$5;
-$9=self._send();
+$5=self._send();
 $ctx1.sendIdx["send"]=1;
-$8=_st($9)._instructions();
-$7=_st($8)._first();
-_st($6)._add_($7);
+$4=_st($5)._instructions();
+$3=_st($4)._first();
+_st(inlinedSend)._add_($3);
 $ctx1.sendIdx["add:"]=1;
-$10=_st($5)._add_(inlinedClosure);
-$11=self._send();
-_st($11)._replaceWith_(inlinedSend);
-$12=inlinedSend;
-return $12;
+$6=_st(inlinedSend)._add_(inlinedClosure);
+_st(self._send())._replaceWith_(inlinedSend);
+return inlinedSend;
 }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,inlinedClosure:inlinedClosure},smalltalk.IRSendInliner)})},
 args: ["inlinedSend", "anIRInstruction"],
 source: "inlinedSend: inlinedSend with: anIRInstruction\x0a\x09| inlinedClosure |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anIRInstruction arguments size = 0 ifFalse: [ self inliningError: 'Inlined block should have zero argument' ].\x0a\x0a\x09inlinedClosure := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x0a\x09^ inlinedSend",
@@ -1268,41 +1234,35 @@ fn: function (inlinedSend,anIRInstruction,anotherIRInstruction){
 var self=this;
 var inlinedClosure1,inlinedClosure2;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$5,$6,$7,$8,$9,$10,$13,$12,$11,$14,$15,$16;
-$2=_st(anIRInstruction)._isClosure();
+var $1,$2,$3,$4,$7,$6,$5,$8;
+$1=_st(anIRInstruction)._isClosure();
 $ctx1.sendIdx["isClosure"]=1;
-if(! smalltalk.assert($2)){
-$1=self._inliningError_("Message argument should be a block");
+if(! smalltalk.assert($1)){
+self._inliningError_("Message argument should be a block");
 $ctx1.sendIdx["inliningError:"]=1;
 };
-$4=_st(anotherIRInstruction)._isClosure();
-if(! smalltalk.assert($4)){
-$3=self._inliningError_("Message argument should be a block");
+$2=_st(anotherIRInstruction)._isClosure();
+if(! smalltalk.assert($2)){
+self._inliningError_("Message argument should be a block");
 };
-$5=self._translator();
+$3=self._translator();
 $ctx1.sendIdx["translator"]=1;
-$6=self._inlineClosure_(anIRInstruction);
+$4=self._inlineClosure_(anIRInstruction);
 $ctx1.sendIdx["inlineClosure:"]=1;
-inlinedClosure1=_st($5)._visit_($6);
+inlinedClosure1=_st($3)._visit_($4);
 $ctx1.sendIdx["visit:"]=1;
-$7=self._translator();
-$8=self._inlineClosure_(anotherIRInstruction);
-inlinedClosure2=_st($7)._visit_($8);
-$9=inlinedSend;
-$10=$9;
-$13=self._send();
+inlinedClosure2=_st(self._translator())._visit_(self._inlineClosure_(anotherIRInstruction));
+$7=self._send();
 $ctx1.sendIdx["send"]=1;
-$12=_st($13)._instructions();
-$11=_st($12)._first();
-_st($10)._add_($11);
+$6=_st($7)._instructions();
+$5=_st($6)._first();
+_st(inlinedSend)._add_($5);
 $ctx1.sendIdx["add:"]=1;
-_st($9)._add_(inlinedClosure1);
+_st(inlinedSend)._add_(inlinedClosure1);
 $ctx1.sendIdx["add:"]=2;
-$14=_st($9)._add_(inlinedClosure2);
-$15=self._send();
-_st($15)._replaceWith_(inlinedSend);
-$16=inlinedSend;
-return $16;
+$8=_st(inlinedSend)._add_(inlinedClosure2);
+_st(self._send())._replaceWith_(inlinedSend);
+return inlinedSend;
 }, function($ctx1) {$ctx1.fill(self,"inlinedSend:with:with:",{inlinedSend:inlinedSend,anIRInstruction:anIRInstruction,anotherIRInstruction:anotherIRInstruction,inlinedClosure1:inlinedClosure1,inlinedClosure2:inlinedClosure2},smalltalk.IRSendInliner)})},
 args: ["inlinedSend", "anIRInstruction", "anotherIRInstruction"],
 source: "inlinedSend: inlinedSend with: anIRInstruction with: anotherIRInstruction\x0a\x09| inlinedClosure1 inlinedClosure2 |\x0a\x0a\x09anIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x09anotherIRInstruction isClosure ifFalse: [ self inliningError: 'Message argument should be a block' ].\x0a\x0a\x09inlinedClosure1 := self translator visit: (self inlineClosure: anIRInstruction).\x0a\x09inlinedClosure2 := self translator visit: (self inlineClosure: anotherIRInstruction).\x0a\x0a\x09inlinedSend\x0a\x09\x09add: self send instructions first;\x0a\x09\x09add: inlinedClosure1;\x0a\x09\x09add: inlinedClosure2.\x0a\x0a\x09self send replaceWith: inlinedSend.\x0a\x09^ inlinedSend",
@@ -1441,17 +1401,17 @@ category: 'accessing',
 fn: function (anIRInstruction){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
+var $1,$2;
 var $early={};
 try {
-$2=_st(self._inlinedSelectors())._includes_(_st(anIRInstruction)._selector());
-if(! smalltalk.assert($2)){
+$1=_st(self._inlinedSelectors())._includes_(_st(anIRInstruction)._selector());
+if(! smalltalk.assert($1)){
 return false;
 };
 _st(_st(_st(anIRInstruction)._instructions())._allButFirst())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$3=_st(each)._isClosure();
-if(! smalltalk.assert($3)){
+$2=_st(each)._isClosure();
+if(! smalltalk.assert($2)){
 throw $early=[false];
 };
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
@@ -1512,7 +1472,7 @@ var self=this;
 var inlinedAssignment;
 function $IRInlinedAssignment(){return smalltalk.IRInlinedAssignment||(typeof IRInlinedAssignment=="undefined"?nil:IRInlinedAssignment)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$4;
+var $1,$2;
 self._assignment_(anIRAssignment);
 inlinedAssignment=_st($IRInlinedAssignment())._new();
 $1=_st(anIRAssignment)._instructions();
@@ -1522,11 +1482,9 @@ return smalltalk.withContext(function($ctx2) {
 return _st(inlinedAssignment)._add_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 _st(anIRAssignment)._replaceWith_(inlinedAssignment);
-$3=_st(inlinedAssignment)._instructions();
-$2=_st($3)._last();
-self._inlineSend_($2);
-$4=inlinedAssignment;
-return $4;
+self._inlineSend_(_st(_st(inlinedAssignment)._instructions())._last());
+$2=inlinedAssignment;
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"inlineAssignment:",{anIRAssignment:anIRAssignment,inlinedAssignment:inlinedAssignment},smalltalk.IRAssignmentInliner)})},
 args: ["anIRAssignment"],
 source: "inlineAssignment: anIRAssignment\x0a\x09| inlinedAssignment |\x0a\x09self assignment: anIRAssignment.\x0a\x09inlinedAssignment := IRInlinedAssignment new.\x0a\x09anIRAssignment instructions do: [ :each |\x0a\x09\x09inlinedAssignment add: each ].\x0a\x09anIRAssignment replaceWith: inlinedAssignment.\x0a\x09self inlineSend: inlinedAssignment instructions last.\x0a\x09^ inlinedAssignment",
@@ -1544,7 +1502,7 @@ var self=this;
 var inlinedClosure,statements;
 function $IRAssignment(){return smalltalk.IRAssignment||(typeof IRAssignment=="undefined"?nil:IRAssignment)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$5,$7,$8,$10,$9,$11,$13,$12,$14,$6,$15;
+var $2,$1,$4,$3,$5,$7,$8,$6,$9;
 inlinedClosure=smalltalk.IRAssignmentInliner.superclass.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
 $2=_st(inlinedClosure)._instructions();
 $ctx1.sendIdx["instructions"]=2;
@@ -1561,22 +1519,16 @@ if(smalltalk.assert($3)){
 $5=_st(statements)._last();
 $ctx2.sendIdx["last"]=3;
 $7=_st($IRAssignment())._new();
-$8=$7;
-$10=_st(self._assignment())._instructions();
-$9=_st($10)._first();
-_st($8)._add_($9);
+_st($7)._add_(_st(_st(self._assignment())._instructions())._first());
 $ctx2.sendIdx["add:"]=1;
-$11=$7;
-$13=_st(statements)._last();
-$12=_st($13)._copy();
-_st($11)._add_($12);
-$14=_st($7)._yourself();
-$6=$14;
+_st($7)._add_(_st(_st(statements)._last())._copy());
+$8=_st($7)._yourself();
+$6=$8;
 return _st($5)._replaceWith_($6);
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$15=inlinedClosure;
-return $15;
+$9=inlinedClosure;
+return $9;
 }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,inlinedClosure:inlinedClosure,statements:statements},smalltalk.IRAssignmentInliner)})},
 args: ["anIRClosure"],
 source: "inlineClosure: anIRClosure\x0a\x09| inlinedClosure statements |\x0a\x0a\x09inlinedClosure := super inlineClosure: anIRClosure.\x0a\x09statements := inlinedClosure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last canBeAssigned ifTrue: [\x0a\x09\x09\x09statements last replaceWith: (IRAssignment new\x0a\x09\x09\x09\x09add: self assignment instructions first;\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself) ] ].\x0a\x0a\x09^ inlinedClosure",
@@ -1598,33 +1550,28 @@ var self=this;
 var closure,statements;
 function $IRReturn(){return smalltalk.IRReturn||(typeof IRReturn=="undefined"?nil:IRReturn)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$5,$7,$8,$10,$9,$11,$6,$12;
+var $1,$3,$2,$4,$5,$6,$7;
 closure=smalltalk.IRReturnInliner.superclass.fn.prototype._inlineClosure_.apply(_st(self), [anIRClosure]);
-$2=_st(closure)._instructions();
-$1=_st($2)._last();
+$1=_st(_st(closure)._instructions())._last();
 $ctx1.sendIdx["last"]=1;
 statements=_st($1)._instructions();
 $ctx1.sendIdx["instructions"]=1;
 _st(statements)._ifNotEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
-$4=_st(statements)._last();
+$3=_st(statements)._last();
 $ctx2.sendIdx["last"]=2;
-$3=_st($4)._isReturn();
-if(! smalltalk.assert($3)){
-$5=_st(statements)._last();
+$2=_st($3)._isReturn();
+if(! smalltalk.assert($2)){
+$4=_st(statements)._last();
 $ctx2.sendIdx["last"]=3;
-$7=_st($IRReturn())._new();
-$8=$7;
-$10=_st(statements)._last();
-$9=_st($10)._copy();
-_st($8)._add_($9);
-$11=_st($7)._yourself();
-$6=$11;
-return _st($5)._replaceWith_($6);
+$5=_st($IRReturn())._new();
+_st($5)._add_(_st(_st(statements)._last())._copy());
+$6=_st($5)._yourself();
+return _st($4)._replaceWith_($6);
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$12=closure;
-return $12;
+$7=closure;
+return $7;
 }, function($ctx1) {$ctx1.fill(self,"inlineClosure:",{anIRClosure:anIRClosure,closure:closure,statements:statements},smalltalk.IRReturnInliner)})},
 args: ["anIRClosure"],
 source: "inlineClosure: anIRClosure\x0a\x09| closure statements |\x0a\x0a\x09closure := super inlineClosure: anIRClosure.\x0a\x09statements := closure instructions last instructions.\x0a\x09\x0a\x09statements ifNotEmpty: [\x0a\x09\x09statements last isReturn\x0a\x09\x09\x09ifFalse: [ statements last replaceWith: (IRReturn new\x0a\x09\x09\x09\x09add: statements last copy;\x0a\x09\x09\x09\x09yourself)] ].\x0a\x0a\x09^ closure",
@@ -1641,7 +1588,7 @@ fn: function (anIRReturn){
 var self=this;
 var return_;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$4;
+var $1,$2;
 return_=self._inlinedReturn();
 $1=_st(anIRReturn)._instructions();
 $ctx1.sendIdx["instructions"]=1;
@@ -1650,11 +1597,9 @@ return smalltalk.withContext(function($ctx2) {
 return _st(return_)._add_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 _st(anIRReturn)._replaceWith_(return_);
-$3=_st(return_)._instructions();
-$2=_st($3)._last();
-self._inlineSend_($2);
-$4=return_;
-return $4;
+self._inlineSend_(_st(_st(return_)._instructions())._last());
+$2=return_;
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"inlineReturn:",{anIRReturn:anIRReturn,return_:return_},smalltalk.IRReturnInliner)})},
 args: ["anIRReturn"],
 source: "inlineReturn: anIRReturn\x0a\x09| return |\x0a\x09return := self inlinedReturn.\x0a\x09anIRReturn instructions do: [ :each |\x0a\x09\x09return add: each ].\x0a\x09anIRReturn replaceWith: return.\x0a\x09self inlineSend: return instructions last.\x0a\x09^ return",
@@ -1694,19 +1639,19 @@ fn: function (aNode){
 var self=this;
 var ir,stream;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$5,$3;
-$1=_st(self._semanticAnalyzer())._visit_(aNode);
+var $2,$3,$1;
+_st(self._semanticAnalyzer())._visit_(aNode);
 $ctx1.sendIdx["visit:"]=1;
 ir=_st(self._translator())._visit_(aNode);
 $ctx1.sendIdx["visit:"]=2;
-$2=_st(self._inliner())._visit_(ir);
+_st(self._inliner())._visit_(ir);
 $ctx1.sendIdx["visit:"]=3;
-$4=self._irTranslator();
-_st($4)._currentClass_(self._currentClass());
-_st($4)._visit_(ir);
-$5=_st($4)._contents();
-$3=$5;
-return $3;
+$2=self._irTranslator();
+_st($2)._currentClass_(self._currentClass());
+_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.InliningCodeGenerator)})},
 args: ["aNode"],
 source: "compileNode: aNode\x0a\x09| ir stream |\x0a\x0a\x09self semanticAnalyzer visit: aNode.\x0a\x09ir := self translator visit: aNode.\x0a\x09self inliner visit: ir.\x0a\x0a\x09^ self irTranslator\x0a\x09\x09currentClass: self currentClass;\x0a\x09\x09visit: ir;\x0a\x09\x09contents",

+ 160 - 157
js/Compiler-Interpreter.js

@@ -184,7 +184,7 @@ fn: function (aCollection){
 var self=this;
 var context,sequenceNode;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$7,$6;
+var $1,$2,$3,$4,$5,$6;
 context=_st(self["@outerContext"])._newBlockContext();
 $1=_st(_st(_st(self["@node"])._nodes())._first())._copy();
 _st($1)._parent_(nil);
@@ -204,8 +204,7 @@ $4=_st($3)._proceed();
 $5=_st(self["@outerContext"])._interpreter();
 $ctx1.sendIdx["interpreter"]=2;
 _st($5)._setNonLocalReturnFromContext_(context);
-$7=_st(context)._interpreter();
-$6=_st($7)._pop();
+$6=_st(_st(context)._interpreter())._pop();
 return $6;
 }, function($ctx1) {$ctx1.fill(self,"valueWithPossibleArguments:",{aCollection:aCollection,context:context,sequenceNode:sequenceNode},smalltalk.AIBlockClosure)})},
 args: ["aCollection"],
@@ -238,7 +237,7 @@ referencedClasses: []
 smalltalk.AIBlockClosure.klass);
 
 
-smalltalk.addClass('AIContext', smalltalk.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'sendIndexes', 'ast', 'interpreter'], 'Compiler-Interpreter');
+smalltalk.addClass('AIContext', smalltalk.MethodContext, ['outerContext', 'innerContext', 'pc', 'locals', 'selector', 'index', 'sendIndexes', 'evaluatedSelector', 'ast', 'interpreter'], 'Compiler-Interpreter');
 smalltalk.AIContext.comment="I am like a `MethodContext`, used by the `ASTInterpreter`.\x0aUnlike a `MethodContext`, my instances are not read-only.\x0a\x0aWhen debugging, my instances are created by copying the current `MethodContext` (thisContext)";
 smalltalk.addMethod(
 smalltalk.method({
@@ -297,6 +296,40 @@ referencedClasses: []
 }),
 smalltalk.AIContext);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "evaluatedSelector",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@evaluatedSelector"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"evaluatedSelector",{},smalltalk.AIContext)})},
+args: [],
+source: "evaluatedSelector\x0a\x09^ evaluatedSelector",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.AIContext);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "evaluatedSelector:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self["@evaluatedSelector"]=aString;
+return self}, function($ctx1) {$ctx1.fill(self,"evaluatedSelector:",{aString:aString},smalltalk.AIContext)})},
+args: ["aString"],
+source: "evaluatedSelector: aString\x0a\x09evaluatedSelector := aString",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.AIContext);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "index",
@@ -344,15 +377,11 @@ fn: function (){
 var self=this;
 function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$5,$4,$2;
+var $1;
 $1=self._method();
 $ctx1.sendIdx["method"]=1;
 self["@ast"]=_st($1)._ast();
-$3=$SemanticAnalyzer();
-$5=self._method();
-$4=_st($5)._methodClass();
-$2=_st($3)._on_($4);
-_st($2)._visit_(self["@ast"]);
+_st(_st($SemanticAnalyzer())._on_(_st(self._method())._methodClass()))._visit_(self["@ast"]);
 return self}, function($ctx1) {$ctx1.fill(self,"initializeAST",{},smalltalk.AIContext)})},
 args: [],
 source: "initializeAST\x0a\x09ast := self method ast.\x0a\x09(SemanticAnalyzer on: self method methodClass)\x0a\x09\x09visit: ast",
@@ -368,39 +397,36 @@ category: 'initialization',
 fn: function (aMethodContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$6,$7,$5,$8,$9,$2;
+var $1,$2,$3,$4;
+self._evaluatedSelector_(_st(aMethodContext)._evaluatedSelector());
 self._index_(_st(aMethodContext)._index());
 self._sendIndexes_(_st(aMethodContext)._sendIndexes());
 self._receiver_(_st(aMethodContext)._receiver());
 $1=self._selector_(_st(aMethodContext)._selector());
-$3=_st(aMethodContext)._outerContext();
+$2=_st(aMethodContext)._outerContext();
 $ctx1.sendIdx["outerContext"]=1;
-if(($receiver = $3) == nil || $receiver == null){
-$2=$3;
+if(($receiver = $2) == nil || $receiver == null){
+$2;
 } else {
 var outer;
 outer=$receiver;
-$4=_st(outer)._methodContext();
-if(($receiver = $4) == nil || $receiver == null){
-$4;
+$3=_st(outer)._methodContext();
+if(($receiver = $3) == nil || $receiver == null){
+$3;
 } else {
-$6=self._class();
-$7=_st(aMethodContext)._outerContext();
-$5=_st($6)._fromMethodContext_($7);
-self._outerContext_($5);
+self._outerContext_(_st(self._class())._fromMethodContext_(_st(aMethodContext)._outerContext()));
 };
-$8=_st(aMethodContext)._locals();
+$4=_st(aMethodContext)._locals();
 $ctx1.sendIdx["locals"]=1;
-$2=_st($8)._keysAndValuesDo_((function(key,value){
+_st($4)._keysAndValuesDo_((function(key,value){
 return smalltalk.withContext(function($ctx2) {
-$9=self._locals();
-return _st($9)._at_put_(key,value);
+return _st(self._locals())._at_put_(key,value);
 }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,3)})}));
 };
 return self}, function($ctx1) {$ctx1.fill(self,"initializeFromMethodContext:",{aMethodContext:aMethodContext},smalltalk.AIContext)})},
 args: ["aMethodContext"],
-source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09sendIndexes: aMethodContext sendIndexes;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\x0a\x09aMethodContext outerContext ifNotNil: [ :outer |\x0a\x09\x09\x22If the method context is nil, the block was defined in JS, so ignore it\x22\x0a\x09\x09outer methodContext ifNotNil: [\x0a\x09\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09\x09\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09self locals at: key put: value ] ]",
-messageSends: ["index:", "index", "sendIndexes:", "sendIndexes", "receiver:", "receiver", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"],
+source: "initializeFromMethodContext: aMethodContext\x0a\x0a\x09self\x0a\x09\x09evaluatedSelector: aMethodContext evaluatedSelector;\x0a\x09\x09index: aMethodContext index;\x0a\x09\x09sendIndexes: aMethodContext sendIndexes;\x0a\x09\x09receiver: aMethodContext receiver;\x0a\x09\x09selector: aMethodContext selector.\x0a\x09\x09\x0a\x09aMethodContext outerContext ifNotNil: [ :outer |\x0a\x09\x09\x22If the method context is nil, the block was defined in JS, so ignore it\x22\x0a\x09\x09outer methodContext ifNotNil: [\x0a\x09\x09\x09self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].\x0a\x09\x09\x09aMethodContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09self locals at: key put: value ] ]",
+messageSends: ["evaluatedSelector:", "evaluatedSelector", "index:", "index", "sendIndexes:", "sendIndexes", "receiver:", "receiver", "selector:", "selector", "ifNotNil:", "outerContext", "methodContext", "outerContext:", "fromMethodContext:", "class", "keysAndValuesDo:", "locals", "at:put:"],
 referencedClasses: []
 }),
 smalltalk.AIContext);
@@ -413,27 +439,21 @@ fn: function (){
 var self=this;
 function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$5,$4,$7,$6,$3;
+var $1,$2,$3;
 $1=_st($ASTInterpreter())._new();
 _st($1)._context_(self);
 $2=_st($1)._yourself();
 self["@interpreter"]=$2;
-$5=self._innerContext();
-$ctx1.sendIdx["innerContext"]=1;
-$4=_st($5)._notNil();
-$3=_st($4)._and_((function(){
-return smalltalk.withContext(function($ctx2) {
-$7=self._innerContext();
-$6=_st($7)._isBlockContext();
-return _st($6)._not();
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-if(smalltalk.assert($3)){
+$3=self._innerContext();
+if(($receiver = $3) == nil || $receiver == null){
+$3;
+} else {
 self._setupInterpreter_(self["@interpreter"]);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"initializeInterpreter",{},smalltalk.AIContext)})},
 args: [],
-source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09yourself.\x0a\x09\x0a\x09(self innerContext notNil and: [ \x0a\x09\x09self innerContext isBlockContext not ]) ifTrue: [\x0a\x09\x09\x09self setupInterpreter: interpreter ]",
-messageSends: ["context:", "new", "yourself", "ifTrue:", "and:", "notNil", "innerContext", "not", "isBlockContext", "setupInterpreter:"],
+source: "initializeInterpreter\x0a\x09interpreter := ASTInterpreter new\x0a\x09\x09context: self;\x0a\x09\x09yourself.\x0a\x09\x0a\x09self innerContext ifNotNil: [\x0a\x09\x09self setupInterpreter: interpreter ]",
+messageSends: ["context:", "new", "yourself", "ifNotNil:", "innerContext", "setupInterpreter:"],
 referencedClasses: ["ASTInterpreter"]
 }),
 smalltalk.AIContext);
@@ -580,7 +600,7 @@ return _st(context)._localAt_ifAbsent_(aString,aBlock);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"localAt:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.AIContext)})},
 args: ["aString", "aBlock"],
-source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext \x0a\x09\x09\x09ifNotNil: [ :context | context localAt: aString ifAbsent: aBlock ]\x0a\x09\x09\x09ifNil: [aBlock value] ]",
+source: "localAt: aString ifAbsent: aBlock\x0a\x09\x22Lookup the local value up to the method context\x22\x0a\x0a\x09^ self locals at: aString ifAbsent: [ \x0a\x09\x09self outerContext \x0a\x09\x09\x09ifNotNil: [ :context | context localAt: aString ifAbsent: aBlock ]\x0a\x09\x09\x09ifNil: [ aBlock value ] ]",
 messageSends: ["at:ifAbsent:", "locals", "ifNotNil:ifNil:", "outerContext", "localAt:ifAbsent:", "value"],
 referencedClasses: []
 }),
@@ -633,7 +653,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$5,$4,$3,$7,$6,$1;
+var $2,$5,$4,$3,$1;
 $2=self._methodContext();
 $ctx1.sendIdx["methodContext"]=1;
 if(($receiver = $2) == nil || $receiver == null){
@@ -643,9 +663,7 @@ $5=self._methodContext();
 $ctx1.sendIdx["methodContext"]=2;
 $4=_st($5)._receiver();
 $3=_st($4)._class();
-$7=self._methodContext();
-$6=_st($7)._selector();
-$1=_st($3)._lookupSelector_($6);
+$1=_st($3)._lookupSelector_(_st(self._methodContext())._selector());
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.AIContext)})},
@@ -850,35 +868,28 @@ var self=this;
 var currentNode;
 function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$8,$7,$6,$10,$12,$11,$9;
+var $1,$2,$5,$4,$3;
 $1=_st($ASTPCNodeVisitor())._new();
-$2=$1;
-$4=self._innerContext();
-$ctx1.sendIdx["innerContext"]=1;
-$3=_st($4)._selector();
-_st($2)._selector_($3);
+_st($1)._selector_(self._evaluatedSelector());
 _st($1)._context_(self);
 _st($1)._visit_(self._ast());
-$5=_st($1)._currentNode();
-currentNode=$5;
+$2=_st($1)._currentNode();
+currentNode=$2;
 _st(anInterpreter)._node_(currentNode);
-$8=self._innerContext();
-$ctx1.sendIdx["innerContext"]=2;
-$7=_st($8)._arguments();
-$6=_st($7)._reversed();
-_st($6)._do_((function(each){
+$5=self._innerContext();
+$ctx1.sendIdx["innerContext"]=1;
+$4=_st($5)._arguments();
+$3=_st($4)._reversed();
+_st($3)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(anInterpreter)._push_(each);
 $ctx2.sendIdx["push:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-$10=anInterpreter;
-$12=self._innerContext();
-$11=_st($12)._receiver();
-$9=_st($10)._push_($11);
+_st(anInterpreter)._push_(_st(self._innerContext())._receiver());
 return self}, function($ctx1) {$ctx1.fill(self,"setupInterpreter:",{anInterpreter:anInterpreter,currentNode:currentNode},smalltalk.AIContext)})},
 args: ["anInterpreter"],
-source: "setupInterpreter: anInterpreter\x0a\x09| currentNode |\x0a\x09\x0a\x09\x22Retrieve the current node\x22\x0a\x09currentNode := ASTPCNodeVisitor new\x0a\x09\x09\x09selector: self innerContext selector;\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode.\x0a\x09\x0a\x09anInterpreter node: currentNode.\x0a\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
-messageSends: ["selector:", "new", "selector", "innerContext", "context:", "visit:", "ast", "currentNode", "node:", "do:", "reversed", "arguments", "push:", "receiver"],
+source: "setupInterpreter: anInterpreter\x0a\x09| currentNode |\x0a\x09\x0a\x09\x22Retrieve the current node\x22\x0a\x09currentNode := ASTPCNodeVisitor new\x0a\x09\x09\x09selector: self evaluatedSelector;\x0a\x09\x09\x09context: self;\x0a\x09\x09\x09visit: self ast;\x0a\x09\x09\x09currentNode.\x0a\x09\x0a\x09anInterpreter node: currentNode.\x0a\x0a\x09\x22Push the send args and receiver to the interpreter stack\x22\x09\x0a\x09self innerContext arguments reversed do: [ :each | \x0a\x09\x09anInterpreter push: each ].\x0a\x09\x09\x0a\x09anInterpreter push: (self innerContext receiver)",
+messageSends: ["selector:", "new", "evaluatedSelector", "context:", "visit:", "ast", "currentNode", "node:", "do:", "reversed", "arguments", "innerContext", "push:", "receiver"],
 referencedClasses: ["ASTPCNodeVisitor"]
 }),
 smalltalk.AIContext);
@@ -907,7 +918,7 @@ smalltalk.AIContext.klass);
 
 
 smalltalk.addClass('ASTDebugger', smalltalk.Object, ['interpreter', 'context'], 'Compiler-Interpreter');
-smalltalk.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTSteppingInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from a `MethodContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
+smalltalk.ASTDebugger.comment="I am a stepping debugger interface for Amber code.\x0aI internally use an instance of `ASTInterpreter` to actually step through node and interpret them.\x0a\x0aMy instances are created from an `AIContext` with `ASTDebugger class >> context:`.\x0aThey hold an `AIContext` instance internally, recursive copy of the `MethodContext`.\x0a\x0a## API\x0a\x0aUse the methods of the `'stepping'` protocol to do stepping.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "atEnd",
@@ -991,9 +1002,7 @@ fn: function (){
 var self=this;
 function $ASTInterpreter(){return smalltalk.ASTInterpreter||(typeof ASTInterpreter=="undefined"?nil:ASTInterpreter)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=$ASTInterpreter();
-return $1;
+return $ASTInterpreter();
 }, function($ctx1) {$ctx1.fill(self,"defaultInterpreterClass",{},smalltalk.ASTDebugger)})},
 args: [],
 source: "defaultInterpreterClass\x0a\x09^ ASTInterpreter",
@@ -1152,6 +1161,22 @@ referencedClasses: []
 }),
 smalltalk.ASTDebugger);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "skip",
+category: 'stepping',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._interpreter())._skip();
+return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.ASTDebugger)})},
+args: [],
+source: "skip\x0a\x09self interpreter skip",
+messageSends: ["skip", "interpreter"],
+referencedClasses: []
+}),
+smalltalk.ASTDebugger);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "stepInto",
@@ -1216,7 +1241,7 @@ category: 'private',
 fn: function (aNode,anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$4,$5,$6;
+var $1,$3,$2,$4;
 $1=_st(_st(aNode)._binding())._isInstanceVar();
 if(smalltalk.assert($1)){
 $3=self._context();
@@ -1226,9 +1251,7 @@ $4=_st(aNode)._value();
 $ctx1.sendIdx["value"]=1;
 _st($2)._instVarAt_put_($4,anObject);
 } else {
-$5=self._context();
-$6=_st(aNode)._value();
-_st($5)._localAt_put_($6,anObject);
+_st(self._context())._localAt_put_(_st(aNode)._value(),anObject);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"assign:to:",{aNode:aNode,anObject:anObject},smalltalk.ASTInterpreter)})},
 args: ["aNode", "anObject"],
@@ -1303,7 +1326,7 @@ var source,function_;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4,$5,$7,$10,$9,$8,$6;
+var $3,$2,$1,$4,$5;
 source=_st($String())._streamContents_((function(str){
 return smalltalk.withContext(function($ctx2) {
 _st(str)._nextPutAll_("(function(");
@@ -1322,21 +1345,16 @@ return smalltalk.withContext(function($ctx3) {
 return _st(str)._nextPutAll_(",");
 $ctx3.sendIdx["nextPutAll:"]=3;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-$4=str;
-_st($4)._nextPutAll_("){ return (function() {");
+_st(str)._nextPutAll_("){ return (function() {");
 $ctx2.sendIdx["nextPutAll:"]=4;
-_st($4)._nextPutAll_(aString);
+_st(str)._nextPutAll_(aString);
 $ctx2.sendIdx["nextPutAll:"]=5;
-$5=_st($4)._nextPutAll_("})() })");
-return $5;
+$4=_st(str)._nextPutAll_("})() })");
+return $4;
 }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
 function_=_st(_st($Compiler())._new())._eval_(source);
-$7=function_;
-$10=self._context();
-$9=_st($10)._locals();
-$8=_st($9)._values();
-$6=_st($7)._valueWithPossibleArguments_($8);
-return $6;
+$5=_st(function_)._valueWithPossibleArguments_(_st(_st(self._context())._locals())._values());
+return $5;
 }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,source:source,function_:function_},smalltalk.ASTInterpreter)})},
 args: ["aString"],
 source: "eval: aString\x0a\x09\x22Evaluate aString as JS source inside an JS function.\x0a\x09aString is not sandboxed.\x22\x0a\x09\x0a\x09| source function |\x0a\x09\x0a\x09source := String streamContents: [ :str |\x0a\x09\x09str nextPutAll: '(function('.\x0a\x09\x09self context locals keys\x0a\x09\x09\x09do: [ :each | str nextPutAll: each ]\x0a\x09\x09\x09separatedBy: [ str nextPutAll: ',' ].\x0a\x09\x09str\x0a\x09\x09\x09nextPutAll: '){ return (function() {';\x0a\x09\x09\x09nextPutAll: aString;\x0a\x09\x09\x09nextPutAll: '})() })' ].\x0a\x09\x09\x09\x0a\x09function := Compiler new eval: source.\x0a\x09\x0a\x09^ function valueWithPossibleArguments: self context locals values",
@@ -1502,7 +1520,7 @@ category: 'stack',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1,$2;
 var $early={};
 try {
 $1=self._stack();
@@ -1511,8 +1529,7 @@ _st($1)._ifEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[nil];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
-$3=self._stack();
-$2=_st($3)._last();
+$2=_st(self._stack())._last();
 return $2;
 }
 catch(e) {if(e===$early)return e[0]; throw e}
@@ -1561,7 +1578,7 @@ return self._step();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.ASTInterpreter)})},
 args: [],
-source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] whileFalse: [ \x0a\x09\x09self step ]",
+source: "proceed\x0a\x09\x22Eagerly evaluate the ast\x22\x0a\x09\x0a\x09[ self atEnd ] \x0a\x09\x09whileFalse: [ self step ]",
 messageSends: ["whileFalse:", "atEnd", "step"],
 referencedClasses: []
 }),
@@ -1666,35 +1683,31 @@ fn: function (aMessage,anObject,aBoolean){
 var self=this;
 var method;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$8,$7,$6,$9,$10;
+var $1,$3,$2,$4,$5,$6;
 var $early={};
 try {
-$1=aBoolean;
-if(! smalltalk.assert($1)){
-$2=_st(aMessage)._sendTo_(anObject);
-return $2;
+if(! smalltalk.assert(aBoolean)){
+$1=_st(aMessage)._sendTo_(anObject);
+return $1;
 };
-$4=_st(anObject)._class();
+$3=_st(anObject)._class();
 $ctx1.sendIdx["class"]=1;
-$3=_st($4)._superclass();
+$2=_st($3)._superclass();
 $ctx1.sendIdx["superclass"]=1;
-if(($receiver = $3) == nil || $receiver == null){
-$5=self._messageNotUnderstood_receiver_(aMessage,anObject);
+if(($receiver = $2) == nil || $receiver == null){
+$4=self._messageNotUnderstood_receiver_(aMessage,anObject);
 $ctx1.sendIdx["messageNotUnderstood:receiver:"]=1;
-return $5;
+return $4;
 } else {
-$3;
+$2;
 };
-$8=_st(anObject)._class();
-$7=_st($8)._superclass();
-$6=_st($7)._methodDictionary();
-method=_st($6)._at_ifAbsent_(_st(aMessage)._selector(),(function(){
+method=_st(_st(_st(_st(anObject)._class())._superclass())._methodDictionary())._at_ifAbsent_(_st(aMessage)._selector(),(function(){
 return smalltalk.withContext(function($ctx2) {
-$9=self._messageNotUnderstood_receiver_(aMessage,anObject);
-throw $early=[$9];
+$5=self._messageNotUnderstood_receiver_(aMessage,anObject);
+throw $early=[$5];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
-$10=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
-return $10;
+$6=_st(method)._sendTo_arguments_(anObject,_st(aMessage)._arguments());
+return $6;
 }
 catch(e) {if(e===$early)return e[0]; throw e}
 }, function($ctx1) {$ctx1.fill(self,"sendMessage:to:superSend:",{aMessage:aMessage,anObject:anObject,aBoolean:aBoolean,method:method},smalltalk.ASTInterpreter)})},
@@ -1712,16 +1725,14 @@ category: 'interpreting',
 fn: function (aContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
+var $2,$1;
 $2=_st(aContext)._interpreter();
 $ctx1.sendIdx["interpreter"]=1;
 $1=_st($2)._hasReturned();
 if(smalltalk.assert($1)){
 self["@returned"]=true;
 self["@returned"];
-$4=_st(aContext)._interpreter();
-$3=_st($4)._returnValue();
-self._returnValue_($3);
+self._returnValue_(_st(_st(aContext)._interpreter())._returnValue());
 };
 return self}, function($ctx1) {$ctx1.fill(self,"setNonLocalReturnFromContext:",{aContext:aContext},smalltalk.ASTInterpreter)})},
 args: ["aContext"],
@@ -1797,8 +1808,7 @@ category: 'interpreting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self._step();
+self._step();
 $ctx1.sendIdx["step"]=1;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -1843,10 +1853,9 @@ fn: function (aNode){
 var self=this;
 var poppedValue;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
 poppedValue=self._pop();
 $ctx1.sendIdx["pop"]=1;
-$1=self._pop();
+self._pop();
 self._push_(poppedValue);
 self._assign_to_(_st(aNode)._left(),poppedValue);
 return self}, function($ctx1) {$ctx1.fill(self,"visitAssignmentNode:",{aNode:aNode,poppedValue:poppedValue},smalltalk.ASTInterpreter)})},
@@ -1908,17 +1917,16 @@ var associations,hashedCollection;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
 associations=_st($OrderedCollection())._new();
 $ctx1.sendIdx["new"]=1;
 hashedCollection=_st($HashedCollection())._new();
-$1=_st(_st(aNode)._nodes())._do_((function(each){
+_st(_st(aNode)._nodes())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(associations)._add_(self._pop());
 $ctx2.sendIdx["add:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $ctx1.sendIdx["do:"]=1;
-$2=_st(_st(associations)._reversed())._do_((function(each){
+_st(_st(associations)._reversed())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(hashedCollection)._add_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
@@ -2040,59 +2048,56 @@ var self=this;
 function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$6,$7,$5,$4,$1,$11,$10,$13,$12,$14,$15,$16,$18,$17,$19,$20,$21,$22,$9,$8;
-$3=_st(aNode)._binding();
+var $2,$1,$5,$6,$4,$3,$8,$10,$9,$11,$12,$13,$15,$14,$16,$17,$7;
+$2=_st(aNode)._binding();
 $ctx1.sendIdx["binding"]=1;
-$2=_st($3)._isUnknownVar();
-if(smalltalk.assert($2)){
-$6=_st($PlatformInterface())._globals();
+$1=_st($2)._isUnknownVar();
+if(smalltalk.assert($1)){
+$5=_st($PlatformInterface())._globals();
 $ctx1.sendIdx["globals"]=1;
-$7=_st(aNode)._value();
+$6=_st(aNode)._value();
 $ctx1.sendIdx["value"]=1;
-$5=_st($6)._at_ifAbsent_($7,(function(){
+$4=_st($5)._at_ifAbsent_($6,(function(){
 return smalltalk.withContext(function($ctx2) {
 return self._error_("Unknown variable");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 $ctx1.sendIdx["at:ifAbsent:"]=1;
-$4=self._push_($5);
+$3=self._push_($4);
 $ctx1.sendIdx["push:"]=1;
-return $4;
+return $3;
 };
-$11=_st(aNode)._binding();
-$10=_st($11)._isInstanceVar();
-if(smalltalk.assert($10)){
-$13=self._context();
+$8=_st(_st(aNode)._binding())._isInstanceVar();
+if(smalltalk.assert($8)){
+$10=self._context();
 $ctx1.sendIdx["context"]=1;
-$12=_st($13)._receiver();
-$14=_st(aNode)._value();
+$9=_st($10)._receiver();
+$11=_st(aNode)._value();
 $ctx1.sendIdx["value"]=2;
-$9=_st($12)._instVarAt_($14);
+$7=_st($9)._instVarAt_($11);
 } else {
-$15=self._context();
-$16=_st(aNode)._value();
+$12=self._context();
+$13=_st(aNode)._value();
 $ctx1.sendIdx["value"]=3;
-$9=_st($15)._localAt_ifAbsent_($16,(function(){
+$7=_st($12)._localAt_ifAbsent_($13,(function(){
 return smalltalk.withContext(function($ctx2) {
-$18=_st(aNode)._value();
+$15=_st(aNode)._value();
 $ctx2.sendIdx["value"]=4;
-$17=_st($18)._isCapitalized();
-if(smalltalk.assert($17)){
-$19=_st($Smalltalk())._current();
-$20=_st(aNode)._value();
+$14=_st($15)._isCapitalized();
+if(smalltalk.assert($14)){
+$16=_st($Smalltalk())._current();
+$17=_st(aNode)._value();
 $ctx2.sendIdx["value"]=5;
-return _st($19)._at_ifAbsent_($20,(function(){
+return _st($16)._at_ifAbsent_($17,(function(){
 return smalltalk.withContext(function($ctx3) {
-$21=_st($PlatformInterface())._globals();
-$22=_st(aNode)._value();
-return _st($21)._at_($22);
+return _st(_st($PlatformInterface())._globals())._at_(_st(aNode)._value());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)})}));
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
 };
-$8=self._push_($9);
+self._push_($7);
 return self}, function($ctx1) {$ctx1.fill(self,"visitVariableNode:",{aNode:aNode},smalltalk.ASTInterpreter)})},
 args: ["aNode"],
-source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (PlatformInterface globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk current \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ]]]])",
+source: "visitVariableNode: aNode\x0a\x09aNode binding isUnknownVar ifTrue: [\x0a\x09\x09^ self push: (PlatformInterface globals at: aNode value ifAbsent: [ self error: 'Unknown variable' ]) ].\x0a\x09\x09\x0a\x09self push: (aNode binding isInstanceVar\x0a\x09\x09ifTrue: [ self context receiver instVarAt: aNode value ]\x0a\x09\x09ifFalse: [ self context \x0a\x09\x09\x09localAt: aNode value\x0a\x09\x09\x09ifAbsent: [\x0a\x09\x09\x09\x09aNode value isCapitalized\x0a\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09Smalltalk current \x0a\x09\x09\x09\x09\x09\x09\x09at: aNode value \x0a\x09\x09\x09\x09\x09\x09\x09ifAbsent: [ PlatformInterface globals at: aNode value ] ] ] ])",
 messageSends: ["ifTrue:", "isUnknownVar", "binding", "push:", "at:ifAbsent:", "globals", "value", "error:", "ifTrue:ifFalse:", "isInstanceVar", "instVarAt:", "receiver", "context", "localAt:ifAbsent:", "isCapitalized", "current", "at:"],
 referencedClasses: ["PlatformInterface", "Smalltalk"]
 }),
@@ -2256,7 +2261,7 @@ fn: function (aNode){
 var self=this;
 var sendIndex;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$5,$3,$7,$6,$9,$8;
+var $1,$2,$4,$3,$6,$5,$7;
 $1=self._context();
 $2=self._selector();
 $ctx1.sendIdx["selector"]=1;
@@ -2264,16 +2269,14 @@ sendIndex=_st($1)._sendIndexAt_($2);
 smalltalk.ASTPCNodeVisitor.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
 $4=self._selector();
 $ctx1.sendIdx["selector"]=2;
-$5=_st(aNode)._selector();
-$3=_st($4).__eq($5);
+$3=_st($4).__eq(_st(aNode)._selector());
 if(smalltalk.assert($3)){
-$7=self._index();
+$6=self._index();
 $ctx1.sendIdx["index"]=1;
-$6=_st($7).__lt(sendIndex);
-if(! smalltalk.assert($6)){
-$9=self._index();
-$8=_st($9).__gt(sendIndex);
-if(! smalltalk.assert($8)){
+$5=_st($6).__lt(sendIndex);
+if(! smalltalk.assert($5)){
+$7=_st(self._index()).__gt(sendIndex);
+if(! smalltalk.assert($7)){
 self["@currentNode"]=aNode;
 self["@currentNode"];
 };

+ 113 - 77
js/Compiler-Semantic.js

@@ -12,13 +12,11 @@ fn: function (aString){
 var self=this;
 function $ArgVar(){return smalltalk.ArgVar||(typeof ArgVar=="undefined"?nil:ArgVar)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1;
 $1=self._args();
 $ctx1.sendIdx["args"]=1;
 _st($1)._at_put_(aString,_st($ArgVar())._on_(aString));
-$3=self._args();
-$2=_st($3)._at_(aString);
-_st($2)._scope_(self);
+_st(_st(self._args())._at_(aString))._scope_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"addArg:",{aString:aString},smalltalk.LexicalScope)})},
 args: ["aString"],
 source: "addArg: aString\x0a\x09self args at: aString put: (ArgVar on: aString).\x0a\x09(self args at: aString) scope: self",
@@ -35,13 +33,11 @@ fn: function (aString){
 var self=this;
 function $TempVar(){return smalltalk.TempVar||(typeof TempVar=="undefined"?nil:TempVar)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1;
 $1=self._temps();
 $ctx1.sendIdx["temps"]=1;
 _st($1)._at_put_(aString,_st($TempVar())._on_(aString));
-$3=self._temps();
-$2=_st($3)._at_(aString);
-_st($2)._scope_(self);
+_st(_st(self._temps())._at_(aString))._scope_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"addTemp:",{aString:aString},smalltalk.LexicalScope)})},
 args: ["aString"],
 source: "addTemp: aString\x0a\x09self temps at: aString put: (TempVar on: aString).\x0a\x09(self temps at: aString) scope: self",
@@ -75,11 +71,10 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $2=_st(self._args())._keys();
 $ctx1.sendIdx["keys"]=1;
-$3=_st(self._temps())._keys();
-$1=_st($2).__comma($3);
+$1=_st($2).__comma(_st(self._temps())._keys());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"allVariableNames",{},smalltalk.LexicalScope)})},
 args: [],
@@ -121,7 +116,7 @@ category: 'accessing',
 fn: function (aStringOrNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$7,$1;
+var $2,$3,$4,$5,$1;
 $2=self._pseudoVars();
 $3=_st(aStringOrNode)._value();
 $ctx1.sendIdx["value"]=1;
@@ -132,9 +127,7 @@ $5=_st(aStringOrNode)._value();
 $ctx2.sendIdx["value"]=2;
 return _st($4)._at_ifAbsent_($5,(function(){
 return smalltalk.withContext(function($ctx3) {
-$6=self._temps();
-$7=_st(aStringOrNode)._value();
-return _st($6)._at_ifAbsent_($7,(function(){
+return _st(self._temps())._at_ifAbsent_(_st(aStringOrNode)._value(),(function(){
 return smalltalk.withContext(function($ctx4) {
 return nil;
 }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
@@ -270,14 +263,13 @@ category: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$4,$1;
+var $3,$2,$1;
 $3=self._instruction();
 $ctx1.sendIdx["instruction"]=1;
 $2=_st($3)._notNil();
 $1=_st($2)._and_((function(){
 return smalltalk.withContext(function($ctx2) {
-$4=self._instruction();
-return _st($4)._isInlined();
+return _st(self._instruction())._isInlined();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isInlined",{},smalltalk.LexicalScope)})},
@@ -312,7 +304,7 @@ fn: function (aNode){
 var self=this;
 var lookup;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
+var $1,$2,$3;
 lookup=self._bindingFor_(aNode);
 $1=lookup;
 if(($receiver = $1) == nil || $receiver == null){
@@ -321,15 +313,14 @@ $ctx1.sendIdx["outerScope"]=1;
 if(($receiver = $2) == nil || $receiver == null){
 lookup=$2;
 } else {
-$3=self._outerScope();
-lookup=_st($3)._lookupVariable_(aNode);
+lookup=_st(self._outerScope())._lookupVariable_(aNode);
 };
 lookup;
 } else {
 $1;
 };
-$4=lookup;
-return $4;
+$3=lookup;
+return $3;
 }, function($ctx1) {$ctx1.fill(self,"lookupVariable:",{aNode:aNode,lookup:lookup},smalltalk.LexicalScope)})},
 args: ["aNode"],
 source: "lookupVariable: aNode\x0a\x09| lookup |\x0a\x09lookup := (self bindingFor: aNode).\x0a\x09lookup ifNil: [\x0a\x09\x09lookup := self outerScope ifNotNil: [\x0a\x09\x09\x09(self outerScope lookupVariable: aNode) ]].\x0a\x09^ lookup",
@@ -345,14 +336,13 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $2=self._outerScope();
 $ctx1.sendIdx["outerScope"]=1;
 if(($receiver = $2) == nil || $receiver == null){
 $1=$2;
 } else {
-$3=self._outerScope();
-$1=_st($3)._methodScope();
+$1=_st(self._outerScope())._methodScope();
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodScope",{},smalltalk.LexicalScope)})},
@@ -456,7 +446,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$7,$6,$5;
+var $1,$2,$4,$3,$5;
 $1=self._outerScope();
 $ctx1.sendIdx["outerScope"]=1;
 if(($receiver = $1) == nil || $receiver == null){
@@ -472,9 +462,7 @@ $3=_st($4)._scopeLevel();
 $ctx1.sendIdx["scopeLevel"]=1;
 return $3;
 };
-$7=self._outerScope();
-$6=_st($7)._scopeLevel();
-$5=_st($6).__plus((1));
+$5=_st(_st(self._outerScope())._scopeLevel()).__plus((1));
 return $5;
 }, function($ctx1) {$ctx1.fill(self,"scopeLevel",{},smalltalk.LexicalScope)})},
 args: [],
@@ -521,13 +509,11 @@ fn: function (aString){
 var self=this;
 function $InstanceVar(){return smalltalk.InstanceVar||(typeof InstanceVar=="undefined"?nil:InstanceVar)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1;
 $1=self._iVars();
 $ctx1.sendIdx["iVars"]=1;
 _st($1)._at_put_(aString,_st($InstanceVar())._on_(aString));
-$3=self._iVars();
-$2=_st($3)._at_(aString);
-_st($2)._scope_(self);
+_st(_st(self._iVars())._at_(aString))._scope_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"addIVar:",{aString:aString},smalltalk.MethodLexicalScope)})},
 args: ["aString"],
 source: "addIVar: aString\x0a\x09self iVars at: aString put: (InstanceVar on: aString).\x0a\x09(self iVars at: aString) scope: self",
@@ -901,6 +887,22 @@ referencedClasses: []
 }),
 smalltalk.ScopeVar);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isImmutable",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return false;
+}, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ScopeVar)})},
+args: [],
+source: "isImmutable\x0a\x09^ false",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ScopeVar);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isInstanceVar",
@@ -1139,6 +1141,22 @@ referencedClasses: []
 }),
 smalltalk.ArgVar);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isImmutable",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ArgVar)})},
+args: [],
+source: "isImmutable\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ArgVar);
+
 
 
 smalltalk.addClass('ClassRefVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
@@ -1150,9 +1168,8 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2="$".__comma(self._name());
-$1=_st($2).__comma("()");
+var $1;
+$1=_st("$".__comma(self._name())).__comma("()");
 $ctx1.sendIdx[","]=1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"alias",{},smalltalk.ClassRefVar)})},
@@ -1179,6 +1196,22 @@ referencedClasses: []
 }),
 smalltalk.ClassRefVar);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isImmutable",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.ClassRefVar)})},
+args: [],
+source: "isImmutable\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ClassRefVar);
+
 
 
 smalltalk.addClass('InstanceVar', smalltalk.ScopeVar, [], 'Compiler-Semantic');
@@ -1190,9 +1223,8 @@ category: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2="self[\x22@".__comma(self._name());
-$1=_st($2).__comma("\x22]");
+var $1;
+$1=_st("self[\x22@".__comma(self._name())).__comma("\x22]");
 $ctx1.sendIdx[","]=1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"alias",{},smalltalk.InstanceVar)})},
@@ -1241,6 +1273,22 @@ referencedClasses: []
 }),
 smalltalk.PseudoVar);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "isImmutable",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"isImmutable",{},smalltalk.PseudoVar)})},
+args: [],
+source: "isImmutable\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.PseudoVar);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isPseudoVar",
@@ -1356,7 +1404,7 @@ var identifier;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6,$7;
+var $1,$2,$3,$4,$5;
 identifier=_st(aNode)._value();
 $ctx1.sendIdx["value"]=1;
 $1=_st(_st(_st(_st(_st($Smalltalk())._current())._globalJsVariables())._includes_(identifier))._not())._and_((function(){
@@ -1372,9 +1420,7 @@ _st($3)._variableName_($4);
 $5=_st($2)._signal();
 $5;
 } else {
-$6=_st(_st(self["@currentScope"])._methodScope())._unknownVariables();
-$7=_st(aNode)._value();
-_st($6)._add_($7);
+_st(_st(_st(self["@currentScope"])._methodScope())._unknownVariables())._add_(_st(aNode)._value());
 };
 return self}, function($ctx1) {$ctx1.fill(self,"errorUnknownVariable:",{aNode:aNode,identifier:identifier},smalltalk.SemanticAnalyzer)})},
 args: ["aNode"],
@@ -1681,15 +1727,14 @@ category: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4;
+var $3,$2,$1;
 smalltalk.SemanticAnalyzer.superclass.fn.prototype._visitCascadeNode_.apply(_st(self), [aNode]);
 $3=_st(aNode)._nodes();
 $ctx1.sendIdx["nodes"]=1;
 $2=_st($3)._first();
 $1=_st($2)._superSend();
 if(smalltalk.assert($1)){
-$4=_st(aNode)._nodes();
-_st($4)._do_((function(each){
+_st(_st(aNode)._nodes())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._superSend_(true);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
@@ -1709,29 +1754,28 @@ category: 'visiting',
 fn: function (aNode){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
+var $1;
 self._pushScope_(self._newMethodScope());
 _st(aNode)._scope_(self["@currentScope"]);
 _st(self["@currentScope"])._node_(aNode);
-$1=_st(_st(self._theClass())._allInstanceVariableNames())._do_((function(each){
+_st(_st(self._theClass())._allInstanceVariableNames())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(self["@currentScope"])._addIVar_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $ctx1.sendIdx["do:"]=1;
-$2=_st(_st(aNode)._arguments())._do_((function(each){
+_st(_st(aNode)._arguments())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 self._validateVariableScope_(each);
 return _st(self["@currentScope"])._addArg_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 smalltalk.SemanticAnalyzer.superclass.fn.prototype._visitMethodNode_.apply(_st(self), [aNode]);
-$3=aNode;
-_st($3)._classReferences_(self._classReferences());
-_st($3)._sendIndexes_(self._messageSends());
-$4=_st($3)._superSends_(_st(self._superSends())._keys());
+_st(aNode)._classReferences_(self._classReferences());
+_st(aNode)._sendIndexes_(self._messageSends());
+$1=_st(aNode)._superSends_(_st(self._superSends())._keys());
 self._popScope();
 return self}, function($ctx1) {$ctx1.fill(self,"visitMethodNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
 args: ["aNode"],
-source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [:each |\x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each |\x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode\x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09sendIndexes: self messageSends;\x0a\x09\x09superSends: self superSends keys.\x0a\x09self popScope",
+source: "visitMethodNode: aNode\x0a\x09self pushScope: self newMethodScope.\x0a\x09aNode scope: currentScope.\x0a\x09currentScope node: aNode.\x0a\x0a\x09self theClass allInstanceVariableNames do: [ :each |\x0a\x09\x09currentScope addIVar: each ].\x0a\x09aNode arguments do: [ :each |\x0a\x09\x09self validateVariableScope: each.\x0a\x09\x09currentScope addArg: each ].\x0a\x0a\x09super visitMethodNode: aNode.\x0a\x0a\x09aNode\x0a\x09\x09classReferences: self classReferences;\x0a\x09\x09sendIndexes: self messageSends;\x0a\x09\x09superSends: self superSends keys.\x0a\x09self popScope",
 messageSends: ["pushScope:", "newMethodScope", "scope:", "node:", "do:", "allInstanceVariableNames", "theClass", "addIVar:", "arguments", "validateVariableScope:", "addArg:", "visitMethodNode:", "classReferences:", "classReferences", "sendIndexes:", "messageSends", "superSends:", "keys", "superSends", "popScope"],
 referencedClasses: []
 }),
@@ -1770,7 +1814,7 @@ var self=this;
 function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
 function $IRSendInliner(){return smalltalk.IRSendInliner||(typeof IRSendInliner=="undefined"?nil:IRSendInliner)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4,$5,$6,$8,$9,$7,$11,$12,$10,$13,$15,$16,$14,$19,$20,$18,$17,$21,$24,$25,$23,$22;
+var $3,$2,$1,$4,$5,$6,$8,$9,$7,$11,$12,$10,$13,$14,$16,$17,$15;
 $3=_st(aNode)._receiver();
 $ctx1.sendIdx["receiver"]=1;
 $2=_st($3)._value();
@@ -1804,31 +1848,25 @@ $ctx1.sendIdx["selector"]=3;
 $10=_st($11)._includes_($12);
 if(smalltalk.assert($10)){
 _st(aNode)._shouldBeInlined_(true);
-$13=_st(aNode)._receiver();
-_st($13)._shouldBeAliased_(true);
+_st(_st(aNode)._receiver())._shouldBeAliased_(true);
 };
 };
-$15=self._messageSends();
+$13=self._messageSends();
 $ctx1.sendIdx["messageSends"]=1;
-$16=_st(aNode)._selector();
+$14=_st(aNode)._selector();
 $ctx1.sendIdx["selector"]=4;
-$14=_st($15)._at_ifAbsentPut_($16,(function(){
+_st($13)._at_ifAbsentPut_($14,(function(){
 return smalltalk.withContext(function($ctx2) {
 return _st($Set())._new();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
-$19=self._messageSends();
+$16=self._messageSends();
 $ctx1.sendIdx["messageSends"]=2;
-$20=_st(aNode)._selector();
+$17=_st(aNode)._selector();
 $ctx1.sendIdx["selector"]=5;
-$18=_st($19)._at_($20);
+$15=_st($16)._at_($17);
 $ctx1.sendIdx["at:"]=2;
-$17=_st($18)._add_(aNode);
-$21=aNode;
-$24=self._messageSends();
-$25=_st(aNode)._selector();
-$23=_st($24)._at_($25);
-$22=_st($23)._size();
-_st($21)._index_($22);
+_st($15)._add_(aNode);
+_st(aNode)._index_(_st(_st(self._messageSends())._at_(_st(aNode)._selector()))._size());
 smalltalk.SemanticAnalyzer.superclass.fn.prototype._visitSendNode_.apply(_st(self), [aNode]);
 return self}, function($ctx1) {$ctx1.fill(self,"visitSendNode:",{aNode:aNode},smalltalk.SemanticAnalyzer)})},
 args: ["aNode"],
@@ -1869,7 +1907,7 @@ var binding;
 function $ClassRefVar(){return smalltalk.ClassRefVar||(typeof ClassRefVar=="undefined"?nil:ClassRefVar)}
 function $UnknownVar(){return smalltalk.UnknownVar||(typeof UnknownVar=="undefined"?nil:UnknownVar)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13;
+var $1,$3,$2,$4,$5,$6,$7,$8,$9,$10,$11;
 binding=_st(self["@currentScope"])._lookupVariable_(aNode);
 $1=binding;
 if(($receiver = $1) == nil || $receiver == null){
@@ -1895,11 +1933,9 @@ _st($8)._add_($9);
 } else {
 self._errorUnknownVariable_(aNode);
 $10=_st($UnknownVar())._new();
-$11=$10;
-$12=_st(aNode)._value();
-_st($11)._name_($12);
-$13=_st($10)._yourself();
-binding=$13;
+_st($10)._name_(_st(aNode)._value());
+$11=_st($10)._yourself();
+binding=$11;
 binding;
 };
 } else {

+ 216 - 261
js/Compiler-Tests.js

@@ -11,10 +11,8 @@ fn: function (aNode,aClass){
 var self=this;
 function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
 _st(_st($SemanticAnalyzer())._on_(aClass))._visit_(aNode);
-$1=aNode;
-return $1;
+return aNode;
 }, function($ctx1) {$ctx1.fill(self,"analyze:forClass:",{aNode:aNode,aClass:aClass},smalltalk.ASTParsingTest)})},
 args: ["aNode", "aClass"],
 source: "analyze: aNode forClass: aClass\x0a\x09(SemanticAnalyzer on: aClass) visit: aNode.\x0a\x09^ aNode",
@@ -72,16 +70,15 @@ var self=this;
 function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
 function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$4,$6,$1;
+var $2,$3,$4,$5,$1;
 $2=_st($ASTPCNodeVisitor())._new();
 $ctx1.sendIdx["new"]=1;
 $3=$2;
-$5=_st($AIContext())._new();
-$4=_st($5)._yourself();
+$4=_st(_st($AIContext())._new())._yourself();
 $ctx1.sendIdx["yourself"]=1;
 _st($3)._context_($4);
-$6=_st($2)._yourself();
-$1=$6;
+$5=_st($2)._yourself();
+$1=$5;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"astPCNodeVisitor",{},smalltalk.ASTPCNodeVisitorTest)})},
 args: [],
@@ -100,17 +97,16 @@ var self=this;
 function $ASTPCNodeVisitor(){return smalltalk.ASTPCNodeVisitor||(typeof ASTPCNodeVisitor=="undefined"?nil:ASTPCNodeVisitor)}
 function $AIContext(){return smalltalk.AIContext||(typeof AIContext=="undefined"?nil:AIContext)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$4,$6,$1;
+var $2,$3,$4,$5,$1;
 $2=_st($ASTPCNodeVisitor())._new();
 $ctx1.sendIdx["new"]=1;
 _st($2)._selector_(aString);
 $3=$2;
-$5=_st($AIContext())._new();
-$4=_st($5)._yourself();
+$4=_st(_st($AIContext())._new())._yourself();
 $ctx1.sendIdx["yourself"]=1;
 _st($3)._context_($4);
-$6=_st($2)._yourself();
-$1=$6;
+$5=_st($2)._yourself();
+$1=$5;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"astPCNodeVisitorForSelector:",{aString:aString},smalltalk.ASTPCNodeVisitorTest)})},
 args: ["aString"],
@@ -198,27 +194,25 @@ var self=this;
 var ast;
 function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
 return smalltalk.withContext(function($ctx1) { 
-var $4,$5,$3,$2,$1,$9,$10,$8,$7,$6;
+var $3,$4,$2,$1,$5,$6;
 ast=self._parse_forClass_("foo true ifTrue: [ self asString yourself ]. ^ self asBoolean",$Object());
 $ctx1.sendIdx["parse:forClass:"]=1;
-$4=self._astPCNodeVisitorForSelector_("yourself");
+$3=self._astPCNodeVisitorForSelector_("yourself");
 $ctx1.sendIdx["astPCNodeVisitorForSelector:"]=1;
-_st($4)._visit_(ast);
+_st($3)._visit_(ast);
 $ctx1.sendIdx["visit:"]=1;
-$5=_st($4)._currentNode();
+$4=_st($3)._currentNode();
 $ctx1.sendIdx["currentNode"]=1;
-$3=$5;
-$2=_st($3)._selector();
+$2=$4;
+$1=_st($2)._selector();
 $ctx1.sendIdx["selector"]=1;
-$1=self._assert_equals_($2,"yourself");
+self._assert_equals_($1,"yourself");
 $ctx1.sendIdx["assert:equals:"]=1;
 ast=self._parse_forClass_("foo true ifTrue: [ self asString yourself ]. ^ self asBoolean",$Object());
-$9=self._astPCNodeVisitorForSelector_("asBoolean");
-_st($9)._visit_(ast);
-$10=_st($9)._currentNode();
-$8=$10;
-$7=_st($8)._selector();
-$6=self._assert_equals_($7,"asBoolean");
+$5=self._astPCNodeVisitorForSelector_("asBoolean");
+_st($5)._visit_(ast);
+$6=_st($5)._currentNode();
+self._assert_equals_(_st($6)._selector(),"asBoolean");
 return self}, function($ctx1) {$ctx1.fill(self,"testMessageSendWithInlining",{ast:ast},smalltalk.ASTPCNodeVisitorTest)})},
 args: [],
 source: "testMessageSendWithInlining\x0a\x09| ast |\x0a\x09\x0a\x09ast := self parse: 'foo true ifTrue: [ self asString yourself ]. ^ self asBoolean' forClass: Object.\x0a\x09self assert: ((self astPCNodeVisitorForSelector: 'yourself')\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) selector equals: 'yourself'.\x0a\x09\x09\x0a\x09ast := self parse: 'foo true ifTrue: [ self asString yourself ]. ^ self asBoolean' forClass: Object.\x0a\x09self assert: ((self astPCNodeVisitorForSelector: 'asBoolean')\x0a\x09\x09visit: ast;\x0a\x09\x09currentNode) selector equals: 'asBoolean'",
@@ -284,9 +278,7 @@ fn: function (){
 var self=this;
 function $CodeGenerator(){return smalltalk.CodeGenerator||(typeof CodeGenerator=="undefined"?nil:CodeGenerator)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=$CodeGenerator();
-return $1;
+return $CodeGenerator();
 }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "codeGeneratorClass\x0a\x09^ CodeGenerator",
@@ -342,16 +334,14 @@ fn: function (aString,anObject,aResult){
 var self=this;
 var method,result;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
+var $1,$2;
 self["@receiver"]=anObject;
 $1=self._compiler();
-$2=aString;
-$3=_st(anObject)._class();
+$2=_st(anObject)._class();
 $ctx1.sendIdx["class"]=1;
-method=_st($1)._install_forClass_category_($2,$3,"tests");
+method=_st($1)._install_forClass_category_(aString,$2,"tests");
 result=_st(self["@receiver"])._perform_(_st(method)._selector());
-$4=_st(anObject)._class();
-_st($4)._removeCompiledMethod_(method);
+_st(_st(anObject)._class())._removeCompiledMethod_(method);
 self._assert_equals_(aResult,result);
 return self}, function($ctx1) {$ctx1.fill(self,"should:receiver:return:",{aString:aString,anObject:anObject,aResult:aResult,method:method,result:result},smalltalk.CodeGeneratorTest)})},
 args: ["aString", "anObject", "aResult"],
@@ -401,12 +391,11 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-$1=self._should_return_("foo | a | a := true ifTrue: [ 1 ]. ^ a",(1));
+self._should_return_("foo | a | a := true ifTrue: [ 1 ]. ^ a",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo | a | a := false ifTrue: [ 1 ]. ^ a",nil);
+self._should_return_("foo | a | a := false ifTrue: [ 1 ]. ^ a",nil);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo | a | ^ a := true ifTrue: [ 1 ]",(1));
+self._should_return_("foo | a | ^ a := true ifTrue: [ 1 ]",(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testAssignment",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testAssignment\x0a\x09self should: 'foo | a | a := true ifTrue: [ 1 ]. ^ a' return: 1.\x0a\x09self should: 'foo | a | a := false ifTrue: [ 1 ]. ^ a' return: nil.\x0a\x0a\x09self should: 'foo | a | ^ a := true ifTrue: [ 1 ]' return: 1",
@@ -422,10 +411,9 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self._should_return_("\x5c arg ^ 4",(4));
+self._should_return_("\x5c arg ^ 4",(4));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("\x5c\x5c arg ^ 42",(42));
+self._should_return_("\x5c\x5c arg ^ 42",(42));
 return self}, function($ctx1) {$ctx1.fill(self,"testBackslashSelectors",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testBackslashSelectors\x0a\x09\x0a\x09self should: '\x5c arg ^ 4' return: 4.\x0a\x09self should: '\x5c\x5c arg ^ 42' return: 42",
@@ -441,12 +429,11 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-$1=self._should_return_("foo ^ #(1 2 3) collect: [ :each | true ifTrue: [ each + 1 ] ]",[(2), (3), (4)]);
+self._should_return_("foo ^ #(1 2 3) collect: [ :each | true ifTrue: [ each + 1 ] ]",[(2), (3), (4)]);
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ #(1 2 3) collect: [ :each | false ifFalse: [ each + 1 ] ]",[(2), (3), (4)]);
+self._should_return_("foo ^ #(1 2 3) collect: [ :each | false ifFalse: [ each + 1 ] ]",[(2), (3), (4)]);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ #(1 2 3) collect: [ :each | each odd ifTrue: [ each + 1 ] ifFalse: [ each - 1 ] ]",[(2), (1), (4)]);
+self._should_return_("foo ^ #(1 2 3) collect: [ :each | each odd ifTrue: [ each + 1 ] ifFalse: [ each - 1 ] ]",[(2), (1), (4)]);
 return self}, function($ctx1) {$ctx1.fill(self,"testBlockReturn",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testBlockReturn\x0a\x09self should: 'foo ^ #(1 2 3) collect: [ :each | true ifTrue: [ each + 1 ] ]' return: #(2 3 4).\x0a\x09self should: 'foo ^ #(1 2 3) collect: [ :each | false ifFalse: [ each + 1 ] ]' return: #(2 3 4).\x0a\x09self should: 'foo ^ #(1 2 3) collect: [ :each | each odd ifTrue: [ each + 1 ] ifFalse: [ each - 1 ] ]' return: #(2 1 4).",
@@ -478,10 +465,12 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { x. x := 2 }\x0a",[(1), (2)]);
+$ctx1.sendIdx["should:return:"]=1;
 self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { x. true ifTrue: [ x := 2 ] }\x0a",[(1), (2)]);
 return self}, function($ctx1) {$ctx1.fill(self,"testDynamicArrayElementsOrdered",{},smalltalk.CodeGeneratorTest)})},
 args: [],
-source: "testDynamicArrayElementsOrdered\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { x. true ifTrue: [ x := 2 ] }\x0a' return: #(1 2).",
+source: "testDynamicArrayElementsOrdered\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { x. x := 2 }\x0a' return: #(1 2).\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { x. true ifTrue: [ x := 2 ] }\x0a' return: #(1 2).",
 messageSends: ["should:return:"],
 referencedClasses: []
 }),
@@ -494,11 +483,10 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $2="foo".__minus_gt((1));
 $ctx1.sendIdx["->"]=1;
-$3="bar".__minus_gt((2));
-$1=smalltalk.HashedCollection._from_([$2,$3]);
+$1=smalltalk.HashedCollection._from_([$2,"bar".__minus_gt((2))]);
 self._should_return_("foo\x0a\x09| x |\x0a\x09x := 'foo'->1.\x0a\x09^ #{ x. (true ifTrue: [ x := 'bar'->2 ]) }\x0a",$1);
 return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaryElementsOrdered",{},smalltalk.CodeGeneratorTest)})},
 args: [],
@@ -516,12 +504,11 @@ fn: function (){
 var self=this;
 function $BlockClosure(){return smalltalk.BlockClosure||(typeof BlockClosure=="undefined"?nil:BlockClosure)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-$1=self._should_return_("foo ^ eval class",$BlockClosure());
+self._should_return_("foo ^ eval class",$BlockClosure());
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ Math cos: 0",(1));
+self._should_return_("foo ^ Math cos: 0",(1));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ NonExistingVar",nil);
+self._should_return_("foo ^ NonExistingVar",nil);
 return self}, function($ctx1) {$ctx1.fill(self,"testGlobalVar",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testGlobalVar\x0a\x09self should: 'foo ^ eval class' return: BlockClosure.\x0a\x09self should: 'foo ^ Math cos: 0' return: 1.\x0a\x09self should: 'foo ^ NonExistingVar' return: nil",
@@ -538,36 +525,42 @@ fn: function (){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$4,$2,$1,$7,$8,$6,$5,$11,$12,$10,$9,$15,$16,$14,$13;
-$3="foo".__minus_gt($Array());
+var $2,$3,$1,$5,$6,$4,$8,$9,$7,$11,$12,$10,$14,$13;
+$2="foo".__minus_gt($Array());
 $ctx1.sendIdx["->"]=1;
-$4="bar".__minus_gt((2));
+$3="bar".__minus_gt((2));
 $ctx1.sendIdx["->"]=2;
-$2=[$3,$4];
-$1=self._should_return_("foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: 'foo'->x with: 'bar'->(true ifTrue: [ x := 2 ])\x0a",$2);
+$1=[$2,$3];
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: 'foo'->x with: 'bar'->(x := 2)\x0a",$1);
 $ctx1.sendIdx["should:return:"]=1;
-$7="foo".__minus_gt((1));
+$5="foo".__minus_gt($Array());
 $ctx1.sendIdx["->"]=3;
-$8="bar".__minus_gt((2));
+$6="bar".__minus_gt((2));
 $ctx1.sendIdx["->"]=4;
-$6=[$7,$8];
-$5=self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: 'foo'->x with: 'bar'->(true ifTrue: [ x := 2 ])\x0a",$6);
+$4=[$5,$6];
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: 'foo'->x with: 'bar'->(true ifTrue: [ x := 2 ])\x0a",$4);
 $ctx1.sendIdx["should:return:"]=2;
-$11="foo".__minus_gt((1));
+$8="foo".__minus_gt((1));
 $ctx1.sendIdx["->"]=5;
-$12="bar".__minus_gt((2));
+$9="bar".__minus_gt((2));
 $ctx1.sendIdx["->"]=6;
-$10=[$11,$12];
-$9=self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",$10);
+$7=[$8,$9];
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: 'foo'->x with: 'bar'->(true ifTrue: [ x := 2 ])\x0a",$7);
 $ctx1.sendIdx["should:return:"]=3;
-$15="foo".__minus_gt((1));
+$11="foo".__minus_gt((1));
 $ctx1.sendIdx["->"]=7;
-$16="bar".__minus_gt((2));
-$14=smalltalk.HashedCollection._from_([$15,$16]);
-$13=self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ #{ 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",$14);
+$12="bar".__minus_gt((2));
+$ctx1.sendIdx["->"]=8;
+$10=[$11,$12];
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",$10);
+$ctx1.sendIdx["should:return:"]=4;
+$14="foo".__minus_gt((1));
+$ctx1.sendIdx["->"]=9;
+$13=smalltalk.HashedCollection._from_([$14,"bar".__minus_gt((2))]);
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ #{ 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",$13);
 return self}, function($ctx1) {$ctx1.fill(self,"testInnerTemporalDependentElementsOrdered",{},smalltalk.CodeGeneratorTest)})},
 args: [],
-source: "testInnerTemporalDependentElementsOrdered\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])\x0a' return: {'foo'->Array. 'bar'->2}.\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])\x0a' return: {'foo'->1. 'bar'->2}.\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }\x0a' return: {'foo'->1. 'bar'->2}.\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ #{ ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }\x0a' return: #{'foo'->1. 'bar'->2}.",
+source: "testInnerTemporalDependentElementsOrdered\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: ''foo''->x with: ''bar''->(x := 2)\x0a' return: {'foo'->Array. 'bar'->2}.\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])\x0a' return: {'foo'->Array. 'bar'->2}.\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])\x0a' return: {'foo'->1. 'bar'->2}.\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ { ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }\x0a' return: {'foo'->1. 'bar'->2}.\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ #{ ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }\x0a' return: #{'foo'->1. 'bar'->2}.",
 messageSends: ["should:return:", "->"],
 referencedClasses: ["Array"]
 }),
@@ -596,30 +589,29 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6,$9,$10,$8,$7,$11,$12,$13;
-$1=self._should_return_("foo ^ 1",(1));
+var $2,$1;
+self._should_return_("foo ^ 1",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ 'hello'","hello");
+self._should_return_("foo ^ 'hello'","hello");
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ #(1 2 3 4)",[(1), (2), (3), (4)]);
+self._should_return_("foo ^ #(1 2 3 4)",[(1), (2), (3), (4)]);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ {1. [:x | x ] value: 2. 3. [4] value}",[(1), (2), (3), (4)]);
+self._should_return_("foo ^ {1. [:x | x ] value: 2. 3. [4] value}",[(1), (2), (3), (4)]);
 $ctx1.sendIdx["should:return:"]=4;
-$5=self._should_return_("foo ^ true",true);
+self._should_return_("foo ^ true",true);
 $ctx1.sendIdx["should:return:"]=5;
-$6=self._should_return_("foo ^ false",false);
+self._should_return_("foo ^ false",false);
 $ctx1.sendIdx["should:return:"]=6;
-$9=(1).__minus_gt((2));
+$2=(1).__minus_gt((2));
 $ctx1.sendIdx["->"]=1;
-$10=(3).__minus_gt((4));
-$8=smalltalk.HashedCollection._from_([$9,$10]);
-$7=self._should_return_("foo ^ #{1->2. 3->4}",$8);
+$1=smalltalk.HashedCollection._from_([$2,(3).__minus_gt((4))]);
+self._should_return_("foo ^ #{1->2. 3->4}",$1);
 $ctx1.sendIdx["should:return:"]=7;
-$11=self._should_return_("foo ^ #hello","hello");
+self._should_return_("foo ^ #hello","hello");
 $ctx1.sendIdx["should:return:"]=8;
-$12=self._should_return_("foo ^ -123.456",(-123.456));
+self._should_return_("foo ^ -123.456",(-123.456));
 $ctx1.sendIdx["should:return:"]=9;
-$13=self._should_return_("foo ^ -2.5e4",(-25000));
+self._should_return_("foo ^ -2.5e4",(-25000));
 return self}, function($ctx1) {$ctx1.fill(self,"testLiterals",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testLiterals\x0a\x09self should: 'foo ^ 1' return: 1.\x0a\x09self should: 'foo ^ ''hello''' return: 'hello'.\x0a\x09self should: 'foo ^ #(1 2 3 4)' return: #(1 2 3 4).\x0a\x09self should: 'foo ^ {1. [:x | x ] value: 2. 3. [4] value}' return: #(1 2 3 4).\x0a\x09self should: 'foo ^ true' return: true.\x0a\x09self should: 'foo ^ false' return: false.\x0a\x09self should: 'foo ^ #{1->2. 3->4}' return: #{1->2. 3->4}.\x0a\x09self should: 'foo ^ #hello' return: #hello.\x0a\x09self should: 'foo ^ -123.456' return: -123.456.\x0a\x09self should: 'foo ^ -2.5e4' return: -25000.",
@@ -635,16 +627,15 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5;
-$1=self._should_return_("foo ^ 1",(1));
+self._should_return_("foo ^ 1",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ 1 + 1",(2));
+self._should_return_("foo ^ 1 + 1",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ",self["@receiver"]);
+self._should_return_("foo ",self["@receiver"]);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo self asString",self["@receiver"]);
+self._should_return_("foo self asString",self["@receiver"]);
 $ctx1.sendIdx["should:return:"]=4;
-$5=self._should_return_("foo | a b | a := 1. b := 2. ^ a + b",(3));
+self._should_return_("foo | a b | a := 1. b := 2. ^ a + b",(3));
 return self}, function($ctx1) {$ctx1.fill(self,"testLocalReturn",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testLocalReturn\x0a\x09self should: 'foo ^ 1' return: 1.\x0a\x09self should: 'foo ^ 1 + 1' return: 2.\x0a\x09self should: 'foo ' return: receiver.\x0a\x09self should: 'foo self asString' return: receiver.\x0a\x09self should: 'foo | a b | a := 1. b := 2. ^ a + b' return: 3",
@@ -660,16 +651,15 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5;
-$1=self._should_return_("foo ^ 1 asString","1");
+self._should_return_("foo ^ 1 asString","1");
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ 1 + 1",(2));
+self._should_return_("foo ^ 1 + 1",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ 1 + 2 * 3",(9));
+self._should_return_("foo ^ 1 + 2 * 3",(9));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ 1 to: 3",[(1), (2), (3)]);
+self._should_return_("foo ^ 1 to: 3",[(1), (2), (3)]);
 $ctx1.sendIdx["should:return:"]=4;
-$5=self._should_return_("foo ^ 1 to: 5 by: 2",[(1), (3), (5)]);
+self._should_return_("foo ^ 1 to: 5 by: 2",[(1), (3), (5)]);
 return self}, function($ctx1) {$ctx1.fill(self,"testMessageSends",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testMessageSends\x0a\x09self should: 'foo ^ 1 asString' return: '1'.\x0a\x0a\x09self should: 'foo ^ 1 + 1' return: 2.\x0a\x09self should: 'foo ^ 1 + 2 * 3' return: 9.\x0a\x0a\x09self should: 'foo ^ 1 to: 3' return: #(1 2 3).\x0a\x09self should: 'foo ^ 1 to: 5 by: 2' return: #(1 3 5)",
@@ -717,14 +707,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo ^ true ifTrue: [ false ifFalse: [ 1 ] ]",(1));
+self._should_return_("foo ^ true ifTrue: [ false ifFalse: [ 1 ] ]",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ true ifTrue: [ false ifTrue: [ 1 ] ]",nil);
+self._should_return_("foo ^ true ifTrue: [ false ifTrue: [ 1 ] ]",nil);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo true ifTrue: [ false ifFalse: [ ^ 1 ] ]",(1));
+self._should_return_("foo true ifTrue: [ false ifFalse: [ ^ 1 ] ]",(1));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo true ifTrue: [ false ifTrue: [ ^ 1 ] ]",self["@receiver"]);
+self._should_return_("foo true ifTrue: [ false ifTrue: [ ^ 1 ] ]",self["@receiver"]);
 return self}, function($ctx1) {$ctx1.fill(self,"testNestedIfTrue",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testNestedIfTrue\x0a\x09self should: 'foo ^ true ifTrue: [ false ifFalse: [ 1 ] ]' return: 1.\x0a\x09self should: 'foo ^ true ifTrue: [ false ifTrue: [ 1 ] ]' return: nil.\x0a\x0a\x09self should: 'foo true ifTrue: [ false ifFalse: [ ^ 1 ] ]' return: 1.\x0a\x09self should: 'foo true ifTrue: [ false ifTrue: [ ^ 1 ] ]' return: receiver.",
@@ -757,14 +746,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo [ ^ 1 ] value",(1));
+self._should_return_("foo [ ^ 1 ] value",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo [ ^ 1 + 1 ] value",(2));
+self._should_return_("foo [ ^ 1 + 1 ] value",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo | a b | a := 1. b := 2. [ ^ a + b ] value. self halt",(3));
+self._should_return_("foo | a b | a := 1. b := 2. [ ^ a + b ] value. self halt",(3));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo [ :x | ^ x + x ] value: 4. ^ 2",(8));
+self._should_return_("foo [ :x | ^ x + x ] value: 4. ^ 2",(8));
 return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testNonLocalReturn\x0a\x09self should: 'foo [ ^ 1 ] value' return: 1.\x0a\x09self should: 'foo [ ^ 1 + 1 ] value' return: 2.\x0a\x09self should: 'foo | a b | a := 1. b := 2. [ ^ a + b ] value. self halt' return: 3.\x0a\x09self should: 'foo [ :x | ^ x + x ] value: 4. ^ 2' return: 8",
@@ -780,10 +768,9 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self._should_return_("foo ^Object",_st(smalltalk)._at_("Object"));
+self._should_return_("foo ^Object",_st(smalltalk)._at_("Object"));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^NonExistent",nil);
+self._should_return_("foo ^NonExistent",nil);
 return self}, function($ctx1) {$ctx1.fill(self,"testPascalCaseGlobal",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testPascalCaseGlobal\x0a\x09self should: 'foo ^Object' return: (smalltalk at: 'Object').\x0a\x09self should: 'foo ^NonExistent' return: nil",
@@ -800,10 +787,9 @@ fn: function (){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: x with: (true ifTrue: [ x := 2 ])\x0a",[(1), (2)]);
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: x with: (true ifTrue: [ x := 2 ])\x0a",[(1), (2)]);
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: x with: (true ifTrue: [ x := 2 ])\x0a",[$Array(),(2)]);
+self._should_return_("foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: x with: (true ifTrue: [ x := 2 ])\x0a",[$Array(),(2)]);
 return self}, function($ctx1) {$ctx1.fill(self,"testSendReceiverAndArgumentsOrdered",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testSendReceiverAndArgumentsOrdered\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := 1.\x0a\x09^ Array with: x with: (true ifTrue: [ x := 2 ])\x0a' return: #(1 2).\x0a\x0a\x09self should: 'foo\x0a\x09| x |\x0a\x09x := Array.\x0a\x09^ x with: x with: (true ifTrue: [ x := 2 ])\x0a' return: {Array. 2}.",
@@ -835,21 +821,20 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6;
-$1=self._should_return_("foo | a | ^ a",nil);
+self._should_return_("foo | a | ^ a",nil);
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo | AVariable | ^ AVariable",nil);
+self._should_return_("foo | AVariable | ^ AVariable",nil);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo | a b c | ^ c",nil);
+self._should_return_("foo | a b c | ^ c",nil);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo | a | [ | d | ^ d ] value",nil);
+self._should_return_("foo | a | [ | d | ^ d ] value",nil);
 $ctx1.sendIdx["should:return:"]=4;
-$5=self._should_return_("foo | a | a:= 1. ^ a",(1));
+self._should_return_("foo | a | a:= 1. ^ a",(1));
 $ctx1.sendIdx["should:return:"]=5;
-$6=self._should_return_("foo | AVariable | AVariable := 1. ^ AVariable",(1));
+self._should_return_("foo | AVariable | AVariable := 1. ^ AVariable",(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testTempVariables",{},smalltalk.CodeGeneratorTest)})},
 args: [],
-source: "testTempVariables\x0a\x09self should: 'foo | a | ^ a' return: nil.\x0a\x09self should: 'foo | AVariable | ^ AVariable' return: nil.\x0a\x09self should: 'foo | a b c | ^ c' return: nil.\x0a\x09self should: 'foo | a | [ | d | ^ d ] value' return: nil.\x0a\x09\x0a\x09self should: 'foo | a | a:= 1. ^ a' return: 1.\x0a\x09self should: 'foo | AVariable | AVariable := 1. ^ AVariable' return: 1.\x09",
+source: "testTempVariables\x0a\x09self should: 'foo | a | ^ a' return: nil.\x0a\x09self should: 'foo | AVariable | ^ AVariable' return: nil.\x0a\x09self should: 'foo | a b c | ^ c' return: nil.\x0a\x09self should: 'foo | a | [ | d | ^ d ] value' return: nil.\x0a\x09\x0a\x09self should: 'foo | a | a:= 1. ^ a' return: 1.\x0a\x09self should: 'foo | AVariable | AVariable := 1. ^ AVariable' return: 1.",
 messageSends: ["should:return:"],
 referencedClasses: []
 }),
@@ -878,14 +863,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo true ifFalse: [ ^ 1 ]",self["@receiver"]);
+self._should_return_("foo true ifFalse: [ ^ 1 ]",self["@receiver"]);
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo false ifFalse: [ ^ 2 ]",(2));
+self._should_return_("foo false ifFalse: [ ^ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ true ifFalse: [ 1 ]",nil);
+self._should_return_("foo ^ true ifFalse: [ 1 ]",nil);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ false ifFalse: [ 2 ]",(2));
+self._should_return_("foo ^ false ifFalse: [ 2 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifFalse",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifFalse\x0a\x09self should: 'foo true ifFalse: [ ^ 1 ]' return: receiver.\x0a\x09self should: 'foo false ifFalse: [ ^ 2 ]' return: 2.\x0a\x09\x0a\x09self should: 'foo ^ true ifFalse: [ 1 ]' return: nil.\x0a\x09self should: 'foo ^ false ifFalse: [ 2 ]' return: 2.",
@@ -901,14 +885,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo true ifFalse: [ ^ 1 ] ifTrue: [ ^ 2 ]",(2));
+self._should_return_("foo true ifFalse: [ ^ 1 ] ifTrue: [ ^ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo false ifFalse: [ ^ 2 ] ifTrue: [ ^1 ]",(2));
+self._should_return_("foo false ifFalse: [ ^ 2 ] ifTrue: [ ^1 ]",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ true ifFalse: [ 1 ] ifTrue: [ 2 ]",(2));
+self._should_return_("foo ^ true ifFalse: [ 1 ] ifTrue: [ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ false ifFalse: [ 2 ] ifTrue: [ 1 ]",(2));
+self._should_return_("foo ^ false ifFalse: [ 2 ] ifTrue: [ 1 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifFalseIfTrue",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifFalseIfTrue\x0a\x09self should: 'foo true ifFalse: [ ^ 1 ] ifTrue: [ ^ 2 ]' return: 2.\x0a\x09self should: 'foo false ifFalse: [ ^ 2 ] ifTrue: [ ^1 ]' return: 2.\x0a\x09\x0a\x09self should: 'foo ^ true ifFalse: [ 1 ] ifTrue: [ 2 ]' return: 2.\x0a\x09self should: 'foo ^ false ifFalse: [ 2 ] ifTrue: [ 1 ]' return: 2.",
@@ -924,14 +907,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo ^ 1 ifNil: [ 2 ]",(1));
+self._should_return_("foo ^ 1 ifNil: [ 2 ]",(1));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ nil ifNil: [ 2 ]",(2));
+self._should_return_("foo ^ nil ifNil: [ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo 1 ifNil: [ ^ 2 ]",self["@receiver"]);
+self._should_return_("foo 1 ifNil: [ ^ 2 ]",self["@receiver"]);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo nil ifNil: [ ^ 2 ]",(2));
+self._should_return_("foo nil ifNil: [ ^ 2 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifNil",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifNil\x0a\x09self should: 'foo ^ 1 ifNil: [ 2 ]' return: 1.\x0a\x09self should: 'foo ^ nil ifNil: [ 2 ]' return: 2.\x0a\x0a\x09self should: 'foo 1 ifNil: [ ^ 2 ]' return: receiver.\x0a\x09self should: 'foo nil ifNil: [ ^ 2 ]' return: 2.",
@@ -947,14 +929,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo ^ 1 ifNil: [ 2 ] ifNotNil: [ 3 ]",(3));
+self._should_return_("foo ^ 1 ifNil: [ 2 ] ifNotNil: [ 3 ]",(3));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ nil ifNil: [ 2 ] ifNotNil: [ 3 ]",(2));
+self._should_return_("foo ^ nil ifNil: [ 2 ] ifNotNil: [ 3 ]",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo 1 ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(3));
+self._should_return_("foo 1 ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(3));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo nil ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(2));
+self._should_return_("foo nil ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifNilIfNotNil",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifNilIfNotNil\x0a\x09self should: 'foo ^ 1 ifNil: [ 2 ] ifNotNil: [ 3 ]' return: 3.\x0a\x09self should: 'foo ^ nil ifNil: [ 2 ] ifNotNil: [ 3 ]' return: 2.\x0a\x0a\x09self should: 'foo 1 ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]' return: 3.\x0a\x09self should: 'foo nil ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]' return: 2.",
@@ -970,14 +951,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo ^ 1 ifNotNil: [ 2 ]",(2));
+self._should_return_("foo ^ 1 ifNotNil: [ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ nil ifNotNil: [ 2 ]",nil);
+self._should_return_("foo ^ nil ifNotNil: [ 2 ]",nil);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo 1 ifNotNil: [ ^ 2 ]",(2));
+self._should_return_("foo 1 ifNotNil: [ ^ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo nil ifNotNil: [ ^ 2 ]",self["@receiver"]);
+self._should_return_("foo nil ifNotNil: [ ^ 2 ]",self["@receiver"]);
 return self}, function($ctx1) {$ctx1.fill(self,"testifNotNil",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifNotNil\x0a\x09self should: 'foo ^ 1 ifNotNil: [ 2 ]' return: 2.\x0a\x09self should: 'foo ^ nil ifNotNil: [ 2 ]' return: nil.\x0a\x0a\x09self should: 'foo 1 ifNotNil: [ ^ 2 ]' return: 2.\x0a\x09self should: 'foo nil ifNotNil: [ ^ 2 ]' return: receiver.",
@@ -993,18 +973,17 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6;
-$1=self._should_return_("foo ^ 1 ifNotNil: [ :val | val + 2 ]",(3));
+self._should_return_("foo ^ 1 ifNotNil: [ :val | val + 2 ]",(3));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo ^ nil ifNotNil: [ :val | val + 2 ]",nil);
+self._should_return_("foo ^ nil ifNotNil: [ :val | val + 2 ]",nil);
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ 1 ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]",(3));
+self._should_return_("foo ^ 1 ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]",(3));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ nil ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]",(5));
+self._should_return_("foo ^ nil ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]",(5));
 $ctx1.sendIdx["should:return:"]=4;
-$5=self._should_return_("foo ^ 1 ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]",(3));
+self._should_return_("foo ^ 1 ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]",(3));
 $ctx1.sendIdx["should:return:"]=5;
-$6=self._should_return_("foo ^ nil ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]",(5));
+self._should_return_("foo ^ nil ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]",(5));
 return self}, function($ctx1) {$ctx1.fill(self,"testifNotNilWithArgument",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifNotNilWithArgument\x0a\x09self should: 'foo ^ 1 ifNotNil: [ :val | val + 2 ]' return: 3.\x0a\x09self should: 'foo ^ nil ifNotNil: [ :val | val + 2 ]' return: nil.\x0a\x09\x0a\x09self should: 'foo ^ 1 ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]' return: 3.\x0a\x09self should: 'foo ^ nil ifNil: [ 5 ] ifNotNil: [ :val | val + 2 ]' return: 5.\x0a\x09\x0a\x09self should: 'foo ^ 1 ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]' return: 3.\x0a\x09self should: 'foo ^ nil ifNotNil: [ :val | val + 2 ] ifNil: [ 5 ]' return: 5",
@@ -1020,14 +999,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo false ifTrue: [ ^ 1 ]",self["@receiver"]);
+self._should_return_("foo false ifTrue: [ ^ 1 ]",self["@receiver"]);
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo true ifTrue: [ ^ 2 ]",(2));
+self._should_return_("foo true ifTrue: [ ^ 2 ]",(2));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ false ifTrue: [ 1 ]",nil);
+self._should_return_("foo ^ false ifTrue: [ 1 ]",nil);
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ true ifTrue: [ 2 ]",(2));
+self._should_return_("foo ^ true ifTrue: [ 2 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifTrue",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifTrue\x0a\x09self should: 'foo false ifTrue: [ ^ 1 ]' return: receiver.\x0a\x09self should: 'foo true ifTrue: [ ^ 2 ]' return: 2.\x0a\x09\x0a\x09self should: 'foo ^ false ifTrue: [ 1 ]' return: nil.\x0a\x09self should: 'foo ^ true ifTrue: [ 2 ]' return: 2.",
@@ -1043,14 +1021,13 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
-$1=self._should_return_("foo false ifTrue: [ ^ 1 ] ifFalse: [ ^2 ]",(2));
+self._should_return_("foo false ifTrue: [ ^ 1 ] ifFalse: [ ^2 ]",(2));
 $ctx1.sendIdx["should:return:"]=1;
-$2=self._should_return_("foo true ifTrue: [ ^ 1 ] ifFalse: [ ^ 2 ]",(1));
+self._should_return_("foo true ifTrue: [ ^ 1 ] ifFalse: [ ^ 2 ]",(1));
 $ctx1.sendIdx["should:return:"]=2;
-$3=self._should_return_("foo ^ false ifTrue: [ 2 ] ifFalse: [ 1 ]",(1));
+self._should_return_("foo ^ false ifTrue: [ 2 ] ifFalse: [ 1 ]",(1));
 $ctx1.sendIdx["should:return:"]=3;
-$4=self._should_return_("foo ^ true ifTrue: [ 2 ] ifFalse: [ 1 ]",(2));
+self._should_return_("foo ^ true ifTrue: [ 2 ] ifFalse: [ 1 ]",(2));
 return self}, function($ctx1) {$ctx1.fill(self,"testifTrueIfFalse",{},smalltalk.CodeGeneratorTest)})},
 args: [],
 source: "testifTrueIfFalse\x0a\x09self should: 'foo false ifTrue: [ ^ 1 ] ifFalse: [ ^2 ]' return: 2.\x0a\x09self should: 'foo true ifTrue: [ ^ 1 ] ifFalse: [ ^ 2 ]' return: 1.\x0a\x09\x0a\x09self should: 'foo ^ false ifTrue: [ 2 ] ifFalse: [ 1 ]' return: 1.\x0a\x09self should: 'foo ^ true ifTrue: [ 2 ] ifFalse: [ 1 ]' return: 2.",
@@ -1070,9 +1047,7 @@ fn: function (){
 var self=this;
 function $InliningCodeGenerator(){return smalltalk.InliningCodeGenerator||(typeof InliningCodeGenerator=="undefined"?nil:InliningCodeGenerator)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=$InliningCodeGenerator();
-return $1;
+return $InliningCodeGenerator();
 }, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{},smalltalk.InliningCodeGeneratorTest)})},
 args: [],
 source: "codeGeneratorClass\x0a\x09^ InliningCodeGenerator",
@@ -1092,10 +1067,8 @@ fn: function (aNode,aClass){
 var self=this;
 function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
 _st(_st($SemanticAnalyzer())._on_(aClass))._visit_(aNode);
-$1=aNode;
-return $1;
+return aNode;
 }, function($ctx1) {$ctx1.fill(self,"analyze:forClass:",{aNode:aNode,aClass:aClass},smalltalk.InterpreterTest)})},
 args: ["aNode", "aClass"],
 source: "analyze: aNode forClass: aClass\x0a\x09(SemanticAnalyzer on: aClass) visit: aNode.\x0a\x09^ aNode",
@@ -1229,7 +1202,7 @@ function $VariableNode(){return smalltalk.VariableNode||(typeof VariableNode=="u
 function $SemanticAnalyzer(){return smalltalk.SemanticAnalyzer||(typeof SemanticAnalyzer=="undefined"?nil:SemanticAnalyzer)}
 function $MethodLexicalScope(){return smalltalk.MethodLexicalScope||(typeof MethodLexicalScope=="undefined"?nil:MethodLexicalScope)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6;
+var $1,$2,$3,$4;
 $1=_st($VariableNode())._new();
 $ctx1.sendIdx["new"]=1;
 _st($1)._value_("Object");
@@ -1237,10 +1210,8 @@ $2=_st($1)._yourself();
 node=$2;
 $3=_st($SemanticAnalyzer())._new();
 $ctx1.sendIdx["new"]=2;
-$4=$3;
-$5=_st($MethodLexicalScope())._new();
-_st($4)._pushScope_($5);
-$6=_st($3)._visit_(node);
+_st($3)._pushScope_(_st($MethodLexicalScope())._new());
+$4=_st($3)._visit_(node);
 self._assert_(_st(_st(node)._binding())._isClassRefVar());
 return self}, function($ctx1) {$ctx1.fill(self,"testClassRefVar",{node:node},smalltalk.ScopeVarTest)})},
 args: [],
@@ -1287,7 +1258,7 @@ var node,pseudoVars;
 function $VariableNode(){return smalltalk.VariableNode||(typeof VariableNode=="undefined"?nil:VariableNode)}
 function $MethodLexicalScope(){return smalltalk.MethodLexicalScope||(typeof MethodLexicalScope=="undefined"?nil:MethodLexicalScope)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$5,$4,$3;
+var $1,$2;
 pseudoVars=["self", "super", "true", "false", "nil"];
 _st(pseudoVars)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
@@ -1297,10 +1268,7 @@ _st($1)._value_(each);
 $2=_st($1)._yourself();
 node=$2;
 node;
-$5=_st($MethodLexicalScope())._new();
-$4=_st($5)._bindingFor_(node);
-$3=_st($4)._isPseudoVar();
-return self._assert_($3);
+return self._assert_(_st(_st(_st($MethodLexicalScope())._new())._bindingFor_(node))._isPseudoVar());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"testPseudoVar",{node:node,pseudoVars:pseudoVars},smalltalk.ScopeVarTest)})},
 args: [],
@@ -1347,16 +1315,13 @@ var node;
 function $VariableNode(){return smalltalk.VariableNode||(typeof VariableNode=="undefined"?nil:VariableNode)}
 function $MethodLexicalScope(){return smalltalk.MethodLexicalScope||(typeof MethodLexicalScope=="undefined"?nil:MethodLexicalScope)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$5,$4,$3;
+var $1,$2;
 $1=_st($VariableNode())._new();
 $ctx1.sendIdx["new"]=1;
 _st($1)._value_("bzzz");
 $2=_st($1)._yourself();
 node=$2;
-$5=_st($MethodLexicalScope())._new();
-$4=_st($5)._bindingFor_(node);
-$3=_st($4)._isNil();
-self._assert_($3);
+self._assert_(_st(_st(_st($MethodLexicalScope())._new())._bindingFor_(node))._isNil());
 return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVar",{node:node},smalltalk.ScopeVarTest)})},
 args: [],
 source: "testUnknownVar\x0a\x09| node |\x0a\x09node := VariableNode new\x0a\x09\x09value: 'bzzz';\x0a\x09\x09yourself.\x0a\x09self assert: (MethodLexicalScope new bindingFor: node) isNil",
@@ -1457,19 +1422,16 @@ fn: function (){
 var self=this;
 var src,ast;
 return smalltalk.withContext(function($ctx1) { 
-var $6,$5,$4,$3,$2,$7,$1;
+var $4,$3,$2,$1;
 src="foo | a | a + 1. [ | b | b := a ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-$6=_st(ast)._nodes();
-$5=_st($6)._first();
-$4=_st($5)._nodes();
+$4=_st(_st(_st(ast)._nodes())._first())._nodes();
 $ctx1.sendIdx["nodes"]=1;
 $3=_st($4)._last();
 $2=_st($3)._scope();
 $ctx1.sendIdx["scope"]=1;
-$7=_st(ast)._scope();
-$1=_st($2).__eq_eq($7);
+$1=_st($2).__eq_eq(_st(ast)._scope());
 self._deny_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"testScope",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
 args: [],
@@ -1487,13 +1449,11 @@ fn: function (){
 var self=this;
 var src,ast;
 return smalltalk.withContext(function($ctx1) { 
-var $10,$9,$8,$7,$6,$5,$4,$3,$2,$11,$1;
+var $8,$7,$6,$5,$4,$3,$2,$1;
 src="foo | a | a + 1. [ [ | b | b := a ] ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-$10=_st(ast)._nodes();
-$9=_st($10)._first();
-$8=_st($9)._nodes();
+$8=_st(_st(_st(ast)._nodes())._first())._nodes();
 $ctx1.sendIdx["nodes"]=3;
 $7=_st($8)._last();
 $6=_st($7)._nodes();
@@ -1506,8 +1466,7 @@ $3=_st($4)._first();
 $ctx1.sendIdx["first"]=1;
 $2=_st($3)._scope();
 $ctx1.sendIdx["scope"]=1;
-$11=_st(ast)._scope();
-$1=_st($2).__eq_eq($11);
+$1=_st($2).__eq_eq(_st(ast)._scope());
 self._deny_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"testScope2",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
 args: [],
@@ -1525,32 +1484,30 @@ fn: function (){
 var self=this;
 var src,ast;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$14,$13,$12,$11,$10,$9,$8,$7,$6,$5,$4;
+var $2,$1,$10,$9,$8,$7,$6,$5,$4,$3;
 src="foo | a | a + 1. [ [ | b | b := a ] ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-$3=_st(ast)._scope();
+$2=_st(ast)._scope();
 $ctx1.sendIdx["scope"]=1;
-$2=_st($3)._scopeLevel();
+$1=_st($2)._scopeLevel();
 $ctx1.sendIdx["scopeLevel"]=1;
-$1=self._assert_equals_($2,(1));
+self._assert_equals_($1,(1));
 $ctx1.sendIdx["assert:equals:"]=1;
-$14=_st(ast)._nodes();
-$13=_st($14)._first();
-$12=_st($13)._nodes();
+$10=_st(_st(_st(ast)._nodes())._first())._nodes();
 $ctx1.sendIdx["nodes"]=3;
-$11=_st($12)._last();
-$10=_st($11)._nodes();
+$9=_st($10)._last();
+$8=_st($9)._nodes();
 $ctx1.sendIdx["nodes"]=2;
-$9=_st($10)._first();
+$7=_st($8)._first();
 $ctx1.sendIdx["first"]=2;
-$8=_st($9)._nodes();
+$6=_st($7)._nodes();
 $ctx1.sendIdx["nodes"]=1;
-$7=_st($8)._first();
+$5=_st($6)._first();
 $ctx1.sendIdx["first"]=1;
-$6=_st($7)._scope();
-$5=_st($6)._scopeLevel();
-$4=self._assert_equals_($5,(3));
+$4=_st($5)._scope();
+$3=_st($4)._scopeLevel();
+self._assert_equals_($3,(3));
 return self}, function($ctx1) {$ctx1.fill(self,"testScopeLevel",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
 args: [],
 source: "testScopeLevel\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.\x0a\x09ast := smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09self assert: ast scope scopeLevel equals: 1.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first scope scopeLevel equals: 3",
@@ -1716,96 +1673,94 @@ fn: function (){
 var self=this;
 var src,ast;
 return smalltalk.withContext(function($ctx1) { 
-var $8,$7,$6,$5,$4,$3,$2,$1,$17,$16,$15,$14,$13,$12,$11,$18,$10,$9,$30,$29,$28,$27,$26,$25,$24,$23,$22,$21,$20,$19,$43,$42,$41,$40,$39,$38,$37,$36,$35,$34,$33,$48,$47,$46,$45,$44,$32,$31;
+var $7,$6,$5,$4,$3,$2,$1,$15,$14,$13,$12,$11,$10,$9,$16,$8,$27,$26,$25,$24,$23,$22,$21,$20,$19,$18,$17,$39,$38,$37,$36,$35,$34,$33,$32,$31,$30,$29,$42,$41,$40,$28;
 src="foo | a | a + 1. [ | b | b := a ]";
 ast=_st(smalltalk)._parse_(src);
 _st(self["@analyzer"])._visit_(ast);
-$8=_st(ast)._nodes();
+$7=_st(ast)._nodes();
 $ctx1.sendIdx["nodes"]=2;
-$7=_st($8)._first();
+$6=_st($7)._first();
 $ctx1.sendIdx["first"]=2;
-$6=_st($7)._nodes();
+$5=_st($6)._nodes();
 $ctx1.sendIdx["nodes"]=1;
-$5=_st($6)._first();
+$4=_st($5)._first();
 $ctx1.sendIdx["first"]=1;
-$4=_st($5)._receiver();
+$3=_st($4)._receiver();
 $ctx1.sendIdx["receiver"]=1;
-$3=_st($4)._binding();
+$2=_st($3)._binding();
 $ctx1.sendIdx["binding"]=1;
-$2=_st($3)._isTempVar();
+$1=_st($2)._isTempVar();
 $ctx1.sendIdx["isTempVar"]=1;
-$1=self._assert_($2);
+self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
-$17=_st(ast)._nodes();
+$15=_st(ast)._nodes();
 $ctx1.sendIdx["nodes"]=4;
-$16=_st($17)._first();
+$14=_st($15)._first();
 $ctx1.sendIdx["first"]=4;
-$15=_st($16)._nodes();
+$13=_st($14)._nodes();
 $ctx1.sendIdx["nodes"]=3;
-$14=_st($15)._first();
+$12=_st($13)._first();
 $ctx1.sendIdx["first"]=3;
-$13=_st($14)._receiver();
-$12=_st($13)._binding();
+$11=_st($12)._receiver();
+$10=_st($11)._binding();
 $ctx1.sendIdx["binding"]=2;
-$11=_st($12)._scope();
+$9=_st($10)._scope();
 $ctx1.sendIdx["scope"]=1;
-$18=_st(ast)._scope();
+$16=_st(ast)._scope();
 $ctx1.sendIdx["scope"]=2;
-$10=_st($11).__eq_eq($18);
+$8=_st($9).__eq_eq($16);
 $ctx1.sendIdx["=="]=1;
-$9=self._assert_($10);
+self._assert_($8);
 $ctx1.sendIdx["assert:"]=2;
-$30=_st(ast)._nodes();
+$27=_st(ast)._nodes();
 $ctx1.sendIdx["nodes"]=8;
-$29=_st($30)._first();
+$26=_st($27)._first();
 $ctx1.sendIdx["first"]=7;
-$28=_st($29)._nodes();
+$25=_st($26)._nodes();
 $ctx1.sendIdx["nodes"]=7;
-$27=_st($28)._last();
+$24=_st($25)._last();
 $ctx1.sendIdx["last"]=1;
-$26=_st($27)._nodes();
+$23=_st($24)._nodes();
 $ctx1.sendIdx["nodes"]=6;
-$25=_st($26)._first();
+$22=_st($23)._first();
 $ctx1.sendIdx["first"]=6;
-$24=_st($25)._nodes();
+$21=_st($22)._nodes();
 $ctx1.sendIdx["nodes"]=5;
-$23=_st($24)._first();
+$20=_st($21)._first();
 $ctx1.sendIdx["first"]=5;
-$22=_st($23)._left();
+$19=_st($20)._left();
 $ctx1.sendIdx["left"]=1;
-$21=_st($22)._binding();
+$18=_st($19)._binding();
 $ctx1.sendIdx["binding"]=3;
-$20=_st($21)._isTempVar();
-$19=self._assert_($20);
+$17=_st($18)._isTempVar();
+self._assert_($17);
 $ctx1.sendIdx["assert:"]=3;
-$43=_st(ast)._nodes();
+$39=_st(ast)._nodes();
 $ctx1.sendIdx["nodes"]=12;
-$42=_st($43)._first();
+$38=_st($39)._first();
 $ctx1.sendIdx["first"]=10;
-$41=_st($42)._nodes();
+$37=_st($38)._nodes();
 $ctx1.sendIdx["nodes"]=11;
-$40=_st($41)._last();
+$36=_st($37)._last();
 $ctx1.sendIdx["last"]=2;
-$39=_st($40)._nodes();
+$35=_st($36)._nodes();
 $ctx1.sendIdx["nodes"]=10;
-$38=_st($39)._first();
+$34=_st($35)._first();
 $ctx1.sendIdx["first"]=9;
-$37=_st($38)._nodes();
+$33=_st($34)._nodes();
 $ctx1.sendIdx["nodes"]=9;
-$36=_st($37)._first();
+$32=_st($33)._first();
 $ctx1.sendIdx["first"]=8;
-$35=_st($36)._left();
-$34=_st($35)._binding();
-$33=_st($34)._scope();
+$31=_st($32)._left();
+$30=_st($31)._binding();
+$29=_st($30)._scope();
 $ctx1.sendIdx["scope"]=3;
-$48=_st(ast)._nodes();
-$47=_st($48)._first();
-$46=_st($47)._nodes();
+$42=_st(_st(_st(ast)._nodes())._first())._nodes();
 $ctx1.sendIdx["nodes"]=13;
-$45=_st($46)._last();
-$44=_st($45)._scope();
-$32=_st($33).__eq_eq($44);
-$31=self._assert_($32);
+$41=_st($42)._last();
+$40=_st($41)._scope();
+$28=_st($29).__eq_eq($40);
+self._assert_($28);
 return self}, function($ctx1) {$ctx1.fill(self,"testVariablesLookup",{src:src,ast:ast},smalltalk.SemanticAnalyzerTest)})},
 args: [],
 source: "testVariablesLookup\x0a\x09| src ast |\x0a\x0a\x09src := 'foo | a | a + 1. [ | b | b := a ]'.\x0a\x09ast := smalltalk parse: src.\x0a\x09analyzer visit: ast.\x0a\x0a\x09\x22Binding for `a` in the message send\x22\x0a\x09self assert: ast nodes first nodes first receiver binding isTempVar.\x0a\x09self assert: ast nodes first nodes first receiver binding scope == ast scope.\x0a\x0a\x09\x22Binding for `b`\x22\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding isTempVar.\x0a\x09self assert: ast nodes first nodes last nodes first nodes first left binding scope == ast nodes first nodes last scope.",

+ 3 - 3
js/Examples.js

@@ -18,7 +18,7 @@ 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)})},
 args: [],
-source: "decrease\x0a\x09count := count - 1.\x0a\x09header contents: [:html | html with: count asString]",
+source: "decrease\x0a\x09count := count - 1.\x0a\x09header contents: [ :html | html with: count asString ]",
 messageSends: ["-", "contents:", "with:", "asString"],
 referencedClasses: []
 }),
@@ -38,7 +38,7 @@ 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)})},
 args: [],
-source: "increase\x0a\x09count := count + 1.\x0a\x09header contents: [:html | html with: count asString]",
+source: "increase\x0a\x09count := count + 1.\x0a\x09header contents: [ :html | html with: count asString ]",
 messageSends: ["+", "contents:", "with:", "asString"],
 referencedClasses: []
 }),
@@ -91,7 +91,7 @@ return self._decrease();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.Counter)})},
 args: ["html"],
-source: "renderOn: html\x0a\x09header := html h1\x0a\x09with: count asString;\x0a\x09yourself.\x0a\x09html button\x0a\x09with: '++';\x0a\x09onClick: [self increase].\x0a\x09html button\x0a\x09with: '--';\x0a\x09onClick: [self decrease]",
+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: []
 }),

+ 179 - 203
js/Helios-Browser.js

@@ -228,26 +228,19 @@ function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="unde
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$6,$8,$10,$11,$9,$12,$7,$5,$3,$1,$13;
-$2=html;
-$4=$HLContainer();
-$6=$HLHorizontalSplitter();
-$8=$HLVerticalSplitter();
-$10=$HLVerticalSplitter();
-$11=self._packagesListWidget();
+var $5,$4,$3,$2,$1;
+$5=self._packagesListWidget();
 $ctx1.sendIdx["packagesListWidget"]=1;
-$9=_st($10)._with_with_($11,self._classesListWidget());
+$4=_st($HLVerticalSplitter())._with_with_($5,self._classesListWidget());
 $ctx1.sendIdx["with:with:"]=3;
-$12=_st($HLVerticalSplitter())._with_with_(self._protocolsListWidget(),self._methodsListWidget());
-$7=_st($8)._with_with_($9,$12);
+$3=_st($HLVerticalSplitter())._with_with_($4,_st($HLVerticalSplitter())._with_with_(self._protocolsListWidget(),self._methodsListWidget()));
 $ctx1.sendIdx["with:with:"]=2;
-$5=_st($6)._with_with_($7,self._sourceWidget());
+$2=_st($HLHorizontalSplitter())._with_with_($3,self._sourceWidget());
 $ctx1.sendIdx["with:with:"]=1;
-$3=_st($4)._with_($5);
-$1=_st($2)._with_($3);
+$1=_st($HLContainer())._with_($2);
+_st(html)._with_($1);
 $ctx1.sendIdx["with:"]=1;
-$13=self._packagesListWidget();
-_st($13)._focus();
+_st(self._packagesListWidget())._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLBrowser)})},
 args: ["html"],
 source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter \x0a    \x09with: (HLVerticalSplitter\x0a        \x09with: (HLVerticalSplitter\x0a            \x09with: self packagesListWidget\x0a                with: self classesListWidget)\x0a            with: (HLVerticalSplitter\x0a            \x09with: self protocolsListWidget\x0a                with: self methodsListWidget)) \x0a        with: self sourceWidget)).\x0a\x09\x0a\x09self packagesListWidget focus",
@@ -291,8 +284,7 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=smalltalk.HLBrowser.superclass.fn.prototype._unregister.apply(_st(self), []);
+smalltalk.HLBrowser.superclass.fn.prototype._unregister.apply(_st(self), []);
 $ctx1.sendIdx["unregister"]=1;
 _st([self._packagesListWidget(),self._classesListWidget(),self._protocolsListWidget(),self._methodsListWidget(),self._sourceWidget()])._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
@@ -859,7 +851,7 @@ fn: function (aBoolean){
 var self=this;
 function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$5,$2;
+var $1,$3,$2;
 self._withChangesDo_((function(){
 return smalltalk.withContext(function($ctx2) {
 self["@showInstance"]=aBoolean;
@@ -869,14 +861,12 @@ $ctx2.sendIdx["selectedClass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$3=aBoolean;
-if(smalltalk.assert($3)){
-$4=self._selectedClass();
+if(smalltalk.assert(aBoolean)){
+$3=self._selectedClass();
 $ctx2.sendIdx["selectedClass"]=2;
-$2=_st($4)._theNonMetaClass();
+$2=_st($3)._theNonMetaClass();
 } else {
-$5=self._selectedClass();
-$2=_st($5)._theMetaClass();
+$2=_st(self._selectedClass())._theMetaClass();
 };
 self._selectedClass_($2);
 };
@@ -884,7 +874,7 @@ return _st(self._announcer())._announce_(_st($HLShowInstanceToggled())._new());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"showInstance:",{aBoolean:aBoolean},smalltalk.HLBrowserModel)})},
 args: ["aBoolean"],
-source: "showInstance: aBoolean\x0a\x0a\x09self withChangesDo: [\x0a\x09\x09showInstance := aBoolean.\x0a\x0a    \x09self selectedClass ifNotNil: [\x0a    \x09\x09self selectedClass: (aBoolean\x0a    \x09\x09\x09ifTrue: [self selectedClass theNonMetaClass ]\x0a\x09    \x09  \x09ifFalse: [ self selectedClass theMetaClass ]) ].\x0a    \x0a\x09\x09self announcer announce: HLShowInstanceToggled new ]",
+source: "showInstance: aBoolean\x0a\x0a\x09self withChangesDo: [\x0a\x09\x09showInstance := aBoolean.\x0a\x0a    \x09self selectedClass ifNotNil: [\x0a    \x09\x09self selectedClass: (aBoolean\x0a    \x09\x09\x09ifTrue: [ self selectedClass theNonMetaClass ]\x0a\x09    \x09  \x09ifFalse: [ self selectedClass theMetaClass ]) ].\x0a    \x0a\x09\x09self announcer announce: HLShowInstanceToggled new ]",
 messageSends: ["withChangesDo:", "ifNotNil:", "selectedClass", "selectedClass:", "ifTrue:ifFalse:", "theNonMetaClass", "theMetaClass", "announce:", "announcer", "new"],
 referencedClasses: ["HLShowInstanceToggled"]
 }),
@@ -944,7 +934,7 @@ category: 'actions',
 fn: function (aSelector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$6,$5,$3,$7;
+var $2,$1,$3,$4;
 $2=self._theClass();
 $ctx1.sendIdx["theClass"]=1;
 $1=_st($2)._superclass();
@@ -952,13 +942,10 @@ $ctx1.sendIdx["superclass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$4=self._selectorsCache();
-$6=self._theClass();
-$5=_st($6)._superclass();
-$3=_st($4)._cacheFor_($5);
+$3=_st(self._selectorsCache())._cacheFor_(_st(self._theClass())._superclass());
 _st($3)._removeSelector_(aSelector);
-$7=_st($3)._invalidateParentSelector_(aSelector);
-$7;
+$4=_st($3)._invalidateParentSelector_(aSelector);
+$4;
 };
 return self}, function($ctx1) {$ctx1.fill(self,"invalidateParentSelector:",{aSelector:aSelector},smalltalk.HLClassCache)})},
 args: ["aSelector"],
@@ -1086,12 +1073,11 @@ category: 'private',
 fn: function (aSelector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(self._overriddenCache())._removeKey_ifAbsent_(aSelector,(function(){
+_st(self._overriddenCache())._removeKey_ifAbsent_(aSelector,(function(){
 return smalltalk.withContext(function($ctx2) {
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["removeKey:ifAbsent:"]=1;
-$2=_st(self._overrideCache())._removeKey_ifAbsent_(aSelector,(function(){
+_st(self._overrideCache())._removeKey_ifAbsent_(aSelector,(function(){
 return smalltalk.withContext(function($ctx2) {
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"removeSelector:",{aSelector:aSelector},smalltalk.HLClassCache)})},
@@ -1203,7 +1189,7 @@ category: 'accessing',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$5,$4;
+var $3,$2,$1,$4;
 $3=_st(aClass)._theNonMetaClass();
 $ctx1.sendIdx["theNonMetaClass"]=1;
 $2=_st($3)._comment();
@@ -1211,8 +1197,7 @@ $1=_st($2)._isEmpty();
 if(smalltalk.assert($1)){
 return "uncommented";
 };
-$5=_st(aClass)._theNonMetaClass();
-$4=_st($5)._heliosClass();
+$4=_st(_st(aClass)._theNonMetaClass())._heliosClass();
 return $4;
 }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{aClass:aClass},smalltalk.HLClassesListWidget)})},
 args: ["aClass"],
@@ -1437,7 +1422,7 @@ fn: function (anAnnouncement){
 var self=this;
 var class_,oldClass;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2,$5;
+var $1,$4,$3,$2;
 class_=_st(anAnnouncement)._theClass();
 oldClass=_st(anAnnouncement)._oldClass();
 $1=_st(self._items())._includes_(oldClass);
@@ -1449,8 +1434,7 @@ $ctx1.sendIdx["model"]=1;
 $3=_st($4)._selectedClass();
 $2=_st($3).__eq(oldClass);
 if(smalltalk.assert($2)){
-$5=self._model();
-_st($5)._selectedClass_(class_);
+_st(self._model())._selectedClass_(class_);
 };
 self._setItemsForSelectedPackage();
 self._refresh();
@@ -1470,7 +1454,7 @@ fn: function (anAnnouncement){
 var self=this;
 var class_,oldPackage;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$5,$4,$2,$6,$8,$7,$1,$10,$12,$11,$9,$13;
+var $3,$5,$4,$2,$6,$8,$7,$1,$9,$10;
 class_=_st(anAnnouncement)._theClass();
 oldPackage=_st(anAnnouncement)._oldPackage();
 $3=oldPackage;
@@ -1493,14 +1477,11 @@ $ctx2.sendIdx["="]=2;
 if(! smalltalk.assert($1)){
 return self;
 };
-$10=oldPackage;
-$12=self._model();
-$11=_st($12)._selectedPackage();
-$9=_st($10).__eq($11);
+$9=_st(oldPackage).__eq(_st(self._model())._selectedPackage());
 if(smalltalk.assert($9)){
 self._selectedItem_(nil);
-$13=self._selectItem_(nil);
-$13;
+$10=self._selectItem_(nil);
+$10;
 };
 self._setItemsForSelectedPackage();
 self._refresh();
@@ -1566,7 +1547,7 @@ fn: function (anAnnouncement){
 var self=this;
 var selectedClass;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4;
+var $1,$2,$3;
 $1=_st(anAnnouncement)._item();
 $ctx1.sendIdx["item"]=1;
 if(($receiver = $1) == nil || $receiver == null){
@@ -1574,14 +1555,13 @@ return self;
 } else {
 $1;
 };
-$2=_st(anAnnouncement)._item();
-selectedClass=_st($2)._theNonMetaClass();
+selectedClass=_st(_st(anAnnouncement)._item())._theNonMetaClass();
 self._selectedItem_(selectedClass);
-$3=self._hasFocus();
-if(! smalltalk.assert($3)){
+$2=self._hasFocus();
+if(! smalltalk.assert($2)){
 self._activateItem_(selectedClass);
-$4=self._focus();
-$4;
+$3=self._focus();
+$3;
 };
 return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,selectedClass:selectedClass},smalltalk.HLClassesListWidget)})},
 args: ["anAnnouncement"],
@@ -1666,7 +1646,7 @@ var self=this;
 var checkbox;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$6,$5,$7,$8,$9,$11,$10,$12,$2,$13,$15,$16,$14,$18,$17;
+var $1,$3,$4,$6,$5,$7,$8,$9,$10,$2,$11,$13,$14,$12,$15;
 $1=_st(html)._div();
 _st($1)._class_("btn-group");
 $ctx1.sendIdx["class:"]=1;
@@ -1698,46 +1678,44 @@ $ctx3.sendIdx["showInstance:"]=1;
 $ctx2.sendIdx["onClick:"]=1;
 $7;
 $8=_st(html)._button();
-$9=$8;
-$10=_st($String())._streamContents_((function(str){
+_st($8)._class_(_st($String())._streamContents_((function(str){
 return smalltalk.withContext(function($ctx3) {
 _st(str)._nextPutAll_("btn");
 $ctx3.sendIdx["nextPutAll:"]=3;
-$11=self._showClass();
-if(smalltalk.assert($11)){
+$9=self._showClass();
+if(smalltalk.assert($9)){
 return _st(str)._nextPutAll_(" active");
 };
-}, function($ctx3) {$ctx3.fillBlock({str:str},$ctx2,5)})}));
-_st($9)._class_($10);
+}, function($ctx3) {$ctx3.fillBlock({str:str},$ctx2,5)})})));
 $ctx2.sendIdx["class:"]=3;
 _st($8)._with_("Class");
 $ctx2.sendIdx["with:"]=3;
-$12=_st($8)._onClick_((function(){
+$10=_st($8)._onClick_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._showInstance_(false);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)})}));
 $ctx2.sendIdx["onClick:"]=2;
-return $12;
+return $10;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["with:"]=1;
-$13=_st(html)._label();
-_st($13)._class_("checkbox");
-$14=_st($13)._with_((function(){
+$11=_st(html)._label();
+_st($11)._class_("checkbox");
+$12=_st($11)._with_((function(){
 return smalltalk.withContext(function($ctx2) {
-$15=_st(html)._input();
-_st($15)._type_("checkbox");
-$16=_st($15)._onClick_((function(){
+$13=_st(html)._input();
+_st($13)._type_("checkbox");
+$14=_st($13)._onClick_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._toggleShowComment();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,9)})}));
-checkbox=$16;
+checkbox=$14;
 checkbox;
 return _st(html)._with_("Doc");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,8)})}));
 $ctx1.sendIdx["with:"]=4;
-$18=self._showComment();
-if(smalltalk.assert($18)){
-$17=_st(checkbox)._at_put_("checked","checked");
+$15=self._showComment();
+if(smalltalk.assert($15)){
+_st(checkbox)._at_put_("checked","checked");
 };
 return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,checkbox:checkbox},smalltalk.HLClassesListWidget)})},
 args: ["html"],
@@ -1755,26 +1733,27 @@ fn: function (aClass,anInteger,html){
 var self=this;
 var li;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
+var $1,$2,$4,$5,$3;
 li=_st(html)._li();
-self._registerMappingFrom_to_(aClass,li);
-$1=li;
-_st($1)._at_put_("list-data",_st(self._items())._indexOf_(aClass));
-_st($1)._class_(self._listCssClassForItem_(aClass));
+$1=_st(li)._asJQuery();
+$ctx1.sendIdx["asJQuery"]=1;
+_st($1)._data_put_("item",aClass);
+$2=li;
+_st($2)._class_(self._listCssClassForItem_(aClass));
 $ctx1.sendIdx["class:"]=1;
-$2=_st($1)._with_((function(){
+$3=_st($2)._with_((function(){
 return smalltalk.withContext(function($ctx2) {
-$3=_st(html)._a();
-_st($3)._with_((function(){
+$4=_st(html)._a();
+_st($4)._with_((function(){
 return smalltalk.withContext(function($ctx3) {
 _st(_st(html)._tag_("i"))._class_(self._cssClassForItem_(aClass));
 return self._renderItemLabel_level_on_(aClass,anInteger,html);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-$4=_st($3)._onClick_((function(){
+$5=_st($4)._onClick_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._activateListItem_(_st(li)._asJQuery());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-return $4;
+return $5;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["with:"]=1;
 _st(self._getChildrenOf_(aClass))._do_((function(each){
@@ -1783,8 +1762,8 @@ return self._renderItem_level_on_(each,_st(anInteger).__plus((1)),html);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"renderItem:level:on:",{aClass:aClass,anInteger:anInteger,html:html,li:li},smalltalk.HLClassesListWidget)})},
 args: ["aClass", "anInteger", "html"],
-source: "renderItem: aClass level: anInteger on: html\x0a\x09| li |\x0a    \x0a\x09li := html li.\x0a\x09self registerMappingFrom: aClass to: li.\x0a\x09\x0a    li\x0a    \x09at: 'list-data' put: (self items indexOf: aClass);\x0a\x09\x09class: (self listCssClassForItem: aClass);\x0a\x09\x09with: [ \x0a        \x09html a\x0a            \x09with: [ \x0a            \x09\x09(html tag: 'i') class: (self cssClassForItem: aClass).\x0a  \x09\x09\x09\x09\x09self renderItemLabel: aClass level: anInteger on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a                  \x09self activateListItem: li asJQuery ] ].\x0a                    \x0a    (self getChildrenOf: aClass) do: [ :each |\x0a    \x09self renderItem: each level: anInteger + 1 on: html ]",
-messageSends: ["li", "registerMappingFrom:to:", "at:put:", "indexOf:", "items", "class:", "listCssClassForItem:", "with:", "a", "tag:", "cssClassForItem:", "renderItemLabel:level:on:", "onClick:", "activateListItem:", "asJQuery", "do:", "getChildrenOf:", "renderItem:level:on:", "+"],
+source: "renderItem: aClass level: anInteger on: html\x0a\x09| li |\x0a    \x0a\x09li := html li.\x0a\x09li asJQuery data: 'item' put: aClass.\x0a    li\x0a\x09\x09class: (self listCssClassForItem: aClass);\x0a\x09\x09with: [ \x0a        \x09html a\x0a            \x09with: [ \x0a            \x09\x09(html tag: 'i') class: (self cssClassForItem: aClass).\x0a  \x09\x09\x09\x09\x09self renderItemLabel: aClass level: anInteger on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a                  \x09self activateListItem: li asJQuery ] ].\x0a                    \x0a    (self getChildrenOf: aClass) do: [ :each |\x0a    \x09self renderItem: each level: anInteger + 1 on: html ]",
+messageSends: ["li", "data:put:", "asJQuery", "class:", "listCssClassForItem:", "with:", "a", "tag:", "cssClassForItem:", "renderItemLabel:level:on:", "onClick:", "activateListItem:", "do:", "getChildrenOf:", "renderItem:level:on:", "+"],
 referencedClasses: []
 }),
 smalltalk.HLClassesListWidget);
@@ -1828,7 +1807,7 @@ return _st(str)._nextPutAll_(_st(aClass)._name());
 }, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})})));
 return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:level:on:",{aClass:aClass,anInteger:anInteger,html:html},smalltalk.HLClassesListWidget)})},
 args: ["aClass", "anInteger", "html"],
-source: "renderItemLabel: aClass level: anInteger on: html\x0a\x09html span asJQuery html: (String streamContents: [ :str |\x0a\x09\x09anInteger timesRepeat: [\x0a\x09\x09\x09str nextPutAll: '&nbsp;&nbsp;&nbsp;&nbsp;'].\x0a\x09\x09\x09str nextPutAll: aClass name ])",
+source: "renderItemLabel: aClass level: anInteger on: html\x0a\x09html span asJQuery html: (String streamContents: [ :str |\x0a\x09\x09anInteger timesRepeat: [\x0a\x09\x09\x09str nextPutAll: '&nbsp;&nbsp;&nbsp;&nbsp;' ].\x0a\x09\x09\x09str nextPutAll: aClass name ])",
 messageSends: ["html:", "asJQuery", "span", "streamContents:", "timesRepeat:", "nextPutAll:", "name"],
 referencedClasses: ["String"]
 }),
@@ -1892,9 +1871,8 @@ category: 'private',
 fn: function (aPackage){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$1;
-$2=aPackage;
-if(($receiver = $2) == nil || $receiver == null){
+var $2,$1;
+if(($receiver = aPackage) == nil || $receiver == null){
 $1=[];
 } else {
 $1=_st(_st(_st(_st(_st(aPackage)._classes())._collect_((function(each){
@@ -1902,16 +1880,15 @@ return smalltalk.withContext(function($ctx2) {
 return _st(each)._theNonMetaClass();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})})))._asSet())._asArray())._sort_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
-$3=_st(a)._name();
+$2=_st(a)._name();
 $ctx2.sendIdx["name"]=1;
-$4=_st(b)._name();
-return _st($3).__lt($4);
+return _st($2).__lt(_st(b)._name());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,4)})}));
 };
 self._items_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"setItemsForPackage:",{aPackage:aPackage},smalltalk.HLClassesListWidget)})},
 args: ["aPackage"],
-source: "setItemsForPackage: aPackage\x0a\x09self items: (aPackage \x0a    \x09ifNil: [ #() ]\x0a  \x09\x09ifNotNil: [ ((aPackage classes \x0a        \x09collect: [ :each | each theNonMetaClass ]) asSet asArray) \x0a            \x09sort: [:a :b | a name < b name ] ]).",
+source: "setItemsForPackage: aPackage\x0a\x09self items: (aPackage \x0a    \x09ifNil: [ #() ]\x0a  \x09\x09ifNotNil: [ ((aPackage classes \x0a        \x09collect: [ :each | each theNonMetaClass ]) asSet asArray) \x0a            \x09sort: [ :a :b | a name < b name ] ]).",
 messageSends: ["items:", "ifNil:ifNotNil:", "sort:", "asArray", "asSet", "collect:", "classes", "theNonMetaClass", "<", "name"],
 referencedClasses: []
 }),
@@ -2259,7 +2236,7 @@ category: 'reactions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $5,$4,$3,$2,$1,$9,$8,$7,$6;
+var $5,$4,$3,$2,$1;
 $5=self._model();
 $ctx1.sendIdx["model"]=1;
 $4=_st($5)._selectedClass();
@@ -2268,11 +2245,7 @@ $3=_st($4)._theNonMetaClass();
 $ctx1.sendIdx["theNonMetaClass"]=1;
 $2=_st($3)._name();
 $1=_st($2).__comma(" comment");
-$9=self._model();
-$8=_st($9)._selectedClass();
-$7=_st($8)._theNonMetaClass();
-$6=_st($7)._comment();
-self._request_value_do_($1,$6,(function(comment){
+self._request_value_do_($1,_st(_st(_st(self._model())._selectedClass())._theNonMetaClass())._comment(),(function(comment){
 return smalltalk.withContext(function($ctx2) {
 return self._setClassComment_(comment);
 }, function($ctx2) {$ctx2.fillBlock({comment:comment},$ctx1,1)})}));
@@ -2316,7 +2289,7 @@ fn: function (html){
 var self=this;
 function $Showdown(){return smalltalk.Showdown||(typeof Showdown=="undefined"?nil:Showdown)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$5,$3,$7,$8,$6;
+var $1,$2,$4,$5,$3,$6,$7;
 $1=self._selectedItem();
 if(($receiver = $1) == nil || $receiver == null){
 $1;
@@ -2339,11 +2312,10 @@ return $5;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 $ctx1.sendIdx["with:"]=2;
 $3;
-$7=_st(html)._div();
-_st($7)._class_("markdown");
-$8=_st($7)._asJQuery();
-$6=$8;
-_st($6)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(self._documentation()));
+$6=_st(html)._div();
+_st($6)._class_("markdown");
+$7=_st($6)._asJQuery();
+_st($7)._html_(_st(_st(_st($Showdown())._at_("converter"))._new())._makeHtml_(self._documentation()));
 };
 return self}, function($ctx1) {$ctx1.fill(self,"renderDocOn:",{html:html},smalltalk.HLDocumentationWidget)})},
 args: ["html"],
@@ -2379,7 +2351,7 @@ category: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$5,$6,$9,$8,$7,$12,$11,$10,$2;
+var $1,$4,$3,$5,$6,$9,$8,$7,$10,$2;
 $1=_st(html)._div();
 _st($1)._class_("inheritance");
 $2=_st($1)._with_((function(){
@@ -2404,9 +2376,7 @@ $7=_st($8)._name();
 _st($6)._with_($7);
 $10=_st($5)._onClick_((function(){
 return smalltalk.withContext(function($ctx3) {
-$12=self._selectedItem();
-$11=_st($12)._superclass();
-return self._selectClass_($11);
+return self._selectClass_(_st(self._selectedItem())._superclass());
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
 return $10;
 };
@@ -2630,7 +2600,7 @@ category: 'accessing',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$5,$7,$6,$9,$8,$4;
+var $2,$1,$3,$5,$7,$6,$4;
 $2=self._model();
 $ctx1.sendIdx["model"]=1;
 $1=_st($2)._selectedClass();
@@ -2649,9 +2619,7 @@ $6=_st($7)._selectedClass();
 $ctx1.sendIdx["selectedClass"]=2;
 $4=_st($6)._methods();
 } else {
-$9=self._model();
-$8=_st($9)._selectedClass();
-$4=_st($8)._methodsInProtocol_(aString);
+$4=_st(_st(self._model())._selectedClass())._methodsInProtocol_(aString);
 };
 return $4;
 }, function($ctx1) {$ctx1.fill(self,"methodsInProtocol:",{aString:aString},smalltalk.HLMethodsListWidget)})},
@@ -2750,27 +2718,25 @@ category: 'reactions',
 fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$1,$8,$7,$10,$9,$6,$11,$5;
-$4=self._model();
+var $3,$2,$1,$6,$5,$4,$7;
+$3=self._model();
 $ctx1.sendIdx["model"]=1;
-$3=_st($4)._selectedMethod();
-$2=_st($3).__eq(_st(anAnnouncement)._method());
+$2=_st($3)._selectedMethod();
+$1=_st($2).__eq(_st(anAnnouncement)._method());
 $ctx1.sendIdx["="]=1;
-if(! smalltalk.assert($2)){
+if(! smalltalk.assert($1)){
 return self;
 };
-$8=self._model();
+$6=self._model();
 $ctx1.sendIdx["model"]=2;
-$7=_st($8)._selectedProtocol();
-$10=self._model();
-$9=_st($10)._allProtocol();
-$6=_st($7).__eq($9);
-if(! smalltalk.assert($6)){
+$5=_st($6)._selectedProtocol();
+$4=_st($5).__eq(_st(self._model())._allProtocol());
+if(! smalltalk.assert($4)){
 self._selectedItem_(nil);
 self._selectItem_(nil);
 self._setItemsForSelectedProtocol();
-$11=self._refresh();
-$5=$11;
+$7=self._refresh();
+$7;
 };
 return self}, function($ctx1) {$ctx1.fill(self,"onMethodMoved:",{anAnnouncement:anAnnouncement},smalltalk.HLMethodsListWidget)})},
 args: ["anAnnouncement"],
@@ -2788,38 +2754,35 @@ fn: function (anAnnouncement){
 var self=this;
 var method;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$6,$7,$4,$8;
+var $1,$2,$4,$3,$5;
 var $early={};
 try {
 method=_st(anAnnouncement)._method();
 _st(self._items())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$1=each;
-$2=_st(method)._selector();
+$1=_st(method)._selector();
 $ctx2.sendIdx["selector"]=1;
-return _st($1).__eq($2);
+return _st(each).__eq($1);
 $ctx2.sendIdx["="]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-$3=self._selectedItem();
+$2=self._selectedItem();
 $ctx1.sendIdx["selectedItem"]=1;
-if(($receiver = $3) == nil || $receiver == null){
-$3;
+if(($receiver = $2) == nil || $receiver == null){
+$2;
 } else {
-$5=_st(_st(method)._methodClass()).__eq(_st(self._model())._selectedClass());
+$4=_st(_st(method)._methodClass()).__eq(_st(self._model())._selectedClass());
 $ctx1.sendIdx["="]=2;
-$4=_st($5)._and_((function(){
+$3=_st($4)._and_((function(){
 return smalltalk.withContext(function($ctx2) {
-$6=_st(method)._selector();
-$7=self._selectedItem();
-return _st($6).__eq($7);
+return _st(_st(method)._selector()).__eq(self._selectedItem());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
-if(smalltalk.assert($4)){
+if(smalltalk.assert($3)){
 self._selectedItem_(nil);
-$8=self._selectItem_(nil);
-$8;
+$5=self._selectItem_(nil);
+$5;
 };
 };
 self._setItemsForSelectedProtocol();
@@ -2964,15 +2927,14 @@ fn: function (){
 var self=this;
 function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $1=_st(self._selectorsCache())._at_ifAbsentPut_("override",(function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(_st(self._model())._selectedClass())._allSuperclasses())._inject_into_(_st($Set())._new(),(function(acc,each){
 return smalltalk.withContext(function($ctx3) {
-$2=acc;
-_st($2)._addAll_(_st(each)._selectors());
-$3=_st($2)._yourself();
-return $3;
+_st(acc)._addAll_(_st(each)._selectors());
+$2=_st(acc)._yourself();
+return $2;
 }, function($ctx3) {$ctx3.fillBlock({acc:acc,each:each},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
@@ -2992,15 +2954,14 @@ fn: function (){
 var self=this;
 function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $1=_st(self._selectorsCache())._at_ifAbsentPut_("overriden",(function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(_st(self._model())._selectedClass())._allSubclasses())._inject_into_(_st($Set())._new(),(function(acc,each){
 return smalltalk.withContext(function($ctx3) {
-$2=acc;
-_st($2)._addAll_(_st(each)._selectors());
-$3=_st($2)._yourself();
-return $3;
+_st(acc)._addAll_(_st(each)._selectors());
+$2=_st(acc)._yourself();
+return $2;
 }, function($ctx3) {$ctx3.fillBlock({acc:acc,each:each},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
@@ -3064,19 +3025,17 @@ category: 'actions',
 fn: function (aSelector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$5,$4;
-$1=aSelector;
-if(($receiver = $1) == nil || $receiver == null){
-$3=self._model();
+var $2,$1;
+if(($receiver = aSelector) == nil || $receiver == null){
+$2=self._model();
 $ctx1.sendIdx["model"]=1;
-$2=_st($3)._selectedMethod_(nil);
+$1=_st($2)._selectedMethod_(nil);
 $ctx1.sendIdx["selectedMethod:"]=1;
-return $2;
+return $1;
 } else {
-$1;
+aSelector;
 };
-$5=self._model();
-$4=_st($5)._selectedMethod_(self._methodForSelector_(aSelector));
+_st(self._model())._selectedMethod_(self._methodForSelector_(aSelector));
 return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aSelector:aSelector},smalltalk.HLMethodsListWidget)})},
 args: ["aSelector"],
 source: "selectItem: aSelector\x0a\x09aSelector ifNil: [ ^ self model selectedMethod: nil ].\x0a\x0a   \x09self model selectedMethod: (self methodForSelector: aSelector)",
@@ -3131,9 +3090,8 @@ category: 'private',
 fn: function (aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1;
-$3=aString;
-if(($receiver = $3) == nil || $receiver == null){
+var $2,$1;
+if(($receiver = aString) == nil || $receiver == null){
 $2=[];
 } else {
 $2=self._selectorsInProtocol_(aString);
@@ -3244,13 +3202,12 @@ category: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 self["@items"]=_st(_st(self._model())._packages())._sort_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
 $2=_st(a)._name();
 $ctx2.sendIdx["name"]=1;
-$3=_st(b)._name();
-return _st($2).__lt($3);
+return _st($2).__lt(_st(b)._name());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)})}));
 $1=self["@items"];
 return $1;
@@ -3330,13 +3287,21 @@ category: 'actions',
 fn: function (){
 var self=this;
 function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
+function $PackageAdded(){return smalltalk.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(self._model())._systemAnnouncer())._on_send_to_($ClassAdded(),"onClassAdded:",self);
+var $2,$1;
+$2=self._model();
+$ctx1.sendIdx["model"]=1;
+$1=_st($2)._systemAnnouncer();
+$ctx1.sendIdx["systemAnnouncer"]=1;
+_st($1)._on_send_to_($ClassAdded(),"onClassAdded:",self);
+$ctx1.sendIdx["on:send:to:"]=1;
+_st(_st(self._model())._systemAnnouncer())._on_send_to_($PackageAdded(),"onPackageAdded:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLPackagesListWidget)})},
 args: [],
-source: "observeSystem\x0a    self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self",
+source: "observeSystem\x0a    self model systemAnnouncer \x0a\x09\x09on: ClassAdded \x0a\x09\x09send: #onClassAdded:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model systemAnnouncer\x0a\x09\x09on: PackageAdded\x0a\x09\x09send: #onPackageAdded:\x0a\x09\x09to: self",
 messageSends: ["on:send:to:", "systemAnnouncer", "model"],
-referencedClasses: ["ClassAdded"]
+referencedClasses: ["ClassAdded", "PackageAdded"]
 }),
 smalltalk.HLPackagesListWidget);
 
@@ -3362,6 +3327,24 @@ referencedClasses: []
 }),
 smalltalk.HLPackagesListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onPackageAdded:",
+category: 'reactions',
+fn: function (anAnnouncement){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+self._initializeItems();
+$1=self._refresh();
+return self}, function($ctx1) {$ctx1.fill(self,"onPackageAdded:",{anAnnouncement:anAnnouncement},smalltalk.HLPackagesListWidget)})},
+args: ["anAnnouncement"],
+source: "onPackageAdded: anAnnouncement\x0a\x09self \x0a\x09\x09initializeItems;\x0a\x09\x09refresh",
+messageSends: ["initializeItems", "refresh"],
+referencedClasses: []
+}),
+smalltalk.HLPackagesListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onPackageSelected:",
@@ -3464,23 +3447,23 @@ category: 'accessing',
 fn: function (anItem){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$6,$5,$8,$7;
-$2=_st(anItem).__eq(self._allProtocol());
+var $1,$2,$3,$4;
+$1=_st(anItem).__eq(self._allProtocol());
 $ctx1.sendIdx["="]=1;
-if(smalltalk.assert($2)){
+if(smalltalk.assert($1)){
 return "";
 };
-$4=_st(anItem).__eq("private");
+$2=_st(anItem).__eq("private");
 $ctx1.sendIdx["="]=2;
-if(smalltalk.assert($4)){
+if(smalltalk.assert($2)){
 return "private";
 };
-$6=_st(anItem).__eq("initialization");
-if(smalltalk.assert($6)){
+$3=_st(anItem).__eq("initialization");
+if(smalltalk.assert($3)){
 return "initialization";
 };
-$8=_st(anItem)._match_("^\x5c*");
-if(smalltalk.assert($8)){
+$4=_st(anItem)._match_("^\x5c*");
+if(smalltalk.assert($4)){
 return "extension";
 };
 return "";
@@ -3608,7 +3591,7 @@ fn: function (anAnnouncement){
 var self=this;
 var class_,protocol;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$3,$1,$7,$6,$5,$8;
+var $2,$4,$3,$1,$5,$6;
 class_=_st(anAnnouncement)._theClass();
 protocol=_st(anAnnouncement)._protocol();
 $2=class_;
@@ -3620,13 +3603,11 @@ $ctx1.sendIdx["="]=1;
 if(! smalltalk.assert($1)){
 return self;
 };
-$7=self._model();
-$6=_st($7)._selectedProtocol();
-$5=_st($6).__eq(protocol);
+$5=_st(_st(self._model())._selectedProtocol()).__eq(protocol);
 if(smalltalk.assert($5)){
 self._selectedItem_(nil);
-$8=self._selectItem_(nil);
-$8;
+$6=self._selectItem_(nil);
+$6;
 };
 self._setItemsForSelectedClass();
 self._refresh();
@@ -3756,21 +3737,17 @@ fn: function (aClass){
 var self=this;
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$6,$7,$5,$8,$1;
-$2=aClass;
-if(($receiver = $2) == nil || $receiver == null){
-$3=$Array();
-$4=self._allProtocol();
+var $2,$3,$4,$1;
+if(($receiver = aClass) == nil || $receiver == null){
+$2=self._allProtocol();
 $ctx1.sendIdx["allProtocol"]=1;
-$1=_st($3)._with_($4);
+$1=_st($Array())._with_($2);
 $ctx1.sendIdx["with:"]=1;
 } else {
-$6=$Array();
-$7=self._allProtocol();
-$5=_st($6)._with_($7);
-_st($5)._addAll_(_st(aClass)._protocols());
-$8=_st($5)._yourself();
-$1=$8;
+$3=_st($Array())._with_(self._allProtocol());
+_st($3)._addAll_(_st(aClass)._protocols());
+$4=_st($3)._yourself();
+$1=$4;
 };
 self._items_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"setItemsForClass:",{aClass:aClass},smalltalk.HLProtocolsListWidget)})},
@@ -3807,18 +3784,17 @@ category: 'accessing',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=aClass;
-if(($receiver = $1) == nil || $receiver == null){
+var $1;
+if(($receiver = aClass) == nil || $receiver == null){
 return nil;
 } else {
-$1;
+aClass;
 };
-$2=_st(self._classesCache())._at_ifAbsentPut_(_st(aClass)._name(),(function(){
+$1=_st(self._classesCache())._at_ifAbsentPut_(_st(aClass)._name(),(function(){
 return smalltalk.withContext(function($ctx2) {
 return self._newCacheFor_(aClass);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-return $2;
+return $1;
 }, function($ctx1) {$ctx1.fill(self,"cacheFor:",{aClass:aClass},smalltalk.HLSelectorsCache)})},
 args: ["aClass"],
 source: "cacheFor: aClass\x0a\x09aClass ifNil: [ ^ nil ].\x0a    \x0a\x09^ self classesCache\x0a    \x09at: aClass name\x0a        ifAbsentPut: [ self newCacheFor: aClass ]",

+ 4 - 9
js/Helios-Commands-Browser.js

@@ -355,15 +355,13 @@ category: 'testing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$5,$4,$1;
+var $3,$2,$1;
 $3=self._model();
 $ctx1.sendIdx["model"]=1;
 $2=_st($3)._showComment();
 $1=_st($2)._and_((function(){
 return smalltalk.withContext(function($ctx2) {
-$5=self._model();
-$4=_st($5)._selectedClass();
-return _st($4)._notNil();
+return _st(_st(self._model())._selectedClass())._notNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLEditCommentCommand)})},
@@ -451,13 +449,10 @@ category: 'executing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2;
+var $1;
 $1=self._model();
 $ctx1.sendIdx["model"]=1;
-$4=self._model();
-$3=_st($4)._showComment();
-$2=_st($3)._not();
-_st($1)._showComment_($2);
+_st($1)._showComment_(_st(_st(self._model())._showComment())._not());
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassCommentCommand)})},
 args: [],
 source: "execute\x0a\x09self model showComment: self model showComment not",

+ 4 - 6
js/Helios-Commands-Core.js

@@ -851,14 +851,12 @@ var self=this;
 var activeTab;
 function $HLTabSelectionWidget(){return smalltalk.HLTabSelectionWidget||(typeof HLTabSelectionWidget=="undefined"?nil:HLTabSelectionWidget)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$1;
+var $2,$3,$1;
 activeTab=self._selectedTab();
 $ctx1.sendIdx["selectedTab"]=1;
 $2=_st($HLTabSelectionWidget())._new();
 _st($2)._tabs_(self._tabs());
-$3=$2;
-$4=self._selectedTab();
-_st($3)._selectedTab_($4);
+_st($2)._selectedTab_(self._selectedTab());
 _st($2)._selectCallback_((function(tab){
 return smalltalk.withContext(function($ctx2) {
 return _st(tab)._activate();
@@ -872,8 +870,8 @@ _st($2)._cancelCallback_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(activeTab)._activate();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
-$5=_st($2)._show();
-$1=$5;
+$3=_st($2)._show();
+$1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{activeTab:activeTab},smalltalk.HLSwitchTabCommand)})},
 args: [],

+ 4 - 7
js/Helios-Commands-Tools.js

@@ -507,13 +507,12 @@ category: 'defaults',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$5,$4,$1;
+var $3,$2,$4,$1;
 $3=self._model();
 $ctx1.sendIdx["model"]=1;
 $2=_st($3)._selectedMethod();
 if(($receiver = $2) == nil || $receiver == null){
-$5=self._model();
-$4=_st($5)._selectedClass();
+$4=_st(self._model())._selectedClass();
 if(($receiver = $4) == nil || $receiver == null){
 $1="";
 } else {
@@ -578,13 +577,11 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$5,$4,$1;
+var $3,$2,$1;
 $3=self._model();
 $ctx1.sendIdx["model"]=1;
 $2=_st($3)._availableClassNames();
-$5=self._model();
-$4=_st($5)._allSelectors();
-$1=_st($2).__comma($4);
+$1=_st($2).__comma(_st(self._model())._allSelectors());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLFindReferencesCommand)})},
 args: [],

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 208 - 286
js/Helios-Core.js


+ 111 - 79
js/Helios-Debugger.js

@@ -46,13 +46,13 @@ var self=this;
 var variables,inspectedContext;
 function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1,$4,$5,$6,$7,$8;
+var $1,$2,$3,$4;
 variables=_st($Dictionary())._new();
 inspectedContext=self._context();
-$2=variables;
-$3=_st(inspectedContext)._locals();
+$1=variables;
+$2=_st(inspectedContext)._locals();
 $ctx1.sendIdx["locals"]=1;
-$1=_st($2)._addAll_($3);
+_st($1)._addAll_($2);
 $ctx1.sendIdx["addAll:"]=1;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -64,18 +64,15 @@ return _st(inspectedContext)._isBlockContext();
 return smalltalk.withContext(function($ctx2) {
 inspectedContext=_st(inspectedContext)._outerContext();
 inspectedContext;
-$4=inspectedContext;
-if(($receiver = $4) == nil || $receiver == null){
-return $4;
+$3=inspectedContext;
+if(($receiver = $3) == nil || $receiver == null){
+return $3;
 } else {
-$5=variables;
-$6=_st(inspectedContext)._locals();
-return _st($5)._addAll_($6);
+return _st(variables)._addAll_(_st(inspectedContext)._locals());
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
-$7=anInspector;
-_st($7)._setLabel_("Context");
-$8=_st($7)._setVariables_(variables);
+_st(anInspector)._setLabel_("Context");
+$4=_st(anInspector)._setVariables_(variables);
 return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables,inspectedContext:inspectedContext},smalltalk.HLContextInspectorDecorator)})},
 args: ["anInspector"],
 source: "inspectOn: anInspector\x0a\x09| variables inspectedContext |\x0a\x09\x0a\x09variables := Dictionary new.\x0a\x09inspectedContext := self context.\x0a\x09\x0a\x09variables addAll: inspectedContext locals.\x0a\x09\x0a\x09[ inspectedContext notNil and: [ inspectedContext isBlockContext ] ] whileTrue: [\x0a\x09\x09inspectedContext := inspectedContext outerContext.\x0a\x09\x09inspectedContext ifNotNil: [\x0a\x09\x09\x09variables addAll: inspectedContext locals ] ].\x0a\x09\x0a\x09anInspector\x0a\x09\x09setLabel: 'Context';\x0a\x09\x09setVariables: variables",
@@ -230,16 +227,14 @@ var self=this;
 function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected||(typeof HLDebuggerContextSelected=="undefined"?nil:HLDebuggerContextSelected)}
 function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$6,$5,$4;
-$3=self._model();
+var $2,$1;
+$2=self._model();
 $ctx1.sendIdx["model"]=1;
-$2=_st($3)._announcer();
+$1=_st($2)._announcer();
 $ctx1.sendIdx["announcer"]=1;
-$1=_st($2)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
+_st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected:",self);
 $ctx1.sendIdx["on:send:to:"]=1;
-$6=self._model();
-$5=_st($6)._announcer();
-$4=_st($5)._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
+_st(_st(self._model())._announcer())._on_send_to_($HLDebuggerStepped(),"onContextSelected:",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLDebugger)})},
 args: [],
 source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self.\x0a\x09\x09\x0a\x09self model announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected:\x0a\x09\x09to: self",
@@ -292,16 +287,11 @@ function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="unde
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$6,$7,$8,$5,$3,$1;
-$2=html;
-$4=$HLContainer();
-$6=$HLHorizontalSplitter();
-$7=self._stackListWidget();
-$8=_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget());
-$5=_st($6)._with_with_($7,$8);
+var $2,$1;
+$2=_st($HLHorizontalSplitter())._with_with_(self._stackListWidget(),_st($HLVerticalSplitter())._with_with_(self._codeWidget(),self._inspectorWidget()));
 $ctx1.sendIdx["with:with:"]=1;
-$3=_st($4)._with_($5);
-$1=_st($2)._with_($3);
+$1=_st($HLContainer())._with_($2);
+_st(html)._with_($1);
 $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLDebugger)})},
 args: ["html"],
@@ -346,10 +336,9 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=smalltalk.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
+smalltalk.HLDebugger.superclass.fn.prototype._unregister.apply(_st(self), []);
 $ctx1.sendIdx["unregister"]=1;
-$2=_st(self._inspectorWidget())._unregister();
+_st(self._inspectorWidget())._unregister();
 return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLDebugger)})},
 args: [],
 source: "unregister\x0a\x09super unregister.\x0a\x09self inspectorWidget unregister",
@@ -508,58 +497,53 @@ fn: function (aNode){
 var self=this;
 var token;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$7,$6,$5,$4,$10,$9,$8,$3,$14,$13,$12,$11,$15,$20,$19,$18,$17,$21,$16,$26,$25,$24,$23,$27,$22;
-$1=aNode;
-if(($receiver = $1) == nil || $receiver == null){
-$1;
+var $1,$6,$5,$4,$3,$9,$8,$7,$2,$13,$12,$11,$10,$14,$19,$18,$17,$16,$20,$15,$22,$21;
+if(($receiver = aNode) == nil || $receiver == null){
+aNode;
 } else {
-$2=self._editor();
+$1=self._editor();
 $ctx1.sendIdx["editor"]=1;
-$7=_st(aNode)._position();
+$6=_st(aNode)._position();
 $ctx1.sendIdx["position"]=1;
-$6=_st($7)._x();
+$5=_st($6)._x();
 $ctx1.sendIdx["x"]=1;
-$5=_st($6).__minus((1));
+$4=_st($5).__minus((1));
 $ctx1.sendIdx["-"]=1;
-$4="line".__minus_gt($5);
+$3="line".__minus_gt($4);
 $ctx1.sendIdx["->"]=1;
-$10=_st(aNode)._position();
+$9=_st(aNode)._position();
 $ctx1.sendIdx["position"]=2;
-$9=_st($10)._y();
-$8="ch".__minus_gt($9);
+$8=_st($9)._y();
+$7="ch".__minus_gt($8);
 $ctx1.sendIdx["->"]=2;
-$3=smalltalk.HashedCollection._from_([$4,$8]);
-token=_st($2)._getTokenAt_($3);
+$2=smalltalk.HashedCollection._from_([$3,$7]);
+token=_st($1)._getTokenAt_($2);
 token;
 self._clearHighlight();
-$14=_st(aNode)._position();
+$13=_st(aNode)._position();
 $ctx1.sendIdx["position"]=3;
-$13=_st($14)._x();
+$12=_st($13)._x();
 $ctx1.sendIdx["x"]=2;
-$12=_st($13).__minus((1));
+$11=_st($12).__minus((1));
 $ctx1.sendIdx["-"]=2;
-$11=self._addStopAt_($12);
-$11;
-$15=self._editor();
-$20=_st(aNode)._position();
+$10=self._addStopAt_($11);
+$10;
+$14=self._editor();
+$19=_st(aNode)._position();
 $ctx1.sendIdx["position"]=4;
-$19=_st($20)._x();
+$18=_st($19)._x();
 $ctx1.sendIdx["x"]=3;
-$18=_st($19).__minus((1));
+$17=_st($18).__minus((1));
 $ctx1.sendIdx["-"]=3;
-$17="line".__minus_gt($18);
+$16="line".__minus_gt($17);
 $ctx1.sendIdx["->"]=3;
-$21="ch".__minus_gt(_st(token)._start());
+$20="ch".__minus_gt(_st(token)._start());
 $ctx1.sendIdx["->"]=4;
-$16=smalltalk.HashedCollection._from_([$17,$21]);
-$26=_st(aNode)._position();
-$25=_st($26)._x();
-$24=_st($25).__minus((1));
-$23="line".__minus_gt($24);
+$15=smalltalk.HashedCollection._from_([$16,$20]);
+$22="line".__minus_gt(_st(_st(_st(aNode)._position())._x()).__minus((1)));
 $ctx1.sendIdx["->"]=5;
-$27="ch".__minus_gt(_st(token)._end());
-$22=smalltalk.HashedCollection._from_([$23,$27]);
-_st($15)._setSelection_to_($16,$22);
+$21=smalltalk.HashedCollection._from_([$22,"ch".__minus_gt(_st(token)._end())]);
+_st($14)._setSelection_to_($15,$21);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"highlightNode:",{aNode:aNode,token:token},smalltalk.HLDebuggerCodeWidget)})},
 args: ["aNode"],
@@ -579,23 +563,21 @@ function $HLDebuggerContextSelected(){return smalltalk.HLDebuggerContextSelected
 function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
 function $HLDebuggerWhere(){return smalltalk.HLDebuggerWhere||(typeof HLDebuggerWhere=="undefined"?nil:HLDebuggerWhere)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$6,$5,$4,$9,$8,$7;
+var $2,$1,$4,$3;
 smalltalk.HLDebuggerCodeWidget.superclass.fn.prototype._observeBrowserModel.apply(_st(self), []);
-$3=self._browserModel();
+$2=self._browserModel();
 $ctx1.sendIdx["browserModel"]=1;
-$2=_st($3)._announcer();
+$1=_st($2)._announcer();
 $ctx1.sendIdx["announcer"]=1;
-$1=_st($2)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
+_st($1)._on_send_to_($HLDebuggerContextSelected(),"onContextSelected",self);
 $ctx1.sendIdx["on:send:to:"]=1;
-$6=self._browserModel();
+$4=self._browserModel();
 $ctx1.sendIdx["browserModel"]=2;
-$5=_st($6)._announcer();
+$3=_st($4)._announcer();
 $ctx1.sendIdx["announcer"]=2;
-$4=_st($5)._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
+_st($3)._on_send_to_($HLDebuggerStepped(),"onContextSelected",self);
 $ctx1.sendIdx["on:send:to:"]=2;
-$9=self._browserModel();
-$8=_st($9)._announcer();
-$7=_st($8)._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
+_st(_st(self._browserModel())._announcer())._on_send_to_($HLDebuggerWhere(),"onContextSelected",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLDebuggerCodeWidget)})},
 args: [],
 source: "observeBrowserModel\x0a\x09super observeBrowserModel.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerContextSelected\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerStepped\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self.\x0a\x09\x0a\x09self browserModel announcer \x0a\x09\x09on: HLDebuggerWhere\x0a\x09\x09send: #onContextSelected\x0a\x09\x09to: self",
@@ -815,6 +797,28 @@ referencedClasses: []
 }),
 smalltalk.HLDebuggerModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "skip",
+category: 'actions',
+fn: function (){
+var self=this;
+function $HLDebuggerStepped(){return smalltalk.HLDebuggerStepped||(typeof HLDebuggerStepped=="undefined"?nil:HLDebuggerStepped)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+_st(self._interpreter())._skip();
+$1=_st($HLDebuggerStepped())._new();
+_st($1)._context_(self._currentContext());
+$2=_st($1)._yourself();
+_st(self._announcer())._announce_($2);
+return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.HLDebuggerModel)})},
+args: [],
+source: "skip\x0a\x09self interpreter skip.\x0a\x09self announcer announce: (HLDebuggerStepped new\x0a\x09\x09context: self currentContext;\x0a\x09\x09yourself)",
+messageSends: ["skip", "interpreter", "announce:", "announcer", "context:", "new", "currentContext", "yourself"],
+referencedClasses: ["HLDebuggerStepped"]
+}),
+smalltalk.HLDebuggerModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "stepOver",
@@ -992,7 +996,7 @@ category: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$5,$6,$7,$8,$2;
+var $1,$3,$4,$5,$6,$7,$8,$9,$10,$2;
 $1=_st(html)._div();
 _st($1)._class_("debugger_bar");
 $ctx1.sendIdx["class:"]=1;
@@ -1023,19 +1027,31 @@ return self._where();
 $ctx2.sendIdx["onClick:"]=2;
 $6;
 $7=_st(html)._button();
+$ctx2.sendIdx["button"]=3;
 _st($7)._class_("btn stepOver");
+$ctx2.sendIdx["class:"]=4;
 _st($7)._with_("Step over");
+$ctx2.sendIdx["with:"]=4;
 $8=_st($7)._onClick_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._stepOver();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
-return $8;
+$ctx2.sendIdx["onClick:"]=3;
+$8;
+$9=_st(html)._button();
+_st($9)._class_("btn skip");
+_st($9)._with_("Skip");
+$10=_st($9)._onClick_((function(){
+return smalltalk.withContext(function($ctx3) {
+return self._skip();
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
+return $10;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLStackListWidget)})},
 args: ["html"],
-source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn where';\x0a\x09\x09\x09\x09with: 'Where';\x0a\x09\x09\x09\x09onClick: [ self where ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ] ]",
-messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver"],
+source: "renderButtonsOn: html\x0a\x09html div \x0a\x09\x09class: 'debugger_bar'; \x0a\x09\x09with: [\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn restart';\x0a\x09\x09\x09\x09with: 'Restart';\x0a\x09\x09\x09\x09onClick: [ self restart ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn where';\x0a\x09\x09\x09\x09with: 'Where';\x0a\x09\x09\x09\x09onClick: [ self where ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn stepOver';\x0a\x09\x09\x09\x09with: 'Step over';\x0a\x09\x09\x09\x09onClick: [ self stepOver ].\x0a\x09\x09\x09html button \x0a\x09\x09\x09\x09class: 'btn skip';\x0a\x09\x09\x09\x09with: 'Skip';\x0a\x09\x09\x09\x09onClick: [ self skip ] ]",
+messageSends: ["class:", "div", "with:", "button", "onClick:", "restart", "where", "stepOver", "skip"],
 referencedClasses: []
 }),
 smalltalk.HLStackListWidget);
@@ -1072,6 +1088,22 @@ referencedClasses: []
 }),
 smalltalk.HLStackListWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "skip",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._model())._skip();
+return self}, function($ctx1) {$ctx1.fill(self,"skip",{},smalltalk.HLStackListWidget)})},
+args: [],
+source: "skip\x0a\x09self model skip",
+messageSends: ["skip", "model"],
+referencedClasses: []
+}),
+smalltalk.HLStackListWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "stepOver",

+ 6 - 0
js/Helios-Exceptions.js

@@ -3,8 +3,14 @@ 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('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('HLListItemNotFound', smalltalk.HLError, [], 'Helios-Exceptions');
+smalltalk.HLListItemNotFound.comment="I get signaled by a `HLListWidget` when a non-existing item in the list is activated.";
 
 });

+ 16 - 24
js/Helios-Inspector.js

@@ -72,7 +72,7 @@ $1="";
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selectionDisplayString",{selection:selection},smalltalk.HLInspectorDisplayWidget)})},
 args: [],
-source: "selectionDisplayString\x0a\x09|selection|\x0a\x09selection := model selection.\x0a    ^ (model variables keys includes: selection)\x0a    \x09ifTrue:[(model instVarObjectAt: selection) printString]\x0a      \x09ifFalse:['']",
+source: "selectionDisplayString\x0a\x09|selection|\x0a\x09selection := model selection.\x0a    ^ (model variables keys includes: selection)\x0a    \x09ifTrue:[ (model instVarObjectAt: selection) printString ]\x0a      \x09ifFalse:[ '' ]",
 messageSends: ["selection", "ifTrue:ifFalse:", "includes:", "keys", "variables", "printString", "instVarObjectAt:"],
 referencedClasses: []
 }),
@@ -100,7 +100,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLInspectorModel)})},
 args: [],
-source: "announcer\x0a\x09^ announcer ifNil: [announcer := Announcer new ]",
+source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: ["Announcer"]
 }),
@@ -1121,13 +1121,10 @@ var self=this;
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
-$1=html;
-$3=$HLHorizontalSplitter();
-$4=_st($HLVerticalSplitter())._with_with_(self._variablesWidget(),self._displayWidget());
-$2=_st($3)._with_with_($4,self._codeWidget());
+var $1;
+$1=_st($HLHorizontalSplitter())._with_with_(_st($HLVerticalSplitter())._with_with_(self._variablesWidget(),self._displayWidget()),self._codeWidget());
 $ctx1.sendIdx["with:with:"]=1;
-_st($1)._with_($2);
+_st(html)._with_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLInspectorWidget)})},
 args: ["html"],
 source: "renderContentOn: html\x0a   \x09html with: (HLHorizontalSplitter\x0a    \x09with: (HLVerticalSplitter \x0a            with: self variablesWidget\x0a            with: self displayWidget)\x0a        with: self codeWidget)",
@@ -1243,21 +1240,16 @@ function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="unde
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$6,$8,$9,$7,$5,$3,$1,$10;
-$2=html;
-$4=$HLContainer();
-$6=$HLHorizontalSplitter();
-$8=$HLVerticalSplitter();
-$9=self._variablesWidget();
+var $4,$3,$2,$1;
+$4=self._variablesWidget();
 $ctx1.sendIdx["variablesWidget"]=1;
-$7=_st($8)._with_with_($9,self._displayWidget());
-$5=_st($6)._with_with_($7,self._codeWidget());
+$3=_st($HLVerticalSplitter())._with_with_($4,self._displayWidget());
+$2=_st($HLHorizontalSplitter())._with_with_($3,self._codeWidget());
 $ctx1.sendIdx["with:with:"]=1;
-$3=_st($4)._with_($5);
-$1=_st($2)._with_($3);
+$1=_st($HLContainer())._with_($2);
+_st(html)._with_($1);
 $ctx1.sendIdx["with:"]=1;
-$10=self._variablesWidget();
-_st($10)._focus();
+_st(self._variablesWidget())._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLInspector)})},
 args: ["html"],
 source: "renderContentOn: html\x0a   \x09html with: (HLContainer with: (HLHorizontalSplitter\x0a    \x09with: (HLVerticalSplitter \x0a            with: self variablesWidget\x0a            with: self displayWidget)\x0a        with: self codeWidget)).\x0a\x09\x0a\x09self variablesWidget focus",
@@ -1310,12 +1302,12 @@ var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=self._new();
-_st($1)._inspect_(anObject);
-$2=_st($1)._openAsTab();
+_st($1)._openAsTab();
+$2=_st($1)._inspect_(anObject);
 return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLInspector.klass)})},
 args: ["anObject"],
-source: "inspect: anObject\x0a\x09self new\x0a\x09\x09inspect: anObject;\x0a\x09\x09openAsTab",
-messageSends: ["inspect:", "new", "openAsTab"],
+source: "inspect: anObject\x0a\x09self new\x0a\x09\x09openAsTab;\x0a\x09\x09inspect: anObject",
+messageSends: ["openAsTab", "new", "inspect:"],
 referencedClasses: []
 }),
 smalltalk.HLInspector.klass);

+ 32 - 48
js/Helios-KeyBindings.js

@@ -361,7 +361,7 @@ fn: function (){
 var self=this;
 function $HLBindingActionInputWidget(){return smalltalk.HLBindingActionInputWidget||(typeof HLBindingActionInputWidget=="undefined"?nil:HLBindingActionInputWidget)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$4,$6,$8,$7,$9,$11,$10,$12,$13,$1;
+var $2,$3,$5,$4,$6,$8,$7,$9,$10,$1;
 $2=_st($HLBindingActionInputWidget())._new();
 $3=$2;
 $5=self._command();
@@ -373,18 +373,15 @@ $8=self._command();
 $ctx1.sendIdx["command"]=2;
 $7=_st($8)._defaultInput();
 _st($6)._defaultValue_($7);
-$9=$2;
-$11=self._command();
-$10=_st($11)._inputCompletion();
-_st($9)._inputCompletion_($10);
+_st($2)._inputCompletion_(_st(self._command())._inputCompletion());
 _st($2)._callback_((function(value){
 return smalltalk.withContext(function($ctx2) {
 self._input_(value);
-$12=self._executeCommand();
-return $12;
+$9=self._executeCommand();
+return $9;
 }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,1)})}));
-$13=_st($2)._yourself();
-$1=$13;
+$10=_st($2)._yourself();
+$1=$10;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"inputWidget",{},smalltalk.HLBindingAction)})},
 args: [],
@@ -808,7 +805,7 @@ return self._errorStatus();
 }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},smalltalk.HLBindingActionInputWidget)})},
 args: ["aString"],
-source: "evaluate: aString\x09\x0a\x09[ self callback value: aString ]\x0a\x09\x09on: Error\x0a\x09\x09do: [:ex |\x0a\x09\x09\x09self input asJQuery \x0a\x09\x09\x09\x09one: 'keydown' \x0a\x09\x09\x09\x09do: [ self clearStatus ].\x0a\x09\x09\x09self message: ex messageText.\x0a\x09\x09\x09self errorStatus ]",
+source: "evaluate: aString\x09\x0a\x09[ self callback value: aString ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :ex |\x0a\x09\x09\x09self input asJQuery \x0a\x09\x09\x09\x09one: 'keydown' \x0a\x09\x09\x09\x09do: [ self clearStatus ].\x0a\x09\x09\x09self message: ex messageText.\x0a\x09\x09\x09self errorStatus ]",
 messageSends: ["on:do:", "value:", "callback", "one:do:", "asJQuery", "input", "clearStatus", "message:", "messageText", "errorStatus"],
 referencedClasses: ["Error"]
 }),
@@ -976,7 +973,7 @@ category: 'rendering',
 fn: function (html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$6,$8,$10,$9,$7,$5,$11,$12,$13,$3,$14;
+var $1,$2,$4,$6,$8,$10,$9,$7,$5,$11,$12,$13,$3;
 $1=self["@wrapper"];
 if(($receiver = $1) == nil || $receiver == null){
 self["@wrapper"]=_st(html)._span();
@@ -1021,8 +1018,7 @@ return self["@messageTag"];
 $ctx1.sendIdx["with:"]=1;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-$14=_st(self["@input"])._asJQuery();
-return _st($14)._focus();
+return _st(_st(self["@input"])._asJQuery())._focus();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}))._valueWithTimeout_((10));
 return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLBindingActionInputWidget)})},
 args: ["html"],
@@ -1206,7 +1202,7 @@ function $HLCloseTabCommand(){return smalltalk.HLCloseTabCommand||(typeof HLClos
 function $HLSwitchTabCommand(){return smalltalk.HLSwitchTabCommand||(typeof HLSwitchTabCommand=="undefined"?nil:HLSwitchTabCommand)}
 function $HLOpenCommand(){return smalltalk.HLOpenCommand||(typeof HLOpenCommand=="undefined"?nil:HLOpenCommand)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5,$7,$6,$8,$9;
+var $1,$2,$4,$3,$5,$6;
 $1=_st($HLBindingGroup())._new();
 $ctx1.sendIdx["new"]=1;
 $2=$1;
@@ -1216,15 +1212,12 @@ $3=_st($4)._asBinding();
 $ctx1.sendIdx["asBinding"]=1;
 _st($2)._add_($3);
 $ctx1.sendIdx["add:"]=1;
-$5=$1;
-$7=_st($HLSwitchTabCommand())._new();
-$6=_st($7)._asBinding();
-_st($5)._add_($6);
-$8=_st($1)._yourself();
-group=$8;
+_st($1)._add_(_st(_st($HLSwitchTabCommand())._new())._asBinding());
+$5=_st($1)._yourself();
+group=$5;
 _st($HLOpenCommand())._registerConcreteClassesOn_(group);
-$9=group;
-return $9;
+$6=group;
+return $6;
 }, function($ctx1) {$ctx1.fill(self,"defaultBindings",{group:group},smalltalk.HLKeyBinder)})},
 args: [],
 source: "defaultBindings\x0a\x09| group |\x0a\x09\x0a\x09group := HLBindingGroup new\x0a\x09\x09add: HLCloseTabCommand new asBinding;\x0a\x09\x09add: HLSwitchTabCommand new asBinding;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09HLOpenCommand registerConcreteClassesOn: group.\x0a\x09\x09\x09\x09\x0a\x09^ group",
@@ -1272,16 +1265,14 @@ category: 'events',
 fn: function (event){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$5,$4,$1,$6;
+var $3,$2,$1,$4;
 $3=_st(event)._which();
 $ctx1.sendIdx["which"]=1;
 $2=_st($3).__eq(self._escapeKey());
 $ctx1.sendIdx["="]=1;
 $1=_st($2)._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-$5=_st(event)._which();
-$4=_st($5).__eq((71));
-return _st($4)._and_((function(){
+return _st(_st(_st(event)._which()).__eq((71)))._and_((function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(event)._ctrlKey();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
@@ -1291,8 +1282,8 @@ self._deactivate();
 _st(event)._preventDefault();
 return false;
 };
-$6=self._handleBindingFor_(event);
-return $6;
+$4=self._handleBindingFor_(event);
+return $4;
 }, function($ctx1) {$ctx1.fill(self,"handleActiveKeyDown:",{event:event},smalltalk.HLKeyBinder)})},
 args: ["event"],
 source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC or ctrl+g deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09event which = 71 and: [ event ctrlKey ] ])\x0a        \x09ifTrue: [ \x0a            \x09self deactivate.\x0a\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09^ false ].\x0a            \x0a    \x22Handle the keybinding\x22\x0a    ^ self handleBindingFor: event",
@@ -1334,11 +1325,11 @@ category: 'events',
 fn: function (event){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=_st(_st(event)._which()).__eq(self._activationKey());
+var $1,$2;
+$1=_st(_st(event)._which()).__eq(self._activationKey());
+if(smalltalk.assert($1)){
+$2=_st(event)._ctrlKey();
 if(smalltalk.assert($2)){
-$3=_st(event)._ctrlKey();
-if(smalltalk.assert($3)){
 self._activate();
 _st(event)._preventDefault();
 return false;
@@ -1704,13 +1695,12 @@ category: 'rendering',
 fn: function (aBindingGroup,html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 _st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
 $1=_st(a)._key();
 $ctx2.sendIdx["key"]=1;
-$2=_st(b)._key();
-return _st($1).__lt($2);
+return _st($1).__lt(_st(b)._key());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)})})))._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return self._renderBindingActionFor_on_(each,html);
@@ -1867,7 +1857,7 @@ category: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$5,$7,$6,$4,$2,$8,$9;
+var $1,$3,$5,$6,$4,$2,$7;
 $1="#helper"._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 _st($1)._remove();
@@ -1876,19 +1866,17 @@ return smalltalk.withContext(function($ctx2) {
 $3=_st(html)._div();
 _st($3)._id_("helper");
 $5=$3;
-$7="Press ".__comma(_st(self._keyBinder())._activationKeyLabel());
-$6=_st($7).__comma(" to start");
+$6=_st("Press ".__comma(_st(self._keyBinder())._activationKeyLabel())).__comma(" to start");
 $ctx2.sendIdx[","]=1;
 $4=_st($5)._with_($6);
 return $4;
 }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
-$8="body"._asJQuery();
+$7="body"._asJQuery();
 $ctx1.sendIdx["asJQuery"]=2;
-_st($2)._appendToJQuery_($8);
+_st($2)._appendToJQuery_($7);
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
-$9="#helper"._asJQuery();
-return _st($9)._fadeOut_((1000));
+return _st("#helper"._asJQuery())._fadeOut_((1000));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((2000));
 return self}, function($ctx1) {$ctx1.fill(self,"renderStart",{},smalltalk.HLKeyBinderHelperWidget)})},
 args: [],
@@ -1956,7 +1944,7 @@ category: 'actions',
 fn: function (aWidget){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4,$7,$6,$5;
+var $3,$2,$1;
 $3=self._mainId();
 $ctx1.sendIdx["mainId"]=1;
 $2="#".__comma($3);
@@ -1964,11 +1952,7 @@ $ctx1.sendIdx[","]=1;
 $1=_st($2)._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 _st($1)._empty();
-$4=aWidget;
-$7=self._mainId();
-$6="#".__comma($7);
-$5=_st($6)._asJQuery();
-_st($4)._appendToJQuery_($5);
+_st(aWidget)._appendToJQuery_(_st("#".__comma(self._mainId()))._asJQuery());
 return self}, function($ctx1) {$ctx1.fill(self,"showWidget:",{aWidget:aWidget},smalltalk.HLKeyBinderHelperWidget)})},
 args: ["aWidget"],
 source: "showWidget: aWidget\x0a\x09\x22Some actions need to display more info to the user or request input.\x0a\x09This method is the right place for that\x22\x0a\x09\x0a\x09('#', self mainId) asJQuery empty.\x0a\x09aWidget appendToJQuery: ('#', self mainId) asJQuery",

+ 34 - 48
js/Helios-Layout.js

@@ -354,7 +354,7 @@ fn: function (anInteger){
 var self=this;
 var container,size,offset,percentage;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$6,$7,$5,$4,$9,$11,$10,$8,$13,$16,$15,$14,$12,$18,$21,$20,$19,$17;
+var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
 $1=_st(self["@firstPane"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 container=_st($1)._parent();
@@ -371,29 +371,25 @@ $ctx1.sendIdx["-"]=1;
 $4=_st($5).__slash(size);
 percentage=_st($4).__star((100));
 percentage=(80)._min_(_st(percentage)._max_((20)));
-$9=_st(self["@firstPane"])._asJQuery();
+$8=_st(self["@firstPane"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=3;
-$11=_st(percentage)._asString();
+$10=_st(percentage)._asString();
 $ctx1.sendIdx["asString"]=1;
-$10=_st($11).__comma("%");
+$9=_st($10).__comma("%");
 $ctx1.sendIdx[","]=1;
-$8=_st($9)._css_put_("bottom",$10);
+_st($8)._css_put_("bottom",$9);
 $ctx1.sendIdx["css:put:"]=1;
-$13=_st(self["@splitter"])._asJQuery();
+$11=_st(self["@splitter"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=4;
-$16=(100).__minus(percentage);
+$14=(100).__minus(percentage);
 $ctx1.sendIdx["-"]=3;
-$15=_st($16)._asString();
+$13=_st($14)._asString();
 $ctx1.sendIdx["asString"]=2;
-$14=_st($15).__comma("%");
+$12=_st($13).__comma("%");
 $ctx1.sendIdx[","]=2;
-$12=_st($13)._css_put_("top",$14);
+_st($11)._css_put_("top",$12);
 $ctx1.sendIdx["css:put:"]=2;
-$18=_st(self["@secondPane"])._asJQuery();
-$21=(100).__minus(percentage);
-$20=_st($21)._asString();
-$19=_st($20).__comma("%");
-$17=_st($18)._css_put_("top",$19);
+_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)})},
 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, '%'",
@@ -409,27 +405,24 @@ category: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$6,$5,$4,$7,$8,$9,$2;
+var $1,$3,$4,$5,$6,$2;
 $1=_st(self["@splitter"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 $3="axis".__minus_gt("y");
 $ctx1.sendIdx["->"]=1;
-$6=_st(self["@splitter"])._asJQuery();
-$5=_st($6)._parent();
-$4="containment".__minus_gt($5);
+$4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
 $ctx1.sendIdx["->"]=2;
-$7="helper".__minus_gt("clone");
+$5="helper".__minus_gt("clone");
 $ctx1.sendIdx["->"]=3;
-$8="start".__minus_gt((function(e,ui){
+$6="start".__minus_gt((function(e,ui){
 return smalltalk.withContext(function($ctx2) {
 return self._startResizing_(_st(ui)._helper());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
 $ctx1.sendIdx["->"]=4;
-$9="drag".__minus_gt((function(e,ui){
+$2=smalltalk.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)})}));
-$2=smalltalk.HashedCollection._from_([$3,$4,$7,$8,$9]);
+}, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
 _st($1)._draggable_($2);
 return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLHorizontalSplitter)})},
 args: [],
@@ -518,7 +511,7 @@ fn: function (anInteger){
 var self=this;
 var container,size,offset,percentage;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2,$6,$7,$5,$4,$9,$11,$10,$8,$13,$16,$15,$14,$12,$18,$21,$20,$19,$17;
+var $1,$3,$2,$6,$7,$5,$4,$8,$10,$9,$11,$14,$13,$12;
 $1=_st(self["@firstPane"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 container=_st($1)._parent();
@@ -535,29 +528,25 @@ $ctx1.sendIdx["-"]=1;
 $4=_st($5).__slash(size);
 percentage=_st($4).__star((100));
 percentage=(80)._min_(_st(percentage)._max_((20)));
-$9=_st(self["@firstPane"])._asJQuery();
+$8=_st(self["@firstPane"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=3;
-$11=_st(percentage)._asString();
+$10=_st(percentage)._asString();
 $ctx1.sendIdx["asString"]=1;
-$10=_st($11).__comma("%");
+$9=_st($10).__comma("%");
 $ctx1.sendIdx[","]=1;
-$8=_st($9)._css_put_("right",$10);
+_st($8)._css_put_("right",$9);
 $ctx1.sendIdx["css:put:"]=1;
-$13=_st(self["@splitter"])._asJQuery();
+$11=_st(self["@splitter"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=4;
-$16=(100).__minus(percentage);
+$14=(100).__minus(percentage);
 $ctx1.sendIdx["-"]=3;
-$15=_st($16)._asString();
+$13=_st($14)._asString();
 $ctx1.sendIdx["asString"]=2;
-$14=_st($15).__comma("%");
+$12=_st($13).__comma("%");
 $ctx1.sendIdx[","]=2;
-$12=_st($13)._css_put_("left",$14);
+_st($11)._css_put_("left",$12);
 $ctx1.sendIdx["css:put:"]=2;
-$18=_st(self["@secondPane"])._asJQuery();
-$21=(100).__minus(percentage);
-$20=_st($21)._asString();
-$19=_st($20).__comma("%");
-$17=_st($18)._css_put_("left",$19);
+_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)})},
 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, '%'",
@@ -573,27 +562,24 @@ category: 'rendering',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$6,$5,$4,$7,$8,$9,$2;
+var $1,$3,$4,$5,$6,$2;
 $1=_st(self["@splitter"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 $3="axis".__minus_gt("x");
 $ctx1.sendIdx["->"]=1;
-$6=_st(self["@splitter"])._asJQuery();
-$5=_st($6)._parent();
-$4="containment".__minus_gt($5);
+$4="containment".__minus_gt(_st(_st(self["@splitter"])._asJQuery())._parent());
 $ctx1.sendIdx["->"]=2;
-$7="helper".__minus_gt("clone");
+$5="helper".__minus_gt("clone");
 $ctx1.sendIdx["->"]=3;
-$8="start".__minus_gt((function(e,ui){
+$6="start".__minus_gt((function(e,ui){
 return smalltalk.withContext(function($ctx2) {
 return self._startResizing_(_st(ui)._helper());
 }, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,1)})}));
 $ctx1.sendIdx["->"]=4;
-$9="drag".__minus_gt((function(e,ui){
+$2=smalltalk.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)})}));
-$2=smalltalk.HashedCollection._from_([$3,$4,$7,$8,$9]);
+}, function($ctx2) {$ctx2.fillBlock({e:e,ui:ui},$ctx1,2)})}))]);
 _st($1)._draggable_($2);
 return self}, function($ctx1) {$ctx1.fill(self,"setupSplitter",{},smalltalk.HLVerticalSplitter)})},
 args: [],

+ 42 - 64
js/Helios-References.js

@@ -298,26 +298,19 @@ function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="unde
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$4,$6,$8,$10,$11,$9,$12,$7,$5,$3,$1,$13;
-$2=html;
-$4=$HLContainer();
-$6=$HLHorizontalSplitter();
-$8=$HLVerticalSplitter();
-$10=$HLVerticalSplitter();
-$11=self._sendersListWidget();
+var $5,$4,$3,$2,$1;
+$5=self._sendersListWidget();
 $ctx1.sendIdx["sendersListWidget"]=1;
-$9=_st($10)._with_with_($11,self._implementorsListWidget());
+$4=_st($HLVerticalSplitter())._with_with_($5,self._implementorsListWidget());
 $ctx1.sendIdx["with:with:"]=3;
-$12=_st($HLVerticalSplitter())._with_with_(self._classReferencesListWidget(),self._regexpListWidget());
-$7=_st($8)._with_with_($9,$12);
+$3=_st($HLVerticalSplitter())._with_with_($4,_st($HLVerticalSplitter())._with_with_(self._classReferencesListWidget(),self._regexpListWidget()));
 $ctx1.sendIdx["with:with:"]=2;
-$5=_st($6)._with_with_($7,self._sourceCodeWidget());
+$2=_st($HLHorizontalSplitter())._with_with_($3,self._sourceCodeWidget());
 $ctx1.sendIdx["with:with:"]=1;
-$3=_st($4)._with_($5);
-$1=_st($2)._with_($3);
+$1=_st($HLContainer())._with_($2);
+_st(html)._with_($1);
 $ctx1.sendIdx["with:"]=1;
-$13=self._sendersListWidget();
-_st($13)._focus();
+_st(self._sendersListWidget())._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLReferences)})},
 args: ["html"],
 source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter \x0a    \x09with: (HLVerticalSplitter\x0a        \x09with: (HLVerticalSplitter\x0a            \x09with: self sendersListWidget\x0a                with: self implementorsListWidget)\x0a            with: (HLVerticalSplitter\x0a            \x09with: self classReferencesListWidget\x0a                with: self regexpListWidget)) \x0a        with: self sourceCodeWidget)).\x0a\x09\x0a\x09self sendersListWidget focus",
@@ -549,30 +542,27 @@ category: 'reactions',
 fn: function (aMethod){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$6,$5;
+var $1,$2,$3;
 var $early={};
 try {
-$1=aMethod;
-if(($receiver = $1) == nil || $receiver == null){
+if(($receiver = aMethod) == nil || $receiver == null){
 return self;
 } else {
-$1;
+aMethod;
 };
 _st(self._items())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$2=each;
-$3=_st(aMethod)._selector();
+$1=_st(aMethod)._selector();
 $ctx2.sendIdx["selector"]=1;
-return _st($2).__eq($3);
+return _st(each).__eq($1);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
 throw $early=[self];
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
-$4=_st(aMethod)._selector();
+$2=_st(aMethod)._selector();
 $ctx1.sendIdx["selector"]=2;
-self._selectedItem_($4);
-$6=_st(aMethod)._selector();
-$5=self._activateItem_($6);
+self._selectedItem_($2);
+$3=self._activateItem_(_st(aMethod)._selector());
 return self}
 catch(e) {if(e===$early)return e[0]; throw e}
 }, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aMethod:aMethod},smalltalk.HLReferencesListWidget)})},
@@ -606,12 +596,10 @@ category: 'rendering',
 fn: function (aMethod,html){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
-$1=html;
-$3=_st(_st(_st(aMethod)._methodClass())._name()).__comma(" >> #");
-$2=_st($3).__comma(_st(aMethod)._selector());
+var $1;
+$1=_st(_st(_st(_st(aMethod)._methodClass())._name()).__comma(" >> #")).__comma(_st(aMethod)._selector());
 $ctx1.sendIdx[","]=1;
-_st($1)._with_($2);
+_st(html)._with_($1);
 return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{aMethod:aMethod,html:html},smalltalk.HLReferencesListWidget)})},
 args: ["aMethod", "html"],
 source: "renderItemLabel: aMethod on: html\x0a\x09html with: aMethod methodClass name, ' >> #', aMethod selector",
@@ -853,29 +841,18 @@ selector: "classReferencesOf:",
 category: 'accessing',
 fn: function (aString){
 var self=this;
-var references;
-function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
-references=_st($OrderedCollection())._new();
-$1=_st(self._classesAndMetaclasses())._do_((function(each){
+var $1;
+$1=_st(self._allMethods())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
-return _st(_st(_st(each)._methodDictionary())._values())._do_((function(method){
-return smalltalk.withContext(function($ctx3) {
-$2=_st(_st(method)._referencedClasses())._includes_(aString);
-if(smalltalk.assert($2)){
-return _st(references)._add_(method);
-};
-}, function($ctx3) {$ctx3.fillBlock({method:method},$ctx2,2)})}));
+return _st(_st(each)._referencedClasses())._includes_(aString);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-$ctx1.sendIdx["do:"]=1;
-$3=references;
-return $3;
-}, function($ctx1) {$ctx1.fill(self,"classReferencesOf:",{aString:aString,references:references},smalltalk.HLReferencesModel)})},
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"classReferencesOf:",{aString:aString},smalltalk.HLReferencesModel)})},
 args: ["aString"],
-source: "classReferencesOf: aString\x0a\x09\x22Answer all methods referencing the class named aString\x22\x0a\x09\x0a\x09| references |\x0a\x09\x0a\x09references := OrderedCollection new.\x0a\x09\x0a\x09self classesAndMetaclasses do: [ :each |\x0a\x09\x09each methodDictionary values do: [ :method |\x0a\x09\x09\x09(method referencedClasses includes: aString) ifTrue: [\x0a\x09\x09\x09\x09references add: method ] ] ].\x0a\x09\x09\x09\x09\x0a\x09^ references",
-messageSends: ["new", "do:", "classesAndMetaclasses", "values", "methodDictionary", "ifTrue:", "includes:", "referencedClasses", "add:"],
-referencedClasses: ["OrderedCollection"]
+source: "classReferencesOf: aString\x0a\x09\x22Answer all methods referencing the class named aString\x22\x0a\x09\x0a\x09^self allMethods select: [ :each |\x0a\x09\x09\x09(each referencedClasses includes: aString) ].",
+messageSends: ["select:", "allMethods", "includes:", "referencedClasses"],
+referencedClasses: []
 }),
 smalltalk.HLReferencesModel);
 
@@ -915,7 +892,7 @@ $2=self["@classesAndMetaclassesCache"];
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"classesAndMetaclassesCache",{},smalltalk.HLReferencesModel)})},
 args: [],
-source: "classesAndMetaclassesCache\x0a\x09classesAndMetaclassesCache ifNil: [ self updateClassesAndMetaclassesCache ].\x0a\x09\x0a\x09^ classesAndMetaclassesCache",
+source: "classesAndMetaclassesCache\x0a\x09classesAndMetaclassesCache ifNil: [ self updateClassesAndMetaclassesCache ].\x0a\x09^ classesAndMetaclassesCache",
 messageSends: ["ifNil:", "updateClassesAndMetaclassesCache"],
 referencedClasses: []
 }),
@@ -998,7 +975,7 @@ $2=self["@methodsCache"];
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"methodsCache",{},smalltalk.HLReferencesModel)})},
 args: [],
-source: "methodsCache\x0a\x09methodsCache ifNil: [ self updateMethodsCache ].\x0a\x09\x0a\x09^ methodsCache",
+source: "methodsCache\x0a\x09methodsCache ifNil: [ self updateMethodsCache ].\x0a\x09^ methodsCache",
 messageSends: ["ifNil:", "updateMethodsCache"],
 referencedClasses: []
 }),
@@ -1101,19 +1078,19 @@ var self=this;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
-self["@classesAndMetaclassesCache"]=_st(_st(self._environment())._classes())._inject_into_(_st($OrderedCollection())._new(),(function(acc,each){
+self["@classesAndMetaclassesCache"]=_st($OrderedCollection())._new();
+_st(_st(self._environment())._classes())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$1=acc;
+$1=self["@classesAndMetaclassesCache"];
 _st($1)._add_(each);
 $ctx2.sendIdx["add:"]=1;
-_st($1)._add_(_st(each)._class());
-$2=_st($1)._yourself();
+$2=_st($1)._add_(_st(each)._class());
 return $2;
-}, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)})}));
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"updateClassesAndMetaclassesCache",{},smalltalk.HLReferencesModel)})},
 args: [],
-source: "updateClassesAndMetaclassesCache\x0a\x09classesAndMetaclassesCache := self environment classes \x0a\x09\x09inject: OrderedCollection new \x0a\x09\x09into: [ :acc :each |\x0a\x09\x09\x09acc \x0a\x09\x09\x09\x09add: each; \x0a\x09\x09\x09\x09add: each class;\x0a\x09\x09\x09\x09yourself ]",
-messageSends: ["inject:into:", "classes", "environment", "new", "add:", "class", "yourself"],
+source: "updateClassesAndMetaclassesCache\x0a\x09classesAndMetaclassesCache := OrderedCollection new.\x0a\x09\x0a\x09self environment classes do: [ :each |\x0a\x09\x09classesAndMetaclassesCache\x0a\x09\x09\x09\x09add: each; \x0a\x09\x09\x09\x09add: each class ]",
+messageSends: ["new", "do:", "classes", "environment", "add:", "class"],
 referencedClasses: ["OrderedCollection"]
 }),
 smalltalk.HLReferencesModel);
@@ -1126,14 +1103,15 @@ fn: function (){
 var self=this;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-self["@methodsCache"]=_st(self._classesAndMetaclasses())._inject_into_(_st($OrderedCollection())._new(),(function(acc,each){
+self["@methodsCache"]=_st($OrderedCollection())._new();
+_st(self._classesAndMetaclasses())._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-return _st(acc).__comma(_st(each)._methods());
-}, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)})}));
+return _st(self["@methodsCache"])._addAll_(_st(each)._methods());
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"updateMethodsCache",{},smalltalk.HLReferencesModel)})},
 args: [],
-source: "updateMethodsCache\x0a\x09methodsCache := self classesAndMetaclasses\x0a\x09\x09inject: OrderedCollection new\x0a\x09\x09into: [ :acc :each |\x0a\x09\x09\x09acc, each methods ]",
-messageSends: ["inject:into:", "classesAndMetaclasses", "new", ",", "methods"],
+source: "updateMethodsCache\x0a\x09methodsCache := OrderedCollection new.\x0a\x09\x0a\x09self classesAndMetaclasses\x0a\x09\x09do: [ :each | methodsCache addAll: each methods ]",
+messageSends: ["new", "do:", "classesAndMetaclasses", "addAll:", "methods"],
 referencedClasses: ["OrderedCollection"]
 }),
 smalltalk.HLReferencesModel);

+ 4 - 5
js/Helios-Workspace-Tests.js

@@ -12,13 +12,12 @@ var self=this;
 function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
 function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
-$2=_st(_st($HLCodeWidget())._pcKeyMap())._isKindOf_($HashedCollection());
+var $1;
+$1=_st(_st($HLCodeWidget())._pcKeyMap())._isKindOf_($HashedCollection());
 $ctx1.sendIdx["isKindOf:"]=1;
-$1=self._assert_($2);
+self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
-$4=_st(_st($HLCodeWidget())._macKeyMap())._isKindOf_($HashedCollection());
-$3=self._assert_($4);
+self._assert_(_st(_st($HLCodeWidget())._macKeyMap())._isKindOf_($HashedCollection()));
 return self}, function($ctx1) {$ctx1.fill(self,"testKeyMap",{},smalltalk.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)",

+ 165 - 190
js/Helios-Workspace.js

@@ -34,16 +34,15 @@ selector: "defaultReceiver",
 category: 'defaults',
 fn: function (){
 var self=this;
-function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st($DoIt())._new();
+$1=_st(self._environment())._doItReceiver();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
 args: [],
-source: "defaultReceiver\x0a\x09^ DoIt new",
-messageSends: ["new"],
-referencedClasses: ["DoIt"]
+source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
+messageSends: ["doItReceiver", "environment"],
+referencedClasses: []
 }),
 smalltalk.HLCodeModel);
 
@@ -242,12 +241,11 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 $1=self._editor();
 $ctx1.sendIdx["editor"]=1;
 _st($1)._at_put_("amberCodeWidget",self);
-$2=self._editor();
-_st($2)._on_do_("change",(function(){
+_st(self._editor())._on_do_("change",(function(){
 return smalltalk.withContext(function($ctx2) {
 return self._onChange();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
@@ -351,22 +349,19 @@ var result;
 function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
 function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$4,$1,$7,$6,$8,$5,$9;
-$3=self._model();
+var $2,$1,$3,$4;
+$2=self._model();
 $ctx1.sendIdx["model"]=1;
-$2=_st($3)._announcer();
+$1=_st($2)._announcer();
 $ctx1.sendIdx["announcer"]=1;
-$4=_st($HLDoItRequested())._on_(self["@model"]);
+$3=_st($HLDoItRequested())._on_(self["@model"]);
 $ctx1.sendIdx["on:"]=1;
-$1=_st($2)._announce_($4);
+_st($1)._announce_($3);
 $ctx1.sendIdx["announce:"]=1;
 result=_st(self["@model"])._doIt_(self._currentLineOrSelection());
-$7=self._model();
-$6=_st($7)._announcer();
-$8=_st($HLDoItExecuted())._on_(self["@model"]);
-$5=_st($6)._announce_($8);
-$9=result;
-return $9;
+_st(_st(self._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
+$4=result;
+return $4;
 }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
 args: [],
 source: "doIt\x0a\x09| result |\x0a\x0a\x09self model announcer announce: (HLDoItRequested on: model).\x0a\x09result := model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result",
@@ -400,7 +395,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$7,$8,$9,$12,$11,$10,$1;
+var $2,$3,$4,$5,$6,$7,$8,$9,$10,$1;
 $2="theme".__minus_gt("amber");
 $ctx1.sendIdx["->"]=1;
 $3="lineNumbers".__minus_gt(true);
@@ -417,9 +412,7 @@ $8="electricChars".__minus_gt(false);
 $ctx1.sendIdx["->"]=7;
 $9="keyMap".__minus_gt("Amber");
 $ctx1.sendIdx["->"]=8;
-$12="Shift-Space".__minus_gt("autocomplete");
-$11=smalltalk.HashedCollection._from_([$12]);
-$10="extraKeys".__minus_gt($11);
+$10="extraKeys".__minus_gt(smalltalk.HashedCollection._from_(["Shift-Space".__minus_gt("autocomplete")]));
 $ctx1.sendIdx["->"]=9;
 $1=smalltalk.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10]);
 return $1;
@@ -490,13 +483,12 @@ var self=this;
 var newInspector;
 function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3;
+var $2,$1;
 $2=self._model();
 $ctx1.sendIdx["model"]=1;
 $1=_st($2)._announcer();
 _st($1)._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
-$3=self._model();
-_st($3)._inspect_(self._doIt());
+_st(self._model())._inspect_(self._doIt());
 return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
 args: [],
 source: "inspectIt\x0a\x09| newInspector |\x0a       \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09self model inspect: self doIt",
@@ -513,18 +505,15 @@ fn: function (anEditor,aToken){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$1;
+var $2,$1;
 $1=_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asArray())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$2=each;
-$3=_st(aToken)._string();
+$2=_st(aToken)._string();
 $ctx2.sendIdx["string"]=1;
-return _st($2)._includesSubString_($3);
+return _st(each)._includesSubString_($2);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._reject_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$4=each;
-$5=_st(aToken)._string();
-return _st($4).__eq($5);
+return _st(each).__eq(_st(aToken)._string());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
@@ -602,7 +591,7 @@ return smalltalk.withContext(function($ctx1) {
 self._doIt();
 return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
 args: [],
-source: "onDoIt\x0a\x09\x0a    self doIt",
+source: "onDoIt\x0a\x09\x0a\x09self doIt",
 messageSends: ["doIt"],
 referencedClasses: []
 }),
@@ -664,59 +653,51 @@ var self=this;
 var start,stop,currentLine;
 function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$6,$5,$3,$7,$8,$9,$10,$12,$13,$11,$14,$16,$19,$20,$18,$17,$15,$21,$25,$24,$23,$22,$26,$27,$28;
+var $1,$2,$4,$3,$5,$6,$7,$8,$10,$9,$11,$12,$13,$15,$14;
 $1=_st(self["@editor"])._getCursor_(false);
 $ctx1.sendIdx["getCursor:"]=1;
 currentLine=_st($1)._line();
 start=_st($HashedCollection())._new();
 $ctx1.sendIdx["new"]=1;
-$2=_st(start)._at_put_("line",currentLine);
+_st(start)._at_put_("line",currentLine);
 $ctx1.sendIdx["at:put:"]=1;
-$4=start;
-$6=_st(self["@editor"])._getCursor_(false);
+$2=start;
+$4=_st(self["@editor"])._getCursor_(false);
 $ctx1.sendIdx["getCursor:"]=2;
-$5=_st($6)._ch();
-$3=_st($4)._at_put_("ch",$5);
+$3=_st($4)._ch();
+_st($2)._at_put_("ch",$3);
 $ctx1.sendIdx["at:put:"]=2;
-$7=_st(self["@editor"])._getSelection();
+$5=_st(self["@editor"])._getSelection();
 $ctx1.sendIdx["getSelection"]=1;
-_st($7)._ifEmpty_((function(){
+_st($5)._ifEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
-$8=start;
-$9=_st(_st(self["@editor"])._getLine_(currentLine))._size();
+$6=start;
+$7=_st(_st(self["@editor"])._getLine_(currentLine))._size();
 $ctx2.sendIdx["size"]=1;
-_st($8)._at_put_("ch",$9);
+_st($6)._at_put_("ch",$7);
 $ctx2.sendIdx["at:put:"]=3;
-$10=self["@editor"];
-$12="line".__minus_gt(currentLine);
+$8=self["@editor"];
+$10="line".__minus_gt(currentLine);
 $ctx2.sendIdx["->"]=1;
-$13="ch".__minus_gt((0));
-$11=smalltalk.HashedCollection._from_([$12,$13]);
-return _st($10)._setSelection_end_($11,start);
+$9=smalltalk.HashedCollection._from_([$10,"ch".__minus_gt((0))]);
+return _st($8)._setSelection_end_($9,start);
 $ctx2.sendIdx["setSelection:end:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 stop=_st($HashedCollection())._new();
-$14=_st(stop)._at_put_("line",currentLine);
+_st(stop)._at_put_("line",currentLine);
 $ctx1.sendIdx["at:put:"]=4;
-$16=stop;
-$19=_st(start)._at_("ch");
-$20=_st(aString)._size();
-$18=_st($19).__plus($20);
-$17=_st($18).__plus((2));
+$11=stop;
+$12=_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2));
 $ctx1.sendIdx["+"]=1;
-$15=_st($16)._at_put_("ch",$17);
-$21=self["@editor"];
-$25=_st(self["@editor"])._getSelection();
-$24=_st($25).__comma(" ");
-$23=_st($24).__comma(aString);
+_st($11)._at_put_("ch",$12);
+$13=self["@editor"];
+$15=_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString);
 $ctx1.sendIdx[","]=2;
-$22=_st($23).__comma(" ");
+$14=_st($15).__comma(" ");
 $ctx1.sendIdx[","]=1;
-_st($21)._replaceSelection_($22);
-$26=self["@editor"];
-$27=_st(self["@editor"])._getCursor_(true);
-_st($26)._setCursor_($27);
-$28=_st(self["@editor"])._setSelection_end_(stop,start);
+_st($13)._replaceSelection_($14);
+_st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
+_st(self["@editor"])._setSelection_end_(stop,start);
 return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
 args: ["aString"],
 source: "print: aString\x0a\x09| start stop currentLine |\x0a    currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a    (editor getSelection) ifEmpty: [\x0a    \x09\x22select current line if selection is empty\x22\x0a    \x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a        editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a    ].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
@@ -740,7 +721,7 @@ self._print_(_st(result)._printString());
 self._focus();
 return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
 args: [],
-source: "printIt\x0a\x09| result |\x0a\x0a\x09result:=  self doIt.       \x0a\x09self model announcer announce: (HLPrintItRequested on: model).\x0a    self print: result printString.\x0a\x09\x0a\x09self focus.",
+source: "printIt\x0a\x09| result |\x0a\x0a\x09result := self doIt.       \x0a\x09self model announcer announce: (HLPrintItRequested on: model).\x0a\x09self print: result printString.\x0a\x09\x0a\x09self focus.",
 messageSends: ["doIt", "announce:", "announcer", "model", "on:", "print:", "printString", "focus"],
 referencedClasses: ["HLPrintItRequested"]
 }),
@@ -988,15 +969,14 @@ category: 'updating',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1,$2;
 $1=self._hasModification();
 if(smalltalk.assert($1)){
 $2=_st(self["@state"])._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 _st($2)._addClass_("modified");
 } else {
-$3=_st(self["@state"])._asJQuery();
-_st($3)._removeClass_("modified");
+_st(_st(self["@state"])._asJQuery())._removeClass_("modified");
 };
 return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
 args: [],
@@ -1015,45 +995,39 @@ var self=this;
 var variables,classNames,pseudoVariables;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$4,$6,$5,$7,$13,$12,$11,$10,$14,$15,$9,$16,$17,$8;
+var $3,$2,$1,$5,$4,$10,$9,$8,$11,$7,$6;
 $3=_st(_st(_st(anEditor)._display())._wrapper())._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 $2=_st($3)._find_("span.cm-variable");
 $1=_st($2)._get();
 variables=_st($1)._collect_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$4=_st(each)._asJQuery();
-return _st($4)._html();
+return _st(_st(each)._asJQuery())._html();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $ctx1.sendIdx["collect:"]=1;
-$6=_st($Smalltalk())._current();
+$5=_st($Smalltalk())._current();
 $ctx1.sendIdx["current"]=1;
-$5=_st($6)._classes();
-classNames=_st($5)._collect_((function(each){
+$4=_st($5)._classes();
+classNames=_st($4)._collect_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(each)._name();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
-$7=_st($Smalltalk())._current();
-pseudoVariables=_st($7)._pseudoVariableNames();
-$13=_st(variables).__comma(classNames);
-$12=_st($13).__comma(pseudoVariables);
+pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
+$10=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
 $ctx1.sendIdx[","]=1;
-$11=_st($12)._asSet();
-$10=_st($11)._asArray();
-$9=_st($10)._select_((function(each){
+$9=_st($10)._asSet();
+$8=_st($9)._asArray();
+$7=_st($8)._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$14=each;
-$15=_st(aToken)._string();
+$11=_st(aToken)._string();
 $ctx2.sendIdx["string"]=1;
-return _st($14)._includesSubString_($15);
+return _st(each)._includesSubString_($11);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
-$8=_st($9)._reject_((function(each){
+$6=_st($7)._reject_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$16=each;
-$17=_st(aToken)._string();
-return _st($16).__eq($17);
+return _st(each).__eq(_st(aToken)._string());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
-return $8;
+return $6;
 }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
 args: ["anEditor", "aToken"],
 source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := (anEditor display wrapper asJQuery find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | each asJQuery html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
@@ -1073,7 +1047,7 @@ var cursor,token,completions;
 function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
 function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2,$5,$7,$10,$11,$9,$8,$14,$15,$13,$12,$6;
+var $1,$4,$3,$2,$5,$7,$10,$11,$9,$8,$6;
 cursor=_st(anEditor)._getCursor();
 token=_st(anEditor)._getTokenAt_(cursor);
 $1=token;
@@ -1099,11 +1073,7 @@ $9=_st($10)._value_value_($11,_st(token)._end());
 $ctx1.sendIdx["value:value:"]=2;
 $8="from".__minus_gt($9);
 $ctx1.sendIdx["->"]=2;
-$14=_st($CodeMirror())._basicAt_("Pos");
-$15=_st(cursor)._line();
-$13=_st($14)._value_value_($15,_st(token)._start());
-$12="to".__minus_gt($13);
-$6=smalltalk.HashedCollection._from_([$7,$8,$12]);
+$6=smalltalk.HashedCollection._from_([$7,$8,"to".__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
 return $6;
 }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
 args: ["anEditor", "options"],
@@ -1164,7 +1134,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$1;
+var $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$1;
 $2="Alt-Backspace".__minus_gt("delWordBefore");
 $ctx1.sendIdx["->"]=1;
 $3="Alt-Delete".__minus_gt("delWordAfter");
@@ -1215,8 +1185,7 @@ $25="Shift-Cmd-G".__minus_gt("findPrev");
 $ctx1.sendIdx["->"]=24;
 $26="Shift-Cmd-Z".__minus_gt("redo");
 $ctx1.sendIdx["->"]=25;
-$27="fallthrough".__minus_gt(["basic","emacsy"]);
-$1=smalltalk.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27]);
+$1=smalltalk.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,"fallthrough".__minus_gt(["basic","emacsy"])]);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
 args: [],
@@ -1251,7 +1220,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$1;
+var $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$1;
 $2="Alt-Left".__minus_gt("goLineStart");
 $ctx1.sendIdx["->"]=1;
 $3="Alt-Right".__minus_gt("goLineEnd");
@@ -1302,8 +1271,7 @@ $25="Shift-Ctrl-R".__minus_gt("replaceAll");
 $ctx1.sendIdx["->"]=24;
 $26="Shift-Ctrl-Z".__minus_gt("redo");
 $ctx1.sendIdx["->"]=25;
-$27="fallthrough".__minus_gt(["basic"]);
-$1=smalltalk.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27]);
+$1=smalltalk.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,"fallthrough".__minus_gt(["basic"])]);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
 args: [],
@@ -1323,12 +1291,12 @@ return smalltalk.withContext(function($ctx1) {
  
 		CodeMirror.keyMap.default.fallthrough = ["basic"];
 		CodeMirror.commands.autocomplete = function(cm) {
-        	CodeMirror.showHint(cm, self._hintFor_options_);
-      	}
+			CodeMirror.showHint(cm, self._hintFor_options_);
+		}
 	;
 return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
 args: [],
-source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a        \x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a      \x09}\x0a\x09>",
+source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a\x09\x09\x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a\x09\x09}\x0a\x09>",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1342,7 +1310,7 @@ fn: function (){
 var self=this;
 function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$6,$5;
+var $1,$2,$3,$4,$5;
 $1=_st($CodeMirror())._basicAt_("commands");
 _st($1)._at_put_("doIt",(function(cm){
 return smalltalk.withContext(function($ctx2) {
@@ -1367,8 +1335,7 @@ return _st($4)._printIt();
 $ctx1.sendIdx["at:put:"]=3;
 $5=_st($1)._at_put_("saveIt",(function(cm){
 return smalltalk.withContext(function($ctx2) {
-$6=_st(cm)._amberCodeWidget();
-return _st($6)._saveIt();
+return _st(_st(cm)._amberCodeWidget())._saveIt();
 }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
 args: [],
@@ -1631,6 +1598,7 @@ function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableError
 function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
 function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
 function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
+function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
 function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
 function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
@@ -1656,14 +1624,16 @@ _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
 $ctx1.sendIdx["on:send:to:"]=9;
 _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
 $ctx1.sendIdx["on:send:to:"]=10;
-_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+_st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
 $ctx1.sendIdx["on:send:to:"]=11;
+_st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
+$ctx1.sendIdx["on:send:to:"]=12;
 $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
 args: [],
-source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self",
+source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLPackageSelected \x0a\x09\x09send: #onPackageSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a    \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self",
 messageSends: ["on:send:to:", "announcer", "browserModel"],
-referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
+referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
 }),
 smalltalk.HLBrowserCodeWidget);
 
@@ -1720,7 +1690,7 @@ fn: function (anAnnouncement){
 var self=this;
 var class_;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1,$2;
 class_=_st(anAnnouncement)._item();
 $1=class_;
 if(($receiver = $1) == nil || $receiver == null){
@@ -1730,10 +1700,10 @@ return $2;
 } else {
 $1;
 };
-$3=self._contents_(_st(class_)._definition());
+self._contents_(_st(class_)._definition());
 return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
 args: ["anAnnouncement"],
-source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a    self contents: class definition",
+source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
 messageSends: ["item", "ifNil:", "contents:", "definition"],
 referencedClasses: []
 }),
@@ -1779,38 +1749,35 @@ fn: function (anAnnouncement){
 var self=this;
 var method;
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$1,$6,$5,$11,$10,$9,$12,$8,$7;
+var $3,$2,$1,$5,$4,$7,$6;
 method=_st(anAnnouncement)._method();
-$4=self._browserModel();
+$3=self._browserModel();
 $ctx1.sendIdx["browserModel"]=1;
-$3=_st($4)._selectedClass();
-$2=_st($3).__eq(_st(method)._methodClass());
+$2=_st($3)._selectedClass();
+$1=_st($2).__eq(_st(method)._methodClass());
 $ctx1.sendIdx["="]=1;
-if(! smalltalk.assert($2)){
+if(! smalltalk.assert($1)){
 return self;
 };
-$6=self._browserModel();
+$5=self._browserModel();
 $ctx1.sendIdx["browserModel"]=2;
-$5=_st($6)._selectedMethod();
+$4=_st($5)._selectedMethod();
 $ctx1.sendIdx["selectedMethod"]=1;
-if(($receiver = $5) == nil || $receiver == null){
+if(($receiver = $4) == nil || $receiver == null){
 return self;
 } else {
-$5;
+$4;
 };
-$11=self._browserModel();
-$10=_st($11)._selectedMethod();
-$9=_st($10)._selector();
+$7=_st(_st(self._browserModel())._selectedMethod())._selector();
 $ctx1.sendIdx["selector"]=1;
-$12=_st(method)._selector();
-$8=_st($9).__eq($12);
-if(! smalltalk.assert($8)){
+$6=_st($7).__eq(_st(method)._selector());
+if(! smalltalk.assert($6)){
 return self;
 };
 self._refresh();
 return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
 args: ["anAnnouncement"],
-source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a    self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
+source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a\x09self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
 messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
 referencedClasses: []
 }),
@@ -1824,7 +1791,7 @@ fn: function (anAnnouncement){
 var self=this;
 var method;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1,$2;
 method=_st(anAnnouncement)._item();
 $1=method;
 if(($receiver = $1) == nil || $receiver == null){
@@ -1834,15 +1801,42 @@ return $2;
 } else {
 $1;
 };
-$3=self._contents_(_st(method)._source());
+self._contents_(_st(method)._source());
 return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
 args: ["anAnnouncement"],
-source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a    self contents: method source",
+source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
 messageSends: ["item", "ifNil:", "contents:", "source"],
 referencedClasses: []
 }),
 smalltalk.HLBrowserCodeWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onPackageSelected:",
+category: 'reactions',
+fn: function (anAnnouncement){
+var self=this;
+var package_;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+package_=_st(anAnnouncement)._item();
+$1=package_;
+if(($receiver = $1) == nil || $receiver == null){
+$2=self._contents_("");
+$ctx1.sendIdx["contents:"]=1;
+return $2;
+} else {
+$1;
+};
+self._contents_(_st(package_)._definition());
+return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},smalltalk.HLBrowserCodeWidget)})},
+args: ["anAnnouncement"],
+source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
+messageSends: ["item", "ifNil:", "contents:", "definition"],
+referencedClasses: []
+}),
+smalltalk.HLBrowserCodeWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onParseError:",
@@ -1852,7 +1846,7 @@ var self=this;
 var lineIndex,newContents;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$6,$4,$8,$10,$12,$11,$9,$7;
+var $1,$3,$2,$6,$5,$4;
 lineIndex=(1);
 self._contents_(_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
@@ -1860,30 +1854,24 @@ return _st(self._contents())._linesDo_((function(each){
 return smalltalk.withContext(function($ctx3) {
 $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
 if(smalltalk.assert($1)){
-$2=stream;
-$3=$2;
-$5=each;
-$6=_st(anAnnouncement)._column();
+$3=_st(anAnnouncement)._column();
 $ctx3.sendIdx["column"]=1;
-$4=_st($5)._copyFrom_to_((1),$6);
+$2=_st(each)._copyFrom_to_((1),$3);
 $ctx3.sendIdx["copyFrom:to:"]=1;
-_st($3)._nextPutAll_($4);
+_st(stream)._nextPutAll_($2);
 $ctx3.sendIdx["nextPutAll:"]=1;
-_st($2)._nextPutAll_("<- ");
+_st(stream)._nextPutAll_("<- ");
 $ctx3.sendIdx["nextPutAll:"]=2;
-_st($2)._nextPutAll_(_st(anAnnouncement)._message());
+_st(stream)._nextPutAll_(_st(anAnnouncement)._message());
 $ctx3.sendIdx["nextPutAll:"]=3;
-_st($2)._nextPutAll_(" ");
+_st(stream)._nextPutAll_(" ");
 $ctx3.sendIdx["nextPutAll:"]=4;
-$8=$2;
-$10=each;
-$12=_st(anAnnouncement)._column();
-$11=_st($12).__plus((1));
+$6=_st(_st(anAnnouncement)._column()).__plus((1));
 $ctx3.sendIdx["+"]=1;
-$9=_st($10)._copyFrom_to_($11,_st(each)._size());
-$7=_st($8)._nextPutAll_($9);
+$5=_st(each)._copyFrom_to_($6,_st(each)._size());
+$4=_st(stream)._nextPutAll_($5);
 $ctx3.sendIdx["nextPutAll:"]=5;
-$7;
+$4;
 } else {
 _st(stream)._nextPutAll_(each);
 $ctx3.sendIdx["nextPutAll:"]=6;
@@ -1908,7 +1896,7 @@ category: 'reactions',
 fn: function (anAnnouncement){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$7,$6,$5,$4;
+var $2,$1,$3;
 $2=self._browserModel();
 $ctx1.sendIdx["browserModel"]=1;
 $1=_st($2)._selectedClass();
@@ -1920,13 +1908,10 @@ return $3;
 } else {
 $1;
 };
-$7=self._browserModel();
-$6=_st($7)._selectedClass();
-$5=_st($6)._definition();
-$4=self._contents_($5);
+self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
 return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
 args: ["anAnnouncement"],
-source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a    self contents: self browserModel selectedClass definition",
+source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
 messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
 referencedClasses: []
 }),
@@ -1955,7 +1940,7 @@ category: 'reactions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$7,$6,$5,$4;
+var $2,$1,$3;
 $2=self._browserModel();
 $ctx1.sendIdx["browserModel"]=1;
 $1=_st($2)._selectedClass();
@@ -1967,13 +1952,10 @@ return $3;
 } else {
 $1;
 };
-$7=self._browserModel();
-$6=_st($7)._selectedClass();
-$5=_st($6)._definition();
-$4=self._contents_($5);
+self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
 return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
 args: [],
-source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a    \x0a    self contents: self browserModel selectedClass definition",
+source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a    \x0a\x09self contents: self browserModel selectedClass definition",
 messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
 referencedClasses: []
 }),
@@ -2021,17 +2003,16 @@ var self=this;
 var error;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 error=_st(anAnnouncement)._error();
 self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
-$1=stream;
-_st($1)._nextPutAll_(_st(error)._messageText());
+_st(stream)._nextPutAll_(_st(error)._messageText());
 $ctx2.sendIdx["nextPutAll:"]=1;
-_st($1)._nextPutAll_(_st($String())._cr());
+_st(stream)._nextPutAll_(_st($String())._cr());
 $ctx2.sendIdx["nextPutAll:"]=2;
-$2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
-return $2;
+$1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
+return $1;
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
@@ -2051,13 +2032,13 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
-$2=self._hasModification();
-if(smalltalk.assert($2)){
+var $1,$2;
+$1=self._hasModification();
+if(smalltalk.assert($1)){
 return self;
 };
-$4=self._hasFocus();
-if(smalltalk.assert($4)){
+$2=self._hasFocus();
+if(smalltalk.assert($2)){
 return self;
 };
 self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
@@ -2116,16 +2097,14 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1,$6,$5,$4;
+var $2,$1;
 smalltalk.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
-$3=self._browserModel();
+$2=self._browserModel();
 $ctx1.sendIdx["browserModel"]=1;
-$2=_st($3)._announcer();
-$1=_st($2)._unsubscribe_(self);
+$1=_st($2)._announcer();
+_st($1)._unsubscribe_(self);
 $ctx1.sendIdx["unsubscribe:"]=1;
-$6=self._browserModel();
-$5=_st($6)._systemAnnouncer();
-$4=_st($5)._unsubscribe_(self);
+_st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
 args: [],
 source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
@@ -2242,13 +2221,10 @@ var self=this;
 function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
 function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=html;
-$3=_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
+_st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
 return smalltalk.withContext(function($ctx2) {
 return self._renderTranscriptOn_(canvas);
-}, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})})));
-$1=_st($2)._with_($3);
+}, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
 $ctx1.sendIdx["with:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
 args: ["html"],
@@ -2319,10 +2295,9 @@ category: 'actions',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=smalltalk.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
+smalltalk.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
 $ctx1.sendIdx["unregister"]=1;
-$2=_st(self._transcript())._unregister();
+_st(self._transcript())._unregister();
 return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWorkspace)})},
 args: [],
 source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 176 - 212
js/IDE.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 227 - 306
js/Importer-Exporter.js


+ 3 - 6
js/Kernel-Announcements.js

@@ -88,7 +88,7 @@ _st(self._valuable())._value_(anAnnouncement);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
 args: ["anAnnouncement"],
-source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [self valuable value: anAnnouncement]",
+source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [ self valuable value: anAnnouncement ]",
 messageSends: ["ifTrue:", "handlesAnnouncement:", "value:", "valuable"],
 referencedClasses: []
 }),
@@ -102,7 +102,7 @@ fn: function (anAnnouncement){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$4,$2,$6,$7,$5,$1;
+var $3,$4,$2,$1;
 $3=_st($Smalltalk())._current();
 $ctx1.sendIdx["current"]=1;
 $4=_st(self._announcementClass())._name();
@@ -114,10 +114,7 @@ return false;
 } else {
 var class_;
 class_=$receiver;
-$6=_st($Smalltalk())._current();
-$7=_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name();
-$5=_st($6)._at_($7);
-$1=_st($5)._includesBehavior_(class_);
+$1=_st(_st(_st($Smalltalk())._current())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()))._includesBehavior_(class_);
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},

+ 168 - 219
js/Kernel-Classes.js

@@ -33,7 +33,7 @@ function $MethodAdded(){return smalltalk.MethodAdded||(typeof MethodAdded=="unde
 function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1,$4,$5,$6,$7,$8,$9,$10;
+var $2,$3,$1,$4,$5,$6,$7,$8;
 oldMethod=_st(self._methodDictionary())._at_ifAbsent_(_st(aMethod)._selector(),(function(){
 return smalltalk.withContext(function($ctx2) {
 return nil;
@@ -43,26 +43,24 @@ $3=_st(aMethod)._protocol();
 $ctx1.sendIdx["protocol"]=1;
 $1=_st($2)._includes_($3);
 if(! smalltalk.assert($1)){
-$4=self._organization();
-$5=_st(aMethod)._protocol();
-_st($4)._addElement_($5);
+_st(self._organization())._addElement_(_st(aMethod)._protocol());
 };
 self._basicAddCompiledMethod_(aMethod);
-$6=oldMethod;
-if(($receiver = $6) == nil || $receiver == null){
-$7=_st($MethodAdded())._new();
+$4=oldMethod;
+if(($receiver = $4) == nil || $receiver == null){
+$5=_st($MethodAdded())._new();
 $ctx1.sendIdx["new"]=1;
-_st($7)._method_(aMethod);
+_st($5)._method_(aMethod);
 $ctx1.sendIdx["method:"]=1;
-$8=_st($7)._yourself();
+$6=_st($5)._yourself();
 $ctx1.sendIdx["yourself"]=1;
-announcement=$8;
+announcement=$6;
 } else {
-$9=_st($MethodModified())._new();
-_st($9)._oldMethod_(oldMethod);
-_st($9)._method_(aMethod);
-$10=_st($9)._yourself();
-announcement=$10;
+$7=_st($MethodModified())._new();
+_st($7)._oldMethod_(oldMethod);
+_st($7)._method_(aMethod);
+$8=_st($7)._yourself();
+announcement=$8;
 };
 _st(_st($SystemAnnouncer())._current())._announce_(announcement);
 return self}, function($ctx1) {$ctx1.fill(self,"addCompiledMethod:",{aMethod:aMethod,oldMethod:oldMethod,announcement:announcement},smalltalk.Behavior)})},
@@ -81,23 +79,20 @@ fn: function (){
 var self=this;
 var result;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5;
+var $1,$2;
 result=_st(self._instanceVariableNames())._copy();
 $1=self._superclass();
 $ctx1.sendIdx["superclass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$2=result;
-$4=self._superclass();
-$3=_st($4)._allInstanceVariableNames();
-_st($2)._addAll_($3);
+_st(result)._addAll_(_st(self._superclass())._allInstanceVariableNames());
 };
-$5=result;
-return $5;
+$2=result;
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"allInstanceVariableNames",{result:result},smalltalk.Behavior)})},
 args: [],
-source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09\x09result addAll: self superclass allInstanceVariableNames].\x0a\x09^result",
+source: "allInstanceVariableNames\x0a\x09| result |\x0a\x09result := self instanceVariableNames copy.\x0a\x09self superclass ifNotNil: [\x0a\x09\x09result addAll: self superclass allInstanceVariableNames ].\x0a\x09^ result",
 messageSends: ["copy", "instanceVariableNames", "ifNotNil:", "superclass", "addAll:", "allInstanceVariableNames"],
 referencedClasses: []
 }),
@@ -110,18 +105,15 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$6,$7,$1;
+var $2,$3,$4,$1;
 $2=self._allSuperclasses();
 $3=self._selectors();
 $ctx1.sendIdx["selectors"]=1;
 $1=_st($2)._inject_into_($3,(function(acc,each){
 return smalltalk.withContext(function($ctx2) {
-$4=acc;
-$5=$4;
-$6=_st(each)._selectors();
-_st($5)._addAll_($6);
-$7=_st($4)._yourself();
-return $7;
+_st(acc)._addAll_(_st(each)._selectors());
+$4=_st(acc)._yourself();
+return $4;
 }, function($ctx2) {$ctx2.fillBlock({acc:acc,each:each},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Behavior)})},
@@ -140,7 +132,7 @@ fn: function (){
 var self=this;
 var subclasses,index;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1;
 subclasses=self._subclasses();
 $ctx1.sendIdx["subclasses"]=1;
 index=(1);
@@ -149,14 +141,12 @@ return smalltalk.withContext(function($ctx2) {
 return _st(index).__gt(_st(subclasses)._size());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._whileFalse_((function(){
 return smalltalk.withContext(function($ctx2) {
-$1=subclasses;
-$2=_st(_st(subclasses)._at_(index))._subclasses();
-_st($1)._addAll_($2);
+_st(subclasses)._addAll_(_st(_st(subclasses)._at_(index))._subclasses());
 index=_st(index).__plus((1));
 return index;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-$3=subclasses;
-return $3;
+$1=subclasses;
+return $1;
 }, function($ctx1) {$ctx1.fill(self,"allSubclasses",{subclasses:subclasses,index:index},smalltalk.Behavior)})},
 args: [],
 source: "allSubclasses\x0a\x09\x22Answer an collection of the receiver's and the receiver's descendent's subclasses. \x22\x0a\x0a\x09| subclasses index |\x0a\x09\x0a\x09subclasses := self subclasses.\x0a\x09index := 1.\x0a\x09[ index > subclasses size ]\x0a\x09\x09whileFalse: [ subclasses addAll: (subclasses at: index) subclasses.\x0a\x09\x09\x09index := index + 1 ].\x0a\x0a\x09^ subclasses",
@@ -192,7 +182,7 @@ fn: function (){
 var self=this;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$5,$6,$4,$7,$9,$8,$10,$3;
+var $1,$2,$5,$4,$6,$3;
 $1=self._superclass();
 $ctx1.sendIdx["superclass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
@@ -201,16 +191,12 @@ return $2;
 } else {
 $1;
 };
-$5=$OrderedCollection();
-$6=self._superclass();
+$5=self._superclass();
 $ctx1.sendIdx["superclass"]=2;
-$4=_st($5)._with_($6);
-$7=$4;
-$9=self._superclass();
-$8=_st($9)._allSuperclasses();
-_st($7)._addAll_($8);
-$10=_st($4)._yourself();
-$3=$10;
+$4=_st($OrderedCollection())._with_($5);
+_st($4)._addAll_(_st(self._superclass())._allSuperclasses());
+$6=_st($4)._yourself();
+$3=$6;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"allSuperclasses",{},smalltalk.Behavior)})},
 args: [],
@@ -275,7 +261,7 @@ category: 'testing',
 fn: function (aSelector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$4,$1;
+var $3,$2,$1;
 $1=_st(_st(_st(self._methodDictionary())._keys())._includes_(_st(aSelector)._asString()))._or_((function(){
 return smalltalk.withContext(function($ctx2) {
 $3=self._superclass();
@@ -283,14 +269,13 @@ $ctx2.sendIdx["superclass"]=1;
 $2=_st($3)._notNil();
 return _st($2)._and_((function(){
 return smalltalk.withContext(function($ctx3) {
-$4=self._superclass();
-return _st($4)._canUnderstand_(aSelector);
+return _st(self._superclass())._canUnderstand_(aSelector);
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"canUnderstand:",{aSelector:aSelector},smalltalk.Behavior)})},
 args: ["aSelector"],
-source: "canUnderstand: aSelector\x0a\x09^(self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [self superclass canUnderstand: aSelector]]",
+source: "canUnderstand: aSelector\x0a\x09^ (self methodDictionary keys includes: aSelector asString) or: [\x0a\x09\x09self superclass notNil and: [ self superclass canUnderstand: aSelector ]]",
 messageSends: ["or:", "includes:", "keys", "methodDictionary", "asString", "and:", "notNil", "superclass", "canUnderstand:"],
 referencedClasses: []
 }),
@@ -313,7 +298,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"comment",{},smalltalk.Behavior)})},
 args: [],
-source: "comment\x0a\x09^(self basicAt: 'comment') ifNil: ['']",
+source: "comment\x0a\x09^ (self basicAt: 'comment') ifNil: [ '' ]",
 messageSends: ["ifNil:", "basicAt:"],
 referencedClasses: []
 }),
@@ -358,7 +343,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"commentStamp",{},smalltalk.Behavior)})},
 args: [],
-source: "commentStamp\x0a\x09^ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
+source: "commentStamp\x0a\x09^ ClassCommentReader new\x0a\x09class: self;\x0a\x09yourself",
 messageSends: ["class:", "new", "yourself"],
 referencedClasses: ["ClassCommentReader"]
 }),
@@ -376,7 +361,7 @@ $1=self._commentStamp();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"commentStamp:prior:",{aStamp:aStamp,prior:prior},smalltalk.Behavior)})},
 args: ["aStamp", "prior"],
-source: "commentStamp: aStamp prior: prior\x0a\x09\x09^self commentStamp",
+source: "commentStamp: aStamp prior: prior\x0a\x09\x09^ self commentStamp",
 messageSends: ["commentStamp"],
 referencedClasses: []
 }),
@@ -481,7 +466,7 @@ category: 'testing',
 fn: function (aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$5,$3,$6,$2;
+var $1,$4,$3,$2;
 $1=self._superclass();
 $ctx1.sendIdx["superclass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
@@ -489,14 +474,12 @@ return false;
 } else {
 $1;
 };
-$4=aClass;
-$5=self._superclass();
+$4=self._superclass();
 $ctx1.sendIdx["superclass"]=2;
-$3=_st($4).__eq_eq($5);
+$3=_st(aClass).__eq_eq($4);
 $2=_st($3)._or_((function(){
 return smalltalk.withContext(function($ctx2) {
-$6=self._superclass();
-return _st($6)._inheritsFrom_(aClass);
+return _st(self._superclass())._inheritsFrom_(aClass);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"inheritsFrom:",{aClass:aClass},smalltalk.Behavior)})},
@@ -682,7 +665,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodsFor:",{aString:aString},smalltalk.Behavior)})},
 args: ["aString"],
-source: "methodsFor: aString\x0a\x09^ClassCategoryReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
+source: "methodsFor: aString\x0a\x09^ ClassCategoryReader new\x0a\x09\x09class: self category: aString;\x0a\x09\x09yourself",
 messageSends: ["class:category:", "new", "yourself"],
 referencedClasses: ["ClassCategoryReader"]
 }),
@@ -700,7 +683,7 @@ $1=self._methodsFor_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodsFor:stamp:",{aString:aString,aStamp:aStamp},smalltalk.Behavior)})},
 args: ["aString", "aStamp"],
-source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^self methodsFor: aString",
+source: "methodsFor: aString stamp: aStamp\x0a\x09\x22Added for compatibility, right now ignores stamp.\x22\x0a\x09^ self methodsFor: aString",
 messageSends: ["methodsFor:"],
 referencedClasses: []
 }),
@@ -755,7 +738,7 @@ $1=_st(self._basicNew())._initialize();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.Behavior)})},
 args: [],
-source: "new\x0a\x09^self basicNew initialize",
+source: "new\x0a\x09^ self basicNew initialize",
 messageSends: ["initialize", "basicNew"],
 referencedClasses: []
 }),
@@ -787,7 +770,7 @@ fn: function (){
 var self=this;
 function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $1=_st(_st(self._ownProtocols())._inject_into_(_st($OrderedCollection())._new(),(function(acc,each){
 return smalltalk.withContext(function($ctx2) {
 return _st(acc).__comma(self._methodsInProtocol_(each));
@@ -795,8 +778,7 @@ return _st(acc).__comma(self._methodsInProtocol_(each));
 return smalltalk.withContext(function($ctx2) {
 $2=_st(a)._selector();
 $ctx2.sendIdx["selector"]=1;
-$3=_st(b)._selector();
-return _st($2).__lt_eq($3);
+return _st($2).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ownMethods",{},smalltalk.Behavior)})},
@@ -856,10 +838,9 @@ var methodsByCategory;
 function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
 methodsByCategory=_st($HashedCollection())._new();
 $ctx1.sendIdx["new"]=1;
-$1=_st(_st(self._methodDictionary())._values())._do_((function(m){
+_st(_st(self._methodDictionary())._values())._do_((function(m){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(methodsByCategory)._at_ifAbsentPut_(_st(m)._category(),(function(){
 return smalltalk.withContext(function($ctx3) {
@@ -867,13 +848,13 @@ return _st($Array())._new();
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._add_(m);
 }, function($ctx2) {$ctx2.fillBlock({m:m},$ctx1,1)})}));
 $ctx1.sendIdx["do:"]=1;
-$2=_st(self._protocols())._do_((function(category){
+_st(self._protocols())._do_((function(category){
 return smalltalk.withContext(function($ctx2) {
 return _st(aBlock)._value_value_(category,_st(methodsByCategory)._at_(category));
 }, function($ctx2) {$ctx2.fillBlock({category:category},$ctx1,3)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"protocolsDo:",{aBlock:aBlock,methodsByCategory:methodsByCategory},smalltalk.Behavior)})},
 args: ["aBlock"],
-source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [:m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [Array new])\x0a\x09\x09\x09add: m].\x0a\x09self protocols do: [:category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category)]",
+source: "protocolsDo: aBlock\x0a\x09\x22Execute aBlock for each method category with\x0a\x09its collection of methods in the sort order of category name.\x22\x0a\x0a\x09| methodsByCategory |\x0a\x09methodsByCategory := HashedCollection new.\x0a\x09self methodDictionary values do: [ :m |\x0a\x09\x09(methodsByCategory at: m category ifAbsentPut: [ Array new ])\x0a\x09\x09\x09add: m ].\x0a\x09self protocols do: [ :category |\x0a\x09\x09aBlock value: category value: (methodsByCategory at: category) ]",
 messageSends: ["new", "do:", "values", "methodDictionary", "add:", "at:ifAbsentPut:", "category", "protocols", "value:value:", "at:"],
 referencedClasses: ["HashedCollection", "Array"]
 }),
@@ -923,7 +904,7 @@ var self=this;
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 function $MethodRemoved(){return smalltalk.MethodRemoved||(typeof MethodRemoved=="undefined"?nil:MethodRemoved)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6;
+var $1,$2,$3,$4;
 self._basicRemoveCompiledMethod_(aMethod);
 _st(self._methods())._detect_ifNone_((function(each){
 return smalltalk.withContext(function($ctx2) {
@@ -934,14 +915,12 @@ $ctx2.sendIdx["protocol"]=2;
 return _st($1).__eq($2);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
 return smalltalk.withContext(function($ctx2) {
-$3=self._organization();
-$4=_st(aMethod)._protocol();
-return _st($3)._removeElement_($4);
+return _st(self._organization())._removeElement_(_st(aMethod)._protocol());
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-$5=_st($MethodRemoved())._new();
-_st($5)._method_(aMethod);
-$6=_st($5)._yourself();
-_st(_st($SystemAnnouncer())._current())._announce_($6);
+$3=_st($MethodRemoved())._new();
+_st($3)._method_(aMethod);
+$4=_st($3)._yourself();
+_st(_st($SystemAnnouncer())._current())._announce_($4);
 return self}, function($ctx1) {$ctx1.fill(self,"removeCompiledMethod:",{aMethod:aMethod},smalltalk.Behavior)})},
 args: ["aMethod"],
 source: "removeCompiledMethod: aMethod\x0a\x09self basicRemoveCompiledMethod: aMethod.\x0a\x09\x0a\x09self methods\x0a\x09\x09detect: [ :each | each protocol = aMethod protocol ]\x0a\x09\x09ifNone: [ self organization removeElement: aMethod protocol ].\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (MethodRemoved new\x0a\x09\x09\x09method: aMethod;\x0a\x09\x09\x09yourself)",
@@ -1050,7 +1029,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"withAllSubclasses",{},smalltalk.Behavior)})},
 args: [],
-source: "withAllSubclasses\x0a\x09^(Array with: self) addAll: self allSubclasses; yourself",
+source: "withAllSubclasses\x0a\x09^ (Array with: self) addAll: self allSubclasses; yourself",
 messageSends: ["addAll:", "with:", "allSubclasses", "yourself"],
 referencedClasses: ["Array"]
 }),
@@ -1085,19 +1064,18 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $2=self._package();
 $ctx1.sendIdx["package"]=1;
 if(($receiver = $2) == nil || $receiver == null){
 $1="Unclassified";
 } else {
-$3=self._package();
-$1=_st($3)._name();
+$1=_st(self._package())._name();
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.Class)})},
 args: [],
-source: "category\x0a\x09^self package ifNil: ['Unclassified'] ifNotNil: [self package name]",
+source: "category\x0a\x09^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]",
 messageSends: ["ifNil:ifNotNil:", "package", "name"],
 referencedClasses: []
 }),
@@ -1111,28 +1089,26 @@ fn: function (){
 var self=this;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$5,$6,$4,$7,$8,$9,$12,$11,$13,$10,$14,$1;
+var $3,$4,$2,$5,$6,$7,$1;
 $1=_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
-$2=stream;
-_st($2)._nextPutAll_(_st(self._superclass())._asString());
+_st(stream)._nextPutAll_(_st(self._superclass())._asString());
 $ctx2.sendIdx["nextPutAll:"]=1;
-_st($2)._nextPutAll_(" subclass: #");
+_st(stream)._nextPutAll_(" subclass: #");
 $ctx2.sendIdx["nextPutAll:"]=2;
-_st($2)._nextPutAll_(self._name());
+_st(stream)._nextPutAll_(self._name());
 $ctx2.sendIdx["nextPutAll:"]=3;
-$3=$2;
-$5=_st($String())._lf();
+$3=_st($String())._lf();
 $ctx2.sendIdx["lf"]=1;
-$6=_st($String())._tab();
+$4=_st($String())._tab();
 $ctx2.sendIdx["tab"]=1;
-$4=_st($5).__comma($6);
+$2=_st($3).__comma($4);
 $ctx2.sendIdx[","]=1;
-_st($3)._nextPutAll_($4);
+_st(stream)._nextPutAll_($2);
 $ctx2.sendIdx["nextPutAll:"]=4;
-$7=_st($2)._nextPutAll_("instanceVariableNames: '");
+$5=_st(stream)._nextPutAll_("instanceVariableNames: '");
 $ctx2.sendIdx["nextPutAll:"]=5;
-$7;
+$5;
 _st(self._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx3) {
 return _st(stream)._nextPutAll_(each);
@@ -1142,21 +1118,16 @@ return smalltalk.withContext(function($ctx3) {
 return _st(stream)._nextPutAll_(" ");
 $ctx3.sendIdx["nextPutAll:"]=7;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-$8=stream;
-$9=$8;
-$12=_st($String())._lf();
-$11="'".__comma($12);
-$13=_st($String())._tab();
-$10=_st($11).__comma($13);
+$6=_st("'".__comma(_st($String())._lf())).__comma(_st($String())._tab());
 $ctx2.sendIdx[","]=2;
-_st($9)._nextPutAll_($10);
+_st(stream)._nextPutAll_($6);
 $ctx2.sendIdx["nextPutAll:"]=8;
-_st($8)._nextPutAll_("package: '");
+_st(stream)._nextPutAll_("package: '");
 $ctx2.sendIdx["nextPutAll:"]=9;
-_st($8)._nextPutAll_(self._category());
+_st(stream)._nextPutAll_(self._category());
 $ctx2.sendIdx["nextPutAll:"]=10;
-$14=_st($8)._nextPutAll_("'");
-return $14;
+$7=_st(stream)._nextPutAll_("'");
+return $7;
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Class)})},
@@ -1177,7 +1148,7 @@ return smalltalk.withContext(function($ctx1) {
 return true;
 }, function($ctx1) {$ctx1.fill(self,"isClass",{},smalltalk.Class)})},
 args: [],
-source: "isClass\x0a\x09^true",
+source: "isClass\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1211,7 +1182,7 @@ var oldPackage;
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 function $ClassMoved(){return smalltalk.ClassMoved||(typeof ClassMoved=="undefined"?nil:ClassMoved)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$4,$5,$6;
+var $2,$1,$3,$4,$5;
 $2=self._package();
 $ctx1.sendIdx["package"]=1;
 $1=_st($2).__eq(aPackage);
@@ -1223,13 +1194,12 @@ self._basicAt_put_("pkg",aPackage);
 $3=_st(oldPackage)._organization();
 $ctx1.sendIdx["organization"]=1;
 _st($3)._removeElement_(self);
-$4=_st(aPackage)._organization();
-_st($4)._addElement_(self);
-$5=_st($ClassMoved())._new();
-_st($5)._theClass_(self);
-_st($5)._oldPackage_(oldPackage);
-$6=_st($5)._yourself();
-_st(_st($SystemAnnouncer())._current())._announce_($6);
+_st(_st(aPackage)._organization())._addElement_(self);
+$4=_st($ClassMoved())._new();
+_st($4)._theClass_(self);
+_st($4)._oldPackage_(oldPackage);
+$5=_st($4)._yourself();
+_st(_st($SystemAnnouncer())._current())._announce_($5);
 return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage,oldPackage:oldPackage},smalltalk.Class)})},
 args: ["aPackage"],
 source: "package: aPackage\x0a\x09| oldPackage |\x0a\x09\x0a\x09self package = aPackage ifTrue: [ ^ self ].\x0a\x09\x0a\x09oldPackage := self package.\x0a\x09\x0a\x09self basicAt: 'pkg' put: aPackage.\x0a\x09oldPackage organization removeElement: self.\x0a\x09aPackage organization addElement: self.\x0a\x0a\x09SystemAnnouncer current announce: (ClassMoved new\x0a\x09\x09theClass: self;\x0a\x09\x09oldPackage: oldPackage;\x0a\x09\x09yourself)",
@@ -1283,7 +1253,7 @@ $1=self._subclass_instanceVariableNames_package_(aString,anotherString,nil);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:",{aString:aString,anotherString:anotherString},smalltalk.Class)})},
 args: ["aString", "anotherString"],
-source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: anotherString package: nil",
+source: "subclass: aString instanceVariableNames: anotherString\x0a\x09\x22Kept for compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: anotherString package: nil",
 messageSends: ["subclass:instanceVariableNames:package:"],
 referencedClasses: []
 }),
@@ -1302,7 +1272,7 @@ $1=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:category:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
 args: ["aString", "aString2", "aString3"],
-source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
+source: "subclass: aString instanceVariableNames: aString2 category: aString3\x0a\x09\x22Kept for compatibility.\x22\x0a\x09self deprecatedAPI.\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
 messageSends: ["deprecatedAPI", "subclass:instanceVariableNames:package:"],
 referencedClasses: []
 }),
@@ -1320,7 +1290,7 @@ $1=self._subclass_instanceVariableNames_package_(aString,aString2,aString3);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",{aString:aString,aString2:aString2,classVars:classVars,pools:pools,aString3:aString3},smalltalk.Class)})},
 args: ["aString", "aString2", "classVars", "pools", "aString3"],
-source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^self subclass: aString instanceVariableNames: aString2 package: aString3",
+source: "subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3\x0a\x09\x22Just ignore class variables and pools. Added for compatibility.\x22\x0a\x09^ self subclass: aString instanceVariableNames: aString2 package: aString3",
 messageSends: ["subclass:instanceVariableNames:package:"],
 referencedClasses: []
 }),
@@ -1339,7 +1309,7 @@ $1=_st(_st($ClassBuilder())._new())._superclass_subclass_instanceVariableNames_p
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"subclass:instanceVariableNames:package:",{aString:aString,aString2:aString2,aString3:aString3},smalltalk.Class)})},
 args: ["aString", "aString2", "aString3"],
-source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
+source: "subclass: aString instanceVariableNames: aString2 package: aString3\x0a\x09^ ClassBuilder new\x0a\x09\x09superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3",
 messageSends: ["superclass:subclass:instanceVariableNames:package:", "new", "asString"],
 referencedClasses: ["ClassBuilder"]
 }),
@@ -1372,9 +1342,8 @@ category: 'converting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2="smalltalk.".__comma(_st(self._instanceClass())._name());
-$1=_st($2).__comma(".klass");
+var $1;
+$1=_st("smalltalk.".__comma(_st(self._instanceClass())._name())).__comma(".klass");
 $ctx1.sendIdx[","]=1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asJavascript",{},smalltalk.Metaclass)})},
@@ -1393,15 +1362,14 @@ fn: function (){
 var self=this;
 function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
+var $2,$1;
 $1=_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
-$2=stream;
-_st($2)._nextPutAll_(self._asString());
+_st(stream)._nextPutAll_(self._asString());
 $ctx2.sendIdx["nextPutAll:"]=1;
-$3=_st($2)._nextPutAll_(" instanceVariableNames: '");
+$2=_st(stream)._nextPutAll_(" instanceVariableNames: '");
 $ctx2.sendIdx["nextPutAll:"]=2;
-$3;
+$2;
 _st(self._instanceVariableNames())._do_separatedBy_((function(each){
 return smalltalk.withContext(function($ctx3) {
 return _st(stream)._nextPutAll_(each);
@@ -1465,7 +1433,7 @@ return smalltalk.withContext(function($ctx1) {
 return true;
 }, function($ctx1) {$ctx1.fill(self,"isMetaclass",{},smalltalk.Metaclass)})},
 args: [],
-source: "isMetaclass\x0a\x09^true",
+source: "isMetaclass\x0a\x09^ true",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1478,11 +1446,10 @@ category: 'printing',
 fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=aStream;
-_st($1)._nextPutAll_(_st(self._instanceClass())._name());
+var $1;
+_st(aStream)._nextPutAll_(_st(self._instanceClass())._name());
 $ctx1.sendIdx["nextPutAll:"]=1;
-$2=_st($1)._nextPutAll_(" class");
+$1=_st(aStream)._nextPutAll_(" class");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Metaclass)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: self instanceClass name;\x0a\x09\x09nextPutAll: ' class'",
@@ -1636,7 +1603,7 @@ self._error_(_st(_st(aClass)._name()).__comma(" is not a metaclass"));
 _st(aClass)._basicAt_put_("iVarNames",aCollection);
 return self}, function($ctx1) {$ctx1.fill(self,"basicClass:instanceVariables:",{aClass:aClass,aCollection:aCollection},smalltalk.ClassBuilder)})},
 args: ["aClass", "aCollection"],
-source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
+source: "basicClass: aClass instanceVariables: aCollection\x0a\x0a\x09aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].\x0a\x09aClass basicAt: 'iVarNames' put: aCollection",
 messageSends: ["ifFalse:", "isMetaclass", "error:", ",", "name", "basicAt:put:"],
 referencedClasses: []
 }),
@@ -1743,7 +1710,7 @@ $3=newClass;
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"copyClass:named:",{aClass:aClass,className:className,newClass:newClass},smalltalk.ClassBuilder)})},
 args: ["aClass", "className"],
-source: "copyClass: aClass named: className\x0a\x09| newClass |\x0a\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
+source: "copyClass: aClass named: className\x0a\x09| newClass |\x0a\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass superclass\x0a\x09\x09named: className\x0a\x09\x09instanceVariableNames: aClass instanceVariableNames\x0a\x09\x09package: aClass package name.\x0a\x0a\x09self copyClass: aClass to: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
 messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "superclass", "instanceVariableNames", "name", "package", "copyClass:to:", "announce:", "current", "theClass:", "new", "yourself"],
 referencedClasses: ["SystemAnnouncer", "ClassAdded"]
 }),
@@ -1757,42 +1724,37 @@ fn: function (aClass,anotherClass){
 var self=this;
 function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$4,$5,$6,$7,$1,$8,$10,$9,$14,$13,$12,$15,$16,$17,$18,$11;
+var $2,$1,$3,$4,$5,$6,$8,$7,$11,$10,$9;
 _st(anotherClass)._comment_(_st(aClass)._comment());
-$3=_st(aClass)._methodDictionary();
+$2=_st(aClass)._methodDictionary();
 $ctx1.sendIdx["methodDictionary"]=1;
-$2=_st($3)._values();
+$1=_st($2)._values();
 $ctx1.sendIdx["values"]=1;
-$1=_st($2)._do_((function(each){
+_st($1)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$4=_st($Compiler())._new();
+$3=_st($Compiler())._new();
 $ctx2.sendIdx["new"]=1;
-$5=_st(each)._source();
+$4=_st(each)._source();
 $ctx2.sendIdx["source"]=1;
-$6=anotherClass;
-$7=_st(each)._category();
+$5=_st(each)._category();
 $ctx2.sendIdx["category"]=1;
-return _st($4)._install_forClass_category_($5,$6,$7);
+return _st($3)._install_forClass_category_($4,anotherClass,$5);
 $ctx2.sendIdx["install:forClass:category:"]=1;
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 $ctx1.sendIdx["do:"]=1;
-$8=_st(anotherClass)._class();
+$6=_st(anotherClass)._class();
 $ctx1.sendIdx["class"]=1;
-$10=_st(aClass)._class();
+$8=_st(aClass)._class();
 $ctx1.sendIdx["class"]=2;
-$9=_st($10)._instanceVariableNames();
-self._basicClass_instanceVariables_($8,$9);
-$14=_st(aClass)._class();
+$7=_st($8)._instanceVariableNames();
+self._basicClass_instanceVariables_($6,$7);
+$11=_st(aClass)._class();
 $ctx1.sendIdx["class"]=3;
-$13=_st($14)._methodDictionary();
-$12=_st($13)._values();
-$11=_st($12)._do_((function(each){
+$10=_st($11)._methodDictionary();
+$9=_st($10)._values();
+_st($9)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$15=_st($Compiler())._new();
-$16=_st(each)._source();
-$17=_st(anotherClass)._class();
-$18=_st(each)._category();
-return _st($15)._install_forClass_category_($16,$17,$18);
+return _st(_st($Compiler())._new())._install_forClass_category_(_st(each)._source(),_st(anotherClass)._class(),_st(each)._category());
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 self._setupClass_(anotherClass);
 return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
@@ -1833,15 +1795,13 @@ category: 'method definition',
 fn: function (aCompiledMethod,aBehavior,aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
 _st(aCompiledMethod)._category_(aString);
 _st(aBehavior)._addCompiledMethod_(aCompiledMethod);
 self._setupClass_(aBehavior);
-$1=aCompiledMethod;
-return $1;
+return aCompiledMethod;
 }, function($ctx1) {$ctx1.fill(self,"installMethod:forClass:category:",{aCompiledMethod:aCompiledMethod,aBehavior:aBehavior,aString:aString},smalltalk.ClassBuilder)})},
 args: ["aCompiledMethod", "aBehavior", "aString"],
-source: "installMethod: aCompiledMethod forClass: aBehavior category: aString\x0a\x09aCompiledMethod category: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09self setupClass: aBehavior.\x0a\x09^aCompiledMethod",
+source: "installMethod: aCompiledMethod forClass: aBehavior category: aString\x0a\x09aCompiledMethod category: aString.\x0a\x09aBehavior addCompiledMethod: aCompiledMethod.\x0a\x09self setupClass: aBehavior.\x0a\x09^ aCompiledMethod",
 messageSends: ["category:", "addCompiledMethod:", "setupClass:"],
 referencedClasses: []
 }),
@@ -1862,7 +1822,7 @@ return _st(each)._isEmpty();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"instanceVariableNamesFor:",{aString:aString},smalltalk.ClassBuilder)})},
 args: ["aString"],
-source: "instanceVariableNamesFor: aString\x0a\x09^(aString tokenize: ' ') reject: [ :each | each isEmpty ]",
+source: "instanceVariableNamesFor: aString\x0a\x09^ (aString tokenize: ' ') reject: [ :each | each isEmpty ]",
 messageSends: ["reject:", "tokenize:", "isEmpty"],
 referencedClasses: []
 }),
@@ -1875,13 +1835,10 @@ category: 'class migration',
 fn: function (aClass,anotherClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$5,$1;
+var $2,$1;
 $2=_st(aClass)._name();
 $ctx1.sendIdx["name"]=1;
-$3=anotherClass;
-$4=_st(aClass)._instanceVariableNames();
-$5=_st(_st(aClass)._package())._name();
-$1=self._migrateClassNamed_superclass_instanceVariableNames_package_($2,$3,$4,$5);
+$1=self._migrateClassNamed_superclass_instanceVariableNames_package_($2,anotherClass,_st(aClass)._instanceVariableNames(),_st(_st(aClass)._package())._name());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"migrateClass:superclass:",{aClass:aClass,anotherClass:anotherClass},smalltalk.ClassBuilder)})},
 args: ["aClass", "anotherClass"],
@@ -1903,14 +1860,14 @@ function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 function $ClassMigrated(){return smalltalk.ClassMigrated||(typeof ClassMigrated=="undefined"?nil:ClassMigrated)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5,$6,$8,$7,$9,$10,$11,$12,$13;
+var $1,$2,$3,$4,$5,$6,$7,$8,$9;
 tmp="new*".__comma(className);
 $ctx1.sendIdx[","]=1;
 $1=_st($Smalltalk())._current();
 $ctx1.sendIdx["current"]=1;
 oldClass=_st($1)._at_(className);
 newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,tmp,aCollection,packageName);
-$2=self._basicSwapClassNames_with_(oldClass,newClass);
+self._basicSwapClassNames_with_(oldClass,newClass);
 $ctx1.sendIdx["basicSwapClassNames:with:"]=1;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -1918,35 +1875,33 @@ return self._copyClass_to_(oldClass,newClass);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(exception){
 return smalltalk.withContext(function($ctx2) {
 self._basicSwapClassNames_with_(oldClass,newClass);
-$3=self._basicRemoveClass_(newClass);
+$2=self._basicRemoveClass_(newClass);
 $ctx2.sendIdx["basicRemoveClass:"]=1;
-$3;
+$2;
 return _st(exception)._signal();
 }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)})}));
 self._rawRenameClass_to_(oldClass,tmp);
 $ctx1.sendIdx["rawRenameClass:to:"]=1;
-$4=self._rawRenameClass_to_(newClass,className);
-$5=_st(oldClass)._subclasses();
-$6=(function(each){
+$3=self._rawRenameClass_to_(newClass,className);
+$4=_st(oldClass)._subclasses();
+$5=(function(each){
 return smalltalk.withContext(function($ctx2) {
 return self._migrateClass_superclass_(each,newClass);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})});
-$8="Recompiling ".__comma(_st(newClass)._name());
-$7=_st($8).__comma("...");
+$6=_st("Recompiling ".__comma(_st(newClass)._name())).__comma("...");
 $ctx1.sendIdx[","]=2;
-_st($5)._do_displayingProgress_($6,$7);
-$9=self._basicRemoveClass_(oldClass);
-$10=_st($SystemAnnouncer())._current();
-$11=_st($ClassMigrated())._new();
-_st($11)._theClass_(newClass);
-_st($11)._oldClass_(oldClass);
-$12=_st($11)._yourself();
-_st($10)._announce_($12);
-$13=newClass;
-return $13;
+_st($4)._do_displayingProgress_($5,$6);
+self._basicRemoveClass_(oldClass);
+$7=_st($ClassMigrated())._new();
+_st($7)._theClass_(newClass);
+_st($7)._oldClass_(oldClass);
+$8=_st($7)._yourself();
+_st(_st($SystemAnnouncer())._current())._announce_($8);
+$9=newClass;
+return $9;
 }, function($ctx1) {$ctx1.fill(self,"migrateClassNamed:superclass:instanceVariableNames:package:",{className:className,aClass:aClass,aCollection:aCollection,packageName:packageName,oldClass:oldClass,newClass:newClass,tmp:tmp},smalltalk.ClassBuilder)})},
 args: ["className", "aClass", "aCollection", "packageName"],
-source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass tmp |\x0a\x09\x0a\x09tmp := 'new*', className.\x0a\x09oldClass := Smalltalk current at: className.\x0a\x09\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: tmp\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09self basicSwapClassNames: oldClass with: newClass.\x0a\x0a\x09[ self copyClass: oldClass to: newClass ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :exception |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09basicSwapClassNames: oldClass with: newClass;\x0a\x09\x09\x09\x09basicRemoveClass: newClass.\x0a\x09\x09\x09exception signal ].\x0a\x0a\x09self\x0a\x09\x09rawRenameClass: oldClass to: tmp;\x0a\x09\x09rawRenameClass: newClass to: className.\x0a\x0a\x09oldClass subclasses \x0a\x09\x09do: [ :each | self migrateClass: each superclass: newClass ]\x0a\x09\x09displayingProgress: 'Recompiling ', newClass name, '...'.\x0a\x0a\x09self basicRemoveClass: oldClass.\x0a\x09\x0a\x09SystemAnnouncer current announce: (ClassMigrated new\x0a\x09\x09theClass: newClass;\x0a\x09\x09oldClass: oldClass;\x0a\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
+source: "migrateClassNamed: className superclass: aClass instanceVariableNames: aCollection package: packageName\x0a\x09| oldClass newClass tmp |\x0a\x09\x0a\x09tmp := 'new*', className.\x0a\x09oldClass := Smalltalk current at: className.\x0a\x09\x0a\x09newClass := self\x0a\x09\x09addSubclassOf: aClass\x0a\x09\x09named: tmp\x0a\x09\x09instanceVariableNames: aCollection\x0a\x09\x09package: packageName.\x0a\x0a\x09self basicSwapClassNames: oldClass with: newClass.\x0a\x0a\x09[ self copyClass: oldClass to: newClass ]\x0a\x09\x09on: Error\x0a\x09\x09do: [ :exception |\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09basicSwapClassNames: oldClass with: newClass;\x0a\x09\x09\x09\x09basicRemoveClass: newClass.\x0a\x09\x09\x09exception signal ].\x0a\x0a\x09self\x0a\x09\x09rawRenameClass: oldClass to: tmp;\x0a\x09\x09rawRenameClass: newClass to: className.\x0a\x0a\x09oldClass subclasses \x0a\x09\x09do: [ :each | self migrateClass: each superclass: newClass ]\x0a\x09\x09displayingProgress: 'Recompiling ', newClass name, '...'.\x0a\x0a\x09self basicRemoveClass: oldClass.\x0a\x09\x0a\x09SystemAnnouncer current announce: (ClassMigrated new\x0a\x09\x09theClass: newClass;\x0a\x09\x09oldClass: oldClass;\x0a\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
 messageSends: [",", "at:", "current", "addSubclassOf:named:instanceVariableNames:package:", "basicSwapClassNames:with:", "on:do:", "copyClass:to:", "basicRemoveClass:", "signal", "rawRenameClass:to:", "do:displayingProgress:", "subclasses", "migrateClass:superclass:", "name", "announce:", "theClass:", "new", "oldClass:", "yourself"],
 referencedClasses: ["Smalltalk", "Error", "SystemAnnouncer", "ClassMigrated"]
 }),
@@ -2022,7 +1977,7 @@ $1=self._superclass_subclass_instanceVariableNames_package_(aClass,className,"",
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:",{aClass:aClass,className:className},smalltalk.ClassBuilder)})},
 args: ["aClass", "className"],
-source: "superclass: aClass subclass: className\x0a\x09^self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
+source: "superclass: aClass subclass: className\x0a\x09^ self superclass: aClass subclass: className instanceVariableNames: '' package: nil",
 messageSends: ["superclass:subclass:instanceVariableNames:package:"],
 referencedClasses: []
 }),
@@ -2038,27 +1993,24 @@ var newClass;
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 function $ClassAdded(){return smalltalk.ClassAdded||(typeof ClassAdded=="undefined"?nil:ClassAdded)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$4,$6,$7,$8;
-$1=aClass;
-$2=className;
-$3=self._instanceVariableNamesFor_(ivarNames);
-$5=packageName;
-if(($receiver = $5) == nil || $receiver == null){
-$4="unclassified";
+var $1,$2,$3,$4,$5;
+$1=self._instanceVariableNamesFor_(ivarNames);
+if(($receiver = packageName) == nil || $receiver == null){
+$2="unclassified";
 } else {
-$4=$5;
+$2=packageName;
 };
-newClass=self._addSubclassOf_named_instanceVariableNames_package_($1,$2,$3,$4);
+newClass=self._addSubclassOf_named_instanceVariableNames_package_(aClass,className,$1,$2);
 self._setupClass_(newClass);
-$6=_st($ClassAdded())._new();
-_st($6)._theClass_(newClass);
-$7=_st($6)._yourself();
-_st(_st($SystemAnnouncer())._current())._announce_($7);
-$8=newClass;
-return $8;
+$3=_st($ClassAdded())._new();
+_st($3)._theClass_(newClass);
+$4=_st($3)._yourself();
+_st(_st($SystemAnnouncer())._current())._announce_($4);
+$5=newClass;
+return $5;
 }, function($ctx1) {$ctx1.fill(self,"superclass:subclass:instanceVariableNames:package:",{aClass:aClass,className:className,ivarNames:ivarNames,packageName:packageName,newClass:newClass},smalltalk.ClassBuilder)})},
 args: ["aClass", "className", "ivarNames", "packageName"],
-source: "superclass: aClass subclass: className instanceVariableNames: ivarNames package: packageName\x0a\x09| newClass |\x0a\x09\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09named: className instanceVariableNames: (self instanceVariableNamesFor: ivarNames)\x0a\x09\x09package: (packageName ifNil: ['unclassified']).\x0a\x09self setupClass: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^newClass",
+source: "superclass: aClass subclass: className instanceVariableNames: ivarNames package: packageName\x0a\x09| newClass |\x0a\x09\x0a\x09newClass := self addSubclassOf: aClass\x0a\x09\x09named: className instanceVariableNames: (self instanceVariableNamesFor: ivarNames)\x0a\x09\x09package: (packageName ifNil: [ 'unclassified' ]).\x0a\x09self setupClass: newClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassAdded new\x0a\x09\x09\x09theClass: newClass;\x0a\x09\x09\x09yourself).\x0a\x09\x0a\x09^ newClass",
 messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "instanceVariableNamesFor:", "ifNil:", "setupClass:", "announce:", "current", "theClass:", "new", "yourself"],
 referencedClasses: ["SystemAnnouncer", "ClassAdded"]
 }),
@@ -2139,7 +2091,7 @@ return self._compileMethod_(chunk);
 _st(_st($ClassBuilder())._new())._setupClass_(self["@class"]);
 return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCategoryReader)})},
 args: ["aChunkParser"],
-source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty] whileFalse: [\x0a\x09\x09self compileMethod: chunk].\x0a\x09ClassBuilder new setupClass: class",
+source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09[ chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ] whileFalse: [\x0a\x09\x09self compileMethod: chunk ].\x0a\x09ClassBuilder new setupClass: class",
 messageSends: ["whileFalse:", "nextChunk", "isEmpty", "compileMethod:", "setupClass:", "new"],
 referencedClasses: ["ClassBuilder"]
 }),
@@ -2197,7 +2149,7 @@ self._setComment_(chunk);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"scanFrom:",{aChunkParser:aChunkParser,chunk:chunk},smalltalk.ClassCommentReader)})},
 args: ["aChunkParser"],
-source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk].",
+source: "scanFrom: aChunkParser\x0a\x09| chunk |\x0a\x09chunk := aChunkParser nextChunk.\x0a\x09chunk isEmpty ifFalse: [\x0a\x09\x09self setComment: chunk ].",
 messageSends: ["nextChunk", "ifFalse:", "isEmpty", "setComment:"],
 referencedClasses: []
 }),
@@ -2251,7 +2203,7 @@ return _st($ClassSorterNode())._on_classes_level_(each,others,_st(self._level())
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassSorterNode)})},
 args: ["aCollection"],
-source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [:each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [children add: each]\x0a\x09\x09\x09ifFalse: [others add: each]].\x0a\x09nodes:= children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1]",
+source: "getNodesFrom: aCollection\x0a\x09| children others |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09aCollection do: [ :each |\x0a\x09\x09(each superclass = self theClass)\x0a\x09\x09\x09ifTrue: [ children add: each ]\x0a\x09\x09\x09ifFalse: [ others add: each ]].\x0a\x09nodes:= children collect: [ :each |\x0a\x09\x09ClassSorterNode on: each classes: others level: self level + 1 ]",
 messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:classes:level:", "+", "level"],
 referencedClasses: ["ClassSorterNode"]
 }),
@@ -2269,7 +2221,7 @@ $1=self["@level"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassSorterNode)})},
 args: [],
-source: "level\x0a\x09^level",
+source: "level\x0a\x09^ level",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2303,7 +2255,7 @@ $1=self["@nodes"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassSorterNode)})},
 args: [],
-source: "nodes\x0a\x09^nodes",
+source: "nodes\x0a\x09^ nodes",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2321,7 +2273,7 @@ $1=self["@theClass"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassSorterNode)})},
 args: [],
-source: "theClass\x0a\x09^theClass",
+source: "theClass\x0a\x09^ theClass",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2350,27 +2302,24 @@ category: 'visiting',
 fn: function (aCollection){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$6,$5;
-$1=aCollection;
-$2=self._theClass();
+var $1,$3,$2;
+$1=self._theClass();
 $ctx1.sendIdx["theClass"]=1;
-_st($1)._add_($2);
+_st(aCollection)._add_($1);
 _st(_st(self._nodes())._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
-$4=_st(a)._theClass();
+$3=_st(a)._theClass();
 $ctx2.sendIdx["theClass"]=2;
-$3=_st($4)._name();
+$2=_st($3)._name();
 $ctx2.sendIdx["name"]=1;
-$6=_st(b)._theClass();
-$5=_st($6)._name();
-return _st($3).__lt_eq($5);
+return _st($2).__lt_eq(_st(_st(b)._theClass())._name());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)})})))._do_((function(aNode){
 return smalltalk.withContext(function($ctx2) {
 return _st(aNode)._traverseClassesWith_(aCollection);
 }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,2)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"traverseClassesWith:",{aCollection:aCollection},smalltalk.ClassSorterNode)})},
 args: ["aCollection"],
-source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
+source: "traverseClassesWith: aCollection\x0a\x09\x22sort classes alphabetically Issue #143\x22\x0a\x0a\x09aCollection add: self theClass.\x0a\x09(self nodes sorted: [ :a :b | a theClass name <= b theClass name ]) do: [ :aNode |\x0a\x09\x09aNode traverseClassesWith: aCollection ].",
 messageSends: ["add:", "theClass", "do:", "sorted:", "nodes", "<=", "name", "traverseClassesWith:"],
 referencedClasses: []
 }),
@@ -2394,7 +2343,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:classes:level:",{aClass:aClass,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassSorterNode.klass)})},
 args: ["aClass", "aCollection", "anInteger"],
-source: "on: aClass classes: aCollection level: anInteger\x0a\x09^self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
+source: "on: aClass classes: aCollection level: anInteger\x0a\x09^ self new\x0a\x09\x09theClass: aClass;\x0a\x09\x09level: anInteger;\x0a\x09\x09getNodesFrom: aCollection;\x0a\x09\x09yourself",
 messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"],
 referencedClasses: []
 }),

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 137 - 161
js/Kernel-Collections.js


+ 23 - 28
js/Kernel-Exceptions.js

@@ -80,7 +80,7 @@ $1=self["@messageText"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"messageText",{},smalltalk.Error)})},
 args: [],
-source: "messageText\x0a\x09^messageText",
+source: "messageText\x0a\x09^ messageText",
 messageSends: [],
 referencedClasses: []
 }),
@@ -180,7 +180,7 @@ $1=_st(self._new())._signal();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"signal",{},smalltalk.Error.klass)})},
 args: [],
-source: "signal\x0a\x09^self new signal",
+source: "signal\x0a\x09^ self new signal",
 messageSends: ["signal", "new"],
 referencedClasses: []
 }),
@@ -198,7 +198,7 @@ $1=_st(self._new())._signal_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"signal:",{aString:aString},smalltalk.Error.klass)})},
 args: ["aString"],
-source: "signal: aString\x0a\x09\x09^self new\x0a\x09\x09signal: aString",
+source: "signal: aString\x0a\x09^ self new\x0a\x09\x09signal: aString",
 messageSends: ["signal:", "new"],
 referencedClasses: []
 }),
@@ -332,7 +332,7 @@ $1=self["@message"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"message",{},smalltalk.MessageNotUnderstood)})},
 args: [],
-source: "message\x0a\x09^message",
+source: "message\x0a\x09^ message",
 messageSends: [],
 referencedClasses: []
 }),
@@ -361,14 +361,13 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=_st(_st(self._receiver())._asString()).__comma(" does not understand #");
-$1=_st($2).__comma(_st(self._message())._selector());
+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)})},
 args: [],
-source: "messageText\x0a\x09^self receiver asString, ' does not understand #', self message selector",
+source: "messageText\x0a\x09^ self receiver asString, ' does not understand #', self message selector",
 messageSends: [",", "asString", "receiver", "selector", "message"],
 referencedClasses: []
 }),
@@ -386,7 +385,7 @@ $1=self["@receiver"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.MessageNotUnderstood)})},
 args: [],
-source: "receiver\x0a\x09^receiver",
+source: "receiver\x0a\x09^ receiver",
 messageSends: [],
 referencedClasses: []
 }),
@@ -457,19 +456,18 @@ category: 'error handling',
 fn: function (anError){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 $1=_st(anError)._context();
 $ctx1.sendIdx["context"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$2=_st(anError)._context();
-self._logErrorContext_($2);
+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",
+source: "handleError: anError\x0a\x09anError context ifNotNil: [ self logErrorContext: anError context ].\x0a\x09self logError: anError",
 messageSends: ["ifNotNil:", "context", "logErrorContext:", "logError:"],
 referencedClasses: []
 }),
@@ -498,19 +496,18 @@ category: 'private',
 fn: function (aContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 $1=_st(aContext)._home();
 $ctx1.sendIdx["home"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$2=_st(aContext)._home();
-self._logContext_($2);
+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",
+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: []
 }),
@@ -539,23 +536,21 @@ category: 'private',
 fn: function (aContext){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$1;
-$2=aContext;
-if(($receiver = $2) == nil || $receiver == null){
-$1=$2;
+var $1;
+if(($receiver = aContext) == nil || $receiver == null){
+aContext;
 } else {
-$3=_st(aContext)._home();
+$1=_st(aContext)._home();
 $ctx1.sendIdx["home"]=1;
-if(($receiver = $3) == nil || $receiver == null){
-$1=$3;
+if(($receiver = $1) == nil || $receiver == null){
+$1;
 } else {
-$4=_st(aContext)._home();
-$1=self._logContext_($4);
+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]]",
+source: "logErrorContext: aContext\x0a\x09aContext ifNotNil: [\x0a\x09\x09aContext home ifNotNil: [\x0a\x09\x09\x09self logContext: aContext home ]]",
 messageSends: ["ifNotNil:", "home", "logContext:"],
 referencedClasses: []
 }),
@@ -581,7 +576,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ErrorHandler.klass)})},
 args: [],
-source: "current\x0a\x09^current ifNil: [current := self new]",
+source: "current\x0a\x09^ current ifNil: [ current := self new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: []
 }),

+ 225 - 104
js/Kernel-Infrastructure.js

@@ -81,7 +81,7 @@ $1=_st($PlatformInterface())._ajax_(anObject);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.InterfacingObject)})},
 args: ["anObject"],
-source: "ajax: anObject\x0a\x09^PlatformInterface ajax: anObject",
+source: "ajax: anObject\x0a\x09^ PlatformInterface ajax: anObject",
 messageSends: ["ajax:"],
 referencedClasses: ["PlatformInterface"]
 }),
@@ -100,7 +100,7 @@ $1=_st($PlatformInterface())._alert_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.InterfacingObject)})},
 args: ["aString"],
-source: "alert: aString\x0a\x09^PlatformInterface alert: aString",
+source: "alert: aString\x0a\x09^ PlatformInterface alert: aString",
 messageSends: ["alert:"],
 referencedClasses: ["PlatformInterface"]
 }),
@@ -119,7 +119,7 @@ $1=_st($PlatformInterface())._confirm_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.InterfacingObject)})},
 args: ["aString"],
-source: "confirm: aString\x0a\x09^PlatformInterface confirm: aString",
+source: "confirm: aString\x0a\x09^ PlatformInterface confirm: aString",
 messageSends: ["confirm:"],
 referencedClasses: ["PlatformInterface"]
 }),
@@ -138,7 +138,7 @@ $1=_st($PlatformInterface())._prompt_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.InterfacingObject)})},
 args: ["aString"],
-source: "prompt: aString\x0a\x09^PlatformInterface prompt: aString",
+source: "prompt: aString\x0a\x09^ PlatformInterface prompt: aString",
 messageSends: ["prompt:"],
 referencedClasses: ["PlatformInterface"]
 }),
@@ -155,17 +155,15 @@ category: 'compiling',
 fn: function (aString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$6,$4,$7;
+var $1,$2,$3,$4,$5;
 $1=self._classBuilder();
 $2=_st(aClass)._superclass();
 $3=_st(aClass)._name();
 $ctx1.sendIdx["name"]=1;
-$5=_st(_st(aClass)._instanceVariableNames())._copy();
-_st($5)._add_(aString);
-$6=_st($5)._yourself();
-$4=$6;
-$7=_st(_st(aClass)._package())._name();
-_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$4,$7);
+$4=_st(_st(aClass)._instanceVariableNames())._copy();
+_st($4)._add_(aString);
+$5=_st($4)._yourself();
+_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,_st(_st(aClass)._package())._name());
 return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
 args: ["aString", "aClass"],
 source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
@@ -245,20 +243,17 @@ fn: function (aClass){
 var self=this;
 var protocols;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5;
+var $1,$2;
 protocols=_st(aClass)._protocols();
 $1=_st(aClass)._superclass();
 $ctx1.sendIdx["superclass"]=1;
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$2=protocols;
-$4=_st(aClass)._superclass();
-$3=self._availableProtocolsFor_($4);
-_st($2)._addAll_($3);
+_st(protocols)._addAll_(self._availableProtocolsFor_(_st(aClass)._superclass()));
 };
-$5=_st(_st(protocols)._asSet())._asArray();
-return $5;
+$2=_st(_st(protocols)._asSet())._asArray();
+return $2;
 }, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.Environment)})},
 args: ["aClass"],
 source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray",
@@ -405,13 +400,12 @@ var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1,$2;
 $1=_st(_st($Smalltalk())._current())._at_(aClassName);
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$3="A class named ".__comma(aClassName);
-$2=_st($3).__comma(" already exists");
+$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
 $ctx1.sendIdx[","]=1;
 self._error_($2);
 };
@@ -424,6 +418,25 @@ referencedClasses: ["Smalltalk", "ClassBuilder"]
 }),
 smalltalk.Environment);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doItReceiver",
+category: 'accessing',
+fn: function (){
+var self=this;
+function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st($DoIt())._new();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},smalltalk.Environment)})},
+args: [],
+source: "doItReceiver\x0a\x09^ DoIt new",
+messageSends: ["new"],
+referencedClasses: ["DoIt"]
+}),
+smalltalk.Environment);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "eval:on:",
@@ -539,7 +552,7 @@ var self=this;
 var destinationClass;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2,$5;
+var $1,$3,$4,$2;
 destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
 $1=destinationClass;
 if(($receiver = $1) == nil || $receiver == null){
@@ -555,8 +568,7 @@ if(smalltalk.assert($2)){
 return self;
 };
 _st(destinationClass)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
-$5=_st(aMethod)._methodClass();
-_st($5)._removeCompiledMethod_(aMethod);
+_st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
 return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.Environment)})},
 args: ["aMethod", "aClassName"],
 source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ self error: 'Invalid class name' ].\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09category: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
@@ -715,13 +727,12 @@ var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1,$2;
 $1=_st(_st($Smalltalk())._current())._at_(aClassName);
 if(($receiver = $1) == nil || $receiver == null){
 $1;
 } else {
-$3="A class named ".__comma(aClassName);
-$2=_st($3).__comma(" already exists");
+$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
 $ctx1.sendIdx[","]=1;
 self._error_($2);
 };
@@ -780,10 +791,8 @@ fn: function (){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$1;
-$3=_st($Smalltalk())._current();
-$2=_st($3)._at_("SystemAnnouncer");
-$1=_st($2)._current();
+var $1;
+$1=_st(_st(_st($Smalltalk())._current())._at_("SystemAnnouncer"))._current();
 $ctx1.sendIdx["current"]=1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.Environment)})},
@@ -818,6 +827,24 @@ referencedClasses: []
 }),
 smalltalk.JSObjectProxy);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asJSON",
+category: 'enumerating',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self["@jsObject"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.JSObjectProxy)})},
+args: [],
+source: "asJSON\x0a\x09\x22Answers the receiver in a stringyfy-friendly fashion\x22\x0a\x0a\x09^ jsObject",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "at:",
@@ -984,7 +1011,7 @@ $1=self["@jsObject"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxy)})},
 args: [],
-source: "jsObject\x0a\x09^jsObject",
+source: "jsObject\x0a\x09^ jsObject",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1117,7 +1144,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
 args: ["aJSObject"],
-source: "on: aJSObject\x0a\x09^self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
+source: "on: aJSObject\x0a\x09^ self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
 messageSends: ["jsObject:", "new", "yourself"],
 referencedClasses: []
 }),
@@ -1286,6 +1313,55 @@ referencedClasses: []
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "definition",
+category: 'accessing',
+fn: function (){
+var self=this;
+function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$4,$5,$3,$7,$6,$8,$9,$1;
+$1=_st($String())._streamContents_((function(stream){
+return smalltalk.withContext(function($ctx2) {
+$2=_st(self._class())._name();
+$ctx2.sendIdx["name"]=1;
+_st(stream)._nextPutAll_($2);
+$ctx2.sendIdx["nextPutAll:"]=1;
+$4=_st($String())._lf();
+$ctx2.sendIdx["lf"]=1;
+$5=_st($String())._tab();
+$ctx2.sendIdx["tab"]=1;
+$3=_st($4).__comma($5);
+$ctx2.sendIdx[","]=1;
+_st(stream)._nextPutAll_($3);
+$ctx2.sendIdx["nextPutAll:"]=2;
+_st(stream)._nextPutAll_(" named: ");
+$ctx2.sendIdx["nextPutAll:"]=3;
+$7="'".__comma(self._name());
+$ctx2.sendIdx[","]=3;
+$6=_st($7).__comma("'");
+$ctx2.sendIdx[","]=2;
+_st(stream)._nextPutAll_($6);
+$ctx2.sendIdx["nextPutAll:"]=4;
+$8=_st(_st($String())._lf()).__comma(_st($String())._tab());
+$ctx2.sendIdx[","]=4;
+_st(stream)._nextPutAll_($8);
+$ctx2.sendIdx["nextPutAll:"]=5;
+_st(stream)._nextPutAll_(" transport: (");
+$ctx2.sendIdx["nextPutAll:"]=6;
+$9=_st(stream)._nextPutAll_(_st(_st(self._transport())._definition()).__comma(")"));
+return $9;
+}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"definition",{},smalltalk.Package)})},
+args: [],
+source: "definition\x0a\x09^ String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: self class name;\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll: ' named: ';\x0a\x09\x09\x09nextPutAll: '''', self name, '''';\x0a\x09\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09\x09nextPutAll:  ' transport: (';\x0a\x09\x09\x09nextPutAll: self transport definition, ')' ]",
+messageSends: ["streamContents:", "nextPutAll:", "name", "class", ",", "lf", "tab", "definition", "transport"],
+referencedClasses: ["String"]
+}),
+smalltalk.Package);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isPackage",
@@ -1324,7 +1400,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"loadDependencies",{classes:classes,packages:packages},smalltalk.Package)})},
 args: [],
-source: "loadDependencies\x0a\x09\x22Returns list of packages that need to be loaded\x0a\x09before loading this package.\x22\x0a\x09\x0a\x09| classes packages |\x0a\x09classes := self loadDependencyClasses.\x0a\x09^(classes collect: [ :each | each package ]) asSet\x0a\x09\x09remove: self ifAbsent: [];\x0a\x09\x09yourself",
+source: "loadDependencies\x0a\x09\x22Returns list of packages that need to be loaded\x0a\x09before loading this package.\x22\x0a\x09\x0a\x09| classes packages |\x0a\x09classes := self loadDependencyClasses.\x0a\x09^ (classes collect: [ :each | each package ]) asSet\x0a\x09\x09remove: self ifAbsent: [];\x0a\x09\x09yourself",
 messageSends: ["loadDependencyClasses", "remove:ifAbsent:", "asSet", "collect:", "package", "yourself"],
 referencedClasses: []
 }),
@@ -1339,7 +1415,7 @@ var self=this;
 var starCategoryName;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $4,$3,$2,$5,$7,$6,$8,$1;
+var $4,$3,$2,$5,$1;
 starCategoryName="*".__comma(self._name());
 $4=self._classes();
 $ctx1.sendIdx["classes"]=1;
@@ -1351,19 +1427,16 @@ $2=_st($3)._asSet();
 _st($2)._remove_ifAbsent_(nil,(function(){
 return smalltalk.withContext(function($ctx2) {
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-$5=$2;
-$7=_st(_st($Smalltalk())._current())._classes();
-$6=_st($7)._select_((function(each){
+_st($2)._addAll_(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(_st(each)._protocols())._includes_(starCategoryName);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
-_st($5)._addAll_($6);
-$8=_st($2)._yourself();
-$1=$8;
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})})));
+$5=_st($2)._yourself();
+$1=$5;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"loadDependencyClasses",{starCategoryName:starCategoryName},smalltalk.Package)})},
 args: [],
-source: "loadDependencyClasses\x0a\x09\x22Returns classes needed at the time of loading a package.\x0a\x09These are all that are used to subclass\x0a\x09and to define an extension method\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^(self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09addAll: (Smalltalk current classes select: [ :each | each protocols includes: starCategoryName ]);\x0a\x09\x09yourself",
+source: "loadDependencyClasses\x0a\x09\x22Returns classes needed at the time of loading a package.\x0a\x09These are all that are used to subclass\x0a\x09and to define an extension method\x22\x0a\x09\x0a\x09| starCategoryName |\x0a\x09starCategoryName := '*', self name.\x0a\x09^ (self classes collect: [ :each | each superclass ]) asSet\x0a\x09\x09remove: nil ifAbsent: [];\x0a\x09\x09addAll: (Smalltalk current classes select: [ :each | each protocols includes: starCategoryName ]);\x0a\x09\x09yourself",
 messageSends: [",", "name", "remove:ifAbsent:", "asSet", "collect:", "classes", "superclass", "addAll:", "select:", "current", "includes:", "protocols", "yourself"],
 referencedClasses: ["Smalltalk"]
 }),
@@ -1426,14 +1499,13 @@ category: 'printing',
 fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 smalltalk.Package.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
-$1=aStream;
-_st($1)._nextPutAll_(" (");
+_st(aStream)._nextPutAll_(" (");
 $ctx1.sendIdx["nextPutAll:"]=1;
-_st($1)._nextPutAll_(self._name());
+_st(aStream)._nextPutAll_(self._name());
 $ctx1.sendIdx["nextPutAll:"]=2;
-$2=_st($1)._nextPutAll_(")");
+$1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Package)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: ' (';\x0a\x09\x09nextPutAll: self name;\x0a\x09\x09nextPutAll: ')'",
@@ -1523,10 +1595,11 @@ fn: function (aPackageTransport){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self["@transport"]=aPackageTransport;
+_st(aPackageTransport)._package_(self);
 return self}, function($ctx1) {$ctx1.fill(self,"transport:",{aPackageTransport:aPackageTransport},smalltalk.Package)})},
 args: ["aPackageTransport"],
-source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport",
-messageSends: [],
+source: "transport: aPackageTransport\x0a\x09transport := aPackageTransport.\x0a\x09aPackageTransport package: self",
+messageSends: ["package:"],
 referencedClasses: []
 }),
 smalltalk.Package);
@@ -1541,13 +1614,18 @@ fn: function (aPackageName){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st($Smalltalk())._current())._packageAt_(aPackageName);
+var $2,$1;
+$2=_st($Smalltalk())._current();
+$ctx1.sendIdx["current"]=1;
+$1=_st($2)._packageAt_ifAbsent_(aPackageName,(function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st($Smalltalk())._current())._createPackage_(aPackageName);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"named:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
 args: ["aPackageName"],
-source: "named: aPackageName\x0a\x0a\x09^Smalltalk current packageAt: aPackageName",
-messageSends: ["packageAt:", "current"],
+source: "named: aPackageName\x0a\x09^ Smalltalk current \x0a\x09\x09packageAt: aPackageName\x0a\x09\x09ifAbsent: [ \x0a\x09\x09\x09Smalltalk current createPackage: aPackageName ]",
+messageSends: ["packageAt:ifAbsent:", "current", "createPackage:"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Package.klass);
@@ -1565,12 +1643,33 @@ $1=_st(_st($Smalltalk())._current())._packageAt_ifAbsent_(aPackageName,aBlock);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"named:ifAbsent:",{aPackageName:aPackageName,aBlock:aBlock},smalltalk.Package.klass)})},
 args: ["aPackageName", "aBlock"],
-source: "named: aPackageName ifAbsent: aBlock\x0a\x0a\x09^Smalltalk current packageAt: aPackageName ifAbsent: aBlock",
+source: "named: aPackageName ifAbsent: aBlock\x0a\x09^ Smalltalk current packageAt: aPackageName ifAbsent: aBlock",
 messageSends: ["packageAt:ifAbsent:", "current"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Package.klass);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "named:transport:",
+category: 'accessing',
+fn: function (aPackageName,aTransport){
+var self=this;
+var package_;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+package_=self._named_(aPackageName);
+_st(package_)._transport_(aTransport);
+$1=package_;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"named:transport:",{aPackageName:aPackageName,aTransport:aTransport,package_:package_},smalltalk.Package.klass)})},
+args: ["aPackageName", "aTransport"],
+source: "named: aPackageName transport: aTransport\x0a\x09| package |\x0a\x09\x0a\x09package := self named: aPackageName.\x0a\x09package transport: aTransport.\x0a\x09\x0a\x09^ package",
+messageSends: ["named:", "transport:"],
+referencedClasses: []
+}),
+smalltalk.Package.klass);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "sortedClasses:",
@@ -1581,13 +1680,13 @@ var children,others,nodes,expandedClasses;
 function $ClassSorterNode(){return smalltalk.ClassSorterNode||(typeof ClassSorterNode=="undefined"?nil:ClassSorterNode)}
 function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$6,$5,$7,$8;
+var $1,$3,$2,$4;
 children=[];
 others=[];
-$1=_st(classes)._do_((function(each){
+_st(classes)._do_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$2=_st(classes)._includes_(_st(each)._superclass());
-if(smalltalk.assert($2)){
+$1=_st(classes)._includes_(_st(each)._superclass());
+if(smalltalk.assert($1)){
 return _st(others)._add_(each);
 } else {
 return _st(children)._add_(each);
@@ -1601,24 +1700,22 @@ return _st($ClassSorterNode())._on_classes_level_(each,others,(0));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
 nodes=_st(nodes)._sorted_((function(a,b){
 return smalltalk.withContext(function($ctx2) {
-$4=_st(a)._theClass();
+$3=_st(a)._theClass();
 $ctx2.sendIdx["theClass"]=1;
-$3=_st($4)._name();
+$2=_st($3)._name();
 $ctx2.sendIdx["name"]=1;
-$6=_st(b)._theClass();
-$5=_st($6)._name();
-return _st($3).__lt_eq($5);
+return _st($2).__lt_eq(_st(_st(b)._theClass())._name());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,5)})}));
 expandedClasses=_st($Array())._new();
-$7=_st(nodes)._do_((function(aNode){
+_st(nodes)._do_((function(aNode){
 return smalltalk.withContext(function($ctx2) {
 return _st(aNode)._traverseClassesWith_(expandedClasses);
 }, function($ctx2) {$ctx2.fillBlock({aNode:aNode},$ctx1,6)})}));
-$8=expandedClasses;
-return $8;
+$4=expandedClasses;
+return $4;
 }, function($ctx1) {$ctx1.fill(self,"sortedClasses:",{classes:classes,children:children,others:others,nodes:nodes,expandedClasses:expandedClasses},smalltalk.Package.klass)})},
 args: ["classes"],
-source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [:each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [children add: each]\x0a\x09\x09\x09ifTrue: [others add: each]].\x0a\x09nodes := children collect: [:each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0].\x0a\x09nodes := nodes sorted: [:a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [:aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses].\x0a\x09^expandedClasses",
+source: "sortedClasses: classes\x0a\x09\x22Answer classes, sorted by superclass/subclasses and by class name for common subclasses (Issue #143)\x22\x0a\x0a\x09| children others nodes expandedClasses |\x0a\x09children := #().\x0a\x09others := #().\x0a\x09classes do: [ :each |\x0a\x09\x09(classes includes: each superclass)\x0a\x09\x09\x09ifFalse: [ children add: each ]\x0a\x09\x09\x09ifTrue: [ others add: each ]].\x0a\x09nodes := children collect: [ :each |\x0a\x09\x09ClassSorterNode on: each classes: others level: 0 ].\x0a\x09nodes := nodes sorted: [ :a :b | a theClass name <= b theClass name ].\x0a\x09expandedClasses := Array new.\x0a\x09nodes do: [ :aNode |\x0a\x09\x09aNode traverseClassesWith: expandedClasses ].\x0a\x09^ expandedClasses",
 messageSends: ["do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:classes:level:", "sorted:", "<=", "name", "theClass", "new", "traverseClassesWith:"],
 referencedClasses: ["ClassSorterNode", "Array"]
 }),
@@ -1646,7 +1743,7 @@ $1=_st(self["@worker"])._ajax_(anObject);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.PlatformInterface.klass)})},
 args: ["anObject"],
-source: "ajax: anObject\x0a\x09^worker\x0a\x09\x09ifNotNil: [ worker ajax: anObject ]\x0a\x09\x09ifNil: [ self error: 'ajax: not available' ]",
+source: "ajax: anObject\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker ajax: anObject ]\x0a\x09\x09ifNil: [ self error: 'ajax: not available' ]",
 messageSends: ["ifNotNil:ifNil:", "ajax:", "error:"],
 referencedClasses: []
 }),
@@ -1669,7 +1766,7 @@ $1=_st(self["@worker"])._alert_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.PlatformInterface.klass)})},
 args: ["aString"],
-source: "alert: aString\x0a\x09^worker\x0a\x09\x09ifNotNil: [ worker alert: aString ]\x0a\x09\x09ifNil: [ self error: 'alert: not available' ]",
+source: "alert: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker alert: aString ]\x0a\x09\x09ifNil: [ self error: 'alert: not available' ]",
 messageSends: ["ifNotNil:ifNil:", "alert:", "error:"],
 referencedClasses: []
 }),
@@ -1692,7 +1789,7 @@ $1=_st(self["@worker"])._confirm_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.PlatformInterface.klass)})},
 args: ["aString"],
-source: "confirm: aString\x0a\x09^worker\x0a\x09\x09ifNotNil: [ worker confirm: aString ]\x0a\x09\x09ifNil: [ self error: 'confirm: not available' ]",
+source: "confirm: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker confirm: aString ]\x0a\x09\x09ifNil: [ self error: 'confirm: not available' ]",
 messageSends: ["ifNotNil:ifNil:", "confirm:", "error:"],
 referencedClasses: []
 }),
@@ -1748,23 +1845,22 @@ var self=this;
 var candidate;
 function $BrowserInterface(){return smalltalk.BrowserInterface||(typeof BrowserInterface=="undefined"?nil:BrowserInterface)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 smalltalk.PlatformInterface.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
-$1=$BrowserInterface();
-if(($receiver = $1) == nil || $receiver == null){
-$1;
+if(($receiver = $BrowserInterface()) == nil || $receiver == null){
+$BrowserInterface();
 } else {
 candidate=_st($BrowserInterface())._new();
 candidate;
-$2=_st(candidate)._isAvailable();
-if(smalltalk.assert($2)){
+$1=_st(candidate)._isAvailable();
+if(smalltalk.assert($1)){
 self._setWorker_(candidate);
 return self;
 };
 };
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{candidate:candidate},smalltalk.PlatformInterface.klass)})},
 args: [],
-source: "initialize\x0a\x09| candidate |\x0a\x09\x0a\x09super initialize.\x0a\x09\x0a\x09BrowserInterface ifNotNil: [\x0a\x09\x09candidate := BrowserInterface new.\x0a\x09\x09candidate isAvailable ifTrue: [ self setWorker: candidate. ^self ]\x0a\x09]",
+source: "initialize\x0a\x09| candidate |\x0a\x09\x0a\x09super initialize.\x0a\x09\x0a\x09BrowserInterface ifNotNil: [\x0a\x09\x09candidate := BrowserInterface new.\x0a\x09\x09candidate isAvailable ifTrue: [ self setWorker: candidate. ^ self ]\x0a\x09]",
 messageSends: ["initialize", "ifNotNil:", "new", "ifTrue:", "isAvailable", "setWorker:"],
 referencedClasses: ["BrowserInterface"]
 }),
@@ -1787,7 +1883,7 @@ $1=_st(self["@worker"])._prompt_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.PlatformInterface.klass)})},
 args: ["aString"],
-source: "prompt: aString\x0a\x09^worker\x0a\x09\x09ifNotNil: [ worker prompt: aString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
+source: "prompt: aString\x0a\x09^ worker\x0a\x09\x09ifNotNil: [ worker prompt: aString ]\x0a\x09\x09ifNil: [ self error: 'prompt: not available' ]",
 messageSends: ["ifNotNil:ifNil:", "prompt:", "error:"],
 referencedClasses: []
 }),
@@ -1848,7 +1944,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.ProgressHandler.klass)})},
 args: [],
-source: "current\x0a\x09^current ifNil: [ current := self new ]",
+source: "current\x0a\x09^ current ifNil: [ current := self new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: []
 }),
@@ -2002,7 +2098,7 @@ return self._at_(aKey);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aKey:aKey,aBlock:aBlock},smalltalk.Smalltalk)})},
 args: ["aKey", "aBlock"],
-source: "at: aKey ifAbsent: aBlock\x0a\x09^ (self includesKey: aKey)\x0a\x09\x09ifTrue: [self at: aKey]\x0a\x09\x09ifFalse: aBlock",
+source: "at: aKey ifAbsent: aBlock\x0a\x09^ (self includesKey: aKey)\x0a\x09\x09ifTrue: [ self at: aKey ]\x0a\x09\x09ifFalse: aBlock",
 messageSends: ["ifTrue:ifFalse:", "includesKey:", "at:"],
 referencedClasses: []
 }),
@@ -2026,6 +2122,22 @@ referencedClasses: []
 }),
 smalltalk.Smalltalk);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "basicCreatePackage:",
+category: 'private',
+fn: function (packageName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return smalltalk.addPackage(packageName);
+return self}, function($ctx1) {$ctx1.fill(self,"basicCreatePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
+args: ["packageName"],
+source: "basicCreatePackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09<return smalltalk.addPackage(packageName)>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.Smalltalk);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "basicParse:",
@@ -2064,13 +2176,24 @@ selector: "createPackage:",
 category: 'packages',
 fn: function (packageName){
 var self=this;
+var package_,announcement;
+function $PackageAdded(){return smalltalk.PackageAdded||(typeof PackageAdded=="undefined"?nil:PackageAdded)}
+function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 return smalltalk.withContext(function($ctx1) { 
-return smalltalk.addPackage(packageName);
-return self}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName},smalltalk.Smalltalk)})},
+var $1,$2,$3;
+package_=self._basicCreatePackage_(packageName);
+$1=_st($PackageAdded())._new();
+_st($1)._package_(package_);
+$2=_st($1)._yourself();
+announcement=$2;
+_st(_st($SystemAnnouncer())._current())._announce_(announcement);
+$3=package_;
+return $3;
+}, function($ctx1) {$ctx1.fill(self,"createPackage:",{packageName:packageName,package_:package_,announcement:announcement},smalltalk.Smalltalk)})},
 args: ["packageName"],
-source: "createPackage: packageName\x0a\x09\x22Create and bind a new bare package with given name and return it.\x22\x0a\x09<return smalltalk.addPackage(packageName)>",
-messageSends: [],
-referencedClasses: []
+source: "createPackage: packageName\x0a\x09| package announcement |\x0a\x09\x0a\x09package := self basicCreatePackage: packageName.\x0a\x09announcement := PackageAdded new\x0a\x09\x09package: package;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09SystemAnnouncer current announce: announcement.\x0a\x09\x0a\x09^ package",
+messageSends: ["basicCreatePackage:", "package:", "new", "yourself", "announce:", "current"],
+referencedClasses: ["PackageAdded", "SystemAnnouncer"]
 }),
 smalltalk.Smalltalk);
 
@@ -2172,10 +2295,10 @@ category: 'private',
 fn: function (packageName){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-delete self.packages[packageName];
+delete self.packages[ packageName];
 return self}, function($ctx1) {$ctx1.fill(self,"deletePackage:",{packageName:packageName},smalltalk.Smalltalk)})},
 args: ["packageName"],
-source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a\x09<delete self.packages[packageName]>",
+source: "deletePackage: packageName\x0a\x09\x22Deletes a package by deleting its binding, but does not check if it contains classes etc.\x0a\x09To remove a package, use #removePackage instead.\x22\x0a\x0a\x09<delete self.packages[ packageName]>",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2236,10 +2359,10 @@ category: 'packages',
 fn: function (packageName){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self.packages[packageName];
+return self.packages[ packageName];
 return self}, function($ctx1) {$ctx1.fill(self,"packageAt:",{packageName:packageName},smalltalk.Smalltalk)})},
 args: ["packageName"],
-source: "packageAt: packageName\x0a\x09<return self.packages[packageName]>",
+source: "packageAt: packageName\x0a\x09<return self.packages[ packageName]>",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2258,7 +2381,7 @@ $1=_st($2)._ifNil_(aBlock);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"packageAt:ifAbsent:",{packageName:packageName,aBlock:aBlock},smalltalk.Smalltalk)})},
 args: ["packageName", "aBlock"],
-source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^(self packageAt: packageName) ifNil: aBlock",
+source: "packageAt: packageName ifAbsent: aBlock\x0a\x09^ (self packageAt: packageName) ifNil: aBlock",
 messageSends: ["ifNil:", "packageAt:"],
 referencedClasses: []
 }),
@@ -2310,7 +2433,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString,result:result},smalltalk.Smalltalk)})},
 args: ["aString"],
-source: "parse: aString\x0a\x09| result |\x0a\x09\x0a\x09self \x0a\x09\x09try: [result := self basicParse: aString] \x0a\x09\x09catch: [:ex | (self parseError: ex parsing: aString) signal].\x0a\x09\x09\x0a\x09^ result\x0a\x09\x09source: aString;\x0a\x09\x09yourself",
+source: "parse: aString\x0a\x09| result |\x0a\x09\x0a\x09self \x0a\x09\x09try: [ result := self basicParse: aString ] \x0a\x09\x09catch: [ :ex | (self parseError: ex parsing: aString) signal ].\x0a\x09\x09\x0a\x09^ result\x0a\x09\x09source: aString;\x0a\x09\x09yourself",
 messageSends: ["try:catch:", "basicParse:", "signal", "parseError:parsing:", "source:", "yourself"],
 referencedClasses: []
 }),
@@ -2324,7 +2447,7 @@ fn: function (anException,aString){
 var self=this;
 function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$8,$7,$6,$9,$5,$4,$10,$3,$1;
+var $2,$8,$7,$6,$9,$5,$4,$3,$1;
 $2=_st($ParseError())._new();
 $8=_st(anException)._basicAt_("line");
 $ctx1.sendIdx["basicAt:"]=1;
@@ -2337,8 +2460,7 @@ $5=_st($6).__comma($9);
 $ctx1.sendIdx[","]=3;
 $4=_st($5).__comma(" : Unexpected character ");
 $ctx1.sendIdx[","]=2;
-$10=_st(anException)._basicAt_("found");
-$3=_st($4).__comma($10);
+$3=_st($4).__comma(_st(anException)._basicAt_("found"));
 $ctx1.sendIdx[","]=1;
 $1=_st($2)._messageText_($3);
 return $1;
@@ -2405,7 +2527,7 @@ $3=_st($2)._yourself();
 _st(_st($SystemAnnouncer())._current())._announce_($3);
 return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Smalltalk)})},
 args: ["aClass"],
-source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!'].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
+source: "removeClass: aClass\x0a\x09aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!' ].\x0a\x09\x0a\x09self deleteClass: aClass.\x0a\x09\x0a\x09SystemAnnouncer current\x0a\x09\x09announce: (ClassRemoved new\x0a\x09\x09\x09theClass: aClass;\x0a\x09\x09\x09yourself)",
 messageSends: ["ifTrue:", "isMetaclass", "error:", ",", "asString", "deleteClass:", "announce:", "current", "theClass:", "new", "yourself"],
 referencedClasses: ["SystemAnnouncer", "ClassRemoved"]
 }),
@@ -2430,7 +2552,7 @@ return self._removeClass_(each);
 self._deletePackage_(packageName);
 return self}, function($ctx1) {$ctx1.fill(self,"removePackage:",{packageName:packageName,pkg:pkg},smalltalk.Smalltalk)})},
 args: ["packageName"],
-source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09pkg classes do: [:each |\x0a\x09\x09\x09self removeClass: each].\x0a\x09self deletePackage: packageName",
+source: "removePackage: packageName\x0a\x09\x22Removes a package and all its classes.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09pkg classes do: [ :each |\x0a\x09\x09\x09self removeClass: each ].\x0a\x09self deletePackage: packageName",
 messageSends: ["packageAt:ifAbsent:", "error:", ",", "do:", "classes", "removeClass:", "deletePackage:"],
 referencedClasses: []
 }),
@@ -2444,7 +2566,7 @@ fn: function (packageName,newName){
 var self=this;
 var pkg;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $1,$2;
 pkg=self._packageAt_ifAbsent_(packageName,(function(){
 return smalltalk.withContext(function($ctx2) {
 $1="Missing package: ".__comma(packageName);
@@ -2456,15 +2578,14 @@ $2=self._packageAt_(newName);
 if(($receiver = $2) == nil || $receiver == null){
 $2;
 } else {
-$3="Already exists a package called: ".__comma(newName);
-self._error_($3);
+self._error_("Already exists a package called: ".__comma(newName));
 };
 _st(self._at_("packages"))._at_put_(newName,pkg);
 _st(pkg)._name_(newName);
 self._deletePackage_(packageName);
 return self}, function($ctx1) {$ctx1.fill(self,"renamePackage:to:",{packageName:packageName,newName:newName,pkg:pkg},smalltalk.Smalltalk)})},
 args: ["packageName", "newName"],
-source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].\x0a\x09(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].\x0a\x09(self at: 'packages') at: newName put: pkg.\x0a\x09pkg name: newName.\x0a\x09self deletePackage: packageName.",
+source: "renamePackage: packageName to: newName\x0a\x09\x22Rename a package.\x22\x0a\x0a\x09| pkg |\x0a\x09pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].\x0a\x09(self packageAt: newName) ifNotNil: [ self error: 'Already exists a package called: ', newName ].\x0a\x09(self at: 'packages') at: newName put: pkg.\x0a\x09pkg name: newName.\x0a\x09self deletePackage: packageName.",
 messageSends: ["packageAt:ifAbsent:", "error:", ",", "ifNotNil:", "packageAt:", "at:put:", "at:", "name:", "deletePackage:"],
 referencedClasses: []
 }),
@@ -2493,10 +2614,10 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return "0.12.0-pre";
+return "0.13.0-pre";
 }, function($ctx1) {$ctx1.fill(self,"version",{},smalltalk.Smalltalk)})},
 args: [],
-source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.12.0-pre'",
+source: "version\x0a\x09\x22Answer the version string of Amber\x22\x0a\x09\x0a\x09^ '0.13.0-pre'",
 messageSends: [],
 referencedClasses: []
 }),
@@ -2548,7 +2669,7 @@ $1=self._replace_with_("^([a-zA-Z0-9]*).*$","$1");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asJavaScriptSelector",{},smalltalk.String)})},
 args: [],
-source: "asJavaScriptSelector\x0a\x09\x22Return first keyword of the selector, without trailing colon.\x22\x0a\x09^self replace: '^([a-zA-Z0-9]*).*$' with: '$1'",
+source: "asJavaScriptSelector\x0a\x09\x22Return first keyword of the selector, without trailing colon.\x22\x0a\x09^ self replace: '^([a-zA-Z0-9]*).*$' with: '$1'",
 messageSends: ["replace:with:"],
 referencedClasses: []
 }),

+ 56 - 52
js/Kernel-Methods.js

@@ -239,7 +239,7 @@ return _st(smalltalkError)._resignal();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:do:",{anErrorClass:anErrorClass,aBlock:aBlock},smalltalk.BlockClosure)})},
 args: ["anErrorClass", "aBlock"],
-source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a\x09Convert all JS exceptions to JavaScriptException instances.\x22\x0a\x09\x0a\x09^self try: self catch: [ :error | | smalltalkError |\x0a\x09\x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09\x09(smalltalkError isKindOf: anErrorClass)\x0a\x09\x09ifTrue: [ aBlock value: smalltalkError ]\x0a\x09\x09ifFalse: [ smalltalkError resignal ] ]",
+source: "on: anErrorClass do: aBlock\x0a\x09\x22All exceptions thrown in the Smalltalk stack are cought.\x0a\x09Convert all JS exceptions to JavaScriptException instances.\x22\x0a\x09\x0a\x09^ self try: self catch: [ :error | | smalltalkError |\x0a\x09\x09smalltalkError := Smalltalk current asSmalltalkException: error.\x0a\x09\x09(smalltalkError isKindOf: anErrorClass)\x0a\x09\x09ifTrue: [ aBlock value: smalltalkError ]\x0a\x09\x09ifFalse: [ smalltalkError resignal ] ]",
 messageSends: ["try:catch:", "asSmalltalkException:", "current", "ifTrue:ifFalse:", "isKindOf:", "value:", "resignal"],
 referencedClasses: ["Smalltalk"]
 }),
@@ -503,7 +503,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "category\x0a\x09^(self basicAt: 'category') ifNil: [ self defaultCategory ]",
+source: "category\x0a\x09^ (self basicAt: 'category') ifNil: [ self defaultCategory ]",
 messageSends: ["ifNil:", "basicAt:", "defaultCategory"],
 referencedClasses: []
 }),
@@ -519,7 +519,7 @@ var oldProtocol;
 function $SystemAnnouncer(){return smalltalk.SystemAnnouncer||(typeof SystemAnnouncer=="undefined"?nil:SystemAnnouncer)}
 function $MethodMoved(){return smalltalk.MethodMoved||(typeof MethodMoved=="undefined"?nil:MethodMoved)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$5,$4,$8,$7,$9,$6,$11,$10;
+var $1,$2,$3,$5,$4,$8,$7,$6;
 oldProtocol=self._protocol();
 $ctx1.sendIdx["protocol"]=1;
 self._basicAt_put_("category",aString);
@@ -543,14 +543,11 @@ $ctx1.sendIdx["methodClass"]=3;
 $7=_st($8)._methods();
 $6=_st($7)._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
-$9=_st(each)._protocol();
-return _st($9).__eq(oldProtocol);
+return _st(_st(each)._protocol()).__eq(oldProtocol);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
 _st($6)._ifEmpty_((function(){
 return smalltalk.withContext(function($ctx2) {
-$11=self._methodClass();
-$10=_st($11)._organization();
-return _st($10)._removeElement_(oldProtocol);
+return _st(_st(self._methodClass())._organization())._removeElement_(oldProtocol);
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
 };
 return self}, function($ctx1) {$ctx1.fill(self,"category:",{aString:aString,oldProtocol:oldProtocol},smalltalk.CompiledMethod)})},
@@ -589,7 +586,7 @@ $1=self._basicAt_("fn");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"fn",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "fn\x0a\x09^self basicAt: 'fn'",
+source: "fn\x0a\x09^ self basicAt: 'fn'",
 messageSends: ["basicAt:"],
 referencedClasses: []
 }),
@@ -665,7 +662,7 @@ fn: function (){
 var self=this;
 var superclass;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$6,$5,$4,$3;
+var $1,$2,$3;
 $1=self._methodClass();
 $ctx1.sendIdx["methodClass"]=1;
 superclass=_st($1)._superclass();
@@ -676,10 +673,7 @@ return false;
 } else {
 $2;
 };
-$6=self._methodClass();
-$5=_st($6)._superclass();
-$4=_st($5)._lookupSelector_(self._selector());
-$3=_st($4)._notNil();
+$3=_st(_st(_st(self._methodClass())._superclass())._lookupSelector_(self._selector()))._notNil();
 return $3;
 }, function($ctx1) {$ctx1.fill(self,"isOverride",{superclass:superclass},smalltalk.CompiledMethod)})},
 args: [],
@@ -701,7 +695,7 @@ $1=self._basicAt_("messageSends");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"messageSends",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "messageSends\x0a\x09^self basicAt: 'messageSends'",
+source: "messageSends\x0a\x09^ self basicAt: 'messageSends'",
 messageSends: ["basicAt:"],
 referencedClasses: []
 }),
@@ -719,7 +713,7 @@ $1=self._basicAt_("methodClass");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"methodClass",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "methodClass\x0a\x09^self basicAt: 'methodClass'",
+source: "methodClass\x0a\x09^ self basicAt: 'methodClass'",
 messageSends: ["basicAt:"],
 referencedClasses: []
 }),
@@ -771,7 +765,7 @@ $1=self._basicAt_("referencedClasses");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "referencedClasses\x0a\x09^self basicAt: 'referencedClasses'",
+source: "referencedClasses\x0a\x09^ self basicAt: 'referencedClasses'",
 messageSends: ["basicAt:"],
 referencedClasses: []
 }),
@@ -789,7 +783,7 @@ $1=self._basicAt_("selector");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "selector\x0a\x09^self basicAt: 'selector'",
+source: "selector\x0a\x09^ self basicAt: 'selector'",
 messageSends: ["basicAt:"],
 referencedClasses: []
 }),
@@ -846,7 +840,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.CompiledMethod)})},
 args: [],
-source: "source\x0a\x09^(self basicAt: 'source') ifNil: ['']",
+source: "source\x0a\x09^ (self basicAt: 'source') ifNil: [ '' ]",
 messageSends: ["ifNil:", "basicAt:"],
 referencedClasses: []
 }),
@@ -983,7 +977,7 @@ return self._addWorker();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"makeWorker",{sentinel:sentinel},smalltalk.ForkPool)})},
 args: [],
-source: "makeWorker\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09^[ | block |\x0a\x09\x09poolSize := poolSize - 1.\x0a\x09\x09block := queue nextIfAbsent: [ sentinel ].\x0a\x09\x09block == sentinel ifFalse: [\x0a\x09\x09\x09[ block value ] ensure: [ self addWorker ]]]",
+source: "makeWorker\x0a\x09| sentinel |\x0a\x09sentinel := Object new.\x0a\x09^ [ | block |\x0a\x09\x09poolSize := poolSize - 1.\x0a\x09\x09block := queue nextIfAbsent: [ sentinel ].\x0a\x09\x09block == sentinel ifFalse: [\x0a\x09\x09\x09[ block value ] ensure: [ self addWorker ] ]]",
 messageSends: ["new", "-", "nextIfAbsent:", "ifFalse:", "==", "ensure:", "value", "addWorker"],
 referencedClasses: ["Object"]
 }),
@@ -1048,7 +1042,7 @@ $1=$2;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.ForkPool.klass)})},
 args: [],
-source: "default\x0a\x09^default ifNil: [ default := self new ]",
+source: "default\x0a\x09^ default ifNil: [ default := self new ]",
 messageSends: ["ifNil:", "new"],
 referencedClasses: []
 }),
@@ -1064,7 +1058,7 @@ return smalltalk.withContext(function($ctx1) {
 return (100);
 }, function($ctx1) {$ctx1.fill(self,"defaultMaxPoolSize",{},smalltalk.ForkPool.klass)})},
 args: [],
-source: "defaultMaxPoolSize\x0a\x09^100",
+source: "defaultMaxPoolSize\x0a\x09^ 100",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1101,7 +1095,7 @@ $1=self["@arguments"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"arguments",{},smalltalk.Message)})},
 args: [],
-source: "arguments\x0a\x09^arguments",
+source: "arguments\x0a\x09^ arguments",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1130,14 +1124,13 @@ category: 'printing',
 fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 smalltalk.Message.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
-$1=aStream;
-_st($1)._nextPutAll_("(");
+_st(aStream)._nextPutAll_("(");
 $ctx1.sendIdx["nextPutAll:"]=1;
-_st($1)._nextPutAll_(self._selector());
+_st(aStream)._nextPutAll_(self._selector());
 $ctx1.sendIdx["nextPutAll:"]=2;
-$2=_st($1)._nextPutAll_(")");
+$1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Message)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self selector;\x0a\x09\x09nextPutAll: ')'",
@@ -1158,7 +1151,7 @@ $1=self["@selector"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.Message)})},
 args: [],
-source: "selector\x0a\x09^selector",
+source: "selector\x0a\x09^ selector",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1215,7 +1208,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector:arguments:",{aString:aString,anArray:anArray},smalltalk.Message.klass)})},
 args: ["aString", "anArray"],
-source: "selector: aString arguments: anArray\x0a\x09^self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
+source: "selector: aString arguments: anArray\x0a\x09^ self new\x0a\x09\x09selector: aString;\x0a\x09\x09arguments: anArray;\x0a\x09\x09yourself",
 messageSends: ["selector:", "new", "arguments:", "yourself"],
 referencedClasses: []
 }),
@@ -1283,18 +1276,17 @@ category: 'printing',
 fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 smalltalk.MessageSend.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
-$1=aStream;
-_st($1)._nextPutAll_("(");
+_st(aStream)._nextPutAll_("(");
 $ctx1.sendIdx["nextPutAll:"]=1;
-_st($1)._nextPutAll_(self._receiver());
+_st(aStream)._nextPutAll_(self._receiver());
 $ctx1.sendIdx["nextPutAll:"]=2;
-_st($1)._nextPutAll_(" >> ");
+_st(aStream)._nextPutAll_(" >> ");
 $ctx1.sendIdx["nextPutAll:"]=3;
-_st($1)._nextPutAll_(self._selector());
+_st(aStream)._nextPutAll_(self._selector());
 $ctx1.sendIdx["nextPutAll:"]=4;
-$2=_st($1)._nextPutAll_(")");
+$1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MessageSend)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream\x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self receiver;\x0a\x09\x09nextPutAll: ' >> ';\x0a\x09\x09nextPutAll: self selector;\x0a\x09\x09nextPutAll: ')'",
@@ -1482,7 +1474,7 @@ category: 'converting',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$4,$1;
+var $2,$3,$1;
 $2=self._isBlockContext();
 if(smalltalk.assert($2)){
 $3="a block (in ".__comma(_st(self._methodContext())._asString());
@@ -1490,19 +1482,34 @@ $ctx1.sendIdx[","]=2;
 $1=_st($3).__comma(")");
 $ctx1.sendIdx[","]=1;
 } else {
-$4=_st(_st(_st(self._receiver())._class())._name()).__comma(" >> ");
-$1=_st($4).__comma(self._selector());
+$1=_st(_st(_st(_st(self._receiver())._class())._name()).__comma(" >> ")).__comma(self._selector());
 $ctx1.sendIdx[","]=3;
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.MethodContext)})},
 args: [],
-source: "asString\x0a\x09^self isBlockContext\x0a\x09\x09ifTrue: [ 'a block (in ', self methodContext asString, ')' ]\x0a\x09\x09ifFalse: [ self receiver class name, ' >> ', self selector ]",
+source: "asString\x0a\x09^ self isBlockContext\x0a\x09\x09ifTrue: [ 'a block (in ', self methodContext asString, ')' ]\x0a\x09\x09ifFalse: [ self receiver class name, ' >> ', self selector ]",
 messageSends: ["ifTrue:ifFalse:", "isBlockContext", ",", "asString", "methodContext", "name", "class", "receiver", "selector"],
 referencedClasses: []
 }),
 smalltalk.MethodContext);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "evaluatedSelector",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self.evaluatedSelector;
+return self}, function($ctx1) {$ctx1.fill(self,"evaluatedSelector",{},smalltalk.MethodContext)})},
+args: [],
+source: "evaluatedSelector\x0a\x09<return self.evaluatedSelector>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodContext);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "home",
@@ -1576,7 +1583,7 @@ category: 'accessing',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$5,$4,$3,$7,$6,$1;
+var $2,$5,$4,$3,$1;
 $2=self._methodContext();
 $ctx1.sendIdx["methodContext"]=1;
 if(($receiver = $2) == nil || $receiver == null){
@@ -1586,9 +1593,7 @@ $5=self._methodContext();
 $ctx1.sendIdx["methodContext"]=2;
 $4=_st($5)._receiver();
 $3=_st($4)._class();
-$7=self._methodContext();
-$6=_st($7)._selector();
-$1=_st($3)._lookupSelector_($6);
+$1=_st($3)._lookupSelector_(_st(self._methodContext())._selector());
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodContext)})},
@@ -1651,14 +1656,13 @@ category: 'printing',
 fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 smalltalk.MethodContext.superclass.fn.prototype._printOn_.apply(_st(self), [aStream]);
-$1=aStream;
-_st($1)._nextPutAll_("(");
+_st(aStream)._nextPutAll_("(");
 $ctx1.sendIdx["nextPutAll:"]=1;
-_st($1)._nextPutAll_(self._asString());
+_st(aStream)._nextPutAll_(self._asString());
 $ctx1.sendIdx["nextPutAll:"]=2;
-$2=_st($1)._nextPutAll_(")");
+$1=_st(aStream)._nextPutAll_(")");
 return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.MethodContext)})},
 args: ["aStream"],
 source: "printOn: aStream\x0a\x09super printOn: aStream.\x0a\x09aStream \x0a\x09\x09nextPutAll: '(';\x0a\x09\x09nextPutAll: self asString;\x0a\x09\x09nextPutAll: ')'",
@@ -1850,7 +1854,7 @@ $1=_st($PlatformInterface())._existsGlobal_(aString);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"exists:",{aString:aString},smalltalk.NativeFunction.klass)})},
 args: ["aString"],
-source: "exists: aString\x0a\x09^PlatformInterface existsGlobal: aString",
+source: "exists: aString\x0a\x09^ PlatformInterface existsGlobal: aString",
 messageSends: ["existsGlobal:"],
 referencedClasses: ["PlatformInterface"]
 }),
@@ -1929,7 +1933,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Timeout.klass)})},
 args: ["anObject"],
-source: "on: anObject\x0a\x09^self new rawTimeout: anObject; yourself",
+source: "on: anObject\x0a\x09^ self new rawTimeout: anObject; yourself",
 messageSends: ["rawTimeout:", "new", "yourself"],
 referencedClasses: []
 }),

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 153 - 180
js/Kernel-Objects.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 233 - 273
js/Kernel-Tests.js


+ 1 - 1
js/Kernel-Transcript.js

@@ -133,7 +133,7 @@ $1=self["@current"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.Transcript.klass)})},
 args: [],
-source: "current\x0a\x09^current",
+source: "current\x0a\x09^ current",
 messageSends: [],
 referencedClasses: []
 }),

+ 52 - 65
js/SUnit-Tests.js

@@ -64,19 +64,18 @@ fn: function (){
 var self=this;
 function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self._should_raise_((function(){
+self._should_raise_((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(self["@empty"])._at_((5));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$Error());
 $ctx1.sendIdx["should:raise:"]=1;
-$2=self._should_raise_((function(){
+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)})},
 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",
+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"]
 }),
@@ -89,13 +88,12 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
-$2=_st(self["@full"])._includes_((5));
+var $1;
+$1=_st(self["@full"])._includes_((5));
 $ctx1.sendIdx["includes:"]=1;
-$1=self._assert_($2);
+self._assert_($1);
 $ctx1.sendIdx["assert:"]=1;
-$4=_st(self["@full"])._includes_("abc");
-$3=self._assert_($4);
+self._assert_(_st(self["@full"])._includes_("abc"));
 return self}, function($ctx1) {$ctx1.fill(self,"testIncludes",{},smalltalk.ExampleSetTest)})},
 args: [],
 source: "testIncludes\x0a\x09self assert: (full includes: 5).\x0a\x09self assert: (full includes: #abc)",
@@ -111,18 +109,17 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3,$6,$5;
-$2=_st(self["@empty"])._occurrencesOf_((0));
+var $1,$2;
+$1=_st(self["@empty"])._occurrencesOf_((0));
 $ctx1.sendIdx["occurrencesOf:"]=1;
-$1=self._assert_equals_($2,(0));
+self._assert_equals_($1,(0));
 $ctx1.sendIdx["assert:equals:"]=1;
-$4=_st(self["@full"])._occurrencesOf_((5));
+$2=_st(self["@full"])._occurrencesOf_((5));
 $ctx1.sendIdx["occurrencesOf:"]=2;
-$3=self._assert_equals_($4,(1));
+self._assert_equals_($2,(1));
 $ctx1.sendIdx["assert:equals:"]=2;
 _st(self["@full"])._add_((5));
-$6=_st(self["@full"])._occurrencesOf_((5));
-$5=self._assert_equals_($6,(1));
+self._assert_equals_(_st(self["@full"])._occurrencesOf_((5)),(1));
 return self}, function($ctx1) {$ctx1.fill(self,"testOccurrences",{},smalltalk.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",
@@ -138,13 +135,12 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 _st(self["@full"])._remove_((5));
 $1=_st(self["@full"])._includes_("abc");
 $ctx1.sendIdx["includes:"]=1;
 self._assert_($1);
-$2=_st(self["@full"])._includes_((5));
-self._deny_($2);
+self._deny_(_st(self["@full"])._includes_((5)));
 return self}, function($ctx1) {$ctx1.fill(self,"testRemove",{},smalltalk.ExampleSetTest)})},
 args: [],
 source: "testRemove\x0a\x09full remove: 5.\x0a\x09self assert: (full includes: #abc).\x0a\x09self deny: (full includes: 5)",
@@ -230,24 +226,23 @@ category: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2;
-$1=self._timeout_((100));
+var $1;
+self._timeout_((100));
 $ctx1.sendIdx["timeout:"]=1;
-$3=self._async_((function(){
+$1=self._async_((function(){
 return smalltalk.withContext(function($ctx2) {
 self._timeout_((20));
-$4=self._async_((function(){
+return _st(self._async_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._finished();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-return _st($4)._valueWithTimeout_((30));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._valueWithTimeout_((30));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["async:"]=1;
-$2=_st($3)._valueWithTimeout_((20));
+_st($1)._valueWithTimeout_((20));
 $ctx1.sendIdx["valueWithTimeout:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutFailing",{},smalltalk.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",
+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: []
 }),
@@ -260,20 +255,19 @@ category: 'helpers',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$4,$3,$2;
-$1=self._timeout_((20));
+var $1;
+self._timeout_((20));
 $ctx1.sendIdx["timeout:"]=1;
-$3=self._async_((function(){
+$1=self._async_((function(){
 return smalltalk.withContext(function($ctx2) {
 self._timeout_((40));
-$4=self._async_((function(){
+return _st(self._async_((function(){
 return smalltalk.withContext(function($ctx3) {
 return self._finished();
-}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
-return _st($4)._valueWithTimeout_((20));
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})})))._valueWithTimeout_((20));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
 $ctx1.sendIdx["async:"]=1;
-$2=_st($3)._valueWithTimeout_((10));
+_st($1)._valueWithTimeout_((10));
 $ctx1.sendIdx["valueWithTimeout:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"fakeMultipleTimeoutPassing",{},smalltalk.SUnitAsyncTest)})},
 args: [],
@@ -318,7 +312,7 @@ return _st(each)._selector();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selectorSetOf:",{aCollection:aCollection},smalltalk.SUnitAsyncTest)})},
 args: ["aCollection"],
-source: "selectorSetOf: aCollection\x0a\x09^(aCollection collect: [:each | each selector]) asSet",
+source: "selectorSetOf: aCollection\x0a\x09^ (aCollection collect: [ :each | each selector ]) asSet",
 messageSends: ["asSet", "collect:", "selector"],
 referencedClasses: []
 }),
@@ -366,7 +360,7 @@ 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)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$6,$5,$7;
+var $1,$2,$3,$4;
 suite=["fakeError", "fakeErrorFailingInTearDown", "fakeFailure", "testPass"]._collect_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(self._class())._selector_(each);
@@ -383,24 +377,21 @@ $2=["fakeError"]._asSet();
 $ctx2.sendIdx["asSet"]=1;
 self._assert_equals_($1,$2);
 $ctx2.sendIdx["assert:equals:"]=1;
-$3=self._selectorSetOf_(_st(result)._failures());
-$4=["fakeErrorFailingInTearDown", "fakeFailure"]._asSet();
-self._assert_equals_($3,$4);
+self._assert_equals_(self._selectorSetOf_(_st(result)._failures()),["fakeErrorFailingInTearDown", "fakeFailure"]._asSet());
 return self._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 return smalltalk.withContext(function($ctx2) {
-$6=_st(ann)._result();
-$5=_st($6).__eq_eq(result);
-if(smalltalk.assert($5)){
-$7=_st(_st(result)._runs()).__eq(_st(result)._total());
-return _st($7)._ifTrue_(assertBlock);
+$3=_st(_st(ann)._result()).__eq_eq(result);
+if(smalltalk.assert($3)){
+$4=_st(_st(result)._runs()).__eq(_st(result)._total());
+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)})},
 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",
+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"]
 }),
@@ -470,18 +461,17 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$3,$5,$4;
-$2=self._isAsync();
+var $1,$2;
+$1=self._isAsync();
 $ctx1.sendIdx["isAsync"]=1;
-$1=self._deny_($2);
+self._deny_($1);
 $ctx1.sendIdx["deny:"]=1;
 self._timeout_((0));
-$3=self._isAsync();
+$2=self._isAsync();
 $ctx1.sendIdx["isAsync"]=2;
-self._assert_($3);
+self._assert_($2);
 self._finished();
-$5=self._isAsync();
-$4=self._deny_($5);
+self._deny_(self._isAsync());
 return self}, function($ctx1) {$ctx1.fill(self,"testIsAsyncReturnsCorrectValues",{},smalltalk.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",
@@ -525,7 +515,7 @@ function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteR
 function $Set(){return smalltalk.Set||(typeof Set=="undefined"?nil:Set)}
 function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$3,$5;
+var $1,$2,$3;
 suite=["fakeTimeout", "fakeMultipleTimeoutFailing", "fakeMultipleTimeoutPassing", "testPass"]._collect_((function(each){
 return smalltalk.withContext(function($ctx2) {
 return _st(self._class())._selector_(each);
@@ -540,23 +530,21 @@ $1=self._selectorSetOf_(_st(result)._errors());
 $ctx2.sendIdx["selectorSetOf:"]=1;
 self._assert_equals_($1,_st($Set())._new());
 $ctx2.sendIdx["assert:equals:"]=1;
-$2=self._selectorSetOf_(_st(result)._failures());
-self._assert_equals_($2,["fakeMultipleTimeoutFailing", "fakeTimeout"]._asSet());
+self._assert_equals_(self._selectorSetOf_(_st(result)._failures()),["fakeMultipleTimeoutFailing", "fakeTimeout"]._asSet());
 return self._finished();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
 _st(_st(runner)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
 return smalltalk.withContext(function($ctx2) {
-$4=_st(ann)._result();
-$3=_st($4).__eq_eq(result);
-if(smalltalk.assert($3)){
-$5=_st(_st(result)._runs()).__eq(_st(result)._total());
-return _st($5)._ifTrue_(assertBlock);
+$2=_st(_st(ann)._result()).__eq_eq(result);
+if(smalltalk.assert($2)){
+$3=_st(_st(result)._runs()).__eq(_st(result)._total());
+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)})},
 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",
+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"]
 }),
@@ -570,7 +558,7 @@ fn: function (){
 var self=this;
 var x;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
+var $1;
 self["@flag"]="bad";
 self._timeout_((10));
 x=(0);
@@ -589,7 +577,7 @@ $ctx2.sendIdx["assert:equals:"]=1;
 $ctx1.sendIdx["async:"]=1;
 self["@flag"]=_st($1)._valueWithTimeout_((0));
 $ctx1.sendIdx["valueWithTimeout:"]=1;
-$2=self._async_((function(){
+self["@flag"]=_st(self._async_((function(){
 return smalltalk.withContext(function($ctx2) {
 self._finished();
 self["@flag"]="ok";
@@ -597,8 +585,7 @@ self["@flag"];
 x=_st(x).__plus((1));
 x;
 return self._assert_equals_(x,(1));
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
-self["@flag"]=_st($2)._valueWithTimeout_((0));
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})})))._valueWithTimeout_((0));
 return self}, function($ctx1) {$ctx1.fill(self,"testTwoAsyncPassesWithFinishedOnlyOneIsRun",{x:x},smalltalk.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.",

+ 41 - 51
js/SUnit.js

@@ -16,7 +16,7 @@ $1=self["@result"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.ResultAnnouncement)})},
 args: [],
-source: "result\x0a\x09^result",
+source: "result\x0a\x09^ result",
 messageSends: [],
 referencedClasses: []
 }),
@@ -65,14 +65,12 @@ category: 'testing',
 fn: function (aBoolean,aString){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=aBoolean;
-if(! smalltalk.assert($1)){
+if(! smalltalk.assert(aBoolean)){
 self._signalFailure_(aString);
 };
 return self}, function($ctx1) {$ctx1.fill(self,"assert:description:",{aBoolean:aBoolean,aString:aString},smalltalk.TestCase)})},
 args: ["aBoolean", "aString"],
-source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [self signalFailure: aString]",
+source: "assert: aBoolean description: aString\x0a\x09aBoolean ifFalse: [ self signalFailure: aString ]",
 messageSends: ["ifFalse:", "signalFailure:"],
 referencedClasses: []
 }),
@@ -85,15 +83,14 @@ category: 'testing',
 fn: function (actual,expected){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$6,$5,$4,$7,$3,$1;
+var $2,$6,$5,$4,$3,$1;
 $2=_st(actual).__eq(expected);
 $6=_st(expected)._printString();
 $ctx1.sendIdx["printString"]=1;
 $5="Expected: ".__comma($6);
 $4=_st($5).__comma(" but was: ");
 $ctx1.sendIdx[","]=2;
-$7=_st(actual)._printString();
-$3=_st($4).__comma($7);
+$3=_st($4).__comma(_st(actual)._printString());
 $ctx1.sendIdx[","]=1;
 $1=self._assert_description_($2,$3);
 return $1;
@@ -213,7 +210,7 @@ $1=_st(self["@asyncTimeout"])._notNil();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isAsync",{},smalltalk.TestCase)})},
 args: [],
-source: "isAsync\x0a\x09^asyncTimeout notNil",
+source: "isAsync\x0a\x09^ asyncTimeout notNil",
 messageSends: ["notNil"],
 referencedClasses: []
 }),
@@ -265,7 +262,7 @@ $1=self["@testSelector"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.TestCase)})},
 args: [],
-source: "selector\x0a\x09^testSelector",
+source: "selector\x0a\x09^ testSelector",
 messageSends: [],
 referencedClasses: []
 }),
@@ -335,7 +332,7 @@ return true;
 }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
 return self}, function($ctx1) {$ctx1.fill(self,"should:raise:",{aBlock:aBlock,anExceptionClass:anExceptionClass},smalltalk.TestCase)})},
 args: ["aBlock", "anExceptionClass"],
-source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. false]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [:ex | true])",
+source: "should: aBlock raise: anExceptionClass\x0a\x09self assert: ([ aBlock value. false ]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [ :ex | true ])",
 messageSends: ["assert:", "on:do:", "value"],
 referencedClasses: []
 }),
@@ -358,7 +355,7 @@ return false;
 }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})})));
 return self}, function($ctx1) {$ctx1.fill(self,"shouldnt:raise:",{aBlock:aBlock,anExceptionClass:anExceptionClass},smalltalk.TestCase)})},
 args: ["aBlock", "anExceptionClass"],
-source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. true]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [:ex | false])",
+source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([ aBlock value. true ]\x0a\x09\x09on: anExceptionClass\x0a\x09\x09do: [ :ex | false ])",
 messageSends: ["assert:", "on:do:", "value"],
 referencedClasses: []
 }),
@@ -445,7 +442,7 @@ $2=selectors;
 return $2;
 }, function($ctx1) {$ctx1.fill(self,"allTestSelectors",{selectors:selectors},smalltalk.TestCase.klass)})},
 args: [],
-source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors].\x0a\x09^selectors",
+source: "allTestSelectors\x0a\x09| selectors |\x0a\x09selectors := self testSelectors.\x0a\x09self shouldInheritSelectors ifTrue: [\x0a\x09\x09selectors addAll: self superclass allTestSelectors ].\x0a\x09^ selectors",
 messageSends: ["testSelectors", "ifTrue:", "shouldInheritSelectors", "addAll:", "allTestSelectors", "superclass"],
 referencedClasses: []
 }),
@@ -466,7 +463,7 @@ return self._selector_(each);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"buildSuite",{},smalltalk.TestCase.klass)})},
 args: [],
-source: "buildSuite\x0a\x09^self allTestSelectors collect: [:each | self selector: each]",
+source: "buildSuite\x0a\x09^ self allTestSelectors collect: [ :each | self selector: each ]",
 messageSends: ["collect:", "allTestSelectors", "selector:"],
 referencedClasses: []
 }),
@@ -514,12 +511,10 @@ fn: function (){
 var self=this;
 function $TestCase(){return smalltalk.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=$TestCase();
-return $1;
+return $TestCase();
 }, function($ctx1) {$ctx1.fill(self,"lookupHierarchyRoot",{},smalltalk.TestCase.klass)})},
 args: [],
-source: "lookupHierarchyRoot\x0a\x09^TestCase",
+source: "lookupHierarchyRoot\x0a\x09^ TestCase",
 messageSends: [],
 referencedClasses: ["TestCase"]
 }),
@@ -540,7 +535,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"selector:",{aSelector:aSelector},smalltalk.TestCase.klass)})},
 args: ["aSelector"],
-source: "selector: aSelector\x0a\x09^self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
+source: "selector: aSelector\x0a\x09^ self new\x0a\x09\x09setTestSelector: aSelector;\x0a\x09\x09yourself",
 messageSends: ["setTestSelector:", "new", "yourself"],
 referencedClasses: []
 }),
@@ -558,7 +553,7 @@ $1=self.__tild_eq(self._lookupHierarchyRoot());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"shouldInheritSelectors",{},smalltalk.TestCase.klass)})},
 args: [],
-source: "shouldInheritSelectors\x0a\x09^self ~= self lookupHierarchyRoot",
+source: "shouldInheritSelectors\x0a\x09^ self ~= self lookupHierarchyRoot",
 messageSends: ["~=", "lookupHierarchyRoot"],
 referencedClasses: []
 }),
@@ -579,7 +574,7 @@ return _st(each)._match_("^test");
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"testSelectors",{},smalltalk.TestCase.klass)})},
 args: [],
-source: "testSelectors\x0a\x09^self methodDictionary keys select: [:each | each match: '^test']",
+source: "testSelectors\x0a\x09^ self methodDictionary keys select: [ :each | each match: '^test' ]",
 messageSends: ["select:", "keys", "methodDictionary", "match:"],
 referencedClasses: []
 }),
@@ -596,8 +591,8 @@ fn: function (aBlock){
 var self=this;
 var failed;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
-$1=_st(self["@testCase"])._context_(self);
+var $1,$2;
+_st(self["@testCase"])._context_(self);
 $ctx1.sendIdx["context:"]=1;
 _st((function(){
 return smalltalk.withContext(function($ctx2) {
@@ -609,16 +604,16 @@ return failed;
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._ensure_((function(){
 return smalltalk.withContext(function($ctx2) {
 _st(self["@testCase"])._context_(nil);
-$2=_st(failed)._and_((function(){
+$1=_st(failed)._and_((function(){
 return smalltalk.withContext(function($ctx3) {
 return _st(self["@testCase"])._isAsync();
 $ctx3.sendIdx["isAsync"]=1;
 }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
-if(smalltalk.assert($2)){
+if(smalltalk.assert($1)){
 _st(self["@testCase"])._finished();
 };
-$3=_st(self["@testCase"])._isAsync();
-if(! smalltalk.assert($3)){
+$2=_st(self["@testCase"])._isAsync();
+if(! smalltalk.assert($2)){
 return _st(self["@testCase"])._tearDown();
 };
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
@@ -682,7 +677,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"testCase:",{aTestCase:aTestCase},smalltalk.TestContext.klass)})},
 args: ["aTestCase"],
-source: "testCase: aTestCase\x0a\x09^self new\x0a\x09\x09testCase: aTestCase;\x0a\x09\x09yourself",
+source: "testCase: aTestCase\x0a\x09^ self new\x0a\x09\x09testCase: aTestCase;\x0a\x09\x09yourself",
 messageSends: ["testCase:", "new", "yourself"],
 referencedClasses: []
 }),
@@ -762,8 +757,7 @@ var self=this;
 function $TestFailure(){return smalltalk.TestFailure||(typeof TestFailure=="undefined"?nil:TestFailure)}
 function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st(aBlock)._on_do_($TestFailure(),(function(ex){
 return smalltalk.withContext(function($ctx3) {
@@ -799,7 +793,7 @@ $1=$3;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"testCase:result:finished:",{aTestCase:aTestCase,aTestResult:aTestResult,aBlock:aBlock},smalltalk.ReportingTestContext.klass)})},
 args: ["aTestCase", "aTestResult", "aBlock"],
-source: "testCase: aTestCase result: aTestResult finished: aBlock\x0a\x09^(super testCase: aTestCase)\x0a\x09\x09result: aTestResult;\x0a\x09\x09finished: aBlock;\x0a\x09\x09yourself",
+source: "testCase: aTestCase result: aTestResult finished: aBlock\x0a\x09^ (super testCase: aTestCase)\x0a\x09\x09result: aTestResult;\x0a\x09\x09finished: aBlock;\x0a\x09\x09yourself",
 messageSends: ["result:", "testCase:", "finished:", "yourself"],
 referencedClasses: []
 }),
@@ -856,7 +850,7 @@ $1=self["@errors"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"errors",{},smalltalk.TestResult)})},
 args: [],
-source: "errors\x0a\x09^errors",
+source: "errors\x0a\x09^ errors",
 messageSends: [],
 referencedClasses: []
 }),
@@ -874,7 +868,7 @@ $1=self["@failures"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"failures",{},smalltalk.TestResult)})},
 args: [],
-source: "failures\x0a\x09^failures",
+source: "failures\x0a\x09^ failures",
 messageSends: [],
 referencedClasses: []
 }),
@@ -927,20 +921,17 @@ category: 'running',
 fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $3,$2,$4,$6,$5,$1;
+var $3,$2,$1;
 $3=self._runs();
 $ctx1.sendIdx["runs"]=1;
 $2=_st($3).__eq_eq(self._total());
 if(! smalltalk.assert($2)){
-$4=aBlock;
-$6=self._runs();
-$5=_st($6).__plus((1));
-$1=_st($4)._value_($5);
+$1=_st(aBlock)._value_(_st(self._runs()).__plus((1)));
 };
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"nextRunDo:",{aBlock:aBlock},smalltalk.TestResult)})},
 args: ["aBlock"],
-source: "nextRunDo: aBlock\x0a\x22Runs aBlock with index of next run\x0aor does nothing if no more runs\x22\x0a^self runs == self total\x0a\x09ifFalse: [ aBlock value: self runs + 1 ]",
+source: "nextRunDo: aBlock\x0a\x09\x22Runs aBlock with index of next run or does nothing if no more runs\x22\x0a\x09^ self runs == self total\x0a\x09\x09ifFalse: [ aBlock value: self runs + 1 ]",
 messageSends: ["ifFalse:", "==", "runs", "total", "value:", "+"],
 referencedClasses: []
 }),
@@ -955,8 +946,7 @@ var self=this;
 function $TestFailure(){return smalltalk.TestFailure||(typeof TestFailure=="undefined"?nil:TestFailure)}
 function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st((function(){
+_st((function(){
 return smalltalk.withContext(function($ctx2) {
 return _st((function(){
 return smalltalk.withContext(function($ctx3) {
@@ -973,7 +963,7 @@ return self._addError_(aTestCase);
 $ctx1.sendIdx["on:do:"]=1;
 return self}, function($ctx1) {$ctx1.fill(self,"runCase:",{aTestCase:aTestCase},smalltalk.TestResult)})},
 args: ["aTestCase"],
-source: "runCase: aTestCase\x0a\x09[[ self increaseRuns.\x0a\x09\x09aTestCase runCase]\x0a\x09on: TestFailure do: [:ex | self addFailure: aTestCase]]\x0a\x09on: Error do: [:ex | self addError: aTestCase]",
+source: "runCase: aTestCase\x0a\x09[ [ self increaseRuns.\x0a\x09\x09aTestCase runCase ]\x0a\x09on: TestFailure do: [ :ex | self addFailure: aTestCase ]]\x0a\x09on: Error do: [ :ex | self addError: aTestCase ]",
 messageSends: ["on:do:", "increaseRuns", "runCase", "addFailure:", "addError:"],
 referencedClasses: ["TestFailure", "Error"]
 }),
@@ -991,7 +981,7 @@ $1=self["@runs"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"runs",{},smalltalk.TestResult)})},
 args: [],
-source: "runs\x0a\x09^runs",
+source: "runs\x0a\x09^ runs",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1020,7 +1010,7 @@ $1="error";
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"status",{},smalltalk.TestResult)})},
 args: [],
-source: "status\x0a\x09^self errors isEmpty\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty\x0a\x09\x09\x09\x09ifTrue: ['success']\x0a\x09\x09\x09\x09ifFalse: ['failure']]\x0a\x09\x09ifFalse: ['error']",
+source: "status\x0a\x09^ self errors isEmpty\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self failures isEmpty\x0a\x09\x09\x09\x09ifTrue: [ 'success' ]\x0a\x09\x09\x09\x09ifFalse: [ 'failure' ]]\x0a\x09\x09ifFalse: [ 'error' ]",
 messageSends: ["ifTrue:ifFalse:", "isEmpty", "errors", "failures"],
 referencedClasses: []
 }),
@@ -1038,7 +1028,7 @@ $1=self["@timestamp"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"timestamp",{},smalltalk.TestResult)})},
 args: [],
-source: "timestamp\x0a\x09^timestamp",
+source: "timestamp\x0a\x09^ timestamp",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1056,7 +1046,7 @@ $1=self["@total"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"total",{},smalltalk.TestResult)})},
 args: [],
-source: "total\x0a\x09^total",
+source: "total\x0a\x09^ total",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1094,7 +1084,7 @@ $1=self["@announcer"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.TestSuiteRunner)})},
 args: [],
-source: "announcer\x0a\x09^announcer",
+source: "announcer\x0a\x09^ announcer",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1116,7 +1106,7 @@ return self._resume();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"contextOf:",{anInteger:anInteger},smalltalk.TestSuiteRunner)})},
 args: ["anInteger"],
-source: "contextOf: anInteger\x0a\x09^ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]",
+source: "contextOf: anInteger\x0a\x09^ ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]",
 messageSends: ["testCase:result:finished:", "at:", "resume"],
 referencedClasses: ["ReportingTestContext"]
 }),
@@ -1148,7 +1138,7 @@ return _st(self._contextOf_(_st(runs).__plus((1))))._start();
 }, function($ctx2) {$ctx2.fillBlock({runs:runs},$ctx1,1)})});
 return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TestSuiteRunner)})},
 args: [],
-source: "initialize\x0a\x09super initialize.\x0a\x09announcer := Announcer new.\x0a\x09result := TestResult new.\x0a\x09runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ]].",
+source: "initialize\x0a\x09super initialize.\x0a\x09announcer := Announcer new.\x0a\x09result := TestResult new.\x0a\x09runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ] ].",
 messageSends: ["initialize", "new", "runs", "ifTrue:", "<", "total", "start", "contextOf:", "+"],
 referencedClasses: ["Announcer", "TestResult"]
 }),
@@ -1166,7 +1156,7 @@ $1=self["@result"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.TestSuiteRunner)})},
 args: [],
-source: "result\x0a\x09^result",
+source: "result\x0a\x09^ result",
 messageSends: [],
 referencedClasses: []
 }),
@@ -1252,7 +1242,7 @@ $1=_st(smalltalk.TestSuiteRunner.klass.superclass.fn.prototype._new.apply(_st(se
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aCollection:aCollection},smalltalk.TestSuiteRunner.klass)})},
 args: ["aCollection"],
-source: "on: aCollection\x0a\x09^super new suite: aCollection",
+source: "on: aCollection\x0a\x09^ super new suite: aCollection",
 messageSends: ["suite:", "new"],
 referencedClasses: []
 }),

+ 10 - 18
js/Spaces.js

@@ -28,13 +28,11 @@ category: 'initialization',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$2;
+var $1;
 $1="body"._asJQuery();
 $ctx1.sendIdx["asJQuery"]=1;
 _st($1)._append_("<iframe style=\x22display: none;\x22></iframe>");
-$3="iframe"._asJQuery();
-$2=_st($3)._get();
-self["@frame"]=_st($2)._last();
+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)})},
 args: [],
@@ -76,15 +74,14 @@ fn: function (aBlock){
 var self=this;
 function $ObjectSpaceConnectionError(){return smalltalk.ObjectSpaceConnectionError||(typeof ObjectSpaceConnectionError=="undefined"?nil:ObjectSpaceConnectionError)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$4,$6,$5,$3;
+var $1,$2,$4,$5,$3;
 $1=self._isConnected();
 if(! smalltalk.assert($1)){
 $2=_st($ObjectSpaceConnectionError())._signal();
 return $2;
 };
 $4=_st(self["@frame"])._contentWindow();
-$6="(".__comma(_st(aBlock)._compiledSource());
-$5=_st($6).__comma(")()");
+$5=_st("(".__comma(_st(aBlock)._compiledSource())).__comma(")()");
 $ctx1.sendIdx[","]=1;
 $3=_st($4)._eval_($5);
 return $3;
@@ -288,10 +285,9 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=self._assert_(_st(_st(self["@space"])._frame())._notNil());
+self._assert_(_st(_st(self["@space"])._frame())._notNil());
 $ctx1.sendIdx["assert:"]=1;
-$2=self._assert_(_st(self["@space"])._isConnected());
+self._assert_(_st(self["@space"])._isConnected());
 return self}, function($ctx1) {$ctx1.fill(self,"testCreate",{},smalltalk.ObjectSpaceTest)})},
 args: [],
 source: "testCreate\x0a\x0a\x09self assert: space frame notNil.\x0a\x09self assert: space isConnected",
@@ -309,7 +305,7 @@ var self=this;
 var result;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
+var $2,$1;
 _st(self["@space"])._whenReadyDo_((function(){
 return smalltalk.withContext(function($ctx2) {
 result=_st(self["@space"])._do_((function(){
@@ -321,9 +317,7 @@ $2=_st(result)._class();
 $ctx2.sendIdx["class"]=1;
 $1=_st($2)._name();
 self._assert_equals_($1,"Smalltalk");
-$4=_st(result)._class();
-$3=_st($4).__eq($Smalltalk());
-self._deny_($3);
+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)})}));
@@ -342,16 +336,14 @@ category: 'tests',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1,$4,$3;
+var $2,$1;
 $2=_st(self["@space"])._frame();
 $ctx1.sendIdx["frame"]=1;
 $1=_st($2)._isNil();
 $ctx1.sendIdx["isNil"]=1;
 self._deny_($1);
 _st(self["@space"])._release();
-$4=_st(self["@space"])._frame();
-$3=_st($4)._isNil();
-self._assert_($3);
+self._assert_(_st(_st(self["@space"])._frame())._isNil());
 return self}, function($ctx1) {$ctx1.fill(self,"testRelease",{},smalltalk.ObjectSpaceTest)})},
 args: [],
 source: "testRelease\x0a\x0a\x09self deny: space frame isNil.\x0a\x0a\x09space release.\x0a\x09\x0a\x09self assert: space frame isNil",

+ 3 - 3
package.json

@@ -1,6 +1,6 @@
 {
   "name": "amber",
-  "version": "0.12.0-pre",
+  "version": "0.13.0-pre",
   "description": "An implementation of the Smalltalk language that runs on top of the JS runtime.",
   "homepage": "http://amber-lang.net",
   "keywords": [
@@ -26,8 +26,8 @@
     "node": ">=0.8.0"
   },
   "bin": {
-    "amber": "./bin/amber-cli.js",
-    "amberc": "./bin/amberc"
+    "amber": "./cli/support/amber-cli.js",
+    "amberc": "./cli/support/amberc-cli.js"
   },
   "scripts": {
     "test": "grunt amberc:amber_test_runner && node ./test/amber_test_runner.js"

+ 129 - 154
st/Canvas.st

@@ -20,19 +20,19 @@ I am platform interface class that tries to use window and jQuery; that is, one
 !BrowserInterface methodsFor: 'actions'!
 
 ajax: anObject
-	^jQuery ajax: anObject
+	^ jQuery ajax: anObject
 !
 
 alert: aString
-	^window alert: aString
+	^ window alert: aString
 !
 
 confirm: aString
-	^window confirm: aString
+	^ window confirm: aString
 !
 
 prompt: aString
-	^window prompt: aString
+	^ window prompt: aString
 ! !
 
 !BrowserInterface methodsFor: 'testing'!
@@ -66,7 +66,7 @@ The `#with:` method is used to compose HTML, nesting tags. `#with:` can take a `
 !HTMLCanvas methodsFor: 'accessing'!
 
 root
-	^root
+	^ root
 !
 
 root: aTagBrush
@@ -86,7 +86,7 @@ snippet: anElement
 	self with: (TagBrush fromJQuery: clone canvas: self).
 	caret := clone find: '[data-snippet="*"]'.
 	caret toArray isEmpty ifTrue: [ caret := clone ].
-	^TagBrush fromJQuery: (caret removeAttr: 'data-snippet') canvas: self
+	^ TagBrush fromJQuery: (caret removeAttr: 'data-snippet') canvas: self
 ! !
 
 !HTMLCanvas methodsFor: 'adding'!
@@ -103,14 +103,14 @@ entity: aString
 !
 
 with: anObject
-	^self root with: anObject
+	^ self root with: anObject
 ! !
 
 !HTMLCanvas methodsFor: 'initialization'!
 
 initialize
 	super initialize.
-	root ifNil: [root := TagBrush fromString: 'div' canvas: self]
+	root ifNil: [ root := TagBrush fromString: 'div' canvas: self ]
 !
 
 initializeFromJQuery: aJQuery
@@ -120,151 +120,151 @@ initializeFromJQuery: aJQuery
 !HTMLCanvas methodsFor: 'tags'!
 
 a
-	^self tag: 'a'
+	^ self tag: 'a'
 !
 
 abbr
-	^self tag: 'abbr'
+	^ self tag: 'abbr'
 !
 
 address
-	^self tag: 'address'
+	^ self tag: 'address'
 !
 
 area
-	^self tag: 'area'
+	^ self tag: 'area'
 !
 
 article
-	^self tag: 'article'
+	^ self tag: 'article'
 !
 
 aside
-	^self tag: 'aside'
+	^ self tag: 'aside'
 !
 
 audio
-	^self tag: 'audio'
+	^ self tag: 'audio'
 !
 
 base
-	^self tag: 'base'
+	^ self tag: 'base'
 !
 
 blockquote
-	^self tag: 'blockquote'
+	^ self tag: 'blockquote'
 !
 
 body
-	^self tag: 'body'
+	^ self tag: 'body'
 !
 
 br
-	^self tag: 'br'
+	^ self tag: 'br'
 !
 
 button
-	^self tag: 'button'
+	^ self tag: 'button'
 !
 
 canvas
-	^self tag: 'canvas'
+	^ self tag: 'canvas'
 !
 
 caption
-	^self tag: 'caption'
+	^ self tag: 'caption'
 !
 
 cite
-	^self tag: 'cite'
+	^ self tag: 'cite'
 !
 
 code
-	^self tag: 'code'
+	^ self tag: 'code'
 !
 
 col
-	^self tag: 'col'
+	^ self tag: 'col'
 !
 
 colgroup
-	^self tag: 'colgroup'
+	^ self tag: 'colgroup'
 !
 
 command
-	^self tag: 'command'
+	^ self tag: 'command'
 !
 
 datalist
-	^self tag: 'datalist'
+	^ self tag: 'datalist'
 !
 
 dd
-	^self tag: 'dd'
+	^ self tag: 'dd'
 !
 
 del
-	^self tag: 'del'
+	^ self tag: 'del'
 !
 
 details
-	^self tag: 'details'
+	^ self tag: 'details'
 !
 
 div
-	^self tag: 'div'
+	^ self tag: 'div'
 !
 
 div: aBlock
-	^self div with: aBlock
+	^ self div with: aBlock
 !
 
 dl
-	^self tag: 'dl'
+	^ self tag: 'dl'
 !
 
 dt
-	^self tag: 'dt'
+	^ self tag: 'dt'
 !
 
 em
-	^self tag: 'em'
+	^ self tag: 'em'
 !
 
 embed
-	^self tag: 'embed'
+	^ self tag: 'embed'
 !
 
 fieldset
-	^self tag: 'fieldset'
+	^ self tag: 'fieldset'
 !
 
 figcaption
-	^self tag: 'figcaption'
+	^ self tag: 'figcaption'
 !
 
 figure
-	^self tag: 'figure'
+	^ self tag: 'figure'
 !
 
 footer
-	^self tag: 'footer'
+	^ self tag: 'footer'
 !
 
 form
-	^self tag: 'form'
+	^ self tag: 'form'
 !
 
 h1
-	^self tag: 'h1'
+	^ self tag: 'h1'
 !
 
 h1: anObject
-	^self h1 with: anObject
+	^ self h1 with: anObject
 !
 
 h2
-	^self tag: 'h2'
+	^ self tag: 'h2'
 !
 
 h2: anObject
@@ -272,203 +272,203 @@ h2: anObject
 !
 
 h3
-	^self tag: 'h3'
+	^ self tag: 'h3'
 !
 
 h3: anObject
-	^self h3 with: anObject
+	^ self h3 with: anObject
 !
 
 h4
-	^self tag: 'h4'
+	^ self tag: 'h4'
 !
 
 h4: anObject
-	^self h4 with: anObject
+	^ self h4 with: anObject
 !
 
 h5
-	^self tag: 'h5'
+	^ self tag: 'h5'
 !
 
 h5: anObject
-	^self h5 with: anObject
+	^ self h5 with: anObject
 !
 
 h6
-	^self tag: 'h6'
+	^ self tag: 'h6'
 !
 
 h6: anObject
-	^self h6 with: anObject
+	^ self h6 with: anObject
 !
 
 head
-	^self tag: 'head'
+	^ self tag: 'head'
 !
 
 header
-	^self tag: 'header'
+	^ self tag: 'header'
 !
 
 hgroup
-	^self tag: 'hgroup'
+	^ self tag: 'hgroup'
 !
 
 hr
-	^self tag: 'hr'
+	^ self tag: 'hr'
 !
 
 html
-	^self tag: 'html'
+	^ self tag: 'html'
 !
 
 iframe
-	^self tag: 'iframe'
+	^ self tag: 'iframe'
 !
 
 iframe: aString
-	^self iframe src: aString
+	^ self iframe src: aString
 !
 
 img
-	^self tag: 'img'
+	^ self tag: 'img'
 !
 
 img: aString
-	^self img src: aString
+	^ self img src: aString
 !
 
 input
-	^self tag: 'input'
+	^ self tag: 'input'
 !
 
 label
-	^self tag: 'label'
+	^ self tag: 'label'
 !
 
 legend
-	^self tag: 'legend'
+	^ self tag: 'legend'
 !
 
 li
-	^self tag: 'li'
+	^ self tag: 'li'
 !
 
 li: anObject
-	^self li with: anObject
+	^ self li with: anObject
 !
 
 link
-	^self tag: 'link'
+	^ self tag: 'link'
 !
 
 map
-	^self tag: 'map'
+	^ self tag: 'map'
 !
 
 mark
-	^self tag: 'mark'
+	^ self tag: 'mark'
 !
 
 menu
-	^self tag: 'menu'
+	^ self tag: 'menu'
 !
 
 meta
-	^self tag: 'meta'
+	^ self tag: 'meta'
 !
 
 nav
-	^self tag: 'nav'
+	^ self tag: 'nav'
 !
 
 newTag: aString
-	^TagBrush fromString: aString canvas: self
+	^ TagBrush fromString: aString canvas: self
 !
 
 noscript
-	^self tag: 'noscript'
+	^ self tag: 'noscript'
 !
 
 object
-	^self tag: 'object'
+	^ self tag: 'object'
 !
 
 ol
-	^self tag: 'ol'
+	^ self tag: 'ol'
 !
 
 ol: anObject
-	^self ol with: anObject
+	^ self ol with: anObject
 !
 
 optgroup
-	^self tag: 'optgroup'
+	^ self tag: 'optgroup'
 !
 
 option
-	^self tag: 'option'
+	^ self tag: 'option'
 !
 
 output
-	^self tag: 'output'
+	^ self tag: 'output'
 !
 
 p
-	^self tag: 'p'
+	^ self tag: 'p'
 !
 
 p: anObject
-	^self p with: anObject
+	^ self p with: anObject
 !
 
 param
-	^self tag: 'param'
+	^ self tag: 'param'
 !
 
 pre
-	^self tag: 'pre'
+	^ self tag: 'pre'
 !
 
 progress
-	^self tag: 'progress'
+	^ self tag: 'progress'
 !
 
 script
-	^self tag: 'script'
+	^ self tag: 'script'
 !
 
 section
-	^self tag: 'section'
+	^ self tag: 'section'
 !
 
 select
-	^self tag: 'select'
+	^ self tag: 'select'
 !
 
 small
-	^self tag: 'small'
+	^ self tag: 'small'
 !
 
 source
-	^self tag: 'source'
+	^ self tag: 'source'
 !
 
 span
-	^self tag: 'span'
+	^ self tag: 'span'
 !
 
 span: anObject
-	^self span with: anObject
+	^ self span with: anObject
 !
 
 strong
-	^self tag: 'strong'
+	^ self tag: 'strong'
 !
 
 strong: anObject
-	^self strong with: anObject
+	^ self strong with: anObject
 !
 
 style
@@ -480,97 +480,97 @@ style: aString
 !
 
 sub
-	^self tag: 'sub'
+	^ self tag: 'sub'
 !
 
 summary
-	^self tag: 'summary'
+	^ self tag: 'summary'
 !
 
 sup
-	^self tag: 'sup'
+	^ self tag: 'sup'
 !
 
 table
-	^self tag: 'table'
+	^ self tag: 'table'
 !
 
 tag: aString
-	^root addBrush: (self newTag: aString)
+	^ root addBrush: (self newTag: aString)
 !
 
 tbody
-	^self tag: 'tbody'
+	^ self tag: 'tbody'
 !
 
 td
-	^self tag: 'td'
+	^ self tag: 'td'
 !
 
 textarea
-	^self tag: 'textarea'
+	^ self tag: 'textarea'
 !
 
 tfoot
-	^self tag: 'tfoot'
+	^ self tag: 'tfoot'
 !
 
 th
-	^self tag: 'th'
+	^ self tag: 'th'
 !
 
 thead
-	^self tag: 'thead'
+	^ self tag: 'thead'
 !
 
 time
-	^self tag: 'time'
+	^ self tag: 'time'
 !
 
 title
-	^self tag: 'title'
+	^ self tag: 'title'
 !
 
 tr
-	^self tag: 'tr'
+	^ self tag: 'tr'
 !
 
 ul
-	^self tag: 'ul'
+	^ self tag: 'ul'
 !
 
 ul: anObject
-	^self ul with: anObject
+	^ self ul with: anObject
 !
 
 video
-	^self tag: 'video'
+	^ self tag: 'video'
 ! !
 
 !HTMLCanvas class methodsFor: 'instance creation'!
 
 browserVersion
-	^(jQuery at: #browser) version
+	^ (jQuery at: #browser) version
 !
 
 isMSIE
-	^((jQuery at: #browser) at: #msie) notNil
+	^ ((jQuery at: #browser) at: #msie) notNil
 !
 
 isMozilla
-	^((jQuery at: #browser) at: #mozilla) notNil
+	^ ((jQuery at: #browser) at: #mozilla) notNil
 !
 
 isOpera
-	^((jQuery at: #browser) at: #opera) notNil
+	^ ((jQuery at: #browser) at: #opera) notNil
 !
 
 isWebkit
-	^((jQuery at: #browser) at: #webkit) notNil
+	^ ((jQuery at: #browser) at: #webkit) notNil
 !
 
 onJQuery: aJQuery
-	^self basicNew
+	^ self basicNew
 		initializeFromJQuery: aJQuery;
 		initialize;
 		yourself
@@ -624,7 +624,7 @@ snippetAt: aString
 !
 
 snippets
-	^snippets ifNil: [ snippets := #{} ]
+	^ snippets ifNil: [ snippets := #{} ]
 ! !
 
 !HTMLSnippet methodsFor: 'initialization'!
@@ -748,14 +748,14 @@ All tags but `<style>` are instances of me (see the `StyleBrush` class).
 !TagBrush methodsFor: 'accessing'!
 
 element
-	^element
+	^ element
 ! !
 
 !TagBrush methodsFor: 'adding'!
 
 addBrush: aTagBrush
 	self appendChild: aTagBrush element.
-	^aTagBrush
+	^ aTagBrush
 !
 
 append: anObject
@@ -931,7 +931,7 @@ width: aString
 !TagBrush methodsFor: 'converting'!
 
 asJQuery
-	^self element asJQuery
+	^ self element asJQuery
 ! !
 
 !TagBrush methodsFor: 'events'!
@@ -1049,42 +1049,17 @@ createTextNodeFor: aString
 !TagBrush class methodsFor: 'instance creation'!
 
 fromJQuery: aJQuery canvas: aCanvas
-	^self new
+	^ self new
 		initializeFromJQuery: aJQuery canvas: aCanvas;
 		yourself
 !
 
 fromString: aString canvas: aCanvas
-	^self new
+	^ self new
 	initializeFromString: aString canvas: aCanvas;
 	yourself
 ! !
 
-TagBrush subclass: #DocumentFragmentTag
-	instanceVariableNames: ''
-	package: 'Canvas'!
-
-!DocumentFragmentTag methodsFor: 'initialization'!
-
-initializeFromCanvas: aCanvas
-	canvas := aCanvas.
-	element := self createDocumentFragment
-! !
-
-!DocumentFragmentTag methodsFor: 'private'!
-
-createDocumentFragment
-	<return document.createDocumentFragment()>
-! !
-
-!DocumentFragmentTag class methodsFor: 'instance creation'!
-
-canvas: aCanvas
-	^ self new
-		initializeFromCanvas: aCanvas;
-		yourself
-! !
-
 TagBrush subclass: #StyleTag
 	instanceVariableNames: ''
 	package: 'Canvas'!
@@ -1099,16 +1074,16 @@ The need for a specific class comes from Internet Explorer compatibility issues.
 
 with: aString
 	HTMLCanvas isMSIE
-		ifTrue: [self element styleSheet cssText: aString ]
-		ifFalse: [super with: aString ].
+		ifTrue: [ self element styleSheet cssText: aString ]
+		ifFalse: [ super with: aString ].
 ! !
 
 !StyleTag class methodsFor: 'instance creation'!
 
 canvas: aCanvas
-	^self new
-	initializeFromString: 'style' canvas: aCanvas;
-	yourself
+	^ self new
+		initializeFromString: 'style' canvas: aCanvas;
+		yourself
 ! !
 
 InterfacingObject subclass: #Widget

+ 74 - 38
st/Compiler-AST.st

@@ -48,7 +48,7 @@ nextNode: aNode
 !
 
 nodes
-	^nodes ifNil: [nodes := Array new]
+	^ nodes ifNil: [ nodes := Array new ] 
 !
 
 parent
@@ -107,11 +107,11 @@ isAssignmentNode
 !
 
 isBlockNode
-	^false
+	^ false
 !
 
 isBlockSequenceNode
-	^false
+	^ false
 !
 
 isCascadeNode
@@ -119,7 +119,7 @@ isCascadeNode
 !
 
 isImmutable
-	^false
+	^ false
 !
 
 isJSStatementNode
@@ -134,16 +134,32 @@ isNode
 	^ true
 !
 
+isReferenced
+	"Answer true if the receiver is referenced by other nodes.
+	Do not take sequences or assignments into account"
+	
+	^ (self parent isSequenceNode or: [
+		self parent isAssignmentNode ]) not
+!
+
 isReturnNode
-	^false
+	^ false
 !
 
 isSendNode
-	^false
+	^ false
+!
+
+isSequenceNode
+	^ false
 !
 
 isValueNode
-	^false
+	^ false
+!
+
+isVariableNode
+	^ false
 !
 
 stopOnStepping
@@ -151,7 +167,7 @@ stopOnStepping
 !
 
 subtreeNeedsAliasing
-	^(self shouldBeAliased or: [ self shouldBeInlined ]) or: [
+	^ (self shouldBeAliased or: [ self shouldBeInlined ]) or: [
 		(self nodes detect: [ :each | each subtreeNeedsAliasing ] ifNone: [ false ]) ~= false ]
 ! !
 
@@ -170,7 +186,7 @@ I represent an assignment node.!
 !AssignmentNode methodsFor: 'accessing'!
 
 left
-	^left
+	^ left
 !
 
 left: aNode
@@ -183,7 +199,7 @@ nodes
 !
 
 right
-	^right
+	^ right
 !
 
 right: aNode
@@ -195,6 +211,10 @@ right: aNode
 
 isAssignmentNode
 	^ true
+!
+
+shouldBeAliased
+	^ super shouldBeAliased or: [ self isReferenced ]
 ! !
 
 !AssignmentNode methodsFor: 'visiting'!
@@ -224,7 +244,7 @@ nextNode: aNode
 !
 
 parameters
-	^parameters ifNil: [parameters := Array new]
+	^ parameters ifNil: [ parameters := Array new ] 
 !
 
 parameters: aCollection
@@ -242,7 +262,7 @@ scope: aLexicalScope
 !BlockNode methodsFor: 'testing'!
 
 isBlockNode
-	^true
+	^ true
 !
 
 subtreeNeedsAliasing
@@ -264,7 +284,7 @@ I represent an cascade node.!
 !CascadeNode methodsFor: 'accessing'!
 
 receiver
-	^receiver
+	^ receiver
 !
 
 receiver: aNode
@@ -316,7 +336,7 @@ I represent an JavaScript statement node.!
 !JSStatementNode methodsFor: 'accessing'!
 
 source
-	^source ifNil: ['']
+	^ source ifNil: [ '' ] 
 !
 
 source: aString
@@ -346,7 +366,7 @@ A method node must be the root and only method node of a valid AST.!
 !MethodNode methodsFor: 'accessing'!
 
 arguments
-	^arguments ifNil: [#()]
+	^ arguments ifNil: [ #() ] 
 !
 
 arguments: aCollection
@@ -382,7 +402,7 @@ scope: aMethodScope
 !
 
 selector
-	^selector
+	^ selector
 !
 
 selector: aString
@@ -398,7 +418,7 @@ sendIndexes: aDictionary
 !
 
 source
-	^source
+	^ source
 !
 
 source: aString
@@ -460,7 +480,7 @@ I represent an message send node.!
 !SendNode methodsFor: 'accessing'!
 
 arguments
-	^arguments ifNil: [arguments := #()]
+	^ arguments ifNil: [ arguments := #() ] 
 !
 
 arguments: aCollection
@@ -474,7 +494,7 @@ cascadeNodeWithMessages: aCollection
 		selector: self selector;
 		arguments: self arguments;
 		yourself.
-	^CascadeNode new
+	^ CascadeNode new
 		receiver: self receiver;
 		nodes: (Array with: first), aCollection;
 		yourself
@@ -497,7 +517,7 @@ nodes
 !
 
 receiver
-	^receiver
+	^ receiver
 !
 
 receiver: aNode
@@ -507,7 +527,7 @@ receiver: aNode
 !
 
 selector
-	^selector
+	^ selector
 !
 
 selector: aString
@@ -523,11 +543,11 @@ superSend: aBoolean
 !
 
 valueForReceiver: anObject
-	^SendNode new
+	^ SendNode new
 		position: self position;
 		receiver: (self receiver
-		ifNil: [anObject]
-		ifNotNil: [self receiver valueForReceiver: anObject]);
+		ifNil: [ anObject ] 
+		ifNotNil: [ self receiver valueForReceiver: anObject ]);
 		selector: self selector;
 		arguments: self arguments;
 		yourself
@@ -544,8 +564,15 @@ isSendNode
 !
 
 shouldBeAliased
+	"Because we keep track of send indexes, some send nodes need additional care for aliasing. 
+	See IRJSVisitor >> visitIRSend:"
+	
+	| sends |
+	
+	sends := (self method sendIndexes at: self selector) size.
+	
 	^ super shouldBeAliased or: [
-		(self method sendIndexes at: self selector) size > 1 ]
+		(sends > 1 and: [ self index < sends ]) and: [ self isReferenced ] ]
 !
 
 stopOnStepping
@@ -575,23 +602,29 @@ scope: aLexicalScope
 !
 
 temps
-	^temps ifNil: [#()]
+	^ temps ifNil: [ #() ]
 !
 
 temps: aCollection
 	temps := aCollection
 ! !
 
-!SequenceNode methodsFor: 'testing'!
+!SequenceNode methodsFor: 'converting'!
 
 asBlockSequenceNode
-	^BlockSequenceNode new
+	^ BlockSequenceNode new
 		position: self position;
 		nodes: self nodes;
 		temps: self temps;
 		yourself
 ! !
 
+!SequenceNode methodsFor: 'testing'!
+
+isSequenceNode
+	^ true
+! !
+
 !SequenceNode methodsFor: 'visiting'!
 
 accept: aVisitor
@@ -607,7 +640,7 @@ I represent an special sequence node for block scopes.!
 !BlockSequenceNode methodsFor: 'testing'!
 
 isBlockSequenceNode
-	^true
+	^ true
 ! !
 
 !BlockSequenceNode methodsFor: 'visiting'!
@@ -625,7 +658,7 @@ I represent a value node.!
 !ValueNode methodsFor: 'accessing'!
 
 value
-	^value
+	^ value
 !
 
 value: anObject
@@ -639,7 +672,7 @@ isImmutable
 !
 
 isValueNode
-	^true
+	^ true
 ! !
 
 !ValueNode methodsFor: 'visiting'!
@@ -648,11 +681,6 @@ accept: aVisitor
 	^ aVisitor visitValueNode: self
 ! !
 
-!ValueNode methodsFor: 'xxxDoIt'!
-
-xxxDoIt ^[self stack] value
-! !
-
 ValueNode subclass: #VariableNode
 	instanceVariableNames: 'assigned binding'
 	package: 'Compiler-AST'!
@@ -666,7 +694,7 @@ alias
 !
 
 assigned
-	^assigned ifNil: [false]
+	^ assigned ifNil: [ false ]
 !
 
 assigned: aBoolean
@@ -688,8 +716,16 @@ binding: aScopeVar
 
 !VariableNode methodsFor: 'testing'!
 
+isArgument
+	^ self binding isArgVar
+!
+
 isImmutable
-	^ self binding isPseudoVar
+	^ self binding isImmutable
+!
+
+isVariableNode
+	^ true
 ! !
 
 !VariableNode methodsFor: 'visiting'!

+ 26 - 26
st/Compiler-Core.st

@@ -8,16 +8,16 @@ I am the abstract super class of all code generators and provide their common AP
 !AbstractCodeGenerator methodsFor: 'accessing'!
 
 classNameFor: aClass
-	^aClass isMetaclass
-		ifTrue: [aClass instanceClass name, '.klass']
+	^ aClass isMetaclass
+		ifTrue: [ aClass instanceClass name, '.klass' ]
 		ifFalse: [
 		aClass isNil
-			ifTrue: ['nil']
-			ifFalse: [aClass name]]
+			ifTrue: [ 'nil' ]
+			ifFalse: [ aClass name ]]
 !
 
 currentClass
-	^currentClass
+	^ currentClass
 !
 
 currentClass: aClass
@@ -29,13 +29,13 @@ pseudoVariables
 !
 
 safeVariableNameFor: aString
-	^(Smalltalk current reservedWords includes: aString)
-		ifTrue: [aString, '_']
-		ifFalse: [aString]
+	^ (Smalltalk current reservedWords includes: aString)
+		ifTrue: [ aString, '_' ]
+		ifFalse: [ aString ]
 !
 
 source
-	^source ifNil: ['']
+	^ source ifNil: [ '' ]
 !
 
 source: aString
@@ -94,7 +94,7 @@ The default code generator is an instance of `InlinedCodeGenerator`!
 !Compiler methodsFor: 'accessing'!
 
 codeGeneratorClass
-	^codeGeneratorClass ifNil: [InliningCodeGenerator]
+	^ codeGeneratorClass ifNil: [ InliningCodeGenerator ]
 !
 
 codeGeneratorClass: aClass
@@ -102,7 +102,7 @@ codeGeneratorClass: aClass
 !
 
 currentClass
-	^currentClass
+	^ currentClass
 !
 
 currentClass: aClass
@@ -110,7 +110,7 @@ currentClass: aClass
 !
 
 source
-	^source ifNil: ['']
+	^ source ifNil: [ '' ]
 !
 
 source: aString
@@ -118,7 +118,7 @@ source: aString
 !
 
 unknownVariables
-	^unknownVariables
+	^ unknownVariables
 !
 
 unknownVariables: aCollection
@@ -128,25 +128,25 @@ unknownVariables: aCollection
 !Compiler methodsFor: 'compiling'!
 
 compile: aString
-	^self compileNode: (self parse: aString)
+	^ self compileNode: (self parse: aString)
 !
 
 compile: aString forClass: aClass
 	self currentClass: aClass.
 	self source: aString.
-	^self compile: aString
+	^ self compile: aString
 !
 
 compileExpression: aString
 	self currentClass: DoIt.
-	self source: 'doIt ^[', aString, '] value'.
-	^self compileNode: (self parse: self source)
+	self source: 'doIt ^ [ ', aString, ' ] value'.
+	^ self compileNode: (self parse: self source)
 !
 
 compileExpression: aString on: anObject
 	self currentClass: anObject class.
-	self source: 'xxxDoIt ^[', aString, '] value'.
-	^self compileNode: (self parse: self source)
+	self source: 'xxxDoIt ^ [ ', aString, ' ] value'.
+	^ self compileNode: (self parse: self source)
 !
 
 compileNode: aNode
@@ -157,7 +157,7 @@ compileNode: aNode
 		currentClass: self currentClass.
 	result := generator compileNode: aNode.
 	self unknownVariables: #().
-	^result
+	^ result
 !
 
 eval: aString
@@ -177,7 +177,7 @@ evaluateExpression: aString on: anObject
 	anObject class addCompiledMethod: method.
 	result := anObject xxxDoIt.
 	anObject class removeCompiledMethod: method.
-	^result
+	^ result
 !
 
 install: aString forClass: aBehavior category: anotherString
@@ -188,11 +188,11 @@ install: aString forClass: aBehavior category: anotherString
 !
 
 parse: aString
-	^Smalltalk current parse: aString
+	^ Smalltalk current parse: aString
 !
 
 parseExpression: aString
-	^self parse: 'doIt ^[', aString, '] value'
+	^ self parse: 'doIt ^ [ ', aString, ' ] value'
 !
 
 recompile: aClass
@@ -205,7 +205,7 @@ recompile: aClass
 
 recompileAll
 	Smalltalk current classes 
-		do: [:each | self recompile: each ]
+		do: [ :each | self recompile: each ]
 		displayingProgress: 'Compiling all classes...'
 ! !
 
@@ -216,8 +216,8 @@ recompile: aClass
 !
 
 recompileAll
-	Smalltalk current classes do: [:each |
-		self recompile: each]
+	Smalltalk current classes do: [ :each |
+		self recompile: each ]
 ! !
 
 Object subclass: #DoIt

+ 26 - 22
st/Compiler-IR.st

@@ -87,15 +87,15 @@ aliasTemporally: aCollection
 	
 	aCollection withIndexDo: [ :each :i |
 		each subtreeNeedsAliasing
-			ifTrue: [ threshold := i ]].
+			ifTrue: [ threshold := i ] ].
 
 	result := OrderedCollection new.
 	aCollection withIndexDo: [ :each :i |
 		result add: (i <= threshold
 			ifTrue: [ self alias: each ]
-			ifFalse: [ self visit: each ])].
+			ifFalse: [ self visit: each ]) ].
 
-	^result
+	^ result
 !
 
 visitAssignmentNode: aNode
@@ -130,10 +130,10 @@ visitBlockSequenceNode: aNode
 		do: [
 			aNode nodes ifNotEmpty: [
 				aNode nodes allButLast do: [ :each |
-					self sequence add: (self visit: each) ].
+					self sequence add: (self visitOrAlias: each) ].
 				aNode nodes last isReturnNode
-					ifFalse: [ self sequence add: (IRBlockReturn new add: (self visit: aNode nodes last); yourself) ]
-					ifTrue: [ self sequence add: (self visit: aNode nodes last) ]]]
+					ifFalse: [ self sequence add: (IRBlockReturn new add: (self visitOrAlias: aNode nodes last); yourself) ]
+					ifTrue: [ self sequence add: (self visitOrAlias: aNode nodes last) ] ]]
 !
 
 visitCascadeNode: aNode
@@ -157,14 +157,14 @@ visitCascadeNode: aNode
 visitDynamicArrayNode: aNode
 	| array |
 	array := IRDynamicArray new.
-	(self aliasTemporally: aNode nodes) do: [:each | array add: each].
+	(self aliasTemporally: aNode nodes) do: [ :each | array add: each ].
 	^ array
 !
 
 visitDynamicDictionaryNode: aNode
 	| dictionary |
 	dictionary := IRDynamicDictionary new.
-	(self aliasTemporally: aNode nodes) do: [:each | dictionary add: each].
+	(self aliasTemporally: aNode nodes) do: [ :each | dictionary add: each ].
 	^ dictionary
 !
 
@@ -203,6 +203,12 @@ visitMethodNode: aNode
 	^ self method
 !
 
+visitOrAlias: aNode
+	^ aNode shouldBeAliased
+		ifTrue: [ self alias: aNode ]
+		ifFalse: [ self visit: aNode ]
+!
+
 visitReturnNode: aNode
 	| return |
 	return := aNode nonLocalReturn
@@ -237,11 +243,9 @@ visitSequenceNode: aNode
 		withSequence: IRSequence new
 		do: [
 			aNode nodes do: [ :each | | instruction |
-				instruction := each shouldBeAliased
-					ifTrue: [ self alias: each ]
-					ifFalse: [ self visit: each ].
+				instruction := self visitOrAlias: each.
 				instruction isVariable ifFalse: [
-					self sequence add: instruction ]]]
+					self sequence add: instruction ] ]]
 !
 
 visitValueNode: aNode
@@ -730,7 +734,7 @@ I am the simplest possible instruction. I represent a value.!
 !IRValue methodsFor: 'accessing'!
 
 value
-	^value
+	^ value
 !
 
 value: aString
@@ -952,7 +956,7 @@ visitIRDynamicDictionary: anIRDynamicDictionary
 	self stream nextPutAll: 'smalltalk.HashedCollection._from_(['.
 		anIRDynamicDictionary instructions
 			do: [ :each | self visit: each ]
-			separatedBy: [self stream nextPutAll: ',' ].
+			separatedBy: [ self stream nextPutAll: ',' ].
 	self stream nextPutAll: '])'
 !
 
@@ -972,8 +976,8 @@ visitIRMethod: anIRMethod
 				anIRMethod scope hasNonLocalReturn
 					ifTrue: [
 						self stream nextPutNonLocalReturnHandlingWith: [
-							super visitIRMethod: anIRMethod ]]
-					ifFalse: [ super visitIRMethod: anIRMethod ]]]
+							super visitIRMethod: anIRMethod ] ]
+					ifFalse: [ super visitIRMethod: anIRMethod ] ]]
 			arguments: anIRMethod arguments ]
 !
 
@@ -1002,7 +1006,7 @@ visitIRSend: anIRSend
 visitIRSequence: anIRSequence
 	self stream nextPutSequenceWith: [
 		anIRSequence instructions do: [ :each |
-			self stream nextPutStatementWith: (self visit: each) ]]
+			self stream nextPutStatementWith: (self visit: each) ] ]
 !
 
 visitIRTempDeclaration: anIRTempDeclaration
@@ -1107,7 +1111,7 @@ nextPutBlockContextFor: anIRClosure during: aBlock
 			self
 				nextPutAll: each asVariableName;
 				nextPutAll: ':';
-				nextPutAll: each asVariableName]
+				nextPutAll: each asVariableName ]
 		separatedBy: [ self nextPutAll: ',' ].
 	
 	self
@@ -1156,7 +1160,7 @@ nextPutContextFor: aMethod during: aBlock
 			self
 				nextPutAll: each asVariableName;
 				nextPutAll: ':';
-				nextPutAll: each asVariableName]
+				nextPutAll: each asVariableName ]
 		separatedBy: [ self nextPutAll: ',' ].
 	
 	self
@@ -1206,8 +1210,8 @@ nextPutMethodDeclaration: aMethod with: aBlock
 		nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;
 		nextPutAll: 'referencedClasses: ['.
 	aMethod classReferences
-		do: [:each | stream nextPutAll: each asJavascript]
-		separatedBy: [stream nextPutAll: ','].
+		do: [ :each | stream nextPutAll: each asJavascript ]
+		separatedBy: [ stream nextPutAll: ',' ].
 	stream
 		nextPutAll: ']';
 		nextPutAll: '})'
@@ -1262,7 +1266,7 @@ nextPutStatementWith: aBlock
 !
 
 nextPutVars: aCollection
-	aCollection ifEmpty: [ ^self ].
+	aCollection ifEmpty: [ ^ self ].
 	
 	stream nextPutAll: 'var '.
 	aCollection

+ 23 - 11
st/Compiler-Interpreter.st

@@ -95,7 +95,7 @@ forContext: aContext node: aNode
 ! !
 
 MethodContext subclass: #AIContext
-	instanceVariableNames: 'outerContext innerContext pc locals selector index sendIndexes ast interpreter'
+	instanceVariableNames: 'outerContext innerContext pc locals selector index sendIndexes evaluatedSelector ast interpreter'
 	package: 'Compiler-Interpreter'!
 !AIContext commentStamp!
 I am like a `MethodContext`, used by the `ASTInterpreter`.
@@ -105,6 +105,14 @@ When debugging, my instances are created by copying the current `MethodContext`
 
 !AIContext methodsFor: 'accessing'!
 
+evaluatedSelector
+	^ evaluatedSelector
+!
+
+evaluatedSelector: aString
+	evaluatedSelector := aString
+!
+
 index
 	^ index ifNil: [ 0 ]
 !
@@ -135,7 +143,7 @@ localAt: aString ifAbsent: aBlock
 	^ self locals at: aString ifAbsent: [ 
 		self outerContext 
 			ifNotNil: [ :context | context localAt: aString ifAbsent: aBlock ]
-			ifNil: [aBlock value] ]
+			ifNil: [ aBlock value ] ]
 !
 
 localAt: aString put: anObject
@@ -201,6 +209,7 @@ initializeAST
 initializeFromMethodContext: aMethodContext
 
 	self
+		evaluatedSelector: aMethodContext evaluatedSelector;
 		index: aMethodContext index;
 		sendIndexes: aMethodContext sendIndexes;
 		receiver: aMethodContext receiver;
@@ -219,9 +228,8 @@ initializeInterpreter
 		context: self;
 		yourself.
 	
-	(self innerContext notNil and: [ 
-		self innerContext isBlockContext not ]) ifTrue: [
-			self setupInterpreter: interpreter ]
+	self innerContext ifNotNil: [
+		self setupInterpreter: interpreter ]
 !
 
 initializeLocals
@@ -266,7 +274,7 @@ setupInterpreter: anInterpreter
 	
 	"Retrieve the current node"
 	currentNode := ASTPCNodeVisitor new
-			selector: self innerContext selector;
+			selector: self evaluatedSelector;
 			context: self;
 			visit: self ast;
 			currentNode.
@@ -293,9 +301,9 @@ Object subclass: #ASTDebugger
 	package: 'Compiler-Interpreter'!
 !ASTDebugger commentStamp!
 I am a stepping debugger interface for Amber code.
-I internally use an instance of `ASTSteppingInterpreter` to actually step through node and interpret them.
+I internally use an instance of `ASTInterpreter` to actually step through node and interpret them.
 
-My instances are created from a `MethodContext` with `ASTDebugger class >> context:`.
+My instances are created from an `AIContext` with `ASTDebugger class >> context:`.
 They hold an `AIContext` instance internally, recursive copy of the `MethodContext`.
 
 ## API
@@ -377,6 +385,10 @@ restart
 	self interpreter restart
 !
 
+skip
+	self interpreter skip
+!
+
 stepInto
 	self shouldBeImplemented
 !
@@ -474,8 +486,8 @@ next
 proceed
 	"Eagerly evaluate the ast"
 	
-	[ self atEnd ] whileFalse: [ 
-		self step ]
+	[ self atEnd ] 
+		whileFalse: [ self step ]
 !
 
 restart
@@ -701,7 +713,7 @@ visitVariableNode: aNode
 					ifTrue: [
 						Smalltalk current 
 							at: aNode value 
-							ifAbsent: [ PlatformInterface globals at: aNode value ]]]])
+							ifAbsent: [ PlatformInterface globals at: aNode value ] ] ] ])
 ! !
 
 Error subclass: #ASTInterpreterError

+ 17 - 1
st/Compiler-Semantic.st

@@ -246,6 +246,10 @@ isClassRefVar
 	^ false
 !
 
+isImmutable
+	^ false
+!
+
 isInstanceVar
 	^ false
 !
@@ -303,6 +307,10 @@ I am an argument of a method or block.!
 
 isArgVar
 	^ true
+!
+
+isImmutable
+	^ true
 ! !
 
 ScopeVar subclass: #ClassRefVar
@@ -325,6 +333,10 @@ alias
 
 isClassRefVar
 	^ true
+!
+
+isImmutable
+	^ true
 ! !
 
 ScopeVar subclass: #InstanceVar
@@ -359,6 +371,10 @@ alias
 
 !PseudoVar methodsFor: 'testing'!
 
+isImmutable
+	^ true
+!
+
 isPseudoVar
 	^ true
 ! !
@@ -527,7 +543,7 @@ visitMethodNode: aNode
 	aNode scope: currentScope.
 	currentScope node: aNode.
 
-	self theClass allInstanceVariableNames do: [:each |
+	self theClass allInstanceVariableNames do: [ :each |
 		currentScope addIVar: each ].
 	aNode arguments do: [ :each |
 		self validateVariableScope: each.

+ 15 - 0
st/Compiler-Tests.st

@@ -176,6 +176,12 @@ testCascades
 !
 
 testDynamicArrayElementsOrdered
+	self should: 'foo
+	| x |
+	x := 1.
+	^ { x. x := 2 }
+' return: #(1 2).
+
 	self should: 'foo
 	| x |
 	x := 1.
@@ -198,21 +204,30 @@ testGlobalVar
 !
 
 testInnerTemporalDependentElementsOrdered
+	self should: 'foo
+	| x |
+	x := Array.
+	^ x with: ''foo''->x with: ''bar''->(x := 2)
+' return: {'foo'->Array. 'bar'->2}.
+
 	self should: 'foo
 	| x |
 	x := Array.
 	^ x with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
 ' return: {'foo'->Array. 'bar'->2}.
+
 	self should: 'foo
 	| x |
 	x := 1.
 	^ Array with: ''foo''->x with: ''bar''->(true ifTrue: [ x := 2 ])
 ' return: {'foo'->1. 'bar'->2}.
+
 	self should: 'foo
 	| x |
 	x := 1.
 	^ { ''foo''->x. ''bar''->(true ifTrue: [ x := 2 ]) }
 ' return: {'foo'->1. 'bar'->2}.
+
 	self should: 'foo
 	| x |
 	x := 1.

+ 8 - 8
st/Examples.st

@@ -13,12 +13,12 @@ Then take a look in the HTML document above the IDE.
 
 decrease
 	count := count - 1.
-	header contents: [:html | html with: count asString]
+	header contents: [ :html | html with: count asString ]
 !
 
 increase
 	count := count + 1.
-	header contents: [:html | html with: count asString]
+	header contents: [ :html | html with: count asString ]
 ! !
 
 !Counter methodsFor: 'initialization'!
@@ -32,14 +32,14 @@ initialize
 
 renderOn: html
 	header := html h1
-	with: count asString;
-	yourself.
+		with: count asString;
+		yourself.
 	html button
-	with: '++';
-	onClick: [self increase].
+		with: '++';
+		onClick: [ self increase ].
 	html button
-	with: '--';
-	onClick: [self decrease]
+		with: '--';
+		onClick: [ self decrease ]
 ! !
 
 !Counter class methodsFor: 'example'!

+ 15 - 6
st/Helios-Browser.st

@@ -238,7 +238,7 @@ showInstance: aBoolean
 
     	self selectedClass ifNotNil: [
     		self selectedClass: (aBoolean
-    			ifTrue: [self selectedClass theNonMetaClass ]
+    			ifTrue: [ self selectedClass theNonMetaClass ]
 	    	  	ifFalse: [ self selectedClass theMetaClass ]) ].
     
 		self announcer announce: HLShowInstanceToggled new ]
@@ -490,7 +490,7 @@ setItemsForPackage: aPackage
     	ifNil: [ #() ]
   		ifNotNil: [ ((aPackage classes 
         	collect: [ :each | each theNonMetaClass ]) asSet asArray) 
-            	sort: [:a :b | a name < b name ] ]).
+            	sort: [ :a :b | a name < b name ] ]).
 !
 
 setItemsForSelectedPackage
@@ -642,10 +642,8 @@ renderItem: aClass level: anInteger on: html
 	| li |
     
 	li := html li.
-	self registerMappingFrom: aClass to: li.
-	
+	li asJQuery data: 'item' put: aClass.
     li
-    	at: 'list-data' put: (self items indexOf: aClass);
 		class: (self listCssClassForItem: aClass);
 		with: [ 
         	html a
@@ -668,7 +666,7 @@ renderItem: aClass on: html
 renderItemLabel: aClass level: anInteger on: html
 	html span asJQuery html: (String streamContents: [ :str |
 		anInteger timesRepeat: [
-			str nextPutAll: '&nbsp;&nbsp;&nbsp;&nbsp;'].
+			str nextPutAll: '&nbsp;&nbsp;&nbsp;&nbsp;' ].
 			str nextPutAll: aClass name ])
 !
 
@@ -1133,6 +1131,11 @@ observeSystem
     self model systemAnnouncer 
 		on: ClassAdded 
 		send: #onClassAdded:
+		to: self.
+		
+	self model systemAnnouncer
+		on: PackageAdded
+		send: #onPackageAdded:
 		to: self
 !
 
@@ -1158,6 +1161,12 @@ onClassAdded: anAnnouncement
 			refresh ]
 !
 
+onPackageAdded: anAnnouncement
+	self 
+		initializeItems;
+		refresh
+!
+
 onPackageSelected: anAnnouncement
 	| package |
 	

+ 17 - 37
st/Helios-Core.st

@@ -1,5 +1,5 @@
 Smalltalk current createPackage: 'Helios-Core'!
-Object subclass: #HLModel
+InterfacingObject subclass: #HLModel
 	instanceVariableNames: 'announcer environment'
 	package: 'Helios-Core'!
 !HLModel commentStamp!
@@ -191,9 +191,7 @@ saveSourceCode
 !HLToolModel methodsFor: 'commands actions'!
 
 commitPackage
-	"self 
-		withHelperLabelled: 'Committing package ', self selectedPackage name, '...'
-		do: [ "self environment commitPackage: self selectedPackage" ]"
+	self environment commitPackage: self selectedPackage
 !
 
 copyClassTo: aClassName
@@ -348,7 +346,7 @@ withCompileErrorHandling: aBlock
 				self environment 
 					evaluate: aBlock
 					on: ParseError
-					do: [:ex | self handleParseError: ex ] ]
+					do: [ :ex | self handleParseError: ex ] ]
 			on: UnknownVariableError
 			do: [ :ex | self handleUnkownVariableError: ex ] ]
 		on: CompilerError
@@ -737,7 +735,7 @@ hasFocus
 ! !
 
 HLFocusableWidget subclass: #HLListWidget
-	instanceVariableNames: 'items selectedItem mapping'
+	instanceVariableNames: 'items selectedItem'
 	package: 'Helios-Core'!
 
 !HLListWidget methodsFor: 'accessing'!
@@ -746,6 +744,11 @@ cssClassForItem: anObject
 	^ ''
 !
 
+findListItemFor: anObject
+	^ (((wrapper asJQuery find: 'li') 
+		filter: [ :thisArg :otherArg | (thisArg asJQuery data: 'item') = anObject ] currySelf) eq: 0)
+!
+
 items
 	^ items ifNil: [ items := self defaultItems ]
 !
@@ -781,22 +784,20 @@ activateFirstListItem
 !
 
 activateItem: anObject
-	self activateListItem: (mapping 
-		at: anObject
-		ifAbsent: [ ^ self ]) asJQuery
+	self activateListItem: (self findListItemFor: anObject)
 !
 
 activateListItem: aListItem
 	| item |
 	
-	(aListItem get: 0) ifNil: [ ^self ].
+	(aListItem get: 0) ifNil: [ ^ self ].
 	aListItem parent children removeClass: 'active'.
 	aListItem addClass: 'active'.
     
 	self ensureVisible: aListItem.
     
    "Activate the corresponding item"
-   item := (self items at: (aListItem attr: 'list-data') asNumber).
+   item := aListItem data: 'item'.
    self selectedItem == item ifFalse: [
 	   self selectItem: item ]
 !
@@ -817,7 +818,7 @@ ensureVisible: aListItem
 	"Move the scrollbar to show the active element"
 	
 	| parent position |
-	
+	(aListItem get: 0) ifNil: [ ^ self ].
 	position := self positionOf: aListItem.
 	parent := aListItem parent.
 	
@@ -835,10 +836,7 @@ focus
 
 refresh
 	super refresh.
-	
-	self ensureVisible: (mapping 
-		at: self selectedItem
-		ifAbsent: [ ^ self ]) asJQuery
+	self ensureVisible: (self findListItemFor: self selectedItem)
 !
 
 selectItem: anObject
@@ -860,20 +858,6 @@ setupKeyBindings
 		rebindKeys
 ! !
 
-!HLListWidget methodsFor: 'initialization'!
-
-initialize
-	super initialize.
-	
-	mapping := Dictionary new.
-! !
-
-!HLListWidget methodsFor: 'private'!
-
-registerMappingFrom: anObject to: aTag
-	mapping at: anObject put: aTag
-! !
-
 !HLListWidget methodsFor: 'rendering'!
 
 renderButtonsOn: html
@@ -893,10 +877,8 @@ renderItem: anObject on: html
 	| li |
     
 	li := html li.
-	self registerMappingFrom: anObject to: li.
-	
+	li asJQuery data: 'item' put: anObject.
     li
-        at: 'list-data' put: (self items indexOf: anObject) asString;
 		class: (self listCssClassForItem: anObject);
         with: [ 
         	html a
@@ -912,10 +894,8 @@ renderItemLabel: anObject on: html
 !
 
 renderListOn: html
-	mapping := Dictionary new.
-	
-	self items do: [ :each | 
-    	self renderItem: each on: html ]
+	self items do: [ :each  | 
+    	self renderItem: each  on: html ]
 ! !
 
 HLListWidget subclass: #HLNavigationListWidget

+ 16 - 1
st/Helios-Debugger.st

@@ -269,6 +269,13 @@ restart
 		yourself)
 !
 
+skip
+	self interpreter skip.
+	self announcer announce: (HLDebuggerStepped new
+		context: self currentContext;
+		yourself)
+!
+
 stepOver
 	self interpreter stepOver.
 	self announcer announce: (HLDebuggerStepped new
@@ -364,6 +371,10 @@ selectItem: aContext
    	self model currentContext: aContext
 !
 
+skip
+	self model skip
+!
+
 stepOver
 	self model stepOver
 !
@@ -389,6 +400,10 @@ renderButtonsOn: html
 			html button 
 				class: 'btn stepOver';
 				with: 'Step over';
-				onClick: [ self stepOver ] ]
+				onClick: [ self stepOver ].
+			html button 
+				class: 'btn skip';
+				with: 'Skip';
+				onClick: [ self skip ] ]
 ! !
 

+ 12 - 0
st/Helios-Exceptions.st

@@ -2,8 +2,20 @@ Smalltalk current createPackage: 'Helios-Exceptions'!
 Error subclass: #HLError
 	instanceVariableNames: ''
 	package: 'Helios-Exceptions'!
+!HLError commentStamp!
+I am the abstract superclass of all Helios-specific errors.!
 
 HLError subclass: #HLChangeForbidden
 	instanceVariableNames: ''
 	package: 'Helios-Exceptions'!
+!HLChangeForbidden commentStamp!
+I get signaled when a (often user) requested change is forbidden. A confirmation message can then be displayed to the user.
+
+See `HLModel >> withChangesDo:`.!
+
+HLError subclass: #HLListItemNotFound
+	instanceVariableNames: ''
+	package: 'Helios-Exceptions'!
+!HLListItemNotFound commentStamp!
+I get signaled by a `HLListWidget` when a non-existing item in the list is activated.!
 

+ 5 - 5
st/Helios-Inspector.st

@@ -26,8 +26,8 @@ selectionDisplayString
 	|selection|
 	selection := model selection.
     ^ (model variables keys includes: selection)
-    	ifTrue:[(model instVarObjectAt: selection) printString]
-      	ifFalse:['']
+    	ifTrue:[ (model instVarObjectAt: selection) printString ]
+      	ifFalse:[ '' ]
 ! !
 
 Object subclass: #HLInspectorModel
@@ -37,7 +37,7 @@ Object subclass: #HLInspectorModel
 !HLInspectorModel methodsFor: 'accessing'!
 
 announcer
-	^ announcer ifNil: [announcer := Announcer new ]
+	^ announcer ifNil: [ announcer := Announcer new ]
 !
 
 code
@@ -417,8 +417,8 @@ tabPriority
 
 inspect: anObject
 	self new
-		inspect: anObject;
-		openAsTab
+		openAsTab;
+		inspect: anObject
 ! !
 
 !HLInspector class methodsFor: 'initialization'!

+ 1 - 1
st/Helios-KeyBindings.st

@@ -294,7 +294,7 @@ errorStatus
 evaluate: aString	
 	[ self callback value: aString ]
 		on: Error
-		do: [:ex |
+		do: [ :ex |
 			self input asJQuery 
 				one: 'keydown' 
 				do: [ self clearStatus ].

+ 11 - 22
st/Helios-References.st

@@ -293,16 +293,8 @@ allSelectors
 classReferencesOf: aString
 	"Answer all methods referencing the class named aString"
 	
-	| references |
-	
-	references := OrderedCollection new.
-	
-	self classesAndMetaclasses do: [ :each |
-		each methodDictionary values do: [ :method |
-			(method referencedClasses includes: aString) ifTrue: [
-				references add: method ] ] ].
-				
-	^ references
+	^self allMethods select: [ :each |
+			(each referencedClasses includes: aString) ].
 !
 
 classesAndMetaclasses
@@ -345,13 +337,11 @@ search: aString
 
 classesAndMetaclassesCache
 	classesAndMetaclassesCache ifNil: [ self updateClassesAndMetaclassesCache ].
-	
 	^ classesAndMetaclassesCache
 !
 
 methodsCache
 	methodsCache ifNil: [ self updateMethodsCache ].
-	
 	^ methodsCache
 !
 
@@ -362,20 +352,19 @@ updateCaches
 !
 
 updateClassesAndMetaclassesCache
-	classesAndMetaclassesCache := self environment classes 
-		inject: OrderedCollection new 
-		into: [ :acc :each |
-			acc 
+	classesAndMetaclassesCache := OrderedCollection new.
+	
+	self environment classes do: [ :each |
+		classesAndMetaclassesCache
 				add: each; 
-				add: each class;
-				yourself ]
+				add: each class ]
 !
 
 updateMethodsCache
-	methodsCache := self classesAndMetaclasses
-		inject: OrderedCollection new
-		into: [ :acc :each |
-			acc, each methods ]
+	methodsCache := OrderedCollection new.
+	
+	self classesAndMetaclasses
+		do: [ :each | methodsCache addAll: each methods ]
 ! !
 
 !HLReferencesModel methodsFor: 'testing'!

+ 24 - 11
st/Helios-Workspace.st

@@ -39,7 +39,7 @@ inspect: anObject
 !HLCodeModel methodsFor: 'defaults'!
 
 defaultReceiver
-	^ DoIt new
+	^ self environment doItReceiver
 ! !
 
 !HLCodeModel class methodsFor: 'actions'!
@@ -189,9 +189,9 @@ print: aString
 printIt
 	| result |
 
-	result:=  self doIt.       
+	result := self doIt.       
 	self model announcer announce: (HLPrintItRequested on: model).
-    self print: result printString.
+	self print: result printString.
 	
 	self focus.
 !
@@ -234,7 +234,7 @@ onChange
 
 onDoIt
 	
-    self doIt
+	self doIt
 !
 
 onInspectIt
@@ -420,8 +420,8 @@ setupCodeMirror
 	< 
 		CodeMirror.keyMap.default.fallthrough = ["basic"];
 		CodeMirror.commands.autocomplete = function(cm) {
-        	CodeMirror.showHint(cm, self._hintFor_options_);
-      	}
+			CodeMirror.showHint(cm, self._hintFor_options_);
+		}
 	>
 !
 
@@ -550,6 +550,10 @@ observeBrowserModel
 		send: #onClassSelected:
 		to: self;
 		
+		on: HLPackageSelected 
+		send: #onPackageSelected:
+		to: self;
+		
     	on: HLProtocolSelected 
 		send: #onProtocolSelected: 
 		to: self;
@@ -618,7 +622,7 @@ onClassSelected: anAnnouncement
 	class:= anAnnouncement item.
 	
 	class ifNil: [ ^ self contents: '' ].
-    self contents: class definition
+	self contents: class definition
 !
 
 onCompileError: anAnnouncement
@@ -636,7 +640,7 @@ onMethodModified: anAnnouncement
 	
 	self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].
 	self browserModel selectedMethod ifNil: [ ^ self ].
-    self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].
+	self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].
 
 	self refresh
 !
@@ -647,7 +651,16 @@ onMethodSelected: anAnnouncement
 	method := anAnnouncement item.
 	
 	method ifNil: [ ^ self contents: '' ].
-    self contents: method source
+	self contents: method source
+!
+
+onPackageSelected: anAnnouncement
+	| package |
+	
+	package := anAnnouncement item.
+	
+	package ifNil: [ ^ self contents: '' ].
+	self contents: package definition
 !
 
 onParseError: anAnnouncement
@@ -672,7 +685,7 @@ onParseError: anAnnouncement
 
 onProtocolSelected: anAnnouncement
 	self browserModel selectedClass ifNil: [ ^ self contents: '' ].
-    self contents: self browserModel selectedClass definition
+	self contents: self browserModel selectedClass definition
 !
 
 onSaveIt
@@ -682,7 +695,7 @@ onSaveIt
 onShowInstanceToggled
 	self browserModel selectedClass ifNil: [ ^ self contents: '' ].
     
-    self contents: self browserModel selectedClass definition
+	self contents: self browserModel selectedClass definition
 !
 
 onSourceCodeFocusRequested

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 214 - 214
st/IDE.st


+ 62 - 40
st/Importer-Exporter.st

@@ -37,7 +37,7 @@ extensionProtocolsOfPackage: aPackage
 			(behavior protocols includes: extensionName) ifTrue: [
 				result add: (ExportMethodProtocol name: extensionName theClass: behavior) ] ] ].
 
-	^result
+	^ result
 ! !
 
 !AbstractExporter methodsFor: 'convenience'!
@@ -45,11 +45,11 @@ extensionProtocolsOfPackage: aPackage
 chunkEscape: aString
 	"Replace all occurrences of !! with !!!! and trim at both ends."
 
-	^(aString replace: '!!' with: '!!!!') trimBoth
+	^ (aString replace: '!!' with: '!!!!') trimBoth
 !
 
 classNameFor: aClass
-	^aClass isMetaclass
+	^ aClass isMetaclass
 		ifTrue: [ aClass instanceClass name, ' class' ]
 		ifFalse: [
 			aClass isNil
@@ -84,9 +84,9 @@ extensionCategoriesOfPackage: aPackage
 			map := Dictionary new.
 			aClass protocolsDo: [ :category :methods |
 				category = ('*', name) ifTrue: [ map at: category put: methods ] ].
-			result addAll: ((map keys sorted: [:a :b | a <= b ]) collect: [ :category |
+			result addAll: ((map keys sorted: [ :a :b | a <= b ]) collect: [ :category |
 				MethodCategory name: category theClass: aClass methods: (map at: category) ]) ] ].
-	^result
+	^ result
 !
 
 ownCategoriesOfClass: aClass
@@ -98,14 +98,14 @@ ownCategoriesOfClass: aClass
 	map := Dictionary new.
 	aClass protocolsDo: [ :each :methods |
 		(each match: '^\*') ifFalse: [ map at: each put: methods ] ].
-	^(map keys sorted: [:a :b | a <= b ]) collect: [ :each |
+	^ (map keys sorted: [ :a :b | a <= b ]) collect: [ :each |
 		MethodCategory name: each theClass: aClass methods: (map at: each) ]
 !
 
 ownCategoriesOfMetaClass: aClass
 	"Issue #143: sort protocol alphabetically"
 
-	^self ownCategoriesOfClass: aClass class
+	^ self ownCategoriesOfClass: aClass class
 !
 
 ownMethodProtocolsOfClass: aClass
@@ -135,15 +135,15 @@ exportDefinitionOf: aClass on: aStream
 		nextPutAll: ' subclass: #', (self classNameFor: aClass); lf;
 		tab; nextPutAll: 'instanceVariableNames: '''.
 	aClass instanceVariableNames
-		do: [:each | aStream nextPutAll: each]
-		separatedBy: [aStream nextPutAll: ' '].
+		do: [ :each | aStream nextPutAll: each ]
+		separatedBy: [ aStream nextPutAll: ' ' ].
 	aStream
 		nextPutAll: ''''; lf;
 		tab; nextPutAll: 'package: ''', aClass category, '''!!'; lf.
 	aClass comment notEmpty ifTrue: [
 		aStream
 		nextPutAll: '!!', (self classNameFor: aClass), ' commentStamp!!';lf;
-		nextPutAll: (self chunkEscape: aClass comment), '!!';lf].
+		nextPutAll: (self chunkEscape: aClass comment), '!!';lf ].
 	aStream lf
 !
 
@@ -154,10 +154,10 @@ exportMetaDefinitionOf: aClass on: aStream
 			nextPutAll: (self classNameFor: aClass class);
 			nextPutAll: ' instanceVariableNames: '''.
 		aClass class instanceVariableNames
-			do: [:each | aStream nextPutAll: each]
-			separatedBy: [aStream nextPutAll: ' '].
+			do: [ :each | aStream nextPutAll: each ]
+			separatedBy: [ aStream nextPutAll: ' ' ].
 		aStream
-			nextPutAll: '''!!'; lf; lf]
+			nextPutAll: '''!!'; lf; lf ]
 !
 
 exportMethod: aMethod on: aStream
@@ -233,20 +233,20 @@ I am typically used to save code outside of the Amber runtime (committing to dis
 ownMethodsOfClass: aClass
 	"Issue #143: sort methods alphabetically"
 
-	^((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector])
-		reject: [:each | (each category match: '^\*')]
+	^ ((aClass methodDictionary values) sorted: [ :a :b | a selector <= b selector ])
+		reject: [ :each | (each category match: '^\*') ]
 !
 
 ownMethodsOfMetaClass: aClass
 	"Issue #143: sort methods alphabetically"
 
-	^self ownMethodsOfClass: aClass class
+	^ self ownMethodsOfClass: aClass class
 ! !
 
 !Exporter methodsFor: 'convenience'!
 
 classNameFor: aClass
-	^aClass isMetaclass
+	^ aClass isMetaclass
 		ifTrue: [ aClass instanceClass name, '.klass' ]
 		ifFalse: [
 			aClass isNil
@@ -264,8 +264,8 @@ exportDefinitionOf: aClass on: aStream
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass superclass);
 		nextPutAll: ', ['.
 	aClass instanceVariableNames
-		do: [:each | aStream nextPutAll: '''', each, '''']
-		separatedBy: [aStream nextPutAll: ', '].
+		do: [ :each | aStream nextPutAll: '''', each, '''' ]
+		separatedBy: [ aStream nextPutAll: ', ' ].
 	aStream
 		nextPutAll: '], ''';
 		nextPutAll: aClass category, '''';
@@ -277,7 +277,7 @@ exportDefinitionOf: aClass on: aStream
 		nextPutAll: (self classNameFor: aClass);
 		nextPutAll: '.comment=';
 		nextPutAll: aClass comment asJavascript;
-		nextPutAll: ';'].
+		nextPutAll: ';' ].
 	aStream lf
 !
 
@@ -288,9 +288,9 @@ exportMetaDefinitionOf: aClass on: aStream
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass class);
 		nextPutAll: '.iVarNames = ['.
 		aClass class instanceVariableNames
-		do: [:each | aStream nextPutAll: '''', each, '''']
-		separatedBy: [aStream nextPutAll: ','].
-		aStream nextPutAll: '];', String lf]
+		do: [ :each | aStream nextPutAll: '''', each, '''' ]
+		separatedBy: [ aStream nextPutAll: ',' ].
+		aStream nextPutAll: '];', String lf ]
 !
 
 exportMethod: aMethod on: aStream
@@ -436,20 +436,20 @@ nextChunk
 
 	| char result chunk |
 	result := '' writeStream.
-		[char := stream next.
-		char notNil] whileTrue: [
+		[ char := stream next.
+		char notNil ] whileTrue: [
 				char = '!!' ifTrue: [
 						stream peek = '!!'
-								ifTrue: [stream next "skipping the escape double"]
-								ifFalse: [^result contents trimBoth "chunk end marker found"]].
-				result nextPut: char].
-	^nil "a chunk needs to end with !!"
+								ifTrue: [ stream next "skipping the escape double" ]
+								ifFalse: [ ^ result contents trimBoth "chunk end marker found" ]].
+				result nextPut: char ].
+	^ nil "a chunk needs to end with !!"
 ! !
 
 !ChunkParser class methodsFor: 'instance creation'!
 
 on: aStream
-	^self new stream: aStream
+	^ self new stream: aStream
 ! !
 
 Object subclass: #ExportMethodProtocol
@@ -469,7 +469,7 @@ methods
 !
 
 name
-	^name
+	^ name
 !
 
 name: aString
@@ -477,7 +477,7 @@ name: aString
 !
 
 theClass
-	^theClass
+	^ theClass
 !
 
 theClass: aClass
@@ -487,7 +487,7 @@ theClass: aClass
 !ExportMethodProtocol class methodsFor: 'instance creation'!
 
 name: aString theClass: aClass
-	^self new
+	^ self new
 		name: aString;
 		theClass: aClass;
 		yourself
@@ -509,16 +509,16 @@ import: aStream
 	| chunk result parser lastEmpty |
 	parser := ChunkParser on: aStream.
 	lastEmpty := false.
-	[chunk := parser nextChunk.
-	chunk isNil] whileFalse: [
+	[ chunk := parser nextChunk.
+	chunk isNil ] whileFalse: [
 		chunk isEmpty
-			ifTrue: [lastEmpty := true]
+			ifTrue: [ lastEmpty := true ]
 			ifFalse: [
 				result := Compiler new evaluateExpression: chunk.
 				lastEmpty
 						ifTrue: [
 									lastEmpty := false.
-									result scanFrom: parser]]]
+									result scanFrom: parser ]] ]
 ! !
 
 InterfacingObject subclass: #PackageHandler
@@ -599,7 +599,7 @@ ajaxPutAt: aURL data: aString
 			'type' -> 'PUT'.
 			'data' -> aString.
 			'contentType' -> 'text/plain;charset=UTF-8'.
-			'error' -> [ :xhr | self error: 'Commiting ' , aURL , ' failed with reason: "' , (xhr responseText) , '"'] }
+			'error' -> [ :xhr | self alert: 'Commiting ' , aURL , ' failed with reason: "' , (xhr responseText) , '"' ] }
 ! !
 
 PackageHandler subclass: #AmdPackageHandler
@@ -613,12 +613,12 @@ I should not be used directly. Instead, use the corresponding `Package` methods.
 !AmdPackageHandler methodsFor: 'accessing'!
 
 commitPathJsFor: aPackage
-	^self toUrl: (self namespaceFor: aPackage)
+	^ self toUrl: (self namespaceFor: aPackage)
 !
 
 commitPathStFor: aPackage
 	"if _source is not mapped, .st commit will likely fail"
-	^self toUrl: (self namespaceFor: aPackage), '/_source'.
+	^ self toUrl: (self namespaceFor: aPackage), '/_source'.
 !
 
 exporterClass
@@ -663,6 +663,10 @@ commitHandlerClass
 	self subclassResponsibility
 !
 
+definition
+	^ ''
+!
+
 package
 	^ package
 !
@@ -763,6 +767,14 @@ commitHandlerClass
 	^ AmdPackageHandler
 !
 
+definition
+	^ String streamContents: [ :stream |
+		stream 
+			nextPutAll: self class name;
+			nextPutAll: ' namespace: ';
+			nextPutAll: '''', self namespace, '''' ]
+!
+
 namespace
 	^ namespace ifNil: [ self defaultNamespace ]
 !
@@ -791,6 +803,16 @@ setupFromJson: anObject
 	self namespace: (anObject at: 'amdNamespace')
 ! !
 
+!AmdPackageTransport methodsFor: 'printing'!
+
+printOn: aStream
+	super printOn: aStream.
+	aStream
+		nextPutAll: ' (AMD Namespace: ';
+		nextPutAll: self namespace;
+		nextPutAll: ')'
+! !
+
 !AmdPackageTransport class methodsFor: 'accessing'!
 
 type

+ 1 - 1
st/Kernel-Announcements.st

@@ -46,7 +46,7 @@ valuable: aValuable
 
 deliver: anAnnouncement
 	(self handlesAnnouncement: anAnnouncement)
-		ifTrue: [self valuable value: anAnnouncement]
+		ifTrue: [ self valuable value: anAnnouncement ]
 !
 
 handlesAnnouncement: anAnnouncement

+ 45 - 45
st/Kernel-Classes.st

@@ -22,8 +22,8 @@ allInstanceVariableNames
 	| result |
 	result := self instanceVariableNames copy.
 	self superclass ifNotNil: [
-		result addAll: self superclass allInstanceVariableNames].
-	^result
+		result addAll: self superclass allInstanceVariableNames ].
+	^ result
 !
 
 allSelectors
@@ -56,7 +56,7 @@ allSuperclasses
 !
 
 comment
-	^(self basicAt: 'comment') ifNil: ['']
+	^ (self basicAt: 'comment') ifNil: [ '' ]
 !
 
 comment: aString
@@ -68,13 +68,13 @@ comment: aString
 !
 
 commentStamp
-	^ClassCommentReader new
+	^ ClassCommentReader new
 	class: self;
 	yourself
 !
 
 commentStamp: aStamp prior: prior
-		^self commentStamp
+		^ self commentStamp
 !
 
 definition
@@ -134,14 +134,14 @@ methods
 !
 
 methodsFor: aString
-	^ClassCategoryReader new
+	^ ClassCategoryReader new
 		class: self category: aString;
 		yourself
 !
 
 methodsFor: aString stamp: aStamp
 	"Added for compatibility, right now ignores stamp."
-	^self methodsFor: aString
+	^ self methodsFor: aString
 !
 
 methodsInProtocol: aString
@@ -201,7 +201,7 @@ theNonMetaClass
 !
 
 withAllSubclasses
-	^(Array with: self) addAll: self allSubclasses; yourself
+	^ (Array with: self) addAll: self allSubclasses; yourself
 ! !
 
 !Behavior methodsFor: 'compiling'!
@@ -277,11 +277,11 @@ protocolsDo: aBlock
 
 	| methodsByCategory |
 	methodsByCategory := HashedCollection new.
-	self methodDictionary values do: [:m |
-		(methodsByCategory at: m category ifAbsentPut: [Array new])
-			add: m].
-	self protocols do: [:category |
-		aBlock value: category value: (methodsByCategory at: category)]
+	self methodDictionary values do: [ :m |
+		(methodsByCategory at: m category ifAbsentPut: [ Array new ])
+			add: m ].
+	self protocols do: [ :category |
+		aBlock value: category value: (methodsByCategory at: category) ]
 ! !
 
 !Behavior methodsFor: 'instance creation'!
@@ -291,7 +291,7 @@ basicNew
 !
 
 new
-	^self basicNew initialize
+	^ self basicNew initialize
 ! !
 
 !Behavior methodsFor: 'private'!
@@ -307,8 +307,8 @@ basicRemoveCompiledMethod: aMethod
 !Behavior methodsFor: 'testing'!
 
 canUnderstand: aSelector
-	^(self methodDictionary keys includes: aSelector asString) or: [
-		self superclass notNil and: [self superclass canUnderstand: aSelector]]
+	^ (self methodDictionary keys includes: aSelector asString) or: [
+		self superclass notNil and: [ self superclass canUnderstand: aSelector ]]
 !
 
 includesBehavior: aClass
@@ -343,7 +343,7 @@ Class creation is done throught a `ClassBuilder` instance.!
 !Class methodsFor: 'accessing'!
 
 category
-	^self package ifNil: ['Unclassified'] ifNotNil: [self package name]
+	^ self package ifNil: [ 'Unclassified' ] ifNotNil: [ self package name ]
 !
 
 definition
@@ -397,22 +397,22 @@ subclasses
 
 subclass: aString instanceVariableNames: anotherString
 	"Kept for compatibility."
-	^self subclass: aString instanceVariableNames: anotherString package: nil
+	^ self subclass: aString instanceVariableNames: anotherString package: nil
 !
 
 subclass: aString instanceVariableNames: aString2 category: aString3
 	"Kept for compatibility."
 	self deprecatedAPI.
-	^self subclass: aString instanceVariableNames: aString2 package: aString3
+	^ self subclass: aString instanceVariableNames: aString2 package: aString3
 !
 
 subclass: aString instanceVariableNames: aString2 classVariableNames: classVars poolDictionaries: pools category: aString3
 	"Just ignore class variables and pools. Added for compatibility."
-	^self subclass: aString instanceVariableNames: aString2 package: aString3
+	^ self subclass: aString instanceVariableNames: aString2 package: aString3
 !
 
 subclass: aString instanceVariableNames: aString2 package: aString3
-	^ClassBuilder new
+	^ ClassBuilder new
 		superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
 ! !
 
@@ -431,7 +431,7 @@ printOn: aStream
 !Class methodsFor: 'testing'!
 
 isClass
-	^true
+	^ true
 ! !
 
 Behavior subclass: #Metaclass
@@ -495,7 +495,7 @@ printOn: aStream
 !Metaclass methodsFor: 'testing'!
 
 isMetaclass
-	^true
+	^ true
 ! !
 
 Object subclass: #ClassBuilder
@@ -509,7 +509,7 @@ Rather than using me directly to compile a class, use `Class >> subclass:instanc
 !ClassBuilder methodsFor: 'accessing'!
 
 instanceVariableNamesFor: aString
-	^(aString tokenize: ' ') reject: [ :each | each isEmpty ]
+	^ (aString tokenize: ' ') reject: [ :each | each isEmpty ]
 ! !
 
 !ClassBuilder methodsFor: 'class definition'!
@@ -547,7 +547,7 @@ class: aClass instanceVariableNames: ivarNames
 !
 
 superclass: aClass subclass: className
-	^self superclass: aClass subclass: className instanceVariableNames: '' package: nil
+	^ self superclass: aClass subclass: className instanceVariableNames: '' package: nil
 !
 
 superclass: aClass subclass: className instanceVariableNames: ivarNames package: packageName
@@ -555,7 +555,7 @@ superclass: aClass subclass: className instanceVariableNames: ivarNames package:
 	
 	newClass := self addSubclassOf: aClass
 		named: className instanceVariableNames: (self instanceVariableNamesFor: ivarNames)
-		package: (packageName ifNil: ['unclassified']).
+		package: (packageName ifNil: [ 'unclassified' ]).
 	self setupClass: newClass.
 	
 	SystemAnnouncer current
@@ -563,7 +563,7 @@ superclass: aClass subclass: className instanceVariableNames: ivarNames package:
 			theClass: newClass;
 			yourself).
 	
-	^newClass
+	^ newClass
 ! !
 
 !ClassBuilder methodsFor: 'class migration'!
@@ -613,7 +613,7 @@ migrateClassNamed: className superclass: aClass instanceVariableNames: aCollecti
 		oldClass: oldClass;
 		yourself).
 	
-	^newClass
+	^ newClass
 !
 
 renameClass: aClass to: className
@@ -646,7 +646,7 @@ copyClass: aClass named: className
 			theClass: newClass;
 			yourself).
 	
-	^newClass
+	^ newClass
 !
 
 copyClass: aClass to: anotherClass
@@ -670,7 +670,7 @@ installMethod: aCompiledMethod forClass: aBehavior category: aString
 	aCompiledMethod category: aString.
 	aBehavior addCompiledMethod: aCompiledMethod.
 	self setupClass: aBehavior.
-	^aCompiledMethod
+	^ aCompiledMethod
 ! !
 
 !ClassBuilder methodsFor: 'private'!
@@ -688,7 +688,7 @@ basicClass: aClass instanceVariableNames: aString
 
 basicClass: aClass instanceVariables: aCollection
 
-	aClass isMetaclass ifFalse: [self error: aClass name, ' is not a metaclass'].
+	aClass isMetaclass ifFalse: [ self error: aClass name, ' is not a metaclass' ].
 	aClass basicAt: 'iVarNames' put: aCollection
 !
 
@@ -746,9 +746,9 @@ class: aClass category: aString
 
 scanFrom: aChunkParser
 	| chunk |
-	[chunk := aChunkParser nextChunk.
-	chunk isEmpty] whileFalse: [
-		self compileMethod: chunk].
+	[ chunk := aChunkParser nextChunk.
+	chunk isEmpty ] whileFalse: [
+		self compileMethod: chunk ].
 	ClassBuilder new setupClass: class
 ! !
 
@@ -784,7 +784,7 @@ scanFrom: aChunkParser
 	| chunk |
 	chunk := aChunkParser nextChunk.
 	chunk isEmpty ifFalse: [
-		self setComment: chunk].
+		self setComment: chunk ].
 ! !
 
 !ClassCommentReader methodsFor: 'initialization'!
@@ -813,16 +813,16 @@ getNodesFrom: aCollection
 	| children others |
 	children := #().
 	others := #().
-	aCollection do: [:each |
+	aCollection do: [ :each |
 		(each superclass = self theClass)
-			ifTrue: [children add: each]
-			ifFalse: [others add: each]].
-	nodes:= children collect: [:each |
-		ClassSorterNode on: each classes: others level: self level + 1]
+			ifTrue: [ children add: each ]
+			ifFalse: [ others add: each ]].
+	nodes:= children collect: [ :each |
+		ClassSorterNode on: each classes: others level: self level + 1 ]
 !
 
 level
-	^level
+	^ level
 !
 
 level: anInteger
@@ -830,11 +830,11 @@ level: anInteger
 !
 
 nodes
-	^nodes
+	^ nodes
 !
 
 theClass
-	^theClass
+	^ theClass
 !
 
 theClass: aClass
@@ -847,14 +847,14 @@ traverseClassesWith: aCollection
 	"sort classes alphabetically Issue #143"
 
 	aCollection add: self theClass.
-	(self nodes sorted: [:a :b | a theClass name <= b theClass name ]) do: [:aNode |
+	(self nodes sorted: [ :a :b | a theClass name <= b theClass name ]) do: [ :aNode |
 		aNode traverseClassesWith: aCollection ].
 ! !
 
 !ClassSorterNode class methodsFor: 'instance creation'!
 
 on: aClass classes: aCollection level: anInteger
-	^self new
+	^ self new
 		theClass: aClass;
 		level: anInteger;
 		getNodesFrom: aCollection;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 172 - 172
st/Kernel-Collections.st


+ 10 - 10
st/Kernel-Exceptions.st

@@ -21,7 +21,7 @@ jsStack
 !
 
 messageText
-	^messageText
+	^ messageText
 !
 
 messageText: aString
@@ -66,11 +66,11 @@ heliosClass
 !Error class methodsFor: 'instance creation'!
 
 signal
-	^self new signal
+	^ self new signal
 !
 
 signal: aString
-		^self new
+	^ self new
 		signal: aString
 ! !
 
@@ -126,7 +126,7 @@ This exception is provided to support `Object>>doesNotUnderstand:`.!
 !MessageNotUnderstood methodsFor: 'accessing'!
 
 message
-	^message
+	^ message
 !
 
 message: aMessage
@@ -134,11 +134,11 @@ message: aMessage
 !
 
 messageText
-	^self receiver asString, ' does not understand #', self message selector
+	^ self receiver asString, ' does not understand #', self message selector
 !
 
 receiver
-	^receiver
+	^ receiver
 !
 
 receiver: anObject
@@ -177,7 +177,7 @@ The default behavior is to log the error and the context stack to the JavaScript
 !ErrorHandler methodsFor: 'error handling'!
 
 handleError: anError
-	anError context ifNotNil: [self logErrorContext: anError context].
+	anError context ifNotNil: [ self logErrorContext: anError context ].
 	self logError: anError
 ! !
 
@@ -189,7 +189,7 @@ log: aString
 
 logContext: aContext
 	aContext home ifNotNil: [
-		self logContext: aContext home].
+		self logContext: aContext home ].
 	self log: aContext asString
 !
 
@@ -200,7 +200,7 @@ logError: anError
 logErrorContext: aContext
 	aContext ifNotNil: [
 		aContext home ifNotNil: [
-			self logContext: aContext home]]
+			self logContext: aContext home ]]
 ! !
 
 ErrorHandler class instanceVariableNames: 'current'!
@@ -208,7 +208,7 @@ ErrorHandler class instanceVariableNames: 'current'!
 !ErrorHandler class methodsFor: 'accessing'!
 
 current
-	^current ifNil: [current := self new]
+	^ current ifNil: [ current := self new ]
 !
 
 setCurrent: anHandler

+ 89 - 43
st/Kernel-Infrastructure.st

@@ -46,19 +46,19 @@ I am superclass of all object that interface with user or environment. `Widget`
 !InterfacingObject methodsFor: 'actions'!
 
 ajax: anObject
-	^PlatformInterface ajax: anObject
+	^ PlatformInterface ajax: anObject
 !
 
 alert: aString
-	^PlatformInterface alert: aString
+	^ PlatformInterface alert: aString
 !
 
 confirm: aString
-	^PlatformInterface confirm: aString
+	^ PlatformInterface confirm: aString
 !
 
 prompt: aString
-	^PlatformInterface prompt: aString
+	^ PlatformInterface prompt: aString
 ! !
 
 InterfacingObject subclass: #Environment
@@ -106,6 +106,10 @@ classes
 	^ Smalltalk current classes
 !
 
+doItReceiver
+	^ DoIt new
+!
+
 packages
 	^ Smalltalk current packages
 !
@@ -309,7 +313,7 @@ at: aString put: anObject
 !
 
 jsObject
-	^jsObject
+	^ jsObject
 !
 
 jsObject: aJSObject
@@ -334,6 +338,12 @@ value
 
 !JSObjectProxy methodsFor: 'enumerating'!
 
+asJSON
+	"Answers the receiver in a stringyfy-friendly fashion"
+
+	^ jsObject
+!
+
 keysAndValuesDo: aBlock
 	<
 		var o = self['@jsObject'];
@@ -395,7 +405,7 @@ inspectOn: anInspector
 !JSObjectProxy class methodsFor: 'instance creation'!
 
 on: aJSObject
-	^self new
+	^ self new
 		jsObject: aJSObject;
 		yourself
 ! !
@@ -489,6 +499,18 @@ basicTransport
 	<return self.transport>
 !
 
+definition
+	^ String streamContents: [ :stream |
+		stream 
+			nextPutAll: self class name;
+			nextPutAll: String lf, String tab;
+			nextPutAll: ' named: ';
+			nextPutAll: '''', self name, '''';
+			nextPutAll: String lf, String tab;
+			nextPutAll:  ' transport: (';
+			nextPutAll: self transport definition, ')' ]
+!
+
 name
 	<return self.pkgName>
 !
@@ -509,7 +531,8 @@ transport
 !
 
 transport: aPackageTransport
-	transport := aPackageTransport
+	transport := aPackageTransport.
+	aPackageTransport package: self
 ! !
 
 !Package methodsFor: 'classes'!
@@ -538,7 +561,7 @@ loadDependencies
 	
 	| classes packages |
 	classes := self loadDependencyClasses.
-	^(classes collect: [ :each | each package ]) asSet
+	^ (classes collect: [ :each | each package ]) asSet
 		remove: self ifAbsent: [];
 		yourself
 !
@@ -550,7 +573,7 @@ loadDependencyClasses
 	
 	| starCategoryName |
 	starCategoryName := '*', self name.
-	^(self classes collect: [ :each | each superclass ]) asSet
+	^ (self classes collect: [ :each | each superclass ]) asSet
 		remove: nil ifAbsent: [];
 		addAll: (Smalltalk current classes select: [ :each | each protocols includes: starCategoryName ]);
 		yourself
@@ -577,13 +600,23 @@ Package class instanceVariableNames: 'defaultCommitPathJs defaultCommitPathSt'!
 !Package class methodsFor: 'accessing'!
 
 named: aPackageName
-
-	^Smalltalk current packageAt: aPackageName
+	^ Smalltalk current 
+		packageAt: aPackageName
+		ifAbsent: [ 
+			Smalltalk current createPackage: aPackageName ]
 !
 
 named: aPackageName ifAbsent: aBlock
+	^ Smalltalk current packageAt: aPackageName ifAbsent: aBlock
+!
 
-	^Smalltalk current packageAt: aPackageName ifAbsent: aBlock
+named: aPackageName transport: aTransport
+	| package |
+	
+	package := self named: aPackageName.
+	package transport: aTransport.
+	
+	^ package
 ! !
 
 !Package class methodsFor: 'sorting'!
@@ -594,17 +627,17 @@ sortedClasses: classes
 	| children others nodes expandedClasses |
 	children := #().
 	others := #().
-	classes do: [:each |
+	classes do: [ :each |
 		(classes includes: each superclass)
-			ifFalse: [children add: each]
-			ifTrue: [others add: each]].
-	nodes := children collect: [:each |
-		ClassSorterNode on: each classes: others level: 0].
-	nodes := nodes sorted: [:a :b | a theClass name <= b theClass name ].
+			ifFalse: [ children add: each ]
+			ifTrue: [ others add: each ]].
+	nodes := children collect: [ :each |
+		ClassSorterNode on: each classes: others level: 0 ].
+	nodes := nodes sorted: [ :a :b | a theClass name <= b theClass name ].
 	expandedClasses := Array new.
-	nodes do: [:aNode |
-		aNode traverseClassesWith: expandedClasses].
-	^expandedClasses
+	nodes do: [ :aNode |
+		aNode traverseClassesWith: expandedClasses ].
+	^ expandedClasses
 ! !
 
 Object subclass: #PlatformInterface
@@ -639,19 +672,19 @@ setWorker: anObject
 !PlatformInterface class methodsFor: 'actions'!
 
 ajax: anObject
-	^worker
+	^ worker
 		ifNotNil: [ worker ajax: anObject ]
 		ifNil: [ self error: 'ajax: not available' ]
 !
 
 alert: aString
-	^worker
+	^ worker
 		ifNotNil: [ worker alert: aString ]
 		ifNil: [ self error: 'alert: not available' ]
 !
 
 confirm: aString
-	^worker
+	^ worker
 		ifNotNil: [ worker confirm: aString ]
 		ifNil: [ self error: 'confirm: not available' ]
 !
@@ -664,7 +697,7 @@ existsGlobal: aString
 !
 
 prompt: aString
-	^worker
+	^ worker
 		ifNotNil: [ worker prompt: aString ]
 		ifNil: [ self error: 'prompt: not available' ]
 ! !
@@ -678,7 +711,7 @@ initialize
 	
 	BrowserInterface ifNotNil: [
 		candidate := BrowserInterface new.
-		candidate isAvailable ifTrue: [ self setWorker: candidate. ^self ]
+		candidate isAvailable ifTrue: [ self setWorker: candidate. ^ self ]
 	]
 ! !
 
@@ -704,7 +737,7 @@ ProgressHandler class instanceVariableNames: 'current'!
 !ProgressHandler class methodsFor: 'accessing'!
 
 current
-	^current ifNil: [ current := self new ]
+	^ current ifNil: [ current := self new ]
 !
 
 setCurrent: anHandler
@@ -760,7 +793,7 @@ at: aString
 
 at: aKey ifAbsent: aBlock
 	^ (self includesKey: aKey)
-		ifTrue: [self at: aKey]
+		ifTrue: [ self at: aKey ]
 		ifFalse: aBlock
 !
 
@@ -776,8 +809,8 @@ parse: aString
 	| result |
 	
 	self 
-		try: [result := self basicParse: aString] 
-		catch: [:ex | (self parseError: ex parsing: aString) signal].
+		try: [ result := self basicParse: aString ] 
+		catch: [ :ex | (self parseError: ex parsing: aString) signal ].
 		
 	^ result
 		source: aString;
@@ -800,7 +833,7 @@ reservedWords
 version
 	"Answer the version string of Amber"
 	
-	^ '0.12.0-pre'
+	^ '0.13.0-pre'
 ! !
 
 !Smalltalk methodsFor: 'accessing amd'!
@@ -824,7 +857,7 @@ classes
 !
 
 removeClass: aClass
-	aClass isMetaclass ifTrue: [self error: aClass asString, ' is a Metaclass and cannot be removed!!'].
+	aClass isMetaclass ifTrue: [ self error: aClass asString, ' is a Metaclass and cannot be removed!!' ].
 	
 	self deleteClass: aClass.
 	
@@ -867,16 +900,24 @@ globalJsVariables
 !Smalltalk methodsFor: 'packages'!
 
 createPackage: packageName
-	"Create and bind a new bare package with given name and return it."
-	<return smalltalk.addPackage(packageName)>
+	| package announcement |
+	
+	package := self basicCreatePackage: packageName.
+	announcement := PackageAdded new
+		package: package;
+		yourself.
+		
+	SystemAnnouncer current announce: announcement.
+	
+	^ package
 !
 
 packageAt: packageName
-	<return self.packages[packageName]>
+	<return self.packages[ packageName]>
 !
 
 packageAt: packageName ifAbsent: aBlock
-	^(self packageAt: packageName) ifNil: aBlock
+	^ (self packageAt: packageName) ifNil: aBlock
 !
 
 packages
@@ -895,9 +936,9 @@ removePackage: packageName
 	"Removes a package and all its classes."
 
 	| pkg |
-	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
-	pkg classes do: [:each |
-			self removeClass: each].
+	pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].
+	pkg classes do: [ :each |
+			self removeClass: each ].
 	self deletePackage: packageName
 !
 
@@ -905,8 +946,8 @@ renamePackage: packageName to: newName
 	"Rename a package."
 
 	| pkg |
-	pkg := self packageAt: packageName ifAbsent: [self error: 'Missing package: ', packageName].
-	(self packageAt: newName) ifNotNil: [self error: 'Already exists a package called: ', newName].
+	pkg := self packageAt: packageName ifAbsent: [ self error: 'Missing package: ', packageName ].
+	(self packageAt: newName) ifNotNil: [ self error: 'Already exists a package called: ', newName ].
 	(self at: 'packages') at: newName put: pkg.
 	pkg name: newName.
 	self deletePackage: packageName.
@@ -914,6 +955,11 @@ renamePackage: packageName to: newName
 
 !Smalltalk methodsFor: 'private'!
 
+basicCreatePackage: packageName
+	"Create and bind a new bare package with given name and return it."
+	<return smalltalk.addPackage(packageName)>
+!
+
 basicParse: aString
 	<return smalltalk.parser.parse(aString)>
 !
@@ -936,7 +982,7 @@ 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 self.packages[ packageName]>
 ! !
 
 !Smalltalk methodsFor: 'testing'!
@@ -965,6 +1011,6 @@ do: aBlock displayingProgress: aString
 
 asJavaScriptSelector
 	"Return first keyword of the selector, without trailing colon."
-	^self replace: '^([a-zA-Z0-9]*).*$' with: '$1'
+	^ self replace: '^([a-zA-Z0-9]*).*$' with: '$1'
 ! !
 

+ 22 - 18
st/Kernel-Methods.st

@@ -85,7 +85,7 @@ on: anErrorClass do: aBlock
 	"All exceptions thrown in the Smalltalk stack are cought.
 	Convert all JS exceptions to JavaScriptException instances."
 	
-	^self try: self catch: [ :error | | smalltalkError |
+	^ self try: self catch: [ :error | | smalltalkError |
 		smalltalkError := Smalltalk current asSmalltalkException: error.
 		(smalltalkError isKindOf: anErrorClass)
 		ifTrue: [ aBlock value: smalltalkError ]
@@ -219,7 +219,7 @@ arguments
 !
 
 category
-	^(self basicAt: 'category') ifNil: [ self defaultCategory ]
+	^ (self basicAt: 'category') ifNil: [ self defaultCategory ]
 !
 
 category: aString
@@ -241,7 +241,7 @@ category: aString
 !
 
 fn
-	^self basicAt: 'fn'
+	^ self basicAt: 'fn'
 !
 
 fn: aBlock
@@ -249,11 +249,11 @@ fn: aBlock
 !
 
 messageSends
-	^self basicAt: 'messageSends'
+	^ self basicAt: 'messageSends'
 !
 
 methodClass
-	^self basicAt: 'methodClass'
+	^ self basicAt: 'methodClass'
 !
 
 protocol
@@ -265,11 +265,11 @@ protocol: aString
 !
 
 referencedClasses
-	^self basicAt: 'referencedClasses'
+	^ self basicAt: 'referencedClasses'
 !
 
 selector
-	^self basicAt: 'selector'
+	^ self basicAt: 'selector'
 !
 
 selector: aString
@@ -277,7 +277,7 @@ selector: aString
 !
 
 source
-	^(self basicAt: 'source') ifNil: ['']
+	^ (self basicAt: 'source') ifNil: [ '' ]
 !
 
 source: aString
@@ -371,11 +371,11 @@ initialize
 makeWorker
 	| sentinel |
 	sentinel := Object new.
-	^[ | block |
+	^ [ | block |
 		poolSize := poolSize - 1.
 		block := queue nextIfAbsent: [ sentinel ].
 		block == sentinel ifFalse: [
-			[ block value ] ensure: [ self addWorker ]]]
+			[ block value ] ensure: [ self addWorker ] ]]
 ! !
 
 !ForkPool methodsFor: 'private'!
@@ -390,11 +390,11 @@ ForkPool class instanceVariableNames: 'default'!
 !ForkPool class methodsFor: 'accessing'!
 
 default
-	^default ifNil: [ default := self new ]
+	^ default ifNil: [ default := self new ]
 !
 
 defaultMaxPoolSize
-	^100
+	^ 100
 !
 
 resetDefault
@@ -418,7 +418,7 @@ Besides accessing methods, `#sendTo:` provides a convenient way to send a messag
 !Message methodsFor: 'accessing'!
 
 arguments
-	^arguments
+	^ arguments
 !
 
 arguments: anArray
@@ -426,7 +426,7 @@ arguments: anArray
 !
 
 selector
-	^selector
+	^ selector
 !
 
 selector: aString
@@ -452,7 +452,7 @@ printOn: aStream
 !Message class methodsFor: 'instance creation'!
 
 selector: aString arguments: anArray
-	^self new
+	^ self new
 		selector: aString;
 		arguments: anArray;
 		yourself
@@ -552,6 +552,10 @@ My instances are JavaScript `SmalltalkMethodContext` objects defined in `boot.js
 
 !MethodContext methodsFor: 'accessing'!
 
+evaluatedSelector
+	<return self.evaluatedSelector>
+!
+
 home
 	<return self.homeContext>
 !
@@ -611,7 +615,7 @@ temps
 !MethodContext methodsFor: 'converting'!
 
 asString
-	^self isBlockContext
+	^ self isBlockContext
 		ifTrue: [ 'a block (in ', self methodContext asString, ')' ]
 		ifFalse: [ self receiver class name, ' >> ', self selector ]
 ! !
@@ -686,7 +690,7 @@ constructor: aString value:anObject value: anObject2 value:anObject3
 !NativeFunction class methodsFor: 'testing'!
 
 exists: aString
-	^PlatformInterface existsGlobal: aString
+	^ PlatformInterface existsGlobal: aString
 ! !
 
 Object subclass: #Timeout
@@ -724,6 +728,6 @@ clearTimeout
 !Timeout class methodsFor: 'instance creation'!
 
 on: anObject
-	^self new rawTimeout: anObject; yourself
+	^ self new rawTimeout: anObject; yourself
 ! !
 

+ 115 - 115
st/Kernel-Objects.st

@@ -84,51 +84,51 @@ value
 !
 
 yourself
-	^self
+	^ self
 ! !
 
 !Object methodsFor: 'comparing'!
 
 = anObject
-	^self == anObject
+	^ self == anObject
 !
 
 == anObject
-	^self identityHash = anObject identityHash
+	^ self identityHash = anObject identityHash
 !
 
 ~= anObject
-	^(self = anObject) = false
+	^ (self = anObject) = false
 !
 
 ~~ anObject
-	^(self == anObject) = false
+	^ (self == anObject) = false
 ! !
 
 !Object methodsFor: 'converting'!
 
 -> anObject
-	^Association key: self value: anObject
+	^ Association key: self value: anObject
 !
 
 asJSON
 	| variables |
 	variables := HashedCollection new.
-	self class allInstanceVariableNames do: [:each |
-		variables at: each put: (self instVarAt: each) asJSON].
-	^variables
+	self class allInstanceVariableNames do: [ :each |
+		variables at: each put: (self instVarAt: each) asJSON ].
+	^ variables
 !
 
 asJSONString
-	^JSON stringify: self asJSON
+	^ JSON stringify: self asJSON
 !
 
 asJavascript
-	^self asString
+	^ self asString
 !
 
 asString
-	^self printString
+	^ self printString
 !
 
 test
@@ -140,7 +140,7 @@ test
 !Object methodsFor: 'copying'!
 
 copy
-	^self shallowCopy postCopy
+	^ self shallowCopy postCopy
 !
 
 deepCopy
@@ -225,8 +225,8 @@ inspectOn: anInspector
 	| variables |
 	variables := Dictionary new.
 	variables at: '#self' put: self.
-	self class allInstanceVariableNames do: [:each |
-		variables at: each put: (self instVarAt: each)].
+	self class allInstanceVariableNames do: [ :each |
+		variables at: each put: (self instVarAt: each) ].
 	anInspector
 		setLabel: self printString;
 		setVariables: variables
@@ -235,7 +235,7 @@ inspectOn: anInspector
 !Object methodsFor: 'message handling'!
 
 basicPerform: aString
-	^self basicPerform: aString withArguments: #()
+	^ self basicPerform: aString withArguments: #()
 !
 
 basicPerform: aString withArguments: aCollection
@@ -243,7 +243,7 @@ basicPerform: aString withArguments: aCollection
 !
 
 perform: aString
-	^self perform: aString withArguments: #()
+	^ self perform: aString withArguments: #()
 !
 
 perform: aString withArguments: aCollection
@@ -277,22 +277,22 @@ putOn: aStream
 
 ifNil: aBlock
 	"inlined in the Compiler"
-	^self
+	^ self
 !
 
 ifNil: aBlock ifNotNil: anotherBlock
 	"inlined in the Compiler"
-	^anotherBlock value: self
+	^ anotherBlock value: self
 !
 
 ifNotNil: aBlock
 	"inlined in the Compiler"
-	^aBlock value: self
+	^ aBlock value: self
 !
 
 ifNotNil: aBlock ifNil: anotherBlock
 	"inlined in the Compiler"
-	^aBlock value: self
+	^ aBlock value: self
 !
 
 isBehavior
@@ -304,7 +304,7 @@ isBoolean
 !
 
 isClass
-	^false
+	^ false
 !
 
 isCompiledMethod
@@ -316,25 +316,25 @@ isImmutable
 !
 
 isKindOf: aClass
-	^(self isMemberOf: aClass)
-		ifTrue: [true]
-		ifFalse: [self class inheritsFrom: aClass]
+	^ (self isMemberOf: aClass)
+		ifTrue: [ true ]
+		ifFalse: [ self class inheritsFrom: aClass ]
 !
 
 isMemberOf: aClass
-	^self class = aClass
+	^ self class = aClass
 !
 
 isMetaclass
-	^false
+	^ false
 !
 
 isNil
-	^false
+	^ false
 !
 
 isNumber
-	^false
+	^ false
 !
 
 isPackage
@@ -342,23 +342,23 @@ isPackage
 !
 
 isParseFailure
-	^false
+	^ false
 !
 
 isString
-	^false
+	^ false
 !
 
 isSymbol
-	^false
+	^ false
 !
 
 notNil
-	^self isNil not
+	^ self isNil not
 !
 
 respondsTo: aSelector
-	^self class canUnderstand: aSelector
+	^ self class canUnderstand: aSelector
 ! !
 
 !Object class methodsFor: 'helios'!
@@ -402,7 +402,7 @@ I am directly mapped to JavaScript Boolean. The `true` and `false` objects are t
 !
 
 == aBoolean
-	^self = aBoolean
+	^ self = aBoolean
 ! !
 
 !Boolean methodsFor: 'controlling'!
@@ -418,24 +418,24 @@ I am directly mapped to JavaScript Boolean. The `true` and `false` objects are t
 !
 
 and: aBlock
-	^self = true
+	^ self = true
 		ifTrue: aBlock
-		ifFalse: [false]
+		ifFalse: [ false ]
 !
 
 ifFalse: aBlock
 	"inlined in the Compiler"
-	^self ifTrue: [] ifFalse: aBlock
+	^ self ifTrue: [] ifFalse: aBlock
 !
 
 ifFalse: aBlock ifTrue: anotherBlock
 	"inlined in the Compiler"
-	^self ifTrue: anotherBlock ifFalse: aBlock
+	^ self ifTrue: anotherBlock ifFalse: aBlock
 !
 
 ifTrue: aBlock
 	"inlined in the Compiler"
-	^self ifTrue: aBlock ifFalse: []
+	^ self ifTrue: aBlock ifFalse: []
 !
 
 ifTrue: aBlock ifFalse: anotherBlock
@@ -450,12 +450,12 @@ ifTrue: aBlock ifFalse: anotherBlock
 !
 
 not
-	^self = false
+	^ self = false
 !
 
 or: aBlock
-	^self = true
-		ifTrue: [true]
+	^ self = true
+		ifTrue: [ true ]
 		ifFalse: aBlock
 !
 
@@ -476,7 +476,7 @@ asBit
 !
 
 asJSON
-	^self
+	^ self
 !
 
 asString
@@ -486,11 +486,11 @@ asString
 !Boolean methodsFor: 'copying'!
 
 deepCopy
-	^self
+	^ self
 !
 
 shallowCopy
-	^self
+	^ self
 ! !
 
 !Boolean methodsFor: 'printing'!
@@ -529,7 +529,7 @@ The `converting` protocol provides convenience methods for various convertions (
 !Date methodsFor: 'accessing'!
 
 day
-	^self dayOfWeek
+	^ self dayOfWeek
 !
 
 day: aNumber
@@ -647,11 +647,11 @@ asLocaleString
 !
 
 asMilliseconds
-	^self time
+	^ self time
 !
 
 asNumber
-	^self asMilliseconds
+	^ self asMilliseconds
 !
 
 asString
@@ -677,23 +677,23 @@ heliosClass
 !Date class methodsFor: 'instance creation'!
 
 fromMilliseconds: aNumber
-	^self new: aNumber
+	^ self new: aNumber
 !
 
 fromSeconds: aNumber
-	^self fromMilliseconds: aNumber * 1000
+	^ self fromMilliseconds: aNumber * 1000
 !
 
 fromString: aString
 	"Example: Date fromString('2011/04/15 00:00:00')"
-	^self new: aString
+	^ self new: aString
 !
 
 millisecondsToRun: aBlock
 	| t |
 	t := Date now.
 	aBlock value.
-	^Date now - t
+	^ Date now - t
 !
 
 new: anObject
@@ -701,11 +701,11 @@ new: anObject
 !
 
 now
-	^self today
+	^ self today
 !
 
 today
-	^self new
+	^ self new
 ! !
 
 Object subclass: #Number
@@ -721,16 +721,16 @@ I provide all necessary methods for arithmetic operations, comparison, conversio
 
 My instances can also be used to evaluate a block a fixed number of times:
 
-	5 timesRepeat: [Transcript show: 'This will be printed 5 times'; cr].
+	5 timesRepeat: [ Transcript show: 'This will be printed 5 times'; cr ].
 	
-	1 to: 5 do: [:aNumber| Transcript show: aNumber asString; cr].
+	1 to: 5 do: [ :aNumber| Transcript show: aNumber asString; cr ].
 	
-	1 to: 10 by: 2 do: [:aNumber| Transcript show: aNumber asString; cr].!
+	1 to: 10 by: 2 do: [ :aNumber| Transcript show: aNumber asString; cr ].!
 
 !Number methodsFor: 'accessing'!
 
 identityHash
-	^self asString, 'n'
+	^ self asString, 'n'
 ! !
 
 !Number methodsFor: 'arithmetic'!
@@ -756,7 +756,7 @@ identityHash
 !
 
 // aNumber
-	^(self / aNumber) floor
+	^ (self / aNumber) floor
 !
 
 \\ aNumber
@@ -776,7 +776,7 @@ min: aNumber
 !
 
 negated
-	^0 - self
+	^ 0 - self
 ! !
 
 !Number methodsFor: 'comparing'!
@@ -817,15 +817,15 @@ negated
 !
 
 @ aNumber
-	^Point x: self y: aNumber
+	^ Point x: self y: aNumber
 !
 
 asJSON
-	^self
+	^ self
 !
 
 asJavascript
-	^'(', self printString, ')'
+	^ '(', self printString, ')'
 !
 
 asNumber
@@ -833,7 +833,7 @@ asNumber
 !
 
 asPoint
-	^Point x: self y: self
+	^ Point x: self y: self
 !
 
 asString
@@ -841,7 +841,7 @@ asString
 !
 
 atRandom
-	^(Random new next * self) truncated + 1
+	^ (Random new next * self) truncated + 1
 !
 
 ceiling
@@ -865,8 +865,8 @@ to: aNumber
 	(last - first) timesRepeat: [
 		array at: count put: first.
 		count := count + 1.
-		first := first + 1].
-	^array
+		first := first + 1 ].
+	^ array
 !
 
 to: stop by: step
@@ -874,17 +874,17 @@ to: stop by: step
 	value := self.
 	array := Array new.
 	pos := 1.
-	step = 0 ifTrue: [self error: 'step must be non-zero'].
+	step = 0 ifTrue: [ self error: 'step must be non-zero' ].
 	step < 0
-		ifTrue: [[ value >= stop ] whileTrue: [
+		ifTrue: [ [ value >= stop ] whileTrue: [
 					array at: pos put: value.
 					pos := pos + 1.
-					value := value + step]]
-		ifFalse: [[ value <= stop ] whileTrue: [
+					value := value + step ]]
+		ifFalse: [ [ value <= stop ] whileTrue: [
 					array at: pos put: value.
 				pos := pos + 1.
-					value := value + step]].
-	^array
+					value := value + step ]].
+	^ array
 !
 
 truncated
@@ -904,11 +904,11 @@ truncated
 !Number methodsFor: 'copying'!
 
 copy
-	^self
+	^ self
 !
 
 deepCopy
-	^self copy
+	^ self copy
 ! !
 
 !Number methodsFor: 'enumerating'!
@@ -916,38 +916,38 @@ deepCopy
 timesRepeat: aBlock
 	| count |
 	count := 1.
-	[count > self] whileFalse: [
+	[ count > self ] whileFalse: [
 		aBlock value.
-		count := count + 1]
+		count := count + 1 ]
 !
 
 to: stop by: step do: aBlock
 	| value |
 	value := self.
-	step = 0 ifTrue: [self error: 'step must be non-zero'].
+	step = 0 ifTrue: [ self error: 'step must be non-zero' ].
 	step < 0
-		ifTrue: [[ value >= stop ] whileTrue: [
+		ifTrue: [ [ value >= stop ] whileTrue: [
 					aBlock value: value.
-					value := value + step]]
-		ifFalse: [[ value <= stop ] whileTrue: [
+					value := value + step ]]
+		ifFalse: [ [ value <= stop ] whileTrue: [
 					aBlock value: value.
-					value := value + step]]
+					value := value + step ]]
 !
 
 to: stop do: aBlock
 	"Evaluate aBlock for each number from self to aNumber."
 	| nextValue |
 	nextValue := self.
-	[nextValue <= stop]
+	[ nextValue <= stop ]
 		whileTrue:
-			[aBlock value: nextValue.
-			nextValue := nextValue + 1]
+			[ aBlock value: nextValue.
+			nextValue := nextValue + 1 ]
 ! !
 
 !Number methodsFor: 'mathematical functions'!
 
 ** exponent
-	^self raisedTo: exponent
+	^ self raisedTo: exponent
 !
 
 arcCos
@@ -999,7 +999,7 @@ sqrt
 !
 
 squared
-	^self * self
+	^ self * self
 !
 
 tan
@@ -1027,11 +1027,11 @@ isImmutable
 !
 
 isNumber
-	^true
+	^ true
 !
 
 isZero
-	^self = 0
+	^ self = 0
 !
 
 negative
@@ -1093,7 +1093,7 @@ Points can then be arithmetically manipulated:
 !Point methodsFor: 'accessing'!
 
 x
-	^x
+	^ x
 !
 
 x: aNumber
@@ -1101,7 +1101,7 @@ x: aNumber
 !
 
 y
-	^y
+	^ y
 !
 
 y: aNumber
@@ -1111,30 +1111,30 @@ y: aNumber
 !Point methodsFor: 'arithmetic'!
 
 * aPoint
-	^Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y
+	^ Point x: self x * aPoint asPoint x y: self y * aPoint asPoint y
 !
 
 + aPoint
-	^Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y
+	^ Point x: self x + aPoint asPoint x y: self y + aPoint asPoint y
 !
 
 - aPoint
-	^Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y
+	^ Point x: self x - aPoint asPoint x y: self y - aPoint asPoint y
 !
 
 / aPoint
-	^Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y
+	^ Point x: self x / aPoint asPoint x y: self y / aPoint asPoint y
 !
 
 = aPoint
-	^aPoint class = self class and: [
-		(aPoint x = self x) & (aPoint y = self y)]
+	^ aPoint class = self class and: [
+		(aPoint x = self x) & (aPoint y = self y) ]
 ! !
 
 !Point methodsFor: 'converting'!
 
 asPoint
-	^self
+	^ self
 ! !
 
 !Point methodsFor: 'printing'!
@@ -1145,7 +1145,7 @@ printOn: aStream
 	x printOn: aStream.
 	
 	aStream nextPutAll: '@'.
-	(y notNil and: [y negative]) ifTrue: [
+	(y notNil and: [ y negative ]) ifTrue: [
 			"Avoid ambiguous @- construct"
 			aStream space ].
 	
@@ -1156,7 +1156,7 @@ printOn: aStream
 
 translateBy: delta
 	"Answer a Point translated by delta (an instance of Point)."
-	^(delta x + x) @ (delta y + y)
+	^ (delta x + x) @ (delta y + y)
 ! !
 
 !Point class methodsFor: 'helios'!
@@ -1168,7 +1168,7 @@ heliosClass
 !Point class methodsFor: 'instance creation'!
 
 x: aNumber y: anotherNumber
-	^self new
+	^ self new
 		x: aNumber;
 		y: anotherNumber;
 		yourself
@@ -1215,7 +1215,7 @@ next
 !
 
 next: anInteger
-	^(1 to: anInteger) collect: [:each | self next]
+	^ (1 to: anInteger) collect: [ :each | self next ]
 ! !
 
 Object subclass: #UndefinedObject
@@ -1231,34 +1231,34 @@ __note:__ When sending messages to the `undefined` JavaScript object, it will be
 !UndefinedObject methodsFor: 'class creation'!
 
 subclass: aString instanceVariableNames: anotherString
-	^self subclass: aString instanceVariableNames: anotherString package: nil
+	^ self subclass: aString instanceVariableNames: anotherString package: nil
 !
 
 subclass: aString instanceVariableNames: aString2 category: aString3
 	"Kept for compatibility."
 	self deprecatedAPI.
-	^self subclass: aString instanceVariableNames: aString2 package: aString3
+	^ self subclass: aString instanceVariableNames: aString2 package: aString3
 !
 
 subclass: aString instanceVariableNames: aString2 package: aString3
-	^ClassBuilder new
+	^ ClassBuilder new
 		superclass: self subclass: aString asString instanceVariableNames: aString2 package: aString3
 ! !
 
 !UndefinedObject methodsFor: 'converting'!
 
 asJSON
-	^null
+	^ null
 ! !
 
 !UndefinedObject methodsFor: 'copying'!
 
 deepCopy
-	^self
+	^ self
 !
 
 shallowCopy
-	^self
+	^ self
 ! !
 
 !UndefinedObject methodsFor: 'printing'!
@@ -1271,22 +1271,22 @@ printOn: aStream
 
 ifNil: aBlock
 	"inlined in the Compiler"
-	^self ifNil: aBlock ifNotNil: []
+	^ self ifNil: aBlock ifNotNil: []
 !
 
 ifNil: aBlock ifNotNil: anotherBlock
 	"inlined in the Compiler"
-	^aBlock value
+	^ aBlock value
 !
 
 ifNotNil: aBlock
 	"inlined in the Compiler"
-	^self
+	^ self
 !
 
 ifNotNil: aBlock ifNil: anotherBlock
 	"inlined in the Compiler"
-	^anotherBlock value
+	^ anotherBlock value
 !
 
 isImmutable
@@ -1294,11 +1294,11 @@ isImmutable
 !
 
 isNil
-	^true
+	^ true
 !
 
 notNil
-	^false
+	^ false
 ! !
 
 !UndefinedObject class methodsFor: 'instance creation'!

+ 291 - 126
st/Kernel-Tests.st

@@ -29,15 +29,15 @@ TestCase subclass: #BlockClosureTest
 !BlockClosureTest methodsFor: 'tests'!
 
 testCanClearInterval
-	self shouldnt: [([Error new signal] valueWithInterval: 0) clearInterval] raise: Error
+	self shouldnt: [ ([ Error new signal ] valueWithInterval: 0) clearInterval ] raise: Error
 !
 
 testCanClearTimeout
-	self shouldnt: [([Error new signal] valueWithTimeout: 0) clearTimeout] raise: Error
+	self shouldnt: [ ([ Error new signal ] valueWithTimeout: 0) clearTimeout ] raise: Error
 !
 
 testCompiledSource
-	self assert: ([1+1] compiledSource includesSubString: 'function')
+	self assert: ([ 1+1 ] compiledSource includesSubString: 'function')
 !
 
 testCurrySelf
@@ -50,11 +50,11 @@ testCurrySelf
 !
 
 testEnsure
-	self assert: ([3] ensure: [4]) equals: 3
+	self assert: ([ 3 ] ensure: [ 4 ]) equals: 3
 !
 
 testEnsureRaises
-	self should: [[Error new signal] ensure: [true]] raise: Error
+	self should: [ [Error new signal ] ensure: [ true ]] raise: Error
 !
 
 testExceptionSemantics
@@ -79,7 +79,7 @@ testNewWithValues
 	theTestConstructor.prototype = new theTestPrototype;
 
 	var theWrappedConstructor = _st(theTestConstructor);
-	var theResult = theWrappedConstructor._newWithValues_([1, 2, 3]);
+	var theResult = theWrappedConstructor._newWithValues_([1, 2, 3 ]);
 	self._assert_equals_(Object.getPrototypeOf(theResult).name, 'theTestPrototype');
 
 	"newWithValues: cannot help if the argument list is wrong, and should warn that a mistake was made."
@@ -90,48 +90,48 @@ testNewWithValues
 
 testNumArgs
 	self assert: [] numArgs equals: 0.
-	self assert: [:a :b | ] numArgs equals: 2
+	self assert: [ :a :b | ] numArgs equals: 2
 !
 
 testOnDo
-	self assert: ([Error new signal] on: Error do: [:ex | true])
+	self assert: ([ Error new signal ] on: Error do: [ :ex | true ])
 !
 
 testValue
-	self assert: ([1+1] value) equals: 2.
-	self assert: ([:x | x +1] value: 2) equals: 3.
-	self assert: ([:x :y | x*y] value: 2 value: 4) equals: 8.
+	self assert: ([ 1+1 ] value) equals: 2.
+	self assert: ([ :x | x +1 ] value: 2) equals: 3.
+	self assert: ([ :x :y | x*y ] value: 2 value: 4) equals: 8.
 
 	"Arguments are optional in Amber. This isn't ANSI compliant."
 
-	self assert: ([:a :b :c | 1] value) equals: 1
+	self assert: ([ :a :b :c | 1 ] value) equals: 1
 !
 
 testValueWithPossibleArguments
-	self assert: ([1] valueWithPossibleArguments: #(3 4)) equals: 1.
-	self assert: ([:a | a + 4] valueWithPossibleArguments: #(3 4)) equals: 7.
-	self assert: ([:a :b | a + b] valueWithPossibleArguments: #(3 4 5)) equals: 7.
+	self assert: ([ 1 ] valueWithPossibleArguments: #(3 4)) equals: 1.
+	self assert: ([ :a | a + 4 ] valueWithPossibleArguments: #(3 4)) equals: 7.
+	self assert: ([ :a :b | a + b ] valueWithPossibleArguments: #(3 4 5)) equals: 7.
 !
 
 testWhileFalse
 	| i |
 	i := 0.
-	[i > 5] whileFalse: [i := i + 1].
+	[ i > 5 ] whileFalse: [ i := i + 1 ].
 	self assert: i equals: 6.
 
 	i := 0.
-	[i := i + 1. i > 5] whileFalse.
+	[ i := i + 1. i > 5 ] whileFalse.
 	self assert: i equals: 6
 !
 
 testWhileTrue
 	| i |
 	i := 0.
-	[i < 5] whileTrue: [i := i + 1].
+	[ i < 5 ] whileTrue: [ i := i + 1 ].
 	self assert: i equals: 5.
 
 	i := 0.
-	[i := i + 1. i < 5] whileTrue.
+	[ i := i + 1. i < 5 ] whileTrue.
 	self assert: i equals: 5
 ! !
 
@@ -179,32 +179,32 @@ testIdentity
 
 testIfTrueIfFalse
 
-	self assert: (true ifTrue: ['alternative block']) equals: 'alternative block'.
-	self assert: (true ifFalse: ['alternative block']) equals: nil.
+	self assert: (true ifTrue: [ 'alternative block' ]) equals: 'alternative block'.
+	self assert: (true ifFalse: [ 'alternative block' ]) equals: nil.
 
-	self assert: (false ifTrue: ['alternative block']) equals: nil.
-	self assert: (false ifFalse: ['alternative block']) equals: 'alternative block'.
+	self assert: (false ifTrue: [ 'alternative block' ]) equals: nil.
+	self assert: (false ifFalse: [ 'alternative block' ]) equals: 'alternative block'.
 
-	self assert: (false ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block2'.
-	self assert: (false ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block'.
+	self assert: (false ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.
+	self assert: (false ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.
 
-	self assert: (true ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block'.
-	self assert: (true ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block2'.
+	self assert: (true ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.
+	self assert: (true ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.
 !
 
 testIfTrueIfFalseWithBoxing
 
-	self assert: (true yourself ifTrue: ['alternative block']) equals: 'alternative block'.
-	self assert: (true yourself ifFalse: ['alternative block']) equals: nil.
+	self assert: (true yourself ifTrue: [ 'alternative block' ]) equals: 'alternative block'.
+	self assert: (true yourself ifFalse: [ 'alternative block' ]) equals: nil.
 
-	self assert: (false yourself ifTrue: ['alternative block']) equals: nil.
-	self assert: (false yourself ifFalse: ['alternative block']) equals: 'alternative block'.
+	self assert: (false yourself ifTrue: [ 'alternative block' ]) equals: nil.
+	self assert: (false yourself ifFalse: [ 'alternative block' ]) equals: 'alternative block'.
 
-	self assert: (false yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block2'.
-	self assert: (false yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block'.
+	self assert: (false yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block2'.
+	self assert: (false yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block'.
 
-	self assert: (true yourself ifTrue: ['alternative block'] ifFalse: ['alternative block2']) equals: 'alternative block'.
-	self assert: (true yourself ifFalse: ['alternative block'] ifTrue: ['alternative block2']) equals: 'alternative block2'.
+	self assert: (true yourself ifTrue: [ 'alternative block' ] ifFalse: [ 'alternative block2' ]) equals: 'alternative block'.
+	self assert: (true yourself ifFalse: [ 'alternative block' ] ifTrue: [ 'alternative block2' ]) equals: 'alternative block2'.
 !
 
 testLogic
@@ -229,7 +229,7 @@ testLogic
 testLogicKeywords
 	"Trivial logic table"
 	self
-		assert: (true and: [ true]);
+		assert: (true and: [ true ]);
 		deny: (true and: [ false ]);
 		deny: (false and: [ true ]);
 		deny: (false and: [ false ]).
@@ -265,7 +265,7 @@ setUp
 !
 
 tearDown
-	theClass ifNotNil: [Smalltalk current removeClass: theClass. theClass := nil]
+	theClass ifNotNil: [ Smalltalk current removeClass: theClass. theClass := nil ]
 ! !
 
 !ClassBuilderTest methodsFor: 'tests'!
@@ -592,8 +592,8 @@ testAccessing
 
 	d at: 'hello' put: 'world'.
 	self assert: (d at: 'hello') equals: 'world'.
-	self assert: (d at: 'hello' ifAbsent: [nil]) equals: 'world'.
-	self deny: (d at: 'foo' ifAbsent: [nil]) = 'world'.
+	self assert: (d at: 'hello' ifAbsent: [ nil ]) equals: 'world'.
+	self deny: (d at: 'foo' ifAbsent: [ nil ]) = 'world'.
 
 	self assert: (d includesKey: 'hello').
 	self deny: (d includesKey: 'foo').
@@ -737,10 +737,10 @@ testRemoveKeyIfAbsent
 	self assert: (d removeKey: key) equals: 3.
 
 	key := 3.
-	self assert: (d removeKey: key ifAbsent: [42]) equals: 4.
+	self assert: (d removeKey: key ifAbsent: [ 42 ]) equals: 4.
 
 	key := 'why'.
-	self assert: (d removeKey: key ifAbsent: [42] ) equals: 42.
+	self assert: (d removeKey: key ifAbsent: [ 42 ] ) equals: 42.
 !
 
 testSize
@@ -777,14 +777,44 @@ IndexableCollectionTest subclass: #SequenceableCollectionTest
 	instanceVariableNames: ''
 	package: 'Kernel-Tests'!
 
+!SequenceableCollectionTest methodsFor: 'tests'!
+
+testFirst
+	self assert: (self collection first) equals: (self collection at: 1)
+!
+
+testFourth
+	self assert: (self collection fourth) equals: (self collection at: 4)
+!
+
+testLast
+	self assert: (self collection last) equals: (self collection at: self collection size)
+!
+
+testSecond
+	self assert: (self collection second) equals: (self collection at: 2)
+!
+
+testThird
+	self assert: (self collection third) equals: (self collection at: 3)
+! !
+
 SequenceableCollectionTest subclass: #ArrayTest
 	instanceVariableNames: ''
 	package: 'Kernel-Tests'!
 
 !ArrayTest methodsFor: 'tests'!
 
+testAdd 
+	| array | 
+	array := self collection. 
+	array add: 6.
+	
+	self assert: array last equals: 6
+!
+
 testAddFirst
-	self assert: (#(2 3 4 5) addFirst: 1; yourself) equals: #(1 2 3 4 5)
+	self assert: (self collection addFirst: 0; yourself) first equals: 0
 !
 
 testAtIfAbsent
@@ -792,10 +822,10 @@ testAtIfAbsent
 	array := #('hello' 'world').
 	self assert: (array at: 1) equals: 'hello'.
 	self assert: (array at: 2) equals: 'world'.
-	self assert: (array at: 2 ifAbsent: ['not found']) equals: 'world'.
-	self assert: (array at: 0 ifAbsent: ['not found']) equals: 'not found'.
-	self assert: (array at: -10 ifAbsent: ['not found']) equals: 'not found'.
-	self assert: (array at: 3 ifAbsent: ['not found']) equals: 'not found'.
+	self assert: (array at: 2 ifAbsent: [ 'not found' ]) equals: 'world'.
+	self assert: (array at: 0 ifAbsent: [ 'not found' ]) equals: 'not found'.
+	self assert: (array at: -10 ifAbsent: [ 'not found' ]) equals: 'not found'.
+	self assert: (array at: 3 ifAbsent: [ 'not found' ]) equals: 'not found'.
 !
 
 testFirstN
@@ -803,7 +833,7 @@ testFirstN
 !
 
 testIfEmpty
-	self assert: ( '' ifEmpty: ['zork'] ) equals: 'zork'
+	self assert: ( '' ifEmpty: [ 'zork' ] ) equals: 'zork'
 !
 
 testPrintString
@@ -822,6 +852,15 @@ testPrintString
 	self assert: array printString equals: 'an Array (''foo'' 3 3)'.
 !
 
+testRemove 
+	| array |
+	array := #(1 2 3 4 5). 
+	array remove: 3.
+
+	self assert: array equals: #(1 2 4 5).
+	self should: [ array remove: 3 ] raise: Error
+!
+
 testRemoveFromTo
 	
 	self assert: (#(1 2 3 4) removeFrom: 1 to: 3) equals: #(4).
@@ -834,6 +873,27 @@ testRemoveIndex
 	self assert: (#(1 2 3 4) removeIndex: 2) equals: #(1 3 4).
 	self assert: (#(1 2 3 4) removeIndex: 1) equals: #(2 3 4).
 	self assert: (#('hello') removeIndex: 1) equals: #()
+!
+
+testRemoveLast 
+	| array |
+	array := #(1 2). 
+	array removeLast.
+	
+	self assert: array last equals: 1
+!
+
+testReversed
+	|array|
+	array := #(5 4 3 2 1). 
+	self assert: (array reversed) equals: #(1 2 3 4 5)
+!
+
+testSort
+	| array |
+	array := #(3 1 4 5 2). 
+	array sort.
+	self assert: array equals: #(1 2 3 4 5)
 ! !
 
 !ArrayTest class methodsFor: 'accessing'!
@@ -849,7 +909,7 @@ SequenceableCollectionTest subclass: #StringTest
 !StringTest methodsFor: 'accessing'!
 
 collection
-	^'hello'
+	^ 'hello'
 !
 
 collectionWithDuplicates
@@ -859,29 +919,45 @@ collectionWithDuplicates
 !StringTest methodsFor: 'tests'!
 
 testAddRemove
-	self should: ['hello' add: 'a'] raise: Error.
-	self should: ['hello' remove: 'h'] raise: Error
+	self should: [ 'hello' add: 'a' ] raise: Error.
+	self should: [ 'hello' remove: 'h' ] raise: Error
 !
 
 testAsArray
 	self assert: 'hello' asArray equals: #('h' 'e' 'l' 'l' 'o').
 !
 
+testAsLowerCase
+	self assert: 'JACKIE' asLowercase equals: 'jackie'.
+!
+
 testAsNumber
 	self assert: '3' asNumber equals: 3.
 	self assert: '-3' asNumber equals: -3.
 	self assert: '-1.5' asNumber equals: -1.5.
 !
 
+testAsUpperCase
+	self assert: 'jackie' asUppercase equals: 'JACKIE'.
+!
+
+testAsciiValue
+    | characterA characterU |
+    characterA := 'A'.
+    characterU := 'U'.
+    self assert: (characterA asciiValue) equals:65.
+    self assert: (characterU asciiValue) equals:85
+!
+
 testAt
 	self assert: ('hello' at: 1) equals: 'h'.
 	self assert: ('hello' at: 5) equals: 'o'.
-	self assert: ('hello' at: 6 ifAbsent: [nil]) equals: nil
+	self assert: ('hello' at: 6 ifAbsent: [ nil ]) equals: nil
 !
 
 testAtPut
 	"String instances are read-only"
-	self should: ['hello' at: 1 put: 'a'] raise: Error
+	self should: [ 'hello' at: 1 put: 'a' ] raise: Error
 !
 
 testCapitalized
@@ -892,6 +968,15 @@ testCapitalized
 	self assert: 'test' isCapitalized equals: false.
 !
 
+testCharCodeAt
+	self assert: ('jackie' charCodeAt:1) equals: 106.
+	self assert: ('jackie' charCodeAt:2) equals: 97.
+	self assert: ('jackie' charCodeAt:3) equals: 99.
+	self assert: ('jackie' charCodeAt:4) equals: 107.
+	self assert: ('jackie' charCodeAt:5) equals: 105.
+	self assert: ('jackie' charCodeAt:6) equals: 101
+!
+
 testCollect
 	| newCollection |
 	newCollection := 'hheelllloo'.
@@ -901,6 +986,11 @@ testCollect
 		as: newCollection
 !
 
+testCopyFromTo
+	self assert: ('jackie' copyFrom: 1 to: 3) equals: 'jac'.
+	self assert: ('jackie' copyFrom: 4 to: 6) equals: 'kie'.
+!
+
 testCopyWithoutAll
 	self
 		assert: ('*hello* *world*' copyWithoutAll: '*')
@@ -955,10 +1045,22 @@ testIndexOf
 	self assert: (self collection indexOf: 999 ifAbsent: [ 'sentinel' ]) equals: 'sentinel'
 !
 
+testIsVowel
+    |vowel consonant|
+    vowel := 'u'.
+    consonant := 'z'.
+    self assert: vowel isVowel equals: true.
+    self assert: consonant isVowel equals: false
+!
+
 testJoin
 	self assert: (',' join: #('hello' 'world')) equals: 'hello,world'
 !
 
+testReversed
+	self assert: 'jackiechan' reversed equals: 'nahceikcaj'.
+!
+
 testSelect
 	| newCollection |
 	newCollection := 'o'.
@@ -980,6 +1082,15 @@ testStreamContents
 				nextPutAll: 'hello'; space;
 				nextPutAll: 'world' ])
 		equals: 'hello world'
+!
+
+testSubStrings
+	self assert: ('jackiechan' subStrings: 'ie') equals: #( 'jack' 'chan' ).
+!
+
+testTrim
+	self assert: '       jackie' trimLeft equals: 'jackie'.
+	self assert: 'jackie               ' trimRight equals: 'jackie'.
 ! !
 
 !StringTest class methodsFor: 'accessing'!
@@ -1020,10 +1131,10 @@ jsObject
 testAtIfAbsent
 	| testObject |
 	testObject := self jsObject.
-	self assert: (testObject at: 'abc' ifAbsent: ['Property does not exist']) equals: 'Property does not exist'.
-	self assert: (testObject at: 'e' ifAbsent: ['Property does not exist']) equals: nil.
-	self assert: (testObject at: 'a' ifAbsent: ['Property does not exist']) equals: 1.
-	self assert: (testObject at: 'f' ifAbsent: ['Property does not exist']) equals: nil.
+	self assert: (testObject at: 'abc' ifAbsent: [ 'Property does not exist' ]) equals: 'Property does not exist'.
+	self assert: (testObject at: 'e' ifAbsent: [ 'Property does not exist' ]) equals: nil.
+	self assert: (testObject at: 'a' ifAbsent: [ 'Property does not exist' ]) equals: 1.
+	self assert: (testObject at: 'f' ifAbsent: [ 'Property does not exist' ]) equals: nil.
 !
 
 testAtIfPresent
@@ -1032,22 +1143,22 @@ testAtIfPresent
 	testObject := self jsObject.
 	
 	self assert: (testObject at: 'abc' ifPresent: [ :x | 'hello ',x asString ]) equals: nil.
-	self assert: (testObject at: 'e' ifPresent: [:x | 'hello ',x asString ]) equals: 'hello nil'.
-	self assert: (testObject at: 'a' ifPresent: [:x | 'hello ',x asString ]) equals: 'hello 1'.
-	self assert: (testObject at: 'f' ifPresent: [:x | 'hello ',x asString ]) equals: 'hello nil'.
+	self assert: (testObject at: 'e' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello nil'.
+	self assert: (testObject at: 'a' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello 1'.
+	self assert: (testObject at: 'f' ifPresent: [ :x | 'hello ',x asString ]) equals: 'hello nil'.
 !
 
 testAtIfPresentIfAbsent
 	| testObject |
 	testObject := self jsObject.
-	self assert: (testObject at: 'abc' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'not present'.
-	self assert: (testObject at: 'e' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.
-	self assert: (testObject at: 'a' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello 1'.
-	self assert: (testObject at: 'f' ifPresent: [:x|'hello ',x asString] ifAbsent: ['not present']) equals: 'hello nil'.
+	self assert: (testObject at: 'abc' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'not present'.
+	self assert: (testObject at: 'e' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.
+	self assert: (testObject at: 'a' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello 1'.
+	self assert: (testObject at: 'f' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.
 !
 
 testDNU
-	self should: [self jsObject foo] raise: MessageNotUnderstood
+	self should: [ self jsObject foo ] raise: MessageNotUnderstood
 !
 
 testMessageSend
@@ -1194,9 +1305,9 @@ setUp
 !
 
 tearDown
-	[ self deinstallTop ] on: Error do: [].
-	[ self deinstallMiddle ] on: Error do: [].
-	[ self deinstallBottom ] on: Error do: []
+	[ self deinstallTop ] on: Error do: [ ].
+	[ self deinstallMiddle ] on: Error do: [ ].
+	[ self deinstallBottom ] on: Error do: [ ]
 ! !
 
 !MethodInheritanceTest methodsFor: 'testing'!
@@ -1397,47 +1508,47 @@ testIdentity
 
 testInvalidHexNumbers
 
-	self should: [16rG] raise: MessageNotUnderstood.
-	self should: [16rg] raise: MessageNotUnderstood.
-	self should: [16rH] raise: MessageNotUnderstood.
-	self should: [16rh] raise: MessageNotUnderstood.
-	self should: [16rI] raise: MessageNotUnderstood.
-	self should: [16ri] raise: MessageNotUnderstood.
-	self should: [16rJ] raise: MessageNotUnderstood.
-	self should: [16rj] raise: MessageNotUnderstood.
-	self should: [16rK] raise: MessageNotUnderstood.
-	self should: [16rk] raise: MessageNotUnderstood.
-	self should: [16rL] raise: MessageNotUnderstood.
-	self should: [16rl] raise: MessageNotUnderstood.
-	self should: [16rM] raise: MessageNotUnderstood.
-	self should: [16rm] raise: MessageNotUnderstood.
-	self should: [16rN] raise: MessageNotUnderstood.
-	self should: [16rn] raise: MessageNotUnderstood.
-	self should: [16rO] raise: MessageNotUnderstood.
-	self should: [16ro] raise: MessageNotUnderstood.
-	self should: [16rP] raise: MessageNotUnderstood.
-	self should: [16rp] raise: MessageNotUnderstood.
-	self should: [16rQ] raise: MessageNotUnderstood.
-	self should: [16rq] raise: MessageNotUnderstood.
-	self should: [16rR] raise: MessageNotUnderstood.
-	self should: [16rr] raise: MessageNotUnderstood.
-	self should: [16rS] raise: MessageNotUnderstood.
-	self should: [16rs] raise: MessageNotUnderstood.
-	self should: [16rT] raise: MessageNotUnderstood.
-	self should: [16rt] raise: MessageNotUnderstood.
-	self should: [16rU] raise: MessageNotUnderstood.
-	self should: [16ru] raise: MessageNotUnderstood.
-	self should: [16rV] raise: MessageNotUnderstood.
-	self should: [16rv] raise: MessageNotUnderstood.
-	self should: [16rW] raise: MessageNotUnderstood.
-	self should: [16rw] raise: MessageNotUnderstood.
-	self should: [16rX] raise: MessageNotUnderstood.
-	self should: [16rx] raise: MessageNotUnderstood.
-	self should: [16rY] raise: MessageNotUnderstood.
-	self should: [16ry] raise: MessageNotUnderstood.
-	self should: [16rZ] raise: MessageNotUnderstood.
-	self should: [16rz] raise: MessageNotUnderstood.
-	self should: [16rABcdEfZ] raise: MessageNotUnderstood.
+	self should: [ 16rG ] raise: MessageNotUnderstood.
+	self should: [ 16rg ] raise: MessageNotUnderstood.
+	self should: [ 16rH ] raise: MessageNotUnderstood.
+	self should: [ 16rh ] raise: MessageNotUnderstood.
+	self should: [ 16rI ] raise: MessageNotUnderstood.
+	self should: [ 16ri ] raise: MessageNotUnderstood.
+	self should: [ 16rJ ] raise: MessageNotUnderstood.
+	self should: [ 16rj ] raise: MessageNotUnderstood.
+	self should: [ 16rK ] raise: MessageNotUnderstood.
+	self should: [ 16rk ] raise: MessageNotUnderstood.
+	self should: [ 16rL ] raise: MessageNotUnderstood.
+	self should: [ 16rl ] raise: MessageNotUnderstood.
+	self should: [ 16rM ] raise: MessageNotUnderstood.
+	self should: [ 16rm ] raise: MessageNotUnderstood.
+	self should: [ 16rN ] raise: MessageNotUnderstood.
+	self should: [ 16rn ] raise: MessageNotUnderstood.
+	self should: [ 16rO ] raise: MessageNotUnderstood.
+	self should: [ 16ro ] raise: MessageNotUnderstood.
+	self should: [ 16rP ] raise: MessageNotUnderstood.
+	self should: [ 16rp ] raise: MessageNotUnderstood.
+	self should: [ 16rQ ] raise: MessageNotUnderstood.
+	self should: [ 16rq ] raise: MessageNotUnderstood.
+	self should: [ 16rR ] raise: MessageNotUnderstood.
+	self should: [ 16rr ] raise: MessageNotUnderstood.
+	self should: [ 16rS ] raise: MessageNotUnderstood.
+	self should: [ 16rs ] raise: MessageNotUnderstood.
+	self should: [ 16rT ] raise: MessageNotUnderstood.
+	self should: [ 16rt ] raise: MessageNotUnderstood.
+	self should: [ 16rU ] raise: MessageNotUnderstood.
+	self should: [ 16ru ] raise: MessageNotUnderstood.
+	self should: [ 16rV ] raise: MessageNotUnderstood.
+	self should: [ 16rv ] raise: MessageNotUnderstood.
+	self should: [ 16rW ] raise: MessageNotUnderstood.
+	self should: [ 16rw ] raise: MessageNotUnderstood.
+	self should: [ 16rX ] raise: MessageNotUnderstood.
+	self should: [ 16rx ] raise: MessageNotUnderstood.
+	self should: [ 16rY ] raise: MessageNotUnderstood.
+	self should: [ 16ry ] raise: MessageNotUnderstood.
+	self should: [ 16rZ ] raise: MessageNotUnderstood.
+	self should: [ 16rz ] raise: MessageNotUnderstood.
+	self should: [ 16rABcdEfZ ] raise: MessageNotUnderstood.
 !
 
 testLog
@@ -1510,10 +1621,10 @@ testTimesRepeat
 	| i |
 
 	i := 0.
-	0 timesRepeat: [i := i + 1].
+	0 timesRepeat: [ i := i + 1 ].
 	self assert: i equals: 0.
 
-	5 timesRepeat: [i := i + 1].
+	5 timesRepeat: [ i := i + 1 ].
 	self assert: i equals: 5
 !
 
@@ -1524,7 +1635,7 @@ testTo
 testToBy
 	self assert: (0 to: 6 by: 2) equals: #(0 2 4 6).
 
-	self should: [1 to: 4 by: 0] raise: Error
+	self should: [ 1 to: 4 by: 0 ] raise: Error
 !
 
 testTrigonometry
@@ -1552,7 +1663,7 @@ ObjectMock is there only to perform tests on classes.!
 !ObjectMock methodsFor: 'not yet classified'!
 
 foo
-	^foo
+	^ foo
 !
 
 foo: anObject
@@ -1580,15 +1691,15 @@ testBasicAccess
 testBasicPerform
 	| o |
 	o := Object new.
-	o basicAt: 'func' put: ['hello'].
-	o basicAt: 'func2' put: [:a | a + 1].
+	o basicAt: 'func' put: [ 'hello' ].
+	o basicAt: 'func2' put: [ :a | a + 1 ].
 
 	self assert: (o basicPerform: 'func') equals: 'hello'.
 	self assert: (o basicPerform: 'func2' withArguments: #(3)) equals: 4
 !
 
 testDNU
-	self should: [Object new foo] raise: MessageNotUnderstood
+	self should: [ Object new foo ] raise: MessageNotUnderstood
 !
 
 testEquality
@@ -1601,7 +1712,7 @@ testEquality
 !
 
 testHalt
-	self should: [Object new halt] raise: Error
+	self should: [ Object new halt ] raise: Error
 !
 
 testIdentity
@@ -1615,11 +1726,11 @@ testIdentity
 
 testIfNil
 	self deny: Object new isNil.
-	self deny: (Object new ifNil: [true]) = true.
-	self assert: (Object new ifNotNil: [true]) equals: true.
+	self deny: (Object new ifNil: [ true ]) = true.
+	self assert: (Object new ifNotNil: [ true ]) equals: true.
 
-	self assert: (Object new ifNil: [false] ifNotNil: [true]) equals: true.
-	self assert: (Object new ifNotNil: [true] ifNil: [false]) equals: true
+	self assert: (Object new ifNil: [ false ] ifNotNil: [ true ]) equals: true.
+	self assert: (Object new ifNotNil: [ true ] ifNil: [ false ]) equals: true
 !
 
 testInstVars
@@ -1683,6 +1794,14 @@ testEgality
 	self deny: 3@5 = (3@6)
 !
 
+testNew
+
+	self assert: (Point new x: 3) y equals: nil.
+	self deny: (Point new x: 3) x = 0.
+	self assert: (Point new y: 4) x equals: nil.
+	self deny: (Point new y: 4) y = 0
+!
+
 testTranslateBy
 	self assert: (3@3 translateBy: 0@1) equals: 3@4.
 	self assert: (3@3 translateBy: 0@1 negated) equals: 3@2.
@@ -1690,12 +1809,58 @@ testTranslateBy
 	self assert: (3@3 translateBy: 3 negated @0) equals: 0@3.
 ! !
 
+TestCase subclass: #QueueTest
+	instanceVariableNames: ''
+	package: 'Kernel-Tests'!
+
+!QueueTest methodsFor: 'tests'!
+
+testNextIfAbsent
+	| queue |
+	queue := Queue new.
+	queue nextPut: 'index1'. 
+
+	self assert: (queue  nextIfAbsent: 'empty') = 'index1'.
+	self deny: (queue  nextIfAbsent: 'empty') = 'index1'
+!
+
+testQueueNext
+	| queue |               
+	queue := Queue new.
+	queue 
+		nextPut: 'index1';
+		nextPut: 'index2'.
+
+	self assert: queue next = 'index1'.
+	self deny: queue next = 'index'.
+	self should: [ queue next ] raise: Error
+! !
+
 TestCase subclass: #RandomTest
 	instanceVariableNames: ''
 	package: 'Kernel-Tests'!
 
 !RandomTest methodsFor: 'tests'!
 
+testAtRandomNumber
+	|val|	
+
+	100 timesRepeat: [
+		val := 10 atRandom.	
+		self assert: (val > 0).
+		self assert: (val <11)
+	]
+!
+
+testAtRandomSequenceableCollection
+	|val|
+	
+	100 timesRepeat: [
+		val := 'abc' atRandom.
+		self assert: ((val = 'a') | (val = 'b') | (val = 'c' )).
+	].
+!
+
 textNext
 
 	10000 timesRepeat: [
@@ -1704,7 +1869,7 @@ textNext
 			self assert: (next >= 0).
 			self assert: (next < 1).
 			self deny: current = next.
-			next = current]
+			next = current ]
 ! !
 
 TestCase subclass: #SetTest
@@ -1730,7 +1895,7 @@ testAddRemove
 !
 
 testAt
-	self should: [Set new at: 1 put: 2] raise: Error
+	self should: [ Set new at: 1 put: 2 ] raise: Error
 !
 
 testCollect
@@ -1961,10 +2126,10 @@ testDeepCopy
 !
 
 testIfNil
-	self assert: (nil ifNil: [true]) equals: true.
-	self deny: (nil ifNotNil: [true]) = true.
-	self assert: (nil ifNil: [true] ifNotNil: [false]) equals: true.
-	self deny: (nil ifNotNil: [true] ifNil: [false]) = true
+	self assert: (nil ifNil: [ true ]) equals: true.
+	self deny: (nil ifNotNil: [ true ]) = true.
+	self assert: (nil ifNil: [ true ] ifNotNil: [ false ]) equals: true.
+	self deny: (nil ifNotNil: [ true ] ifNil: [ false ]) = true
 !
 
 testIsNil

+ 1 - 1
st/Kernel-Transcript.st

@@ -53,7 +53,7 @@ Transcript class instanceVariableNames: 'current'!
 !Transcript class methodsFor: 'instance creation'!
 
 current
-	^current
+	^ current
 !
 
 new

+ 8 - 8
st/SUnit-Tests.st

@@ -28,10 +28,10 @@ testGrow
 
 testIllegal
 	self
-		should: [empty at: 5]
+		should: [ empty at: 5 ]
 		raise: Error.
 	self
-		should: [empty at: 5 put: #abc]
+		should: [ empty at: 5 put: #abc ]
 		raise: Error
 !
 
@@ -79,7 +79,7 @@ fakeFailure
 
 fakeMultipleTimeoutFailing
 	self timeout: 100.
-	(self async: [
+	(self async: [ 
 		self timeout: 20.
 		(self async: [ self finished ]) valueWithTimeout: 30
 	]) valueWithTimeout: 20
@@ -101,7 +101,7 @@ fakeTimeout
 !SUnitAsyncTest methodsFor: 'private'!
 
 selectorSetOf: aCollection
-	^(aCollection collect: [:each | each selector]) asSet
+	^ (aCollection collect: [ :each | each selector ]) asSet
 ! !
 
 !SUnitAsyncTest methodsFor: 'running'!
@@ -127,8 +127,8 @@ testAsyncErrorsAndFailures
 		self assert: (self selectorSetOf: result failures) equals: #('fakeErrorFailingInTearDown' 'fakeFailure') asSet.
 		self finished
 	].
-	runner announcer on: ResultAnnouncement do: [:ann |
-		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ]].
+	runner announcer on: ResultAnnouncement do: [ :ann |
+		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ] ].
 	runner run
 !
 
@@ -170,8 +170,8 @@ testTimeouts
 		self assert: (self selectorSetOf: result failures) equals: #('fakeMultipleTimeoutFailing' 'fakeTimeout') asSet.
 		self finished
 	].
-	runner announcer on: ResultAnnouncement do: [:ann |
-		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ]].
+	runner announcer on: ResultAnnouncement do: [ :ann |
+		ann result == result ifTrue: [ result runs = result total ifTrue: assertBlock ] ].
 	runner run
 !
 

+ 38 - 39
st/SUnit.st

@@ -10,7 +10,7 @@ My instances hold the result (instance of `TestResult`) of the test run.!
 !ResultAnnouncement methodsFor: 'accessing'!
 
 result
-	^result
+	^ result
 !
 
 result: aTestResult
@@ -40,7 +40,7 @@ context: aRunningTestContext
 !
 
 selector
-	^testSelector
+	^ testSelector
 !
 
 setTestSelector: aSelector
@@ -115,7 +115,7 @@ assert: aBoolean
 !
 
 assert: aBoolean description: aString
-	aBoolean ifFalse: [self signalFailure: aString]
+	aBoolean ifFalse: [ self signalFailure: aString ]
 !
 
 assert: actual equals: expected
@@ -127,7 +127,7 @@ deny: aBoolean
 !
 
 isAsync
-	^asyncTimeout notNil
+	^ asyncTimeout notNil
 !
 
 should: aBlock
@@ -135,15 +135,15 @@ should: aBlock
 !
 
 should: aBlock raise: anExceptionClass
-	self assert: ([aBlock value. false]
+	self assert: ([ aBlock value. false ]
 		on: anExceptionClass
-		do: [:ex | true])
+		do: [ :ex | true ])
 !
 
 shouldnt: aBlock raise: anExceptionClass
-	self assert: ([aBlock value. true]
+	self assert: ([ aBlock value. true ]
 		on: anExceptionClass
-		do: [:ex | false])
+		do: [ :ex | false ])
 ! !
 
 !TestCase class methodsFor: 'accessing'!
@@ -152,26 +152,26 @@ allTestSelectors
 	| selectors |
 	selectors := self testSelectors.
 	self shouldInheritSelectors ifTrue: [
-		selectors addAll: self superclass allTestSelectors].
-	^selectors
+		selectors addAll: self superclass allTestSelectors ].
+	^ selectors
 !
 
 buildSuite
-	^self allTestSelectors collect: [:each | self selector: each]
+	^ self allTestSelectors collect: [ :each | self selector: each ]
 !
 
 lookupHierarchyRoot
-	^TestCase
+	^ TestCase
 !
 
 selector: aSelector
-	^self new
+	^ self new
 		setTestSelector: aSelector;
 		yourself
 !
 
 testSelectors
-	^self methodDictionary keys select: [:each | each match: '^test']
+	^ self methodDictionary keys select: [ :each | each match: '^test' ]
 ! !
 
 !TestCase class methodsFor: 'helios'!
@@ -187,7 +187,7 @@ isAbstract
 !
 
 shouldInheritSelectors
-	^self ~= self lookupHierarchyRoot
+	^ self ~= self lookupHierarchyRoot
 ! !
 
 Object subclass: #TestContext
@@ -233,7 +233,7 @@ start
 !TestContext class methodsFor: 'instance creation'!
 
 testCase: aTestCase
-	^self new
+	^ self new
 		testCase: aTestCase;
 		yourself
 ! !
@@ -282,7 +282,7 @@ execute: aBlock
 !ReportingTestContext class methodsFor: 'instance creation'!
 
 testCase: aTestCase result: aTestResult finished: aBlock
-	^(super testCase: aTestCase)
+	^ (super testCase: aTestCase)
 		result: aTestResult;
 		finished: aBlock;
 		yourself
@@ -319,11 +319,11 @@ addFailure: aFailure
 !
 
 errors
-	^errors
+	^ errors
 !
 
 failures
-	^failures
+	^ failures
 !
 
 increaseRuns
@@ -331,24 +331,24 @@ increaseRuns
 !
 
 runs
-	^runs
+	^ runs
 !
 
 status
-	^self errors isEmpty
+	^ self errors isEmpty
 		ifTrue: [
 			self failures isEmpty
-				ifTrue: ['success']
-				ifFalse: ['failure']]
-		ifFalse: ['error']
+				ifTrue: [ 'success' ]
+				ifFalse: [ 'failure' ]]
+		ifFalse: [ 'error' ]
 !
 
 timestamp
-	^timestamp
+	^ timestamp
 !
 
 total
-	^total
+	^ total
 !
 
 total: aNumber
@@ -369,17 +369,16 @@ initialize
 !TestResult methodsFor: 'running'!
 
 nextRunDo: aBlock
-"Runs aBlock with index of next run
-or does nothing if no more runs"
-^self runs == self total
-	ifFalse: [ aBlock value: self runs + 1 ]
+	"Runs aBlock with index of next run or does nothing if no more runs"
+	^ self runs == self total
+		ifFalse: [ aBlock value: self runs + 1 ]
 !
 
 runCase: aTestCase
-	[[ self increaseRuns.
-		aTestCase runCase]
-	on: TestFailure do: [:ex | self addFailure: aTestCase]]
-	on: Error do: [:ex | self addError: aTestCase]
+	[ [ self increaseRuns.
+		aTestCase runCase ]
+	on: TestFailure do: [ :ex | self addFailure: aTestCase ]]
+	on: Error do: [ :ex | self addError: aTestCase ]
 ! !
 
 Object subclass: #TestSuiteRunner
@@ -396,11 +395,11 @@ To run the test suite, use `#run`.!
 !TestSuiteRunner methodsFor: 'accessing'!
 
 announcer
-	^announcer
+	^ announcer
 !
 
 result
-	^result
+	^ result
 !
 
 suite: aCollection
@@ -425,13 +424,13 @@ initialize
 	super initialize.
 	announcer := Announcer new.
 	result := TestResult new.
-	runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ]].
+	runNextTest := [ | runs | runs := result runs. runs < result total ifTrue: [ (self contextOf: runs + 1) start ] ].
 ! !
 
 !TestSuiteRunner methodsFor: 'private'!
 
 contextOf: anInteger
-	^ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]
+	^ ReportingTestContext testCase: (suite at: anInteger) result: result finished: [ self resume ]
 ! !
 
 !TestSuiteRunner class methodsFor: 'instance creation'!
@@ -441,6 +440,6 @@ new
 !
 
 on: aCollection
-	^super new suite: aCollection
+	^ super new suite: aCollection
 ! !
 

+ 29 - 13
support/amber.js

@@ -17,7 +17,23 @@ var require;
 require = function (require) {
     var scripts = document.getElementsByTagName("script");
     var src = scripts[ scripts.length - 1 ].src;
-    var home = resolveViaDOM(src).replace(/\/[^\/]+\/[^\/]+$/, "");
+    // strip the last two elements from the URL
+    // e.g. http://app.com/lib/script.js -> http://app.com/
+    var amber_home = resolveViaDOM(src).replace(/\/[^\/]+\/[^\/]+$/, "");
+    // strip the last element from the URL
+    // e.g. http://app.com/index.html -> http://app.com/
+    var document_home = window.location.href.replace(/\/[^\/]+$/, "");
+
+    // at the present moment, bower tries to have flat hierarchy,
+    // which leads to two possible scenarios:
+    // 1. amber itself was deployed via bower,
+    //    its libraries are next to it; document_home from above covers this
+    // 2. amber was deployed in different fashion,
+    //    its libraries are included by bower locally; document_home is fixed below
+    // The detection is done by looking for '/bower_components/' in amber path.
+    if (!amber_home.match(/\/bower_components\//)) {
+        document_home = amber_home;
+    }
 
     function resolveViaDOM(url) {
         var a = document.createElement("a");
@@ -27,16 +43,16 @@ require = function (require) {
 
     var config = {
         paths: {
-            'amber': home+'/support',
-            'amber_vm': home+'/support',
-            'amber_css': home+'/css',
-            'amber_lib': home+'/bower_components',
-            'amber_inc': home+'/support',
-            'amber_core': home+'/js',
-            'amber_core/_source': home+'/st',
-            'amber_html': home,
-            'jquery': home+'/bower_components/jquery/jquery.min',
-            'jquery-ui': home+'/support/jQuery/jquery-ui-1.8.24.custom.min'
+            'amber': amber_home + '/support',
+            'amber_vm': amber_home + '/support',
+            'amber_css': amber_home + '/css',
+            'amber_lib': document_home + '/bower_components',
+            'amber_inc': amber_home + '/support',
+            'amber_core': amber_home + '/js',
+            'amber_core/_source': amber_home + '/st',
+            'amber_html': amber_home,
+            'jquery': document_home + '/bower_components/jquery/jquery.min',
+            'jquery-ui': amber_home + '/support/jQuery/jquery-ui-1.8.24.custom.min'
         },
         map: {
             '*': {
@@ -48,7 +64,7 @@ require = function (require) {
                 deps: [ 'jquery' ]
             },
             'amber_lib/bootstrap/js/bootstrap': {
-                deps: [ 'css!amber_lib/bootstrap/css/bootstrap' ]
+                deps: [ 'jquery', 'css!amber_lib/bootstrap/css/bootstrap' ]
             },
             'amber_lib/CodeMirror/codemirror': {
                 deps: [ 'css!amber_lib/codemirror/lib/codemirror' ]
@@ -79,4 +95,4 @@ require = function (require) {
     } else {
         return config;
     }
-}(require);
+}(require);

+ 8 - 1
support/boot.js

@@ -7,9 +7,13 @@
 
    ======================================================================
    |
-   | Copyright (c) 2010-2011
+   | Copyright (c) 2010-2013
    | Nicolas Petton <petton.nicolas@gmail.com>
    |
+   | Copyright (c) 2012-2013
+   | The Amber team https://github.com/amber-smalltalk?tab=members
+   | Amber contributors https://github.com/amber-smalltalk/amber/graphs/contributors
+   |
    | Amber is released under the MIT license
    |
    | Permission is hereby granted, free of charge, to any person obtaining
@@ -812,6 +816,9 @@ function RuntimeBrik(brikz, st) {
 			this.selector    = selector;
 			this.locals      = locals || {};
 			this.lookupClass = lookupClass;
+			if(this.homeContext) {
+				this.homeContext.evaluatedSelector = selector;
+			}
 		};
 
 		SmalltalkMethodContext.prototype.fillBlock = function(locals, ctx, index) {

+ 88 - 14
test/Test.js

@@ -6,15 +6,15 @@ smalltalk.addClass('NodeTestRunner', smalltalk.Object, [], 'Test');
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "initialize",
+selector: "main",
 category: 'not yet classified',
 fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 self._runTestSuite();
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.NodeTestRunner.klass)})},
+return self}, function($ctx1) {$ctx1.fill(self,"main",{},smalltalk.NodeTestRunner.klass)})},
 args: [],
-source: "initialize\x0a\x09self runTestSuite",
+source: "main\x0a\x09self runTestSuite",
 messageSends: ["runTestSuite"],
 referencedClasses: []
 }),
@@ -32,7 +32,7 @@ function $TestCase(){return smalltalk.TestCase||(typeof TestCase=="undefined"?ni
 function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
 function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3;
+var $2,$1,$3,$10,$9,$8,$13,$12,$11,$7,$6,$16,$15,$14,$5,$4,$18,$17,$20,$19,$27,$26,$25,$24,$23,$30,$29,$28,$22,$21,$32,$31,$34,$33,$41,$40,$39,$38,$37,$44,$43,$42,$36,$35;
 suite=_st($OrderedCollection())._new();
 _st(_st(_st($TestCase())._allSubclasses())._select_((function(each){
 return smalltalk.withContext(function($ctx2) {
@@ -47,18 +47,92 @@ var result;
 return smalltalk.withContext(function($ctx2) {
 result=_st(ann)._result();
 result;
-$1=_st(_st(result)._runs()).__eq(_st(result)._total());
+$2=_st(result)._runs();
+$ctx2.sendIdx["runs"]=1;
+$1=_st($2).__eq(_st(result)._total());
 if(smalltalk.assert($1)){
-_st(console)._log_(_st(_st(_st(_st(_st(_st(_st(result)._runs())._asString()).__comma(" tests run, ")).__comma(_st(_st(_st(result)._failures())._size())._asString())).__comma(" failures, ")).__comma(_st(_st(_st(result)._errors())._size())._asString())).__comma(" errors."));
-$2=_st(_st(result)._failures())._isEmpty();
-if(! smalltalk.assert($2)){
-_st(_st(_st(result)._failures())._first())._runCase();
-self._throw_(_st(_st(_st(_st(_st(_st(_st(result)._failures())._first())._class())._name()).__comma(" >> ")).__comma(_st(_st(_st(result)._failures())._first())._selector())).__comma(" is failing!"));
+$3=console;
+$10=_st(result)._runs();
+$9=_st($10)._asString();
+$ctx2.sendIdx["asString"]=1;
+$8=_st($9).__comma(" tests run, ");
+$ctx2.sendIdx[","]=5;
+$13=_st(result)._failures();
+$ctx2.sendIdx["failures"]=1;
+$12=_st($13)._size();
+$ctx2.sendIdx["size"]=1;
+$11=_st($12)._asString();
+$ctx2.sendIdx["asString"]=2;
+$7=_st($8).__comma($11);
+$ctx2.sendIdx[","]=4;
+$6=_st($7).__comma(" failures, ");
+$ctx2.sendIdx[","]=3;
+$16=_st(result)._errors();
+$ctx2.sendIdx["errors"]=1;
+$15=_st($16)._size();
+$14=_st($15)._asString();
+$5=_st($6).__comma($14);
+$ctx2.sendIdx[","]=2;
+$4=_st($5).__comma(" errors.");
+$ctx2.sendIdx[","]=1;
+_st($3)._log_($4);
+$18=_st(result)._failures();
+$ctx2.sendIdx["failures"]=2;
+$17=_st($18)._isEmpty();
+$ctx2.sendIdx["isEmpty"]=1;
+if(! smalltalk.assert($17)){
+$20=_st(result)._failures();
+$ctx2.sendIdx["failures"]=3;
+$19=_st($20)._first();
+$ctx2.sendIdx["first"]=1;
+_st($19)._runCase();
+$ctx2.sendIdx["runCase"]=1;
+$27=_st(result)._failures();
+$ctx2.sendIdx["failures"]=4;
+$26=_st($27)._first();
+$ctx2.sendIdx["first"]=2;
+$25=_st($26)._class();
+$ctx2.sendIdx["class"]=1;
+$24=_st($25)._name();
+$ctx2.sendIdx["name"]=1;
+$23=_st($24).__comma(" >> ");
+$ctx2.sendIdx[","]=8;
+$30=_st(result)._failures();
+$29=_st($30)._first();
+$ctx2.sendIdx["first"]=3;
+$28=_st($29)._selector();
+$ctx2.sendIdx["selector"]=1;
+$22=_st($23).__comma($28);
+$ctx2.sendIdx[","]=7;
+$21=_st($22).__comma(" is failing!");
+$ctx2.sendIdx[","]=6;
+self._throw_($21);
+$ctx2.sendIdx["throw:"]=1;
 };
-$3=_st(_st(result)._errors())._isEmpty();
-if(! smalltalk.assert($3)){
-_st(_st(_st(result)._errors())._first())._runCase();
-return self._throw_(_st(_st(_st(_st(_st(_st(_st(result)._errors())._first())._class())._name()).__comma(" >> ")).__comma(_st(_st(_st(result)._errors())._first())._selector())).__comma(" has errors!"));
+$32=_st(result)._errors();
+$ctx2.sendIdx["errors"]=2;
+$31=_st($32)._isEmpty();
+if(! smalltalk.assert($31)){
+$34=_st(result)._errors();
+$ctx2.sendIdx["errors"]=3;
+$33=_st($34)._first();
+$ctx2.sendIdx["first"]=4;
+_st($33)._runCase();
+$41=_st(result)._errors();
+$ctx2.sendIdx["errors"]=4;
+$40=_st($41)._first();
+$ctx2.sendIdx["first"]=5;
+$39=_st($40)._class();
+$38=_st($39)._name();
+$37=_st($38).__comma(" >> ");
+$44=_st(result)._errors();
+$43=_st($44)._first();
+$42=_st($43)._selector();
+$36=_st($37).__comma($42);
+$ctx2.sendIdx[","]=10;
+$35=_st($36).__comma(" has errors!");
+$ctx2.sendIdx[","]=9;
+return self._throw_($35);
 };
 };
 }, function($ctx2) {$ctx2.fillBlock({ann:ann,result:result},$ctx1,3)})}));

+ 1 - 1
test/Test.st

@@ -5,7 +5,7 @@ Object subclass: #NodeTestRunner
 
 !NodeTestRunner class methodsFor: 'not yet classified'!
 
-initialize
+main
 	self runTestSuite
 !
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác