Browse Source

Merge branch 'less-globals' into requirejs

Conflicts:
	index.html
	js/boot.js
Herbert Vojčík 11 years ago
parent
commit
cfb0589704
86 changed files with 1490 additions and 1022 deletions
  1. 1 1
      grunt/tasks/grunt-peg.js
  2. 2 0
      js/Benchfib.deploy.js
  3. 2 0
      js/Benchfib.js
  4. 2 0
      js/Canvas.deploy.js
  5. 2 0
      js/Canvas.js
  6. 2 0
      js/Compiler-AST.deploy.js
  7. 2 0
      js/Compiler-AST.js
  8. 2 0
      js/Compiler-Core.deploy.js
  9. 2 0
      js/Compiler-Core.js
  10. 2 0
      js/Compiler-Exceptions.deploy.js
  11. 2 0
      js/Compiler-Exceptions.js
  12. 2 0
      js/Compiler-IR.deploy.js
  13. 2 0
      js/Compiler-IR.js
  14. 2 0
      js/Compiler-Inlining.deploy.js
  15. 2 0
      js/Compiler-Inlining.js
  16. 2 0
      js/Compiler-Interpreter.deploy.js
  17. 2 0
      js/Compiler-Interpreter.js
  18. 2 0
      js/Compiler-Semantic.deploy.js
  19. 2 0
      js/Compiler-Semantic.js
  20. 2 0
      js/Compiler-Tests.deploy.js
  21. 2 0
      js/Compiler-Tests.js
  22. 2 0
      js/Examples.deploy.js
  23. 2 0
      js/Examples.js
  24. 2 0
      js/Helios-Announcements.deploy.js
  25. 2 0
      js/Helios-Announcements.js
  26. 2 0
      js/Helios-Browser.deploy.js
  27. 2 0
      js/Helios-Browser.js
  28. 2 0
      js/Helios-Commands-Browser.deploy.js
  29. 2 0
      js/Helios-Commands-Browser.js
  30. 2 0
      js/Helios-Commands-Core.deploy.js
  31. 2 0
      js/Helios-Commands-Core.js
  32. 2 0
      js/Helios-Commands-Tools.deploy.js
  33. 2 0
      js/Helios-Commands-Tools.js
  34. 154 76
      js/Helios-Commands.deploy.js
  35. 154 76
      js/Helios-Commands.js
  36. 2 0
      js/Helios-Core.deploy.js
  37. 2 0
      js/Helios-Core.js
  38. 2 0
      js/Helios-Debugger.deploy.js
  39. 2 0
      js/Helios-Debugger.js
  40. 2 0
      js/Helios-Exceptions.deploy.js
  41. 2 0
      js/Helios-Exceptions.js
  42. 2 0
      js/Helios-Inspector.deploy.js
  43. 2 0
      js/Helios-Inspector.js
  44. 2 0
      js/Helios-KeyBindings.deploy.js
  45. 2 0
      js/Helios-KeyBindings.js
  46. 2 0
      js/Helios-Layout.deploy.js
  47. 2 0
      js/Helios-Layout.js
  48. 2 0
      js/Helios-References.deploy.js
  49. 2 0
      js/Helios-References.js
  50. 2 0
      js/Helios-Transcript.deploy.js
  51. 2 0
      js/Helios-Transcript.js
  52. 2 0
      js/Helios-Workspace-Tests.deploy.js
  53. 2 0
      js/Helios-Workspace-Tests.js
  54. 2 0
      js/Helios-Workspace.deploy.js
  55. 2 0
      js/Helios-Workspace.js
  56. 2 0
      js/IDE.deploy.js
  57. 2 0
      js/IDE.js
  58. 60 3
      js/Importer-Exporter.deploy.js
  59. 81 4
      js/Importer-Exporter.js
  60. 2 0
      js/Kernel-Announcements.deploy.js
  61. 2 0
      js/Kernel-Announcements.js
  62. 2 0
      js/Kernel-Classes.deploy.js
  63. 2 0
      js/Kernel-Classes.js
  64. 2 0
      js/Kernel-Collections.deploy.js
  65. 2 0
      js/Kernel-Collections.js
  66. 2 0
      js/Kernel-Exceptions.deploy.js
  67. 2 0
      js/Kernel-Exceptions.js
  68. 2 0
      js/Kernel-Methods.deploy.js
  69. 2 0
      js/Kernel-Methods.js
  70. 2 0
      js/Kernel-Objects.deploy.js
  71. 2 0
      js/Kernel-Objects.js
  72. 2 0
      js/Kernel-Tests.deploy.js
  73. 2 0
      js/Kernel-Tests.js
  74. 2 0
      js/Kernel-Transcript.deploy.js
  75. 2 0
      js/Kernel-Transcript.js
  76. 2 0
      js/SUnit-Tests.deploy.js
  77. 2 0
      js/SUnit-Tests.js
  78. 2 0
      js/SUnit.deploy.js
  79. 2 0
      js/SUnit.js
  80. 2 0
      js/Spaces.deploy.js
  81. 2 0
      js/Spaces.js
  82. 2 2
      js/amber.js
  83. 853 852
      js/boot.js
  84. 3 3
      js/init.js
  85. 2 0
      js/parser.js
  86. 28 5
      st/Importer-Exporter.st

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

@@ -23,7 +23,7 @@ module.exports = function(grunt) {
       export_var: 'module.exports'
     });
     var parser = PEG.buildParser(grunt.file.read(this.data.src), options);
-    var content = options.export_var + ' = ' + parser.toSource() + ';\n';
+    var content = '(function(smalltalk,nil){\n'+options.export_var + ' = ' + parser.toSource() + ';\n})(global_smalltalk,global_nil);';
     grunt.file.write(this.data.dest, content);
   });
 };

+ 2 - 0
js/Benchfib.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Benchfib');
 smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
 
@@ -215,3 +216,4 @@ return $1;
 messageSends: ["whileTrue:", "*", "millisecondsToRun:", "benchmark", "<", "+", "benchFib", ",", "printString", "/"]}),
 smalltalk.Number);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Benchfib.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Benchfib');
 smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib');
 
@@ -250,3 +251,4 @@ referencedClasses: ["Date"]
 }),
 smalltalk.Number);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Canvas.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Canvas');
 smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
 smalltalk.addMethod(
@@ -2758,3 +2759,4 @@ return self}, function($ctx1) {$ctx1.fill(self,"asJQuery",{},smalltalk.JSObjectP
 messageSends: []}),
 smalltalk.JSObjectProxy);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Canvas.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Canvas');
 smalltalk.addClass('HTMLCanvas', smalltalk.Object, ['root'], 'Canvas');
 smalltalk.HTMLCanvas.comment="I am a canvas for building HTML.\x0a\x0aI provide the `#tag:` method to create a `TagBrush` (wrapping a DOM element) and convenience methods in the `tags` protocol.\x0a\x0a## API\x0a\x0aMy instances are used as the argument of the `#renderOn:` method of `Widget` objects.\x0a\x0aThe `#with:` method is used to compose HTML, nesting tags. `#with:` can take a `TagBrush`, a `String`, a `BlockClosure` or a `Widget` as argument.\x0a\x0a## Usage example:\x0a\x0a    aCanvas a \x0a        with: [ aCanvas span with: 'click me' ];\x0a        onClick: [ window alert: 'clicked!' ]";
@@ -3843,3 +3844,4 @@ referencedClasses: []
 }),
 smalltalk.JSObjectProxy);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-AST.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-AST');
 smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
 smalltalk.addMethod(
@@ -1536,3 +1537,4 @@ return $1;
 messageSends: ["ifEmpty:", "error:", "source", "parse:", "current"]}),
 smalltalk.CompiledMethod);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-AST.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-AST');
 smalltalk.addClass('Node', smalltalk.Object, ['parent', 'position', 'nodes', 'shouldBeInlined', 'shouldBeAliased'], 'Compiler-AST');
 smalltalk.Node.comment="I am the abstract root class of the abstract syntax tree.\x0a\x0aConcrete classes should implement `#accept:` to allow visiting.\x0a\x0a`position` holds a point containing line and column number of the symbol location in the original source file.";
@@ -2101,3 +2102,4 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.CompiledMethod);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Core.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Core');
 smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
 smalltalk.addMethod(
@@ -755,3 +756,4 @@ smalltalk.NodeVisitor);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Core.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Core');
 smalltalk.addClass('AbstractCodeGenerator', smalltalk.Object, ['currentClass', 'source'], 'Compiler-Core');
 smalltalk.AbstractCodeGenerator.comment="I am the abstract super class of all code generators and provide their common API.";
@@ -1020,3 +1021,4 @@ smalltalk.NodeVisitor);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Exceptions.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Exceptions');
 smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
 
@@ -157,3 +158,4 @@ smalltalk.RethrowErrorHandler);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Exceptions.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Exceptions');
 smalltalk.addClass('CompilerError', smalltalk.Error, [], 'Compiler-Exceptions');
 smalltalk.CompilerError.comment="I am the common superclass of all compiling errors.";
@@ -220,3 +221,4 @@ smalltalk.RethrowErrorHandler);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-IR.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-IR');
 smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
 smalltalk.addMethod(
@@ -2777,3 +2778,4 @@ return $1;
 messageSends: ["ifTrue:ifFalse:", ",", "includes:", "reservedWords", "current"]}),
 smalltalk.String);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-IR.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-IR');
 smalltalk.addClass('IRASTTranslator', smalltalk.NodeVisitor, ['source', 'theClass', 'method', 'sequence', 'nextAlias'], 'Compiler-IR');
 smalltalk.IRASTTranslator.comment="I am the AST (abstract syntax tree) visitor responsible for building the intermediate representation graph.";
@@ -3681,3 +3682,4 @@ referencedClasses: ["Smalltalk"]
 }),
 smalltalk.String);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Inlining.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Inlining');
 smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
 smalltalk.addMethod(
@@ -1157,3 +1158,4 @@ smalltalk.InliningCodeGenerator);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Inlining.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Inlining');
 smalltalk.addClass('IRInlinedAssignment', smalltalk.IRAssignment, [], 'Compiler-Inlining');
 smalltalk.IRInlinedAssignment.comment="I represent an inlined assignment instruction.";
@@ -1502,3 +1503,4 @@ smalltalk.InliningCodeGenerator);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Interpreter.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Interpreter');
 smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['methodContext', 'outerContext', 'pc', 'locals', 'method'], 'Compiler-Interpreter');
 smalltalk.addMethod(
@@ -1529,3 +1530,4 @@ return $1;
 messageSends: ["interpretClassReferenceNode:continue:"]}),
 smalltalk.ClassReferenceNode);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Interpreter.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Interpreter');
 smalltalk.addClass('AIContext', smalltalk.NodeVisitor, ['methodContext', 'outerContext', 'pc', 'locals', 'method'], '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)";
@@ -2044,3 +2045,4 @@ referencedClasses: []
 }),
 smalltalk.ClassReferenceNode);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Semantic.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Semantic');
 smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
 smalltalk.addMethod(
@@ -1341,3 +1342,4 @@ messageSends: ["theClass:", "new", "yourself"]}),
 smalltalk.SemanticAnalyzer.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Semantic.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Semantic');
 smalltalk.addClass('LexicalScope', smalltalk.Object, ['node', 'instruction', 'temps', 'args', 'outerScope'], 'Compiler-Semantic');
 smalltalk.LexicalScope.comment="I represent a lexical scope where variable names are associated with ScopeVars\x0aInstances are used for block scopes. Method scopes are instances of MethodLexicalScope.\x0a\x0aI am attached to a ScopeVar and method/block nodes.\x0aEach context (method/closure) get a fresh scope that inherits from its outer scope.";
@@ -1777,3 +1778,4 @@ referencedClasses: []
 smalltalk.SemanticAnalyzer.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Tests.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Tests');
 smalltalk.addClass('ASTVisitorTest', smalltalk.TestCase, [], 'Compiler-Tests');
 smalltalk.addMethod(
@@ -1255,3 +1256,4 @@ smalltalk.SemanticAnalyzerTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Compiler-Tests.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Compiler-Tests');
 smalltalk.addClass('ASTVisitorTest', smalltalk.TestCase, [], 'Compiler-Tests');
 smalltalk.addMethod(
@@ -1665,3 +1666,4 @@ smalltalk.SemanticAnalyzerTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Examples.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Examples');
 smalltalk.addClass('Counterzzz', smalltalk.Widget, ['count', 'header'], 'Examples');
 smalltalk.addMethod(
@@ -82,3 +83,4 @@ messageSends: ["appendToJQuery:", "asJQuery", "new"]}),
 smalltalk.Counterzzz.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Examples.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Examples');
 smalltalk.addClass('Counterzzz', smalltalk.Widget, ['count', 'header'], 'Examples');
 smalltalk.Counterzzz.comment="This is a trivial Widget example mimicking the classic Counter example in Seaside.\x0aIn order to play with it, just evaluate the doit below in a workspace.\x0aThen take a look in the HTML document above the IDE.\x0a\x0a\x09\x09Counter new appendToJQuery: 'body' asJQuery";
@@ -108,3 +109,4 @@ referencedClasses: []
 smalltalk.Counterzzz.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Announcements.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Announcements');
 smalltalk.addClass('HLAboutToChange', smalltalk.Object, ['actionBlock'], 'Helios-Announcements');
 smalltalk.addMethod(
@@ -402,3 +403,4 @@ smalltalk.addClass('HLShowInstanceToggled', smalltalk.HLAnnouncement, [], 'Helio
 smalltalk.addClass('HLSourceCodeSaved', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Announcements.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Announcements');
 smalltalk.addClass('HLAboutToChange', smalltalk.Object, ['actionBlock'], 'Helios-Announcements');
 smalltalk.addMethod(
@@ -533,3 +534,4 @@ smalltalk.addClass('HLShowInstanceToggled', smalltalk.HLAnnouncement, [], 'Helio
 smalltalk.addClass('HLSourceCodeSaved', smalltalk.HLAnnouncement, [], 'Helios-Announcements');
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Browser.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Browser');
 smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget', 'bottomDiv'], 'Helios-Browser');
 smalltalk.addMethod(
@@ -2986,3 +2987,4 @@ messageSends: ["shouldNotImplement"]}),
 smalltalk.HLSelectorsCache.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Browser.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Browser');
 smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['model', 'packagesListWidget', 'classesListWidget', 'protocolsListWidget', 'methodsListWidget', 'sourceWidget', 'bottomDiv'], 'Helios-Browser');
 smalltalk.HLBrowser.comment="I render a system browser with 4 panes (Packages, Classes, Protocols, Methods) and a source area.";
@@ -3893,3 +3894,4 @@ referencedClasses: []
 smalltalk.HLSelectorsCache.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Browser.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Browser');
 smalltalk.addClass('HLBrowserCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Browser');
 
@@ -418,3 +419,4 @@ messageSends: []}),
 smalltalk.HLToggleInstanceSideCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Browser.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Browser');
 smalltalk.addClass('HLBrowserCommand', smalltalk.HLToolCommand, [], 'Helios-Commands-Browser');
 
@@ -588,3 +589,4 @@ referencedClasses: []
 smalltalk.HLToggleInstanceSideCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Core.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Core');
 smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
@@ -627,3 +628,4 @@ messageSends: []}),
 smalltalk.HLViewCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Core.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Core');
 smalltalk.addClass('HLCommand', smalltalk.Object, ['input'], 'Helios-Commands-Core');
 smalltalk.addMethod(
@@ -857,3 +858,4 @@ referencedClasses: []
 smalltalk.HLViewCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Tools.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Tools');
 smalltalk.addClass('HLToolCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
@@ -1341,3 +1342,4 @@ messageSends: []}),
 smalltalk.HLRenameProtocolCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Commands-Tools.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands-Tools');
 smalltalk.addClass('HLToolCommand', smalltalk.HLModelCommand, [], 'Helios-Commands-Tools');
 smalltalk.addMethod(
@@ -1896,3 +1897,4 @@ referencedClasses: []
 smalltalk.HLRenameProtocolCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 154 - 76
js/Helios-Commands.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands');
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands');
 smalltalk.addMethod(
@@ -6,9 +7,11 @@ smalltalk.method({
 selector: "asActionBinding",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(_st(self)._key(),_st(self)._label()))._callback_((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._execute();
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._execute();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},smalltalk.HLCommand)})},
@@ -21,7 +24,8 @@ smalltalk.method({
 selector: "asBinding",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
 $2=_st(self)._isBindingGroup();
 if(smalltalk.assert($2)){
 $1=_st(self)._asGroupBinding();
@@ -39,7 +43,8 @@ smalltalk.method({
 selector: "asGroupBinding",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLBindingGroup || HLBindingGroup))._on_labelled_(_st(self)._key(),_st(self)._label());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asGroupBinding",{},smalltalk.HLCommand)})},
@@ -52,7 +57,8 @@ smalltalk.method({
 selector: "documentation",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._documentation();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"documentation",{}, smalltalk.HLCommand)})},
@@ -65,7 +71,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCommand)})},
 messageSends: []}),
 smalltalk.HLCommand);
 
@@ -75,7 +82,8 @@ smalltalk.method({
 selector: "isBindingGroup",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(_st(_st(self)._class())._methodDictionary())._includesKey_("execute"))._not();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{},smalltalk.HLCommand)})},
@@ -88,7 +96,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._key();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCommand)})},
@@ -101,7 +110,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._label();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCommand)})},
@@ -114,7 +124,8 @@ smalltalk.method({
 selector: "registerOn:",
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(aBinding)._add_(_st(self)._asBinding());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand)})},
@@ -128,9 +139,11 @@ smalltalk.method({
 selector: "concreteSubclasses",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._subclasses())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._isConcrete();
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._isConcrete();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"concreteSubclasses",{},smalltalk.HLCommand.klass)})},
@@ -143,7 +156,8 @@ smalltalk.method({
 selector: "documentation",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "";
+return smalltalk.withContext(function($ctx1) { 
+return "";
 }, function($ctx1) {$ctx1.fill(self,"documentation",{}, smalltalk.HLCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCommand.klass);
@@ -154,7 +168,8 @@ smalltalk.method({
 selector: "isConcrete",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._key())._notNil();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isConcrete",{},smalltalk.HLCommand.klass)})},
@@ -167,7 +182,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return nil;
+return smalltalk.withContext(function($ctx1) { 
+return nil;
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCommand.klass);
@@ -178,7 +194,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "";
+return smalltalk.withContext(function($ctx1) { 
+return "";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCommand.klass);
@@ -189,10 +206,12 @@ smalltalk.method({
 selector: "registerConcreteClassesOn:",
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(self)._concreteSubclasses())._do_((function(each){
 var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_(aBinding);
+return smalltalk.withContext(function($ctx2) {
+binding=_st(each)._registerOn_(aBinding);
 binding;
 $1=_st(binding)._isBindingGroup();
 if(smalltalk.assert($1)){
@@ -209,7 +228,8 @@ smalltalk.method({
 selector: "registerOn:",
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._registerOn_(aBinding);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand.klass)})},
@@ -224,7 +244,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st((smalltalk.HLManager || HLManager))._current())._removeActiveTab();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st((smalltalk.HLManager || HLManager))._current())._removeActiveTab();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCloseTabCommand)})},
 messageSends: ["removeActiveTab", "current"]}),
 smalltalk.HLCloseTabCommand);
@@ -236,7 +257,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (87);
+return smalltalk.withContext(function($ctx1) { 
+return (87);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCloseTabCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCloseTabCommand.klass);
@@ -247,7 +269,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Close tab";
+return smalltalk.withContext(function($ctx1) { 
+return "Close tab";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCloseTabCommand.klass)})},
 messageSends: []}),
 smalltalk.HLCloseTabCommand.klass);
@@ -260,7 +283,8 @@ smalltalk.method({
 selector: "model",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@model"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLModelCommand)})},
@@ -273,7 +297,8 @@ smalltalk.method({
 selector: "model:",
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@model"]=aModel;
+return smalltalk.withContext(function($ctx1) { 
+self["@model"]=aModel;
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLModelCommand)})},
 messageSends: []}),
 smalltalk.HLModelCommand);
@@ -285,7 +310,8 @@ smalltalk.method({
 selector: "for:",
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(self)._new();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"for:",{aModel:aModel},smalltalk.HLModelCommand.klass)})},
@@ -298,10 +324,12 @@ smalltalk.method({
 selector: "registerConcreteClassesOn:for:",
 fn: function (aBinding,aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(self)._concreteSubclasses())._do_((function(each){
 var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_for_(aBinding,aModel);
+return smalltalk.withContext(function($ctx2) {
+binding=_st(each)._registerOn_for_(aBinding,aModel);
 binding;
 $1=_st(binding)._isBindingGroup();
 if(smalltalk.assert($1)){
@@ -318,7 +346,8 @@ smalltalk.method({
 selector: "registerOn:for:",
 fn: function (aBinding,aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._for_(aModel))._registerOn_(aBinding);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:for:",{aBinding:aBinding,aModel:aModel},smalltalk.HLModelCommand.klass)})},
@@ -334,7 +363,8 @@ smalltalk.method({
 selector: "for:",
 fn: function (aBrowserModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(self)._new();
 _st($2)._model_(aBrowserModel);
 $3=_st($2)._yourself();
@@ -353,7 +383,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (71);
+return smalltalk.withContext(function($ctx1) { 
+return (71);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToCommand.klass);
@@ -364,7 +395,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Go to";
+return smalltalk.withContext(function($ctx1) { 
+return "Go to";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToCommand.klass);
@@ -377,7 +409,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnClasses();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnClasses();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToClassesCommand)})},
 messageSends: ["focusOnClasses", "model"]}),
 smalltalk.HLGoToClassesCommand);
@@ -389,7 +422,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToClassesCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToClassesCommand.klass);
@@ -400,7 +434,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Classes";
+return smalltalk.withContext(function($ctx1) { 
+return "Classes";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToClassesCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToClassesCommand.klass);
@@ -413,7 +448,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnMethods();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnMethods();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToMethodsCommand)})},
 messageSends: ["focusOnMethods", "model"]}),
 smalltalk.HLGoToMethodsCommand);
@@ -425,7 +461,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToMethodsCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToMethodsCommand.klass);
@@ -436,7 +473,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Methods";
+return smalltalk.withContext(function($ctx1) { 
+return "Methods";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToMethodsCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToMethodsCommand.klass);
@@ -449,7 +487,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnPackages();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnPackages();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToPackagesCommand)})},
 messageSends: ["focusOnPackages", "model"]}),
 smalltalk.HLGoToPackagesCommand);
@@ -461,7 +500,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (80);
+return smalltalk.withContext(function($ctx1) { 
+return (80);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToPackagesCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToPackagesCommand.klass);
@@ -472,7 +512,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Packages";
+return smalltalk.withContext(function($ctx1) { 
+return "Packages";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToPackagesCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToPackagesCommand.klass);
@@ -485,7 +526,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnProtocols();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnProtocols();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToProtocolsCommand)})},
 messageSends: ["focusOnProtocols", "model"]}),
 smalltalk.HLGoToProtocolsCommand);
@@ -497,7 +539,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToProtocolsCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToProtocolsCommand.klass);
@@ -508,7 +551,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Protocols";
+return smalltalk.withContext(function($ctx1) { 
+return "Protocols";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToProtocolsCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToProtocolsCommand.klass);
@@ -521,7 +565,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnSourceCode();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnSourceCode();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToSourceCodeCommand)})},
 messageSends: ["focusOnSourceCode", "model"]}),
 smalltalk.HLGoToSourceCodeCommand);
@@ -533,7 +578,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (83);
+return smalltalk.withContext(function($ctx1) { 
+return (83);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToSourceCodeCommand.klass);
@@ -544,7 +590,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Source code";
+return smalltalk.withContext(function($ctx1) { 
+return "Source code";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
 messageSends: []}),
 smalltalk.HLGoToSourceCodeCommand.klass);
@@ -558,7 +605,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveToCommand.klass);
@@ -569,7 +617,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Move";
+return smalltalk.withContext(function($ctx1) { 
+return "Move";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveToCommand.klass);
@@ -583,7 +632,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToCommand.klass);
@@ -594,7 +644,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Method";
+return smalltalk.withContext(function($ctx1) { 
+return "Method";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToCommand.klass);
@@ -607,7 +658,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToClassCommand);
 
@@ -618,7 +670,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToClassCommand.klass);
@@ -629,7 +682,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to class";
+return smalltalk.withContext(function($ctx1) { 
+return "to class";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToClassCommand.klass);
@@ -642,7 +696,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToProtocolCommand);
 
@@ -653,7 +708,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToProtocolCommand.klass);
@@ -664,7 +720,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to protocol";
+return smalltalk.withContext(function($ctx1) { 
+return "to protocol";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
 messageSends: []}),
 smalltalk.HLMoveMethodToProtocolCommand.klass);
@@ -678,7 +735,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleCommand.klass);
@@ -689,7 +747,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Toggle";
+return smalltalk.withContext(function($ctx1) { 
+return "Toggle";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleCommand.klass);
@@ -702,7 +761,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(false);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._showInstance_(false);
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassSideCommand)})},
 messageSends: ["showInstance:", "model"]}),
 smalltalk.HLToggleClassSideCommand);
@@ -714,7 +774,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassSideCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleClassSideCommand.klass);
@@ -725,7 +786,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Class side";
+return smalltalk.withContext(function($ctx1) { 
+return "Class side";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassSideCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleClassSideCommand.klass);
@@ -738,7 +800,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(true);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._showInstance_(true);
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleInstanceSideCommand)})},
 messageSends: ["showInstance:", "model"]}),
 smalltalk.HLToggleInstanceSideCommand);
@@ -750,7 +813,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (73);
+return smalltalk.withContext(function($ctx1) { 
+return (73);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleInstanceSideCommand.klass);
@@ -761,7 +825,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Instance side";
+return smalltalk.withContext(function($ctx1) { 
+return "Instance side";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
 messageSends: []}),
 smalltalk.HLToggleInstanceSideCommand.klass);
@@ -775,7 +840,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (79);
+return smalltalk.withContext(function($ctx1) { 
+return (79);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLOpenCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenCommand.klass);
@@ -786,7 +852,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Open";
+return smalltalk.withContext(function($ctx1) { 
+return "Open";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLOpenCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenCommand.klass);
@@ -799,7 +866,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLBrowser || HLBrowser))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLOpenBrowserCommand)})},
@@ -813,7 +881,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (66);
+return smalltalk.withContext(function($ctx1) { 
+return (66);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenBrowserCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenBrowserCommand.klass);
@@ -824,7 +893,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Browser";
+return smalltalk.withContext(function($ctx1) { 
+return "Browser";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenBrowserCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenBrowserCommand.klass);
@@ -837,7 +907,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLTranscript || HLTranscript))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLOpenTranscriptCommand)})},
@@ -851,7 +922,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenTranscriptCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenTranscriptCommand.klass);
@@ -862,7 +934,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Transcript";
+return smalltalk.withContext(function($ctx1) { 
+return "Transcript";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenTranscriptCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenTranscriptCommand.klass);
@@ -875,7 +948,8 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLCodeWidget || HLCodeWidget))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenWorkspaceCommand)})},
@@ -889,7 +963,8 @@ smalltalk.method({
 selector: "key",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (87);
+return smalltalk.withContext(function($ctx1) { 
+return (87);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenWorkspaceCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenWorkspaceCommand.klass);
@@ -900,7 +975,8 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Workspace";
+return smalltalk.withContext(function($ctx1) { 
+return "Workspace";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenWorkspaceCommand.klass)})},
 messageSends: []}),
 smalltalk.HLOpenWorkspaceCommand.klass);
@@ -914,9 +990,11 @@ smalltalk.method({
 selector: "label",
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "View";
+return smalltalk.withContext(function($ctx1) { 
+return "View";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLViewCommand.klass)})},
 messageSends: []}),
 smalltalk.HLViewCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 154 - 76
js/Helios-Commands.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Commands');
 smalltalk.addClass('HLCommand', smalltalk.Object, [], 'Helios-Commands');
 smalltalk.addMethod(
@@ -7,9 +8,11 @@ selector: "asActionBinding",
 category: 'converting',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st((smalltalk.HLBindingAction || HLBindingAction))._on_labelled_(_st(self)._key(),_st(self)._label()))._callback_((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._execute();
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._execute();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},smalltalk.HLCommand)})},
@@ -27,7 +30,8 @@ selector: "asBinding",
 category: 'converting',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
 $2=_st(self)._isBindingGroup();
 if(smalltalk.assert($2)){
 $1=_st(self)._asGroupBinding();
@@ -50,7 +54,8 @@ selector: "asGroupBinding",
 category: 'converting',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLBindingGroup || HLBindingGroup))._on_labelled_(_st(self)._key(),_st(self)._label());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"asGroupBinding",{},smalltalk.HLCommand)})},
@@ -68,7 +73,8 @@ selector: "documentation",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._documentation();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"documentation",{}, smalltalk.HLCommand)})},
@@ -86,7 +92,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCommand)})},
 args: [],
 source: "execute\x0a\x09",
 messageSends: [],
@@ -101,7 +108,8 @@ selector: "isBindingGroup",
 category: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(_st(_st(self)._class())._methodDictionary())._includesKey_("execute"))._not();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{},smalltalk.HLCommand)})},
@@ -119,7 +127,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._key();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCommand)})},
@@ -137,7 +146,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._class())._label();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCommand)})},
@@ -155,7 +165,8 @@ selector: "registerOn:",
 category: 'registration',
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(aBinding)._add_(_st(self)._asBinding());
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand)})},
@@ -174,9 +185,11 @@ selector: "concreteSubclasses",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._subclasses())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(each)._isConcrete();
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._isConcrete();
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"concreteSubclasses",{},smalltalk.HLCommand.klass)})},
@@ -194,7 +207,8 @@ selector: "documentation",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "";
+return smalltalk.withContext(function($ctx1) { 
+return "";
 }, function($ctx1) {$ctx1.fill(self,"documentation",{}, smalltalk.HLCommand.klass)})},
 args: [],
 source: "documentation\x0a\x09^ ''",
@@ -210,7 +224,8 @@ selector: "isConcrete",
 category: 'testing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._key())._notNil();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"isConcrete",{},smalltalk.HLCommand.klass)})},
@@ -228,7 +243,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return nil;
+return smalltalk.withContext(function($ctx1) { 
+return nil;
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ nil",
@@ -244,7 +260,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "";
+return smalltalk.withContext(function($ctx1) { 
+return "";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ ''",
@@ -260,10 +277,12 @@ selector: "registerConcreteClassesOn:",
 category: 'registration',
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(self)._concreteSubclasses())._do_((function(each){
 var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_(aBinding);
+return smalltalk.withContext(function($ctx2) {
+binding=_st(each)._registerOn_(aBinding);
 binding;
 $1=_st(binding)._isBindingGroup();
 if(smalltalk.assert($1)){
@@ -285,7 +304,8 @@ selector: "registerOn:",
 category: 'registration',
 fn: function (aBinding){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._registerOn_(aBinding);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},smalltalk.HLCommand.klass)})},
@@ -305,7 +325,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st((smalltalk.HLManager || HLManager))._current())._removeActiveTab();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st((smalltalk.HLManager || HLManager))._current())._removeActiveTab();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLCloseTabCommand)})},
 args: [],
 source: "execute\x0a\x09HLManager current removeActiveTab",
@@ -322,7 +343,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (87);
+return smalltalk.withContext(function($ctx1) { 
+return (87);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLCloseTabCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 87",
@@ -338,7 +360,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Close tab";
+return smalltalk.withContext(function($ctx1) { 
+return "Close tab";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLCloseTabCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Close tab'",
@@ -356,7 +379,8 @@ selector: "model",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=self["@model"];
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLModelCommand)})},
@@ -374,7 +398,8 @@ selector: "model:",
 category: 'accessing',
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@model"]=aModel;
+return smalltalk.withContext(function($ctx1) { 
+self["@model"]=aModel;
 return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLModelCommand)})},
 args: ["aModel"],
 source: "model: aModel\x0a\x09model := aModel",
@@ -391,7 +416,8 @@ selector: "for:",
 category: 'instance creation',
 fn: function (aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(self)._new();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"for:",{aModel:aModel},smalltalk.HLModelCommand.klass)})},
@@ -409,10 +435,12 @@ selector: "registerConcreteClassesOn:for:",
 category: 'registration',
 fn: function (aBinding,aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(self)._concreteSubclasses())._do_((function(each){
 var binding;
-return smalltalk.withContext(function($ctx2) {
binding=_st(each)._registerOn_for_(aBinding,aModel);
+return smalltalk.withContext(function($ctx2) {
+binding=_st(each)._registerOn_for_(aBinding,aModel);
 binding;
 $1=_st(binding)._isBindingGroup();
 if(smalltalk.assert($1)){
@@ -434,7 +462,8 @@ selector: "registerOn:for:",
 category: 'registration',
 fn: function (aBinding,aModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._for_(aModel))._registerOn_(aBinding);
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"registerOn:for:",{aBinding:aBinding,aModel:aModel},smalltalk.HLModelCommand.klass)})},
@@ -455,7 +484,8 @@ selector: "for:",
 category: 'instance creation',
 fn: function (aBrowserModel){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(self)._new();
 _st($2)._model_(aBrowserModel);
 $3=_st($2)._yourself();
@@ -479,7 +509,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (71);
+return smalltalk.withContext(function($ctx1) { 
+return (71);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 71",
@@ -495,7 +526,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Go to";
+return smalltalk.withContext(function($ctx1) { 
+return "Go to";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Go to'",
@@ -513,7 +545,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnClasses();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnClasses();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToClassesCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnClasses",
@@ -530,7 +563,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToClassesCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22c\x22\x0a    \x0a\x09^ 67",
@@ -546,7 +580,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Classes";
+return smalltalk.withContext(function($ctx1) { 
+return "Classes";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToClassesCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Classes'",
@@ -564,7 +599,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnMethods();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnMethods();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToMethodsCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnMethods",
@@ -581,7 +617,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToMethodsCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22m\x22\x0a    \x0a\x09^ 77",
@@ -597,7 +634,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Methods";
+return smalltalk.withContext(function($ctx1) { 
+return "Methods";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToMethodsCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Methods'",
@@ -615,7 +653,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnPackages();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnPackages();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToPackagesCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnPackages",
@@ -632,7 +671,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (80);
+return smalltalk.withContext(function($ctx1) { 
+return (80);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToPackagesCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22p\x22\x0a    \x0a\x09^ 80",
@@ -648,7 +688,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Packages";
+return smalltalk.withContext(function($ctx1) { 
+return "Packages";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToPackagesCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Packages'",
@@ -666,7 +707,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnProtocols();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnProtocols();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToProtocolsCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnProtocols",
@@ -683,7 +725,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToProtocolsCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22p\x22\x0a    \x0a\x09^ 84",
@@ -699,7 +742,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Protocols";
+return smalltalk.withContext(function($ctx1) { 
+return "Protocols";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToProtocolsCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Protocols'",
@@ -717,7 +761,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._focusOnSourceCode();
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._focusOnSourceCode();
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLGoToSourceCodeCommand)})},
 args: [],
 source: "execute\x0a\x09self model focusOnSourceCode",
@@ -734,7 +779,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (83);
+return smalltalk.withContext(function($ctx1) { 
+return (83);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22s\x22\x0a    \x0a\x09^ 83",
@@ -750,7 +796,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Source code";
+return smalltalk.withContext(function($ctx1) { 
+return "Source code";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLGoToSourceCodeCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Source code'",
@@ -769,7 +816,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveToCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 77",
@@ -785,7 +833,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Move";
+return smalltalk.withContext(function($ctx1) { 
+return "Move";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveToCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Move'",
@@ -804,7 +853,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (77);
+return smalltalk.withContext(function($ctx1) { 
+return (77);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 77",
@@ -820,7 +870,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Method";
+return smalltalk.withContext(function($ctx1) { 
+return "Method";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Method'",
@@ -838,7 +889,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToClassCommand)})},
 args: [],
 source: "execute",
 messageSends: [],
@@ -854,7 +906,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 67",
@@ -870,7 +923,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to class";
+return smalltalk.withContext(function($ctx1) { 
+return "to class";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToClassCommand.klass)})},
 args: [],
 source: "label\x09\x0a\x09^ 'to class'",
@@ -888,7 +942,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLMoveMethodToProtocolCommand)})},
 args: [],
 source: "execute",
 messageSends: [],
@@ -904,7 +959,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 84",
@@ -920,7 +976,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "to protocol";
+return smalltalk.withContext(function($ctx1) { 
+return "to protocol";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLMoveMethodToProtocolCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'to protocol'",
@@ -939,7 +996,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 84",
@@ -955,7 +1013,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Toggle";
+return smalltalk.withContext(function($ctx1) { 
+return "Toggle";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Toggle'",
@@ -973,7 +1032,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(false);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._showInstance_(false);
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleClassSideCommand)})},
 args: [],
 source: "execute\x0a\x09self model showInstance: false",
@@ -990,7 +1050,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (67);
+return smalltalk.withContext(function($ctx1) { 
+return (67);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleClassSideCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22c\x22\x0a    \x0a\x09^ 67",
@@ -1006,7 +1067,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Class side";
+return smalltalk.withContext(function($ctx1) { 
+return "Class side";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleClassSideCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Class side'",
@@ -1024,7 +1086,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(_st(self)._model())._showInstance_(true);
+return smalltalk.withContext(function($ctx1) { 
+_st(_st(self)._model())._showInstance_(true);
 return self}, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLToggleInstanceSideCommand)})},
 args: [],
 source: "execute\x0a\x09self model showInstance: true",
@@ -1041,7 +1104,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (73);
+return smalltalk.withContext(function($ctx1) { 
+return (73);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
 args: [],
 source: "key\x0a\x09\x22i\x22\x0a    \x0a\x09^ 73",
@@ -1057,7 +1121,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Instance side";
+return smalltalk.withContext(function($ctx1) { 
+return "Instance side";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToggleInstanceSideCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Instance side'",
@@ -1076,7 +1141,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (79);
+return smalltalk.withContext(function($ctx1) { 
+return (79);
 }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLOpenCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 79",
@@ -1092,7 +1158,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Open";
+return smalltalk.withContext(function($ctx1) { 
+return "Open";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLOpenCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Open'",
@@ -1110,7 +1177,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLBrowser || HLBrowser))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLOpenBrowserCommand)})},
@@ -1129,7 +1197,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (66);
+return smalltalk.withContext(function($ctx1) { 
+return (66);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenBrowserCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 66",
@@ -1145,7 +1214,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Browser";
+return smalltalk.withContext(function($ctx1) { 
+return "Browser";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenBrowserCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Browser'",
@@ -1163,7 +1233,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLTranscript || HLTranscript))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{}, smalltalk.HLOpenTranscriptCommand)})},
@@ -1182,7 +1253,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (84);
+return smalltalk.withContext(function($ctx1) { 
+return (84);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenTranscriptCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 84",
@@ -1198,7 +1270,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Transcript";
+return smalltalk.withContext(function($ctx1) { 
+return "Transcript";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenTranscriptCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Transcript'",
@@ -1216,7 +1289,8 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.HLCodeWidget || HLCodeWidget))._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenWorkspaceCommand)})},
@@ -1235,7 +1309,8 @@ selector: "key",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return (87);
+return smalltalk.withContext(function($ctx1) { 
+return (87);
 }, function($ctx1) {$ctx1.fill(self,"key",{}, smalltalk.HLOpenWorkspaceCommand.klass)})},
 args: [],
 source: "key\x0a\x09^ 87",
@@ -1251,7 +1326,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "Workspace";
+return smalltalk.withContext(function($ctx1) { 
+return "Workspace";
 }, function($ctx1) {$ctx1.fill(self,"label",{}, smalltalk.HLOpenWorkspaceCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'Workspace'",
@@ -1270,7 +1346,8 @@ selector: "label",
 category: 'accessing',
 fn: function (){
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
return "View";
+return smalltalk.withContext(function($ctx1) { 
+return "View";
 }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLViewCommand.klass)})},
 args: [],
 source: "label\x0a\x09^ 'View'",
@@ -1280,3 +1357,4 @@ referencedClasses: []
 smalltalk.HLViewCommand.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Core.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Core');
 smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
 smalltalk.addMethod(
@@ -3698,3 +3699,4 @@ messageSends: []}),
 smalltalk.HLSUnit.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Core.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Core');
 smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
 smalltalk.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).\x0a\x0a";
@@ -4869,3 +4870,4 @@ referencedClasses: []
 smalltalk.HLSUnit.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Debugger.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Debugger');
 smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
 smalltalk.addMethod(
@@ -698,3 +699,4 @@ smalltalk.HLStackListWidget);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Debugger.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Debugger');
 smalltalk.addClass('HLContextInspectorDecorator', smalltalk.Object, ['context'], 'Helios-Debugger');
 smalltalk.addMethod(
@@ -920,3 +921,4 @@ smalltalk.HLStackListWidget);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Exceptions.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Exceptions');
 smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 
@@ -5,3 +6,4 @@ smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 smalltalk.addClass('HLChangeForbidden', smalltalk.HLError, [], 'Helios-Exceptions');
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Exceptions.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Exceptions');
 smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 
@@ -5,3 +6,4 @@ smalltalk.addClass('HLError', smalltalk.Error, [], 'Helios-Exceptions');
 smalltalk.addClass('HLChangeForbidden', smalltalk.HLError, [], 'Helios-Exceptions');
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Inspector.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Inspector');
 smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
 smalltalk.addMethod(
@@ -1061,3 +1062,4 @@ messageSends: ["valueWithInterval:", "do:", "refresh", "inspectors"]}),
 smalltalk.HLInspector.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Inspector.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Inspector');
 smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
 smalltalk.addMethod(
@@ -1431,3 +1432,4 @@ referencedClasses: []
 smalltalk.HLInspector.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-KeyBindings.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-KeyBindings');
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
 smalltalk.addMethod(
@@ -1688,3 +1689,4 @@ messageSends: ["widget:", "new", "yourself"]}),
 smalltalk.HLRepeatingKeyBindingHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-KeyBindings.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-KeyBindings');
 smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
 smalltalk.addMethod(
@@ -2229,3 +2230,4 @@ referencedClasses: []
 smalltalk.HLRepeatingKeyBindingHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Layout.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Layout');
 smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
 smalltalk.addMethod(
@@ -391,3 +392,4 @@ return false;
 messageSends: []}),
 smalltalk.Object);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Layout.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Layout');
 smalltalk.addClass('HLContainer', smalltalk.HLWidget, ['splitter'], 'Helios-Layout');
 smalltalk.addMethod(
@@ -531,3 +532,4 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-References.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-References');
 smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
 smalltalk.addMethod(
@@ -840,3 +841,4 @@ smalltalk.HLReferencesModel);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-References.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-References');
 smalltalk.addClass('HLMethodReference', smalltalk.Object, ['selector', 'methodClass'], 'Helios-References');
 smalltalk.addMethod(
@@ -1110,3 +1111,4 @@ smalltalk.HLReferencesModel);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Transcript.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Transcript');
 smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
 smalltalk.addMethod(
@@ -171,3 +172,4 @@ messageSends: ["remove:", "transcripts"]}),
 smalltalk.HLTranscriptHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Transcript.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Transcript');
 smalltalk.addClass('HLTranscript', smalltalk.HLWidget, ['textarea'], 'Helios-Transcript');
 smalltalk.HLTranscript.comment="I am a widget responsible for displaying transcript contents.\x0a\x0a## Transcript API\x0a\x0a    Transcript \x0a        show: 'hello world';\x0a        cr;\x0a        show: anObject.\x0a\x0a    Transcript clear.\x0a\x0aSee the `Transcript` class.";
@@ -233,3 +234,4 @@ referencedClasses: []
 smalltalk.HLTranscriptHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Workspace-Tests.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace-Tests');
 smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
 smalltalk.addMethod(
@@ -16,3 +17,4 @@ smalltalk.HLCodeWidgetTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Workspace-Tests.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace-Tests');
 smalltalk.addClass('HLCodeWidgetTest', smalltalk.TestCase, [], 'Helios-Workspace-Tests');
 smalltalk.addMethod(
@@ -21,3 +22,4 @@ smalltalk.HLCodeWidgetTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Workspace.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace');
 smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
 smalltalk.addMethod(
@@ -1575,3 +1576,4 @@ messageSends: []}),
 smalltalk.HLWorkspace.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Helios-Workspace.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Helios-Workspace');
 smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
 smalltalk.addMethod(
@@ -2075,3 +2076,4 @@ referencedClasses: []
 smalltalk.HLWorkspace.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/IDE.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('IDE');
 smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
 smalltalk.addMethod(
@@ -5538,3 +5539,4 @@ return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspe
 messageSends: ["new", "at:put:", "home", "receiver", "selector", "temps", "do:", "instVarAt:", "instanceVariableNames", "class", "setLabel:", "printString", "setVariables:"]}),
 smalltalk.MethodContext);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/IDE.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('IDE');
 smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
 smalltalk.addMethod(
@@ -6963,3 +6964,4 @@ referencedClasses: ["Dictionary"]
 }),
 smalltalk.MethodContext);
 
+})(global_smalltalk,global_nil,global__st);

+ 60 - 3
js/Importer-Exporter.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Importer-Exporter');
 smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
 smalltalk.addMethod(
@@ -265,18 +266,25 @@ return smalltalk.withContext(function($ctx1) {
 var $1;
 $1=_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
+self._exportPackagePrologueOn_(stream);
+return _st((function(){
+return smalltalk.withContext(function($ctx3) {
 package_=_st(_st($Smalltalk())._current())._packageAt_(packageName);
 package_;
 self._exportPackageDefinitionOf_on_(package_,stream);
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
-return smalltalk.withContext(function($ctx3) {
+return smalltalk.withContext(function($ctx4) {
 return _st(stream)._nextPutAll_(self._exportClass_(each));
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
+}, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
 return self._exportPackageExtensionsOf_on_(package_,stream);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
+return smalltalk.withContext(function($ctx3) {
+return self._exportPackageEpilogueOn_(stream);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"exportPackage:",{packageName:packageName,package_:package_},smalltalk.Exporter)})},
-messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"]}),
+messageSends: ["streamContents:", "exportPackagePrologueOn:", "ensure:", "exportPackageEpilogueOn:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"]}),
 smalltalk.Exporter);
 
 smalltalk.addMethod(
@@ -294,6 +302,20 @@ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{
 messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackageEpilogueOn:",
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=aStream;
+_st($1)._nextPutAll_("})(global_smalltalk,global_nil,global__st);");
+$2=_st($1)._lf();
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOn:",{aStream:aStream},smalltalk.Exporter)})},
+messageSends: ["nextPutAll:", "lf"]}),
+smalltalk.Exporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
@@ -325,6 +347,20 @@ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{
 messageSends: ["name", "do:", "ifTrue:", "exportMethod:of:on:", "match:", ",", "category", "sorted:", "<=", "selector", "values", "methodDictionary", "class", "sortedClasses:", "classes", "current"]}),
 smalltalk.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackagePrologueOn:",
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=aStream;
+_st($1)._nextPutAll_("(function(smalltalk,nil,_st){");
+$2=_st($1)._lf();
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOn:",{aStream:aStream},smalltalk.Exporter)})},
+messageSends: ["nextPutAll:", "lf"]}),
+smalltalk.Exporter);
+
 
 
 smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Importer-Exporter');
@@ -521,6 +557,16 @@ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{
 messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.ChunkExporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackageEpilogueOn:",
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOn:",{aStream:aStream},smalltalk.ChunkExporter)})},
+messageSends: []}),
+smalltalk.ChunkExporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
@@ -562,6 +608,16 @@ return self}, function($ctx1) {$ctx1.fill(self,"exportPackageExtensionsOf:on:",{
 messageSends: ["name", "do:", "new", "protocolsDo:", "ifTrue:", "at:put:", "match:", ",", "at:", "exportMethods:category:of:on:", "sorted:", "<=", "keys", "class", "sortedClasses:", "classes", "current"]}),
 smalltalk.ChunkExporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackagePrologueOn:",
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOn:",{aStream:aStream},smalltalk.ChunkExporter)})},
+messageSends: []}),
+smalltalk.ChunkExporter);
+
 
 
 smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
@@ -780,3 +836,4 @@ return $1;
 messageSends: ["commit:", "new"]}),
 smalltalk.Package);
 
+})(global_smalltalk,global_nil,global__st);

+ 81 - 4
js/Importer-Exporter.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Importer-Exporter');
 smalltalk.addClass('ChunkParser', smalltalk.Object, ['stream'], 'Importer-Exporter');
 smalltalk.ChunkParser.comment="I am responsible for parsing aStream contents in the chunk format.\x0a\x0a## API\x0a\x0a    ChunkParser new\x0a        stream: aStream;\x0a        nextChunk";
@@ -318,20 +319,27 @@ return smalltalk.withContext(function($ctx1) {
 var $1;
 $1=_st($String())._streamContents_((function(stream){
 return smalltalk.withContext(function($ctx2) {
+self._exportPackagePrologueOn_(stream);
+return _st((function(){
+return smalltalk.withContext(function($ctx3) {
 package_=_st(_st($Smalltalk())._current())._packageAt_(packageName);
 package_;
 self._exportPackageDefinitionOf_on_(package_,stream);
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
-return smalltalk.withContext(function($ctx3) {
+return smalltalk.withContext(function($ctx4) {
 return _st(stream)._nextPutAll_(self._exportClass_(each));
-}, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
+}, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
 return self._exportPackageExtensionsOf_on_(package_,stream);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}))._ensure_((function(){
+return smalltalk.withContext(function($ctx3) {
+return self._exportPackageEpilogueOn_(stream);
+}, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"exportPackage:",{packageName:packageName,package_:package_},smalltalk.Exporter)})},
 args: ["packageName"],
-source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a\x09\x09\x09\x09package := Smalltalk current packageAt: packageName.\x0a\x09\x09\x09\x09self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x22Export classes in dependency order.\x0a\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09\x09\x09package sortedClasses asSet do: [:each |\x0a\x09\x09\x09\x09\x09\x09stream nextPutAll: (self exportClass: each)].\x0a\x09\x09self exportPackageExtensionsOf: package on: stream]",
-messageSends: ["streamContents:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"],
+source: "exportPackage: packageName\x0a\x09\x22Export a given package by name.\x22\x0a\x0a\x09| package |\x0a\x09^String streamContents: [:stream |\x0a\x09\x09self exportPackagePrologueOn: stream.\x0a\x09\x09[\x0a\x09\x09\x09package := Smalltalk current packageAt: packageName.\x0a\x09\x09\x09self exportPackageDefinitionOf: package on: stream.\x0a\x0a\x09\x09\x09\x22Export classes in dependency order.\x0a\x09\x09\x09Update (issue #171): Remove duplicates for export\x22\x0a\x09\x09\x09package sortedClasses asSet do: [:each |\x0a\x09\x09\x09\x09\x09\x09stream nextPutAll: (self exportClass: each)].\x0a\x09\x09\x09self exportPackageExtensionsOf: package on: stream\x0a\x09\x09] ensure: [\x0a\x09\x09\x09self exportPackageEpilogueOn: stream\x0a\x09\x09]]",
+messageSends: ["streamContents:", "exportPackagePrologueOn:", "ensure:", "exportPackageEpilogueOn:", "packageAt:", "current", "exportPackageDefinitionOf:on:", "do:", "nextPutAll:", "exportClass:", "asSet", "sortedClasses", "exportPackageExtensionsOf:on:"],
 referencedClasses: ["Smalltalk", "String"]
 }),
 smalltalk.Exporter);
@@ -356,6 +364,25 @@ referencedClasses: []
 }),
 smalltalk.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackageEpilogueOn:",
+category: 'private',
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=aStream;
+_st($1)._nextPutAll_("})(global_smalltalk,global_nil,global__st);");
+$2=_st($1)._lf();
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOn:",{aStream:aStream},smalltalk.Exporter)})},
+args: ["aStream"],
+source: "exportPackageEpilogueOn: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '})(global_smalltalk,global_nil,global__st);';\x0a\x09\x09lf",
+messageSends: ["nextPutAll:", "lf"],
+referencedClasses: []
+}),
+smalltalk.Exporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
@@ -392,6 +419,25 @@ referencedClasses: ["Smalltalk", "Package"]
 }),
 smalltalk.Exporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackagePrologueOn:",
+category: 'private',
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=aStream;
+_st($1)._nextPutAll_("(function(smalltalk,nil,_st){");
+$2=_st($1)._lf();
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOn:",{aStream:aStream},smalltalk.Exporter)})},
+args: ["aStream"],
+source: "exportPackagePrologueOn: aStream\x0a\x09aStream\x0a\x09\x09nextPutAll: '(function(smalltalk,nil,_st){';\x0a\x09\x09lf",
+messageSends: ["nextPutAll:", "lf"],
+referencedClasses: []
+}),
+smalltalk.Exporter);
+
 
 
 smalltalk.addClass('ChunkExporter', smalltalk.Exporter, [], 'Importer-Exporter');
@@ -629,6 +675,21 @@ referencedClasses: []
 }),
 smalltalk.ChunkExporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackageEpilogueOn:",
+category: 'private',
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackageEpilogueOn:",{aStream:aStream},smalltalk.ChunkExporter)})},
+args: ["aStream"],
+source: "exportPackageEpilogueOn: aStream",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ChunkExporter);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "exportPackageExtensionsOf:on:",
@@ -675,6 +736,21 @@ referencedClasses: ["Dictionary", "Smalltalk", "Package"]
 }),
 smalltalk.ChunkExporter);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "exportPackagePrologueOn:",
+category: 'private',
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"exportPackagePrologueOn:",{aStream:aStream},smalltalk.ChunkExporter)})},
+args: ["aStream"],
+source: "exportPackagePrologueOn: aStream",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ChunkExporter);
+
 
 
 smalltalk.addClass('StrippedExporter', smalltalk.Exporter, [], 'Importer-Exporter');
@@ -946,3 +1022,4 @@ referencedClasses: ["PackageHandler"]
 }),
 smalltalk.Package);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Announcements.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Announcements');
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.addMethod(
@@ -553,3 +554,4 @@ smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-
 smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Announcements.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Announcements');
 smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
 smalltalk.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible.";
@@ -761,3 +762,4 @@ smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kerne
 smalltalk.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class.";
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Classes.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Classes');
 smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
 smalltalk.addMethod(
@@ -1637,3 +1638,4 @@ messageSends: ["theClass:", "new", "level:", "getNodesFrom:", "yourself"]}),
 smalltalk.ClassSorterNode.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Classes.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Classes');
 smalltalk.addClass('Behavior', smalltalk.Object, [], 'Kernel-Classes');
 smalltalk.Behavior.comment="I am the superclass of all class objects.\x0a\x0aI define the protocol for creating instances of a class with `#basicNew` and `#new` (see `boot.js` for class constructors details).\x0a\x0aMy instances know about the subclass/superclass relationships between classes, contain the description that instances are created from,\x0aand hold the method dictionary that's associated with each class.\x0a\x0aI also provides methods for compiling methods, examining the method dictionary, and iterating over the class hierarchy.";
@@ -2144,3 +2145,4 @@ referencedClasses: []
 smalltalk.ClassSorterNode.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Collections.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Collections');
 smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
 smalltalk.addMethod(
@@ -4262,3 +4263,4 @@ smalltalk.StringStream);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Collections.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Collections');
 smalltalk.addClass('Association', smalltalk.Object, ['key', 'value'], 'Kernel-Collections');
 smalltalk.Association.comment="I represent a pair of associated objects, a key and a value. My instances can serve as entries in a dictionary.\x0a\x0aInstances can be created with the class-side method `#key:value:`";
@@ -5736,3 +5737,4 @@ smalltalk.StringStream);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Exceptions.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Exceptions');
 smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
 smalltalk.addMethod(
@@ -451,3 +452,4 @@ messageSends: []}),
 smalltalk.ErrorHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Exceptions.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Exceptions');
 smalltalk.addClass('Error', smalltalk.Object, ['messageText'], 'Kernel-Exceptions');
 smalltalk.Error.comment="From the ANSI standard:\x0a\x0aThis protocol describes the behavior of instances of class `Error`.\x0aThese are used to represent error conditions that prevent the normal continuation of processing.\x0aActual error exceptions used by an application may be subclasses of this class.\x0aAs `Error` is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.";
@@ -626,3 +627,4 @@ referencedClasses: []
 smalltalk.ErrorHandler.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Methods.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Methods');
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.addMethod(
@@ -1306,3 +1307,4 @@ messageSends: []}),
 smalltalk.NativeFunction.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Methods.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Methods');
 smalltalk.addClass('BlockClosure', smalltalk.Object, [], 'Kernel-Methods');
 smalltalk.BlockClosure.comment="I represent a lexical closure.\x0aI am is directly mapped to JavaScript Function.\x0a\x0a## API\x0a\x0a1. Evaluation\x0a\x0a    My instances get evaluated with the `#value*` methods in the 'evaluating' protocol.\x0a\x0a    Example: ` [ :x | x + 1 ] value: 3 \x22Answers 4\x22 `\x0a\x0a2. Control structures\x0a\x0a    Blocks are used (together with `Boolean`) for control structures (methods in the `controlling` protocol).\x0a\x0a    Example: `aBlock whileTrue: [ ... ]`\x0a\x0a3. Error handling\x0a\x0a    I provide the `#on:do:` method for handling exceptions.\x0a\x0a    Example: ` aBlock on: MessageNotUnderstood do: [ :ex | ... ] `";
@@ -1768,3 +1769,4 @@ referencedClasses: []
 smalltalk.NativeFunction.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Objects.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.addMethod(
@@ -4338,3 +4339,4 @@ return $1;
 messageSends: ["replace:with:"]}),
 smalltalk.String);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Objects.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Objects');
 smalltalk.addClass('Object', smalltalk.nil, [], 'Kernel-Objects');
 smalltalk.Object.comment="**I am the root of the Smalltalk class system**. All classes in the system are subclasses of me.\x0a\x0aI provide default behavior common to all normal objects, such as:\x0a\x0a- accessing\x0a- copying\x0a- comparison\x0a- error handling\x0a- message sending\x0a- reflection\x0a\x0aAlso utility messages that all objects should respond to are defined here.\x0a\x0aI have no instance variable.\x0a\x0a##Access\x0a\x0aInstance variables can be accessed with `#instVarAt:` and `#instVarAt:put:`. `#instanceVariableNames` answers a collection of all instance variable names.\x0aAccessing JavaScript properties of an object is done through `#basicAt:`, `#basicAt:put:` and `basicDelete:`.\x0a\x0a##Copying\x0a\x0aCopying an object is handled by `#copy` and `#deepCopy`. The first one performs a shallow copy of the receiver, while the second one performs a deep copy.\x0aThe hook method `#postCopy` can be overriden in subclasses to copy fields as necessary to complete the full copy. It will be sent by the copy of the receiver.\x0a\x0a##Comparison\x0a\x0aI understand equality `#=` and identity `#==` comparison.\x0a\x0a##Error handling\x0a\x0a- `#halt` is the typical message to use for inserting breakpoints during debugging.\x0a- `#error:` throws a generic error exception\x0a- `#doesNotUnderstand:` handles the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message.\x0a\x09Overriding this message can be useful to implement proxies for example.";
@@ -5925,3 +5926,4 @@ referencedClasses: []
 }),
 smalltalk.String);
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Tests.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Tests');
 smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
@@ -3773,3 +3774,4 @@ smalltalk.UndefinedTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Tests.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Tests');
 smalltalk.addClass('BlockClosureTest', smalltalk.TestCase, [], 'Kernel-Tests');
 smalltalk.addMethod(
@@ -4775,3 +4776,4 @@ smalltalk.UndefinedTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Transcript.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Transcript');
 smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
 smalltalk.addMethod(
@@ -150,3 +151,4 @@ messageSends: ["show:", "current"]}),
 smalltalk.Transcript.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Kernel-Transcript.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Kernel-Transcript');
 smalltalk.addClass('ConsoleTranscript', smalltalk.Object, ['textarea'], 'Kernel-Transcript');
 smalltalk.ConsoleTranscript.comment="I am a specific transcript emitting to the JavaScript console.\x0a\x0aIf no other transcript is registered, I am the default.";
@@ -217,3 +218,4 @@ referencedClasses: []
 smalltalk.Transcript.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/SUnit-Tests.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit-Tests');
 smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
 smalltalk.addMethod(
@@ -427,3 +428,4 @@ smalltalk.SUnitAsyncTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/SUnit-Tests.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit-Tests');
 smalltalk.addClass('ExampleSetTest', smalltalk.TestCase, ['empty', 'full'], 'SUnit-Tests');
 smalltalk.ExampleSetTest.comment="ExampleSetTest is taken from Pharo 1.4.\x0a\x0aTHe purpose of this class is to demonstrate a simple use case of the test framework.";
@@ -543,3 +544,4 @@ smalltalk.SUnitAsyncTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/SUnit.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit');
 smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
 smalltalk.addMethod(
@@ -921,3 +922,4 @@ messageSends: ["suite:", "new"]}),
 smalltalk.TestSuiteRunner.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/SUnit.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('SUnit');
 smalltalk.addClass('ResultAnnouncement', smalltalk.Object, ['result'], 'SUnit');
 smalltalk.ResultAnnouncement.comment="I get signaled when a `TestCase` has been run.\x0a\x0aMy instances hold the result (instance of `TestResult`) of the test run.";
@@ -1233,3 +1234,4 @@ referencedClasses: []
 smalltalk.TestSuiteRunner.klass);
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Spaces.deploy.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Spaces');
 smalltalk.addClass('ObjectSpace', smalltalk.Object, ['frame'], 'Spaces');
 smalltalk.addMethod(
@@ -249,3 +250,4 @@ smalltalk.ObjectSpaceTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/Spaces.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil,_st){
 smalltalk.addPackage('Spaces');
 smalltalk.addClass('ObjectSpace', smalltalk.Object, ['frame'], 'Spaces');
 smalltalk.ObjectSpace.comment="I am a connection to another Smalltalk environment.\x0aThe implementation creates an iframe on the same location as the window, and connect to the Amber environment.\x0a\x0a\x0a\x0a## Usage example:\x0a\x0a\x09| space |\x0a\x09\x0a\x09space := ObjectSpace new.\x0a\x09space do: [ smalltalk ] \x22Answers aSmalltalk\x22\x0a\x09(space do: [ smalltalk ]) == smalltalk \x22Answers false\x22\x0a\x09\x0a\x09space release \x22Remove the object space environment\x22";
@@ -335,3 +336,4 @@ smalltalk.ObjectSpaceTest);
 
 
 
+})(global_smalltalk,global_nil,global__st);

+ 2 - 2
js/amber.js

@@ -206,9 +206,9 @@ amber = (function() {
 
 	// This will be called after JS files have been loaded
 	function initializeSmalltalk() {
-		that.smalltalkReady = function() {
+		that.smalltalkReady = function(smalltalk,nil,_st) {
 			if (spec.ready) {
-				spec.ready();
+				spec.ready(smalltalk,nil,_st);
 			}
 			evaluateSmalltalkScripts();
 		};

+ 853 - 852
js/boot.js

@@ -33,859 +33,860 @@
    |
    ==================================================================== */
 
+// TODO make this unnecessary
+/* Global Smalltalk objects. */
+var global_smalltalk, global_nil, global__st;
+
 define([ 'ensure-console', 'es5-shim-2.0.2/es5-shim.min', 'es5-shim-2.0.2/es5-sham.min' ], function () {
-    /* Array extensions */
-
-    Array.prototype.addElement = function(el) {
-        if(typeof el === 'undefined') { return; }
-        if(this.indexOf(el) == -1) {
-            this.push(el);
-        }
-    };
-
-    Array.prototype.removeElement = function(el) {
-        var i = this.indexOf(el);
-        if (i !== -1) { this.splice(i, 1); }
-    };
-
-
-    /* Smalltalk constructors definition */
-
-    function SmalltalkObject() {}
-    function SmalltalkBehavior() {}
-    function SmalltalkClass() {}
-    function SmalltalkMetaclass() {
-        this.meta = true;
-    }
-    function SmalltalkPackage() {}
-    function SmalltalkMethod() {}
-    function SmalltalkNil() {}
-
-    function SmalltalkOrganizer() {
-    }
-
-    function SmalltalkPackageOrganizer() {
-        this.elements = [];
-    }
-
-    function SmalltalkClassOrganizer() {
-        this.elements = [];
-    }
-
-    function inherits(child, parent) {
-        child.prototype = Object.create(parent.prototype, {
-            constructor: { value: child,
-                enumerable: false, configurable: true, writable: true }
-        });
-    }
-
-    inherits(SmalltalkBehavior, SmalltalkObject);
-    inherits(SmalltalkClass, SmalltalkBehavior);
-    inherits(SmalltalkMetaclass, SmalltalkBehavior);
-    inherits(SmalltalkNil, SmalltalkObject);
-    inherits(SmalltalkMethod, SmalltalkObject);
-    inherits(SmalltalkPackage, SmalltalkObject);
-    inherits(SmalltalkOrganizer, SmalltalkObject);
-    inherits(SmalltalkPackageOrganizer, SmalltalkOrganizer);
-    inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
-
-
-    function Smalltalk() {
-
-        var st = this;
-
-        /* This is the current call context object. While it is publicly available,
-         Use smalltalk.getThisContext() instead which will answer a safe copy of
-         the current context */
-
-        st.thisContext = undefined;
-
-        /* List of all reserved words in JavaScript. They may not be used as variables
-         in Smalltalk. */
-
-        // list of reserved JavaScript keywords as of
-        //   http://es5.github.com/#x7.6.1.1
-        // and
-        //   http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1
-        st.reservedWords = ['break', 'case', 'catch', 'continue', 'debugger',
-            'default', 'delete', 'do', 'else', 'finally', 'for', 'function',
-            'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw',
-            'try', 'typeof', 'var', 'void', 'while', 'with',
-            // ES5: future use: http://es5.github.com/#x7.6.1.2
-            'class', 'const', 'enum', 'export', 'extends', 'import', 'super',
-            // ES5: future use in strict mode
-            'implements', 'interface', 'let', 'package', 'private', 'protected',
-            'public', 'static', 'yield'];
-
-        st.globalJsVariables = ['jQuery', 'window', 'document', 'process', 'global'];
-
-        var initialized = false;
-
-        /* Smalltalk classes */
-
-        var classes = [];
-        var wrappedClasses = [];
-
-        /* Method not implemented handlers */
-
-        var dnu = {
-            methods: [],
-            selectors: [],
-
-            get: function (string) {
-                var index = this.selectors.indexOf(string);
-                if(index !== -1) {
-                    return this.methods[index];
-                }
-                this.selectors.push(string);
-                var selector = st.selector(string);
-                var method = {jsSelector: selector, fn: this.createHandler(selector)};
-                this.methods.push(method);
-                return method;
-            },
-
-            /* Dnu handler method */
-
-            createHandler: function (selector) {
-                var handler = function() {
-                    var args = Array.prototype.slice.call(arguments);
-                    return messageNotUnderstood(this, selector, args);
-                };
-
-                return handler;
-            }
-        };
-
-        /* Answer all method selectors based on dnu handlers */
-
-        st.allSelectors = function() {
-            return dnu.selectors;
-        };
-
-        /* Unique ID number generator */
-
-        var oid = 0;
-        st.nextId = function() {
-            oid += 1;
-            return oid;
-        };
-
-        /* We hold all Packages in a separate Object */
-
-        st.packages = {};
-
-        /* Smalltalk package creation. To add a Package, use smalltalk.addPackage() */
-
-        function pkg(spec) {
-            var that = new SmalltalkPackage();
-            that.pkgName = spec.pkgName;
-            that.organization = new SmalltalkPackageOrganizer();
-            that.properties = spec.properties || {};
-            return that;
-        }
-
-        /* Smalltalk class creation. A class is an instance of an automatically
-         created metaclass object. Newly created classes (not their metaclass)
-         should be added to the smalltalk object, see smalltalk.addClass().
-         Superclass linking is *not* handled here, see smalltalk.init()  */
-
-        function klass(spec) {
-            spec = spec || {};
-            var meta = metaclass(spec);
-            var that = meta.instanceClass;
-            that.fn = spec.fn || function() {};
-            setupClass(that, spec);
-
-            that.className = spec.className;
-            that.wrapped   = spec.wrapped || false;
-            meta.className = spec.className + ' class';
-            if(spec.superclass) {
-                that.superclass = spec.superclass;
-                meta.superclass = spec.superclass.klass;
-            }
-            return that;
-        }
-
-        function metaclass(spec) {
-            spec = spec || {};
-            var that = new SmalltalkMetaclass();
-            inherits(
-                that.fn = function() {},
-                spec.superclass ? spec.superclass.klass.fn : SmalltalkClass
-            );
-            that.instanceClass = new that.fn();
-            setupClass(that);
-            return that;
-        }
-
-        function setupClass(klass, spec) {
-            spec = spec || {};
-            klass.iVarNames = spec.iVarNames || [];
-            klass.pkg = spec.pkg;
-
-            Object.defineProperty(klass, "toString", {
-                value: function() { return 'Smalltalk ' + this.className; },
-                enumerable:false, configurable: true, writable: false
-            });
-
-            klass.organization          = new SmalltalkClassOrganizer();
-            klass.organization.theClass = klass;
-
-            Object.defineProperty(klass, "methods", {
-                value: {},
-                enumerable: false, configurable: true, writable: true
-            });
-            wireKlass(klass);
-        }
-
-        /* Smalltalk method object. To add a method to a class,
-         use smalltalk.addMethod() */
-
-        st.method = function(spec) {
-            var that = new SmalltalkMethod();
-            that.selector          = spec.selector;
-            that.jsSelector        = spec.jsSelector;
-            that.args              = spec.args || {};
-            that.category          = spec.category;
-            that.source            = spec.source;
-            that.messageSends      = spec.messageSends || [];
-            that.referencedClasses = spec.referencedClasses || [];
-            that.fn                = spec.fn;
-            return that;
-        };
-
-        /* Initialize a class in its class hierarchy. Handle both classes and
-         metaclasses. */
-
-        st.init = function(klass) {
-            st.initClass(klass);
-            if(klass.klass && !klass.meta) {
-                st.initClass(klass.klass);
-            }
-        };
-
-        st.initClass = function(klass) {
-            if(klass.wrapped) {
-                klass.inheritedMethods = {};
-                copySuperclass(klass);
-            } else {
-                installSuperclass(klass);
-            }
-
-            if(klass === st.Object || klass.wrapped) {
-                installDnuHandlers(klass);
-            }
-        };
-
-        function wireKlass(klass) {
-            Object.defineProperty(klass.fn.prototype, "klass", {
-                value: klass,
-                enumerable: false, configurable: true, writable: true
-            });
-        }
-
-        function installSuperclass(klass) {
-            // only if the klass has not been initialized yet.
-            if(klass.fn.prototype._yourself) { return; }
-
-            if(klass.superclass && klass.superclass !== nil) {
-                inherits(klass.fn, klass.superclass.fn);
-                wireKlass(klass);
-                reinstallMethods(klass);
-            }
-        }
-
-        function copySuperclass(klass, superclass) {
-            for (superclass = superclass || klass.superclass;
-                 superclass && superclass !== nil;
-                 superclass = superclass.superclass) {
-                for (var keys = Object.keys(superclass.methods), i = 0; i < keys.length; i++) {
-                    inheritMethodIfAbsent(superclass.methods[keys[i]], klass);
-                }
-            }
-        }
-
-        function installMethod(method, klass) {
-            Object.defineProperty(klass.fn.prototype, method.jsSelector, {
-                value: method.fn,
-                enumerable: false, configurable: true, writable: true
-            });
-        }
-
-        function inheritMethodIfAbsent(method, klass) {
-            var selector = method.selector;
-
-            if(klass.methods.hasOwnProperty(selector) || klass.inheritedMethods.hasOwnProperty(selector)) {
-                return;
-            }
-
-            installMethod(method, klass);
-            klass.inheritedMethods[method.selector] = true;
-        }
-
-        function reinstallMethods(klass) {
-            for(var keys = Object.keys(klass.methods), i=0; i<keys.length; i++) {
-                installMethod(klass.methods[keys[i]], klass);
-            }
-        }
-
-        function installDnuHandlers(klass) {
-            var m = dnu.methods;
-            for(var i=0; i<m.length; i++) {
-                installDnuHandlerIfAbsent(m[i], klass);
-            }
-        }
-
-        function installNewDnuHandler(newHandler) {
-            installDnuHandlerIfAbsent(newHandler, st.Object);
-            for(var i = 0; i < wrappedClasses.length; i++) {
-                installDnuHandlerIfAbsent(newHandler, wrappedClasses[i]);
-            }
-        }
-
-        function installDnuHandlerIfAbsent(handler, klass) {
-            var jsFunction = klass.fn.prototype[handler.jsSelector];
-            if(!jsFunction) {
-                installMethod(handler, klass);
-            }
-        }
-
-        /* Answer all registered Packages as Array */
-        // TODO: Remove this hack
-
-        st.packages.all = function() {
-            var packages = [];
-            for(var i in st.packages) {
-                if(!st.packages.hasOwnProperty(i) || typeof(st.packages[i]) === "function") continue;
-                packages.push(st.packages[i]);
-            }
-            return packages;
-        };
-
-        /* Answer all registered Smalltalk classes */
-        //TODO: remove the function and make smalltalk.classes an array
-
-        st.classes = function() {
-            return classes;
-        };
-
-        st.wrappedClasses = function() {
-            return wrappedClasses;
-        };
-
-        /* Answer the direct subclasses of klass. */
-
-        st.subclasses = function(klass) {
-            var subclasses = [];
-            var classes = st.classes();
-            for(var i=0; i < classes.length; i++) {
-                var c = classes[i];
-                if(c.fn) {
-                    //Classes
-                    if(c.superclass === klass) {
-                        subclasses.push(c);
-                    }
-                    c = c.klass;
-                    //Metaclasses
-                    if(c && c.superclass === klass) {
-                        subclasses.push(c);
-                    }
-                }
-            }
-            return subclasses;
-        };
-
-        st.allSubclasses = function(klass) {
-            var result, subclasses;
-            result = subclasses = st.subclasses(klass);
-            subclasses.forEach(function(subclass) {
-                result.push.apply(result, st.allSubclasses(subclass));
-            });
-
-            return result;
-        };
-
-
-        /* Create a new class wrapping a JavaScript constructor, and add it to the
-         global smalltalk object. Package is lazily created if it does not exist with given name. */
-
-        st.wrapClassName = function(className, pkgName, fn, superclass, wrapped) {
-            if(wrapped !== false) {
-                wrapped = true;
-            }
-            var pkg = st.addPackage(pkgName);
-            st[className] = klass({
-                className:  className,
-                superclass: superclass,
-                pkg:        pkg,
-                fn:         fn,
-                wrapped:    wrapped
-            });
-
-            classes.addElement(st[className]);
-            if(wrapped) {
-                wrappedClasses.addElement(st[className]);
-            }
-            pkg.organization.elements.addElement(st[className]);
-        };
-
-        /* Create an alias for an existing class */
-
-        st.alias = function(klass, alias) {
-            st[alias] = klass;
-        };
-
-        /* Add a package to the smalltalk.packages object, creating a new one if needed.
-         If pkgName is null or empty we return nil, which is an allowed package for a class.
-         If package already exists we still update the properties of it. */
-
-        st.addPackage = function(pkgName, properties) {
-            if(!pkgName) {return nil;}
-            if(!(st.packages[pkgName])) {
-                st.packages[pkgName] = pkg({
-                    pkgName: pkgName,
-                    properties: properties
-                });
-            } else {
-                if(properties) {
-                    st.packages[pkgName].properties = properties;
-                }
-            }
-            return st.packages[pkgName];
-        };
-
-        /* Add a class to the smalltalk object, creating a new one if needed.
-         A Package is lazily created if it does not exist with given name. */
-
-        st.addClass = function(className, superclass, iVarNames, pkgName) {
-            var pkg = st.addPackage(pkgName);
-            if (superclass == nil) { superclass = null; }
-            if(st[className] && st[className].superclass == superclass) {
-                st[className].superclass = superclass;
-                st[className].iVarNames = iVarNames;
-                st[className].pkg = pkg || st[className].pkg;
-            } else {
-                if(st[className]) {
-                    st.removeClass(st[className]);
-                }
-                st[className] = klass({
-                    className: className,
-                    superclass: superclass,
-                    pkg: pkg,
-                    iVarNames: iVarNames
-                });
-            }
-
-            classes.addElement(st[className]);
-            pkg.organization.elements.addElement(st[className]);
-        };
-
-        st.removeClass = function(klass) {
-            klass.pkg.organization.elements.removeElement(klass);
-            classes.removeElement(klass);
-            delete st[klass.className];
-        };
-
-        /* Add/remove a method to/from a class */
-
-        /* This is a temporary version of addMethod() for backward compatibility */
-        st.addMethod = function(method_exJsSelector, klass_exMethod, exKlass) {
-            if (typeof method_exJsSelector === "string") { //legacy
-                if (method_exJsSelector !== st.selector(klass_exMethod.selector)) {
-                    console.log("DISCREPANCY: arg, in_method");
-                    console.log(method_exJsSelector);
-                    console.log(st.selector(klass_exMethod.selector));
-                    klass_exMethod.jsSelector = method_exJsSelector;
-                }
-                return new_addMethod(klass_exMethod, exKlass);
-            }
-
-            return new_addMethod(method_exJsSelector, klass_exMethod);
-        };
-
-        // later, st.addMethod can be this:
-        function new_addMethod(method, klass) {
-            if (!(method.jsSelector)) {
-                method.jsSelector = st.selector(method.selector);
-            }
-            installMethod(method, klass);
-            klass.methods[method.selector] = method;
-            method.methodClass = klass;
-
-            // During the bootstrap, #addCompiledMethod is not used.
-            // Therefore we populate the organizer here too
-            klass.organization.elements.addElement(method.category);
-
-            // If already initialized (else it will be done later anyway),
-            // re-initialize all subclasses to ensure the new method
-            // propagation (for wrapped classes, not using the prototype
-            // chain.
-            if(initialized) {
-                st.allSubclasses(klass).forEach(function(subclass) {
-                    st.initClass(subclass);
-                });
-            }
-
-            for(var i=0; i<method.messageSends.length; i++) {
-                var dnuHandler = dnu.get(method.messageSends[i]);
-                if(initialized) {
-                    installNewDnuHandler(dnuHandler);
-                }
-            }
-        }
-
-        st.removeMethod = function(method) {
-            var klass = method.methodClass;
-
-            delete klass.fn.prototype[st.selector(method.selector)];
-            delete klass.methods[method.selector];
-
-            // Do *not* delete protocols from here.
-            // This is handled by #removeCompiledMethod
-        };
-
-        /* Handles unhandled errors during message sends */
-        // simply send the message and handle #dnu:
-
-        st.send = function(receiver, selector, args, klass) {
-            var method;
-            if(receiver === null) {
-                receiver = nil;
-            }
-            method = klass ? klass.fn.prototype[selector] : receiver.klass && receiver[selector];
-            if(method) {
-                return method.apply(receiver, args);
-            } else {
-                return messageNotUnderstood(receiver, selector, args);
-            }
-        };
-
-        st.withContext = function(worker, setup) {
-            if(st.thisContext) {
-                st.thisContext.pc++;
-                return inContext(worker, setup);
-            } else {
-                try {
-                    return inContext(worker, setup);
-                } catch(error) {
-                    if(error.smalltalkError) {
-                        handleError(error);
-                    } else {
-                        var errorWrapper = st.JavaScriptException._on_(error);
-                        try {errorWrapper._signal();} catch(ex) {}
-                        errorWrapper._context_(st.getThisContext());
-                        handleError(errorWrapper);
-                    }
-                    // Reset the context stack in any case
-                    st.thisContext = undefined;
-                    // Throw the exception anyway, as we want to stop
-                    // the execution to avoid infinite loops
-                    // Update: do not throw the exception. It's really annoying.
-                    // throw error;
-                }
-            }
-        };
-
-        function inContext(worker, setup) {
-            var context = pushContext(setup);
-            var result = worker(context);
-            popContext(context);
-            return result;
-        }
-
-        /* Handles Smalltalk errors. Triggers the registered ErrorHandler
-         (See the Smalltalk class ErrorHandler and its subclasses */
-
-        function handleError(error) {
-            st.ErrorHandler._current()._handleError_(error);
-        }
-
-        /* Handles #dnu: *and* JavaScript method calls.
-         if the receiver has no klass, we consider it a JS object (outside of the
-         Amber system). Else assume that the receiver understands #doesNotUnderstand: */
-
-        function messageNotUnderstood(receiver, selector, args) {
-            /* Handles JS method calls. */
-            if(receiver.klass === undefined || receiver.allowJavaScriptCalls) {
-                return callJavaScriptMethod(receiver, selector, args);
-            }
-
-            /* Handles not understood messages. Also see the Amber counter-part
-             Object>>doesNotUnderstand: */
-
-            return receiver._doesNotUnderstand_(
-                st.Message._new()
-                    ._selector_(st.convertSelector(selector))
-                    ._arguments_(args)
-            );
-        }
-
-        /* Call a method of a JS object, or answer a property if it exists.
-         Else try wrapping a JSObjectProxy around the receiver.
-
-         If the object property is a function, then call it, except if it starts with
-         an uppercase character (we probably want to answer the function itself in this
-         case and send it #new from Amber).
-
-         Converts keyword-based selectors by using the first
-         keyword only, but keeping all message arguments.
-
-         Example:
-         "self do: aBlock with: anObject" -> "self.do(aBlock, anObject)" */
-
-        function callJavaScriptMethod(receiver, selector, args) {
-            var jsSelector = selector._asJavaScriptSelector();
-            var jsProperty = receiver[jsSelector];
-            if(typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
-                return jsProperty.apply(receiver, args);
-            } else if(jsProperty !== undefined) {
-                if(args[0]) {
-                    receiver[jsSelector] = args[0];
-                    return nil;
-                } else {
-                    return jsProperty;
-                }
-            }
-
-            return st.send(st.JSObjectProxy._on_(receiver), selector, args);
-        }
-
-        /* Handle thisContext pseudo variable */
-
-        st.getThisContext = function() {
-            if(st.thisContext) {
-                st.thisContext.init();
-                return st.thisContext;
-            } else {
-                return nil;
-            }
-        };
-
-        function pushContext(setup) {
-            st.thisContext = new SmalltalkMethodContext(smalltalk.thisContext, setup);
-            return st.thisContext;
-        }
-
-        function popContext(context) {
-            st.thisContext = context.homeContext;
-        }
-
-        /* Convert a Smalltalk selector into a JS selector */
-
-        st.selector = function(string) {
-            var selector = '_' + string;
-            selector = selector.replace(/:/g, '_');
-            selector = selector.replace(/[\&]/g, '_and');
-            selector = selector.replace(/[\|]/g, '_or');
-            selector = selector.replace(/[+]/g, '_plus');
-            selector = selector.replace(/-/g, '_minus');
-            selector = selector.replace(/[*]/g ,'_star');
-            selector = selector.replace(/[\/]/g ,'_slash');
-            selector = selector.replace(/[\\]/g ,'_backslash');
-            selector = selector.replace(/[\~]/g ,'_tild');
-            selector = selector.replace(/>/g ,'_gt');
-            selector = selector.replace(/</g ,'_lt');
-            selector = selector.replace(/=/g ,'_eq');
-            selector = selector.replace(/,/g ,'_comma');
-            selector = selector.replace(/[@]/g ,'_at');
-            return selector;
-        };
-
-        /* Convert a string to a valid smalltalk selector.
-         if you modify the following functions, also change String>>asSelector
-         accordingly */
-
-        st.convertSelector = function(selector) {
-            if(selector.match(/__/)) {
-                return convertBinarySelector(selector);
-            } else {
-                return convertKeywordSelector(selector);
-            }
-        };
-
-        function convertKeywordSelector(selector) {
-            return selector.replace(/^_/, '').replace(/_/g, ':');
-        }
-
-        function convertBinarySelector(selector) {
-            return selector
-                .replace(/^_/, '')
-                .replace(/_and/g, '&')
-                .replace(/_or/g, '|')
-                .replace(/_plus/g, '+')
-                .replace(/_minus/g, '-')
-                .replace(/_star/g, '*')
-                .replace(/_slash/g, '/')
-                .replace(/_backslash/g, '\\')
-                .replace(/_tild/g, '~')
-                .replace(/_gt/g, '>')
-                .replace(/_lt/g, '<')
-                .replace(/_eq/g, '=')
-                .replace(/_comma/g, ',')
-                .replace(/_at/g, '@');
-        }
-
-        /* Converts a JavaScript object to valid Smalltalk Object */
-        st.readJSObject = function(js) {
-            var object = js;
-            var readObject = (js.constructor === Object);
-            var readArray = (js.constructor === Array);
-
-            if(readObject) {
-                object = st.Dictionary._new();
-            }
-            for(var i in js) {
-                if(readObject) {
-                    object._at_put_(i, st.readJSObject(js[i]));
-                }
-                if(readArray) {
-                    object[i] = st.readJSObject(js[i]);
-                }
-            }
-            return object;
-        };
-
-        /* Boolean assertion */
-        st.assert = function(shouldBeBoolean) {
-            if ((undefined !== shouldBeBoolean) && (shouldBeBoolean.klass === smalltalk.Boolean)) {
-                return (shouldBeBoolean == true);
-            } else {
-                smalltalk.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
-            }
-        };
-
-        /* Backward compatibility with Amber 0.9.1 */
-        st.symbolFor = function(aString) { return aString; };
-
-        /* Smalltalk initialization. Called on page load */
-
-        st.initialize = function() {
-            if(initialized) { return; }
-
-            classes.forEach(function(klass) {
-                st.init(klass);
-            });
-            classes.forEach(function(klass) {
-                klass._initialize();
-            });
-
-            initialized = true;
-        };
-    }
-
-    inherits(Smalltalk, SmalltalkObject);
-
-    function SmalltalkMethodContext(home, setup) {
-        this.homeContext = home;
-        this.setup       = setup || function() {};
-        this.pc          = 0;
-    }
 
-// Fallbacks
-    SmalltalkMethodContext.prototype.locals = {};
-    SmalltalkMethodContext.prototype.receiver = null;
-    SmalltalkMethodContext.prototype.selector = null;
-    SmalltalkMethodContext.prototype.lookupClass = null;
-
-    inherits(SmalltalkMethodContext, SmalltalkObject);
-
-    SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
-        this.receiver    = receiver;
-        this.selector    = selector;
-        this.locals      = locals || {};
-        this.lookupClass = lookupClass;
-    };
-
-    SmalltalkMethodContext.prototype.fillBlock = function(locals, ctx) {
-        this.locals        = locals || {};
-        this.outerContext  = ctx;
-    };
-
-    SmalltalkMethodContext.prototype.init = function() {
-        var home = this.homeContext;
-        if(home) {
-            home = home.init();
-        }
-
-        this.setup(this);
-    };
-
-    SmalltalkMethodContext.prototype.method = function() {
-        var method;
-        var lookup = this.lookupClass || this.receiver.klass;
-        while(!method && lookup) {
-            method = lookup.methods[smalltalk.convertSelector(this.selector)];
-            lookup = lookup.superclass;
-        }
-        return method;
-    };
-
-    /* Global Smalltalk objects. */
-
-    var nil = new SmalltalkNil();
-    var smalltalk = new Smalltalk();
-
-    if(this.jQuery) {
-        this.jQuery.allowJavaScriptCalls = true;
-    }
-
-    /*
-     * Answer the smalltalk representation of o.
-     * Used in message sends
-     */
-
-    var _st = function(o) {
-        if(o == null) {return nil;}
-        if(o.klass) {return o;}
-        return smalltalk.JSObjectProxy._on_(o);
-    };
-
-
-    /***************************************** BOOTSTRAP ******************************************/
-
-    smalltalk.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
-    smalltalk.wrapClassName("Behavior", "Kernel-Classes", SmalltalkBehavior, smalltalk.Object, false);
-    smalltalk.wrapClassName("Metaclass", "Kernel-Classes", SmalltalkMetaclass, smalltalk.Behavior, false);
-    smalltalk.wrapClassName("Class", "Kernel-Classes", SmalltalkClass, smalltalk.Behavior, false);
-
-    smalltalk.Object.klass.superclass = smalltalk.Class;
-
-
-    smalltalk.wrapClassName("Smalltalk", "Kernel-Objects", Smalltalk, smalltalk.Object, false);
-    smalltalk.wrapClassName("Package", "Kernel-Objects", SmalltalkPackage, smalltalk.Object, false);
-    smalltalk.wrapClassName("CompiledMethod", "Kernel-Methods", SmalltalkMethod, smalltalk.Object, false);
-    smalltalk.wrapClassName("Organizer", "Kernel-Objects", SmalltalkOrganizer, smalltalk.Object, false);
-    smalltalk.wrapClassName("PackageOrganizer", "Kernel-Objects", SmalltalkPackageOrganizer, smalltalk.Organizer, false);
-    smalltalk.wrapClassName("ClassOrganizer", "Kernel-Objects", SmalltalkClassOrganizer, smalltalk.Organizer, false);
-
-
-    smalltalk.wrapClassName("Number", "Kernel-Objects", Number, smalltalk.Object);
-    smalltalk.wrapClassName("BlockClosure", "Kernel-Methods", Function, smalltalk.Object);
-    smalltalk.wrapClassName("Boolean", "Kernel-Objects", Boolean, smalltalk.Object);
-    smalltalk.wrapClassName("Date", "Kernel-Objects", Date, smalltalk.Object);
-    smalltalk.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, smalltalk.Object, false);
-
-    smalltalk.addClass("Collection", smalltalk.Object, null, "Kernel-Collections");
-    smalltalk.addClass("IndexableCollection", smalltalk.Collection, null, "Kernel-Collections");
-    smalltalk.addClass("SequenceableCollection", smalltalk.IndexableCollection, null, "Kernel-Collections");
-    smalltalk.addClass("CharacterArray", smalltalk.SequenceableCollection, null, "Kernel-Collections");
-    smalltalk.wrapClassName("String", "Kernel-Collections", String, smalltalk.CharacterArray);
-    smalltalk.wrapClassName("Array", "Kernel-Collections", Array, smalltalk.SequenceableCollection);
-    smalltalk.wrapClassName("RegularExpression", "Kernel-Collections", RegExp, smalltalk.Object);
-
-    smalltalk.wrapClassName("Error", "Kernel-Exceptions", Error, smalltalk.Object);
-    smalltalk.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContext, smalltalk.Object, false);
-
-    /* Alias definitions */
-
-    smalltalk.alias(smalltalk.Array, "OrderedCollection");
-    smalltalk.alias(smalltalk.Date, "Time");
-
-    // TODO make this unnecessary
-    this.smalltalk = smalltalk;
-    this.nil = nil;
-    this._st = _st;
+/* Array extensions */
 
-    return { smalltalk: smalltalk, nil: nil, _st: _st };
-});
+Array.prototype.addElement = function(el) {
+	if(typeof el === 'undefined') { return; }
+	if(this.indexOf(el) == -1) {
+		this.push(el);
+	}
+};
+
+Array.prototype.removeElement = function(el) {
+	var i = this.indexOf(el);
+	if (i !== -1) { this.splice(i, 1); }
+};
+
+
+/* Smalltalk constructors definition */
+
+function SmalltalkObject() {}
+function SmalltalkBehavior() {}
+function SmalltalkClass() {}
+function SmalltalkMetaclass() {
+	this.meta = true;
+}
+function SmalltalkPackage() {}
+function SmalltalkMethod() {}
+function SmalltalkNil() {}
+
+function SmalltalkOrganizer() {
+}
+
+function SmalltalkPackageOrganizer() {
+	this.elements = [];
+}
+
+function SmalltalkClassOrganizer() {
+	this.elements = [];
+}
+
+function inherits(child, parent) {
+	child.prototype = Object.create(parent.prototype, {
+		constructor: { value: child,
+			enumerable: false, configurable: true, writable: true }
+	});
+}
 
+inherits(SmalltalkBehavior, SmalltalkObject);
+inherits(SmalltalkClass, SmalltalkBehavior);
+inherits(SmalltalkMetaclass, SmalltalkBehavior);
+inherits(SmalltalkNil, SmalltalkObject);
+inherits(SmalltalkMethod, SmalltalkObject);
+inherits(SmalltalkPackage, SmalltalkObject);
+inherits(SmalltalkOrganizer, SmalltalkObject);
+inherits(SmalltalkPackageOrganizer, SmalltalkOrganizer);
+inherits(SmalltalkClassOrganizer, SmalltalkOrganizer);
+
+global_nil = new SmalltalkNil();
+(function (nil) {
+
+function Smalltalk() {
+
+	var st = this;
+
+	/* This is the current call context object. While it is publicly available,
+		Use smalltalk.getThisContext() instead which will answer a safe copy of
+		the current context */
+
+	st.thisContext = undefined;
+
+	/* List of all reserved words in JavaScript. They may not be used as variables
+		in Smalltalk. */
+
+	// list of reserved JavaScript keywords as of
+	//   http://es5.github.com/#x7.6.1.1
+	// and
+	//   http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.6.1
+	st.reservedWords = ['break', 'case', 'catch', 'continue', 'debugger',
+		'default', 'delete', 'do', 'else', 'finally', 'for', 'function',
+		'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw',
+		'try', 'typeof', 'var', 'void', 'while', 'with',
+		// ES5: future use: http://es5.github.com/#x7.6.1.2
+		'class', 'const', 'enum', 'export', 'extends', 'import', 'super',
+		// ES5: future use in strict mode
+		'implements', 'interface', 'let', 'package', 'private', 'protected',
+		'public', 'static', 'yield'];
+
+	st.globalJsVariables = ['jQuery', 'window', 'document', 'process', 'global'];
+
+	var initialized = false;
+
+	/* Smalltalk classes */
+
+	var classes = [];
+	var wrappedClasses = [];
+
+	/* Method not implemented handlers */
+
+	var dnu = {
+		methods: [],
+		selectors: [],
+
+		get: function (string) {
+			var index = this.selectors.indexOf(string);
+			if(index !== -1) {
+				return this.methods[index];
+			}
+			this.selectors.push(string);
+			var selector = st.selector(string);
+			var method = {jsSelector: selector, fn: this.createHandler(selector)};
+			this.methods.push(method);
+			return method;
+		},
+
+		/* Dnu handler method */
+
+		createHandler: function (selector) {
+			var handler = function() {
+				var args = Array.prototype.slice.call(arguments);
+				return messageNotUnderstood(this, selector, args);
+			};
+
+			return handler;
+		}
+	};
+
+	/* Answer all method selectors based on dnu handlers */
+
+	st.allSelectors = function() {
+		return dnu.selectors;
+	};
+
+	/* Unique ID number generator */
+
+	var oid = 0;
+	st.nextId = function() {
+		oid += 1;
+		return oid;
+	};
+
+	/* We hold all Packages in a separate Object */
+
+	st.packages = {};
+
+	/* Smalltalk package creation. To add a Package, use smalltalk.addPackage() */
+
+	function pkg(spec) {
+		var that = new SmalltalkPackage();
+		that.pkgName = spec.pkgName;
+		that.organization = new SmalltalkPackageOrganizer();
+		that.properties = spec.properties || {};
+		return that;
+	}
+
+	/* Smalltalk class creation. A class is an instance of an automatically
+		created metaclass object. Newly created classes (not their metaclass)
+		should be added to the smalltalk object, see smalltalk.addClass().
+		Superclass linking is *not* handled here, see smalltalk.init()  */
+
+	function klass(spec) {
+		spec = spec || {};
+		var meta = metaclass(spec);
+		var that = meta.instanceClass;
+		that.fn = spec.fn || function() {};
+		setupClass(that, spec);
+
+		that.className = spec.className;
+		that.wrapped   = spec.wrapped || false;
+		meta.className = spec.className + ' class';
+		if(spec.superclass) {
+			that.superclass = spec.superclass;
+			meta.superclass = spec.superclass.klass;
+		}
+		return that;
+	}
+
+	function metaclass(spec) {
+		spec = spec || {};
+		var that = new SmalltalkMetaclass();
+		inherits(
+			that.fn = function() {},
+			spec.superclass ? spec.superclass.klass.fn : SmalltalkClass
+		);
+		that.instanceClass = new that.fn();
+		setupClass(that);
+		return that;
+	}
+
+	function setupClass(klass, spec) {
+		spec = spec || {};
+		klass.iVarNames = spec.iVarNames || [];
+		klass.pkg = spec.pkg;
+
+		Object.defineProperty(klass, "toString", {
+			value: function() { return 'Smalltalk ' + this.className; },
+			enumerable:false, configurable: true, writable: false
+		});
+
+		klass.organization          = new SmalltalkClassOrganizer();
+		klass.organization.theClass = klass;
+
+		Object.defineProperty(klass, "methods", {
+			value: {},
+			enumerable: false, configurable: true, writable: true
+		});
+		wireKlass(klass);
+	}
+
+	/* Smalltalk method object. To add a method to a class,
+		use smalltalk.addMethod() */
+
+	st.method = function(spec) {
+		var that = new SmalltalkMethod();
+		that.selector          = spec.selector;
+		that.jsSelector        = spec.jsSelector;
+		that.args              = spec.args || {};
+		that.category          = spec.category;
+		that.source            = spec.source;
+		that.messageSends      = spec.messageSends || [];
+		that.referencedClasses = spec.referencedClasses || [];
+		that.fn                = spec.fn;
+		return that;
+	};
+
+	/* Initialize a class in its class hierarchy. Handle both classes and
+		metaclasses. */
+
+	st.init = function(klass) {
+		st.initClass(klass);
+		if(klass.klass && !klass.meta) {
+			st.initClass(klass.klass);
+		}
+	};
+
+	st.initClass = function(klass) {
+		if(klass.wrapped) {
+			klass.inheritedMethods = {};
+			copySuperclass(klass);
+		} else {
+			installSuperclass(klass);
+		}
+
+		if(klass === st.Object || klass.wrapped) {
+			installDnuHandlers(klass);
+		}
+	};
+
+	function wireKlass(klass) {
+		Object.defineProperty(klass.fn.prototype, "klass", {
+			value: klass,
+			enumerable: false, configurable: true, writable: true
+		});
+	}
+
+	function installSuperclass(klass) {
+		// only if the klass has not been initialized yet.
+		if(klass.fn.prototype._yourself) { return; }
+
+		if(klass.superclass && klass.superclass !== nil) {
+			inherits(klass.fn, klass.superclass.fn);
+			wireKlass(klass);
+			reinstallMethods(klass);
+		}
+	}
+
+	function copySuperclass(klass, superclass) {
+		for (superclass = superclass || klass.superclass;
+			superclass && superclass !== nil;
+			superclass = superclass.superclass) {
+			for (var keys = Object.keys(superclass.methods), i = 0; i < keys.length; i++) {
+				inheritMethodIfAbsent(superclass.methods[keys[i]], klass);
+			}
+		}
+	}
+
+	function installMethod(method, klass) {
+		Object.defineProperty(klass.fn.prototype, method.jsSelector, {
+			value: method.fn,
+			enumerable: false, configurable: true, writable: true
+		});
+	}
+
+	function inheritMethodIfAbsent(method, klass) {
+		var selector = method.selector;
+
+		if(klass.methods.hasOwnProperty(selector) || klass.inheritedMethods.hasOwnProperty(selector)) {
+			return;
+		}
+
+		installMethod(method, klass);
+		klass.inheritedMethods[method.selector] = true;
+	}
+
+	function reinstallMethods(klass) {
+		for(var keys = Object.keys(klass.methods), i=0; i<keys.length; i++) {
+			installMethod(klass.methods[keys[i]], klass);
+		}
+	}
+
+	function installDnuHandlers(klass) {
+		var m = dnu.methods;
+		for(var i=0; i<m.length; i++) {
+			installDnuHandlerIfAbsent(m[i], klass);
+		}
+	}
+
+	function installNewDnuHandler(newHandler) {
+		installDnuHandlerIfAbsent(newHandler, st.Object);
+		for(var i = 0; i < wrappedClasses.length; i++) {
+			installDnuHandlerIfAbsent(newHandler, wrappedClasses[i]);
+		}
+	}
+
+	function installDnuHandlerIfAbsent(handler, klass) {
+		var jsFunction = klass.fn.prototype[handler.jsSelector];
+		if(!jsFunction) {
+			installMethod(handler, klass);
+		}
+	}
+
+	/* Answer all registered Packages as Array */
+	// TODO: Remove this hack
+
+	st.packages.all = function() {
+		var packages = [];
+		for(var i in st.packages) {
+			if(!st.packages.hasOwnProperty(i) || typeof(st.packages[i]) === "function") continue;
+			packages.push(st.packages[i]);
+		}
+		return packages;
+	};
+
+	/* Answer all registered Smalltalk classes */
+	//TODO: remove the function and make smalltalk.classes an array
+
+	st.classes = function() {
+		return classes;
+	};
+
+	st.wrappedClasses = function() {
+		return wrappedClasses;
+	};
+
+	/* Answer the direct subclasses of klass. */
+
+	st.subclasses = function(klass) {
+		var subclasses = [];
+		var classes = st.classes();
+		for(var i=0; i < classes.length; i++) {
+			var c = classes[i];
+			if(c.fn) {
+				//Classes
+				if(c.superclass === klass) {
+					subclasses.push(c);
+				}
+				c = c.klass;
+				//Metaclasses
+				if(c && c.superclass === klass) {
+					subclasses.push(c);
+				}
+			}
+		}
+		return subclasses;
+	};
+
+	st.allSubclasses = function(klass) {
+		var result, subclasses;
+		result = subclasses = st.subclasses(klass);
+		subclasses.forEach(function(subclass) {
+			result.push.apply(result, st.allSubclasses(subclass));
+		});
+
+		return result;
+	};
+
+
+	/* Create a new class wrapping a JavaScript constructor, and add it to the
+		global smalltalk object. Package is lazily created if it does not exist with given name. */
+
+	st.wrapClassName = function(className, pkgName, fn, superclass, wrapped) {
+		if(wrapped !== false) {
+			wrapped = true;
+		}
+		var pkg = st.addPackage(pkgName);
+		st[className] = klass({
+			className:  className,
+			superclass: superclass,
+			pkg:        pkg,
+			fn:         fn,
+			wrapped:    wrapped
+		});
+
+		classes.addElement(st[className]);
+		if(wrapped) {
+			wrappedClasses.addElement(st[className]);
+		}
+		pkg.organization.elements.addElement(st[className]);
+	};
+
+	/* Create an alias for an existing class */
+
+	st.alias = function(klass, alias) {
+		st[alias] = klass;
+	};
+
+	/* Add a package to the smalltalk.packages object, creating a new one if needed.
+		If pkgName is null or empty we return nil, which is an allowed package for a class.
+		If package already exists we still update the properties of it. */
+
+	st.addPackage = function(pkgName, properties) {
+		if(!pkgName) {return nil;}
+		if(!(st.packages[pkgName])) {
+			st.packages[pkgName] = pkg({
+				pkgName: pkgName,
+				properties: properties
+			});
+		} else {
+			if(properties) {
+				st.packages[pkgName].properties = properties;
+			}
+		}
+		return st.packages[pkgName];
+	};
+
+	/* Add a class to the smalltalk object, creating a new one if needed.
+		A Package is lazily created if it does not exist with given name. */
+
+	st.addClass = function(className, superclass, iVarNames, pkgName) {
+		var pkg = st.addPackage(pkgName);
+		if (superclass == nil) { superclass = null; }
+		if(st[className] && st[className].superclass == superclass) {
+			st[className].superclass = superclass;
+			st[className].iVarNames = iVarNames;
+			st[className].pkg = pkg || st[className].pkg;
+		} else {
+			if(st[className]) {
+				st.removeClass(st[className]);
+			}
+			st[className] = klass({
+				className: className,
+				superclass: superclass,
+				pkg: pkg,
+				iVarNames: iVarNames
+			});
+		}
+
+		classes.addElement(st[className]);
+		pkg.organization.elements.addElement(st[className]);
+	};
+
+	st.removeClass = function(klass) {
+		klass.pkg.organization.elements.removeElement(klass);
+		classes.removeElement(klass);
+		delete st[klass.className];
+	};
+
+	/* Add/remove a method to/from a class */
+
+	/* This is a temporary version of addMethod() for backward compatibility */
+	st.addMethod = function(method_exJsSelector, klass_exMethod, exKlass) {
+		if (typeof method_exJsSelector === "string") { //legacy
+			if (method_exJsSelector !== st.selector(klass_exMethod.selector)) {
+				console.log("DISCREPANCY: arg, in_method");
+				console.log(method_exJsSelector);
+				console.log(st.selector(klass_exMethod.selector));
+				klass_exMethod.jsSelector = method_exJsSelector;
+			}
+			return new_addMethod(klass_exMethod, exKlass);
+		}
+
+		return new_addMethod(method_exJsSelector, klass_exMethod);
+	};
+
+	// later, st.addMethod can be this:
+	function new_addMethod(method, klass) {
+		if (!(method.jsSelector)) {
+			method.jsSelector = st.selector(method.selector);
+		}
+		installMethod(method, klass);
+		klass.methods[method.selector] = method;
+		method.methodClass = klass;
+
+		// During the bootstrap, #addCompiledMethod is not used.
+		// Therefore we populate the organizer here too
+		klass.organization.elements.addElement(method.category);
+
+		// If already initialized (else it will be done later anyway),
+		// re-initialize all subclasses to ensure the new method
+		// propagation (for wrapped classes, not using the prototype
+		// chain.
+		if(initialized) {
+			st.allSubclasses(klass).forEach(function(subclass) {
+				st.initClass(subclass);
+			});
+		}
+
+		for(var i=0; i<method.messageSends.length; i++) {
+			var dnuHandler = dnu.get(method.messageSends[i]);
+			if(initialized) {
+				installNewDnuHandler(dnuHandler);
+			}
+		}
+	}
+
+	st.removeMethod = function(method) {
+		var klass = method.methodClass;
+
+		delete klass.fn.prototype[st.selector(method.selector)];
+		delete klass.methods[method.selector];
+
+		// Do *not* delete protocols from here.
+		// This is handled by #removeCompiledMethod
+	};
+
+	/* Handles unhandled errors during message sends */
+	// simply send the message and handle #dnu:
+
+	st.send = function(receiver, selector, args, klass) {
+		var method;
+		if(receiver === null) {
+			receiver = nil;
+		}
+		method = klass ? klass.fn.prototype[selector] : receiver.klass && receiver[selector];
+		if(method) {
+			return method.apply(receiver, args);
+		} else {
+			return messageNotUnderstood(receiver, selector, args);
+		}
+	};
+
+	st.withContext = function(worker, setup) {
+		if(st.thisContext) {
+			st.thisContext.pc++;
+			return inContext(worker, setup);
+		} else {
+			try {
+				return inContext(worker, setup);
+			} catch(error) {
+				if(error.smalltalkError) {
+					handleError(error);
+				} else {
+					var errorWrapper = st.JavaScriptException._on_(error);
+					try {errorWrapper._signal();} catch(ex) {}
+					errorWrapper._context_(st.getThisContext());
+					handleError(errorWrapper);
+				}
+				// Reset the context stack in any case
+				st.thisContext = undefined;
+				// Throw the exception anyway, as we want to stop
+				// the execution to avoid infinite loops
+				// Update: do not throw the exception. It's really annoying.
+				// throw error;
+			}
+		}
+	};
+
+	function inContext(worker, setup) {
+		var context = pushContext(setup);
+		var result = worker(context);
+		popContext(context);
+		return result;
+	}
+
+	/* Handles Smalltalk errors. Triggers the registered ErrorHandler
+		(See the Smalltalk class ErrorHandler and its subclasses */
+
+	function handleError(error) {
+		st.ErrorHandler._current()._handleError_(error);
+	}
+
+	/* Handles #dnu: *and* JavaScript method calls.
+		if the receiver has no klass, we consider it a JS object (outside of the
+		Amber system). Else assume that the receiver understands #doesNotUnderstand: */
+
+	function messageNotUnderstood(receiver, selector, args) {
+		/* Handles JS method calls. */
+		if(receiver.klass === undefined || receiver.allowJavaScriptCalls) {
+			return callJavaScriptMethod(receiver, selector, args);
+		}
+
+		/* Handles not understood messages. Also see the Amber counter-part
+			Object>>doesNotUnderstand: */
+
+		return receiver._doesNotUnderstand_(
+			st.Message._new()
+				._selector_(st.convertSelector(selector))
+				._arguments_(args)
+		);
+	}
+
+	/* Call a method of a JS object, or answer a property if it exists.
+		Else try wrapping a JSObjectProxy around the receiver.
+
+		If the object property is a function, then call it, except if it starts with
+		an uppercase character (we probably want to answer the function itself in this
+		case and send it #new from Amber).
+
+		Converts keyword-based selectors by using the first
+		keyword only, but keeping all message arguments.
+
+		Example:
+		"self do: aBlock with: anObject" -> "self.do(aBlock, anObject)" */
+
+	function callJavaScriptMethod(receiver, selector, args) {
+		var jsSelector = selector._asJavaScriptSelector();
+		var jsProperty = receiver[jsSelector];
+		if(typeof jsProperty === "function" && !/^[A-Z]/.test(jsSelector)) {
+			return jsProperty.apply(receiver, args);
+		} else if(jsProperty !== undefined) {
+			if(args[0]) {
+				receiver[jsSelector] = args[0];
+				return nil;
+			} else {
+				return jsProperty;
+			}
+		}
+
+		return st.send(st.JSObjectProxy._on_(receiver), selector, args);
+	}
+
+	/* Handle thisContext pseudo variable */
+
+	st.getThisContext = function() {
+		if(st.thisContext) {
+			st.thisContext.init();
+			return st.thisContext;
+		} else {
+			return nil;
+		}
+	};
+
+	function pushContext(setup) {
+		return st.thisContext = new SmalltalkMethodContext(st.thisContext, setup);
+	}
+
+	function popContext(context) {
+		st.thisContext = context.homeContext;
+	}
+
+	/* Convert a Smalltalk selector into a JS selector */
+
+	st.selector = function(string) {
+		var selector = '_' + string;
+		selector = selector.replace(/:/g, '_');
+		selector = selector.replace(/[\&]/g, '_and');
+		selector = selector.replace(/[\|]/g, '_or');
+		selector = selector.replace(/[+]/g, '_plus');
+		selector = selector.replace(/-/g, '_minus');
+		selector = selector.replace(/[*]/g ,'_star');
+		selector = selector.replace(/[\/]/g ,'_slash');
+		selector = selector.replace(/[\\]/g ,'_backslash');
+		selector = selector.replace(/[\~]/g ,'_tild');
+		selector = selector.replace(/>/g ,'_gt');
+		selector = selector.replace(/</g ,'_lt');
+		selector = selector.replace(/=/g ,'_eq');
+		selector = selector.replace(/,/g ,'_comma');
+		selector = selector.replace(/[@]/g ,'_at');
+		return selector;
+	};
+
+	/* Convert a string to a valid smalltalk selector.
+		if you modify the following functions, also change String>>asSelector
+		accordingly */
+
+	st.convertSelector = function(selector) {
+		if(selector.match(/__/)) {
+			return convertBinarySelector(selector);
+		} else {
+			return convertKeywordSelector(selector);
+		}
+	};
+
+	function convertKeywordSelector(selector) {
+		return selector.replace(/^_/, '').replace(/_/g, ':');
+	}
+
+	function convertBinarySelector(selector) {
+		return selector
+			.replace(/^_/, '')
+			.replace(/_and/g, '&')
+			.replace(/_or/g, '|')
+			.replace(/_plus/g, '+')
+			.replace(/_minus/g, '-')
+			.replace(/_star/g, '*')
+			.replace(/_slash/g, '/')
+			.replace(/_backslash/g, '\\')
+			.replace(/_tild/g, '~')
+			.replace(/_gt/g, '>')
+			.replace(/_lt/g, '<')
+			.replace(/_eq/g, '=')
+			.replace(/_comma/g, ',')
+			.replace(/_at/g, '@');
+	}
+
+	/* Converts a JavaScript object to valid Smalltalk Object */
+	st.readJSObject = function(js) {
+		var object = js;
+		var readObject = (js.constructor === Object);
+		var readArray = (js.constructor === Array);
+
+		if(readObject) {
+			object = st.Dictionary._new();
+		}
+		for(var i in js) {
+			if(readObject) {
+				object._at_put_(i, st.readJSObject(js[i]));
+			}
+			if(readArray) {
+				object[i] = st.readJSObject(js[i]);
+			}
+		}
+		return object;
+	};
+
+	/* Boolean assertion */
+	st.assert = function(shouldBeBoolean) {
+		if ((undefined !== shouldBeBoolean) && (shouldBeBoolean.klass === st.Boolean)) {
+			return (shouldBeBoolean == true);
+		} else {
+			st.NonBooleanReceiver._new()._object_(shouldBeBoolean)._signal();
+		}
+	};
+
+	/* Backward compatibility with Amber 0.9.1 */
+	st.symbolFor = function(aString) { return aString; };
+
+	/* Smalltalk initialization. Called on page load */
+
+	st.initialize = function() {
+		if(initialized) { return; }
+
+		classes.forEach(function(klass) {
+			st.init(klass);
+		});
+		classes.forEach(function(klass) {
+			klass._initialize();
+		});
+
+		initialized = true;
+	};
+}
+
+inherits(Smalltalk, SmalltalkObject);
+
+if(this.jQuery) {
+    this.jQuery.allowJavaScriptCalls = true;
+}
+
+function SmalltalkMethodContext(home, setup) {
+	this.homeContext = home;
+	this.setup       = setup || function() {};
+	this.pc          = 0;
+}
+
+// Fallbacks
+SmalltalkMethodContext.prototype.locals = {};
+SmalltalkMethodContext.prototype.receiver = null;
+SmalltalkMethodContext.prototype.selector = null;
+SmalltalkMethodContext.prototype.lookupClass = null;
+
+inherits(SmalltalkMethodContext, SmalltalkObject);
+
+global_smalltalk = new Smalltalk();
+(function (smalltalk) {
+
+SmalltalkMethodContext.prototype.fill = function(receiver, selector, locals, lookupClass) {
+	this.receiver    = receiver;
+	this.selector    = selector;
+	this.locals      = locals || {};
+	this.lookupClass = lookupClass;
+};
+
+SmalltalkMethodContext.prototype.fillBlock = function(locals, ctx) {
+	this.locals        = locals || {};
+	this.outerContext  = ctx;
+};
+
+SmalltalkMethodContext.prototype.init = function() {
+	var home = this.homeContext;
+	if(home) {
+		home = home.init();
+	}
+
+	this.setup(this);
+};
+
+SmalltalkMethodContext.prototype.method = function() {
+	var method;
+	var lookup = this.lookupClass || this.receiver.klass;
+	while(!method && lookup) {
+		method = lookup.methods[smalltalk.convertSelector(this.selector)];
+		lookup = lookup.superclass;
+	}
+	return method;
+};
+
+/*
+ * Answer the smalltalk representation of o.
+ * Used in message sends
+ */
+
+global__st = function(o) {
+	if(o == null) {return nil;}
+	if(o.klass) {return o;}
+	return smalltalk.JSObjectProxy._on_(o);
+};
+
+
+/***************************************** BOOTSTRAP ******************************************/
+
+smalltalk.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
+smalltalk.wrapClassName("Behavior", "Kernel-Classes", SmalltalkBehavior, smalltalk.Object, false);
+smalltalk.wrapClassName("Metaclass", "Kernel-Classes", SmalltalkMetaclass, smalltalk.Behavior, false);
+smalltalk.wrapClassName("Class", "Kernel-Classes", SmalltalkClass, smalltalk.Behavior, false);
+
+smalltalk.Object.klass.superclass = smalltalk.Class;
+
+
+smalltalk.wrapClassName("Smalltalk", "Kernel-Objects", Smalltalk, smalltalk.Object, false);
+smalltalk.wrapClassName("Package", "Kernel-Objects", SmalltalkPackage, smalltalk.Object, false);
+smalltalk.wrapClassName("CompiledMethod", "Kernel-Methods", SmalltalkMethod, smalltalk.Object, false);
+smalltalk.wrapClassName("Organizer", "Kernel-Objects", SmalltalkOrganizer, smalltalk.Object, false);
+smalltalk.wrapClassName("PackageOrganizer", "Kernel-Objects", SmalltalkPackageOrganizer, smalltalk.Organizer, false);
+smalltalk.wrapClassName("ClassOrganizer", "Kernel-Objects", SmalltalkClassOrganizer, smalltalk.Organizer, false);
+
+
+smalltalk.wrapClassName("Number", "Kernel-Objects", Number, smalltalk.Object);
+smalltalk.wrapClassName("BlockClosure", "Kernel-Methods", Function, smalltalk.Object);
+smalltalk.wrapClassName("Boolean", "Kernel-Objects", Boolean, smalltalk.Object);
+smalltalk.wrapClassName("Date", "Kernel-Objects", Date, smalltalk.Object);
+smalltalk.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, smalltalk.Object, false);
+
+smalltalk.addClass("Collection", smalltalk.Object, null, "Kernel-Collections");
+smalltalk.addClass("IndexableCollection", smalltalk.Collection, null, "Kernel-Collections");
+smalltalk.addClass("SequenceableCollection", smalltalk.IndexableCollection, null, "Kernel-Collections");
+smalltalk.addClass("CharacterArray", smalltalk.SequenceableCollection, null, "Kernel-Collections");
+smalltalk.wrapClassName("String", "Kernel-Collections", String, smalltalk.CharacterArray);
+smalltalk.wrapClassName("Array", "Kernel-Collections", Array, smalltalk.SequenceableCollection);
+smalltalk.wrapClassName("RegularExpression", "Kernel-Collections", RegExp, smalltalk.Object);
+
+smalltalk.wrapClassName("Error", "Kernel-Exceptions", Error, smalltalk.Object);
+smalltalk.wrapClassName("MethodContext", "Kernel-Methods", SmalltalkMethodContext, smalltalk.Object, false);
+
+/* Alias definitions */
+
+smalltalk.alias(smalltalk.Array, "OrderedCollection");
+smalltalk.alias(smalltalk.Date, "Time");
+
+})(global_smalltalk);
+})(global_nil);
+
+return { smalltalk: global_smalltalk, nil: global_nil, _st: global__st };
+});

+ 3 - 3
js/init.js

@@ -1,4 +1,4 @@
-(function () {
+(function (smalltalk,nil,_st) {
     var inBrowser = typeof amber !== "undefined" && typeof amber.load === "function";
     function init() {
         smalltalk.initialize();
@@ -6,7 +6,7 @@
         /* Similar to jQuery(document).ready() */
 
         if (inBrowser && amber.smalltalkReady) {
-            amber.smalltalkReady();
+            amber.smalltalkReady(smalltalk,nil,_st);
         }
     }
 
@@ -23,4 +23,4 @@
         // immediately after init, so it must happens synchronously.
         init();
     }
-})();
+})(global_smalltalk,global_nil,global__st);

+ 2 - 0
js/parser.js

@@ -1,3 +1,4 @@
+(function(smalltalk,nil){
 smalltalk.parser = (function(){
   /*
    * Generated by PEG.js 0.7.0.
@@ -4181,3 +4182,4 @@ smalltalk.parser = (function(){
   
   return result;
 })();
+})(global_smalltalk,global_nil);

+ 28 - 5
st/Importer-Exporter.st

@@ -89,14 +89,19 @@ exportPackage: packageName
 
 	| package |
 	^String streamContents: [:stream |
-				package := Smalltalk current packageAt: packageName.
-				self exportPackageDefinitionOf: package on: stream.
+		self exportPackagePrologueOn: stream.
+		[
+			package := Smalltalk current packageAt: packageName.
+			self exportPackageDefinitionOf: package on: stream.
 
-		"Export classes in dependency order.
-		Update (issue #171): Remove duplicates for export"
+			"Export classes in dependency order.
+			Update (issue #171): Remove duplicates for export"
 			package sortedClasses asSet do: [:each |
 						stream nextPutAll: (self exportClass: each)].
-		self exportPackageExtensionsOf: package on: stream]
+			self exportPackageExtensionsOf: package on: stream
+		] ensure: [
+			self exportPackageEpilogueOn: stream
+		]]
 ! !
 
 !Exporter methodsFor: 'private'!
@@ -180,6 +185,12 @@ exportPackageDefinitionOf: package on: aStream
 		lf
 !
 
+exportPackageEpilogueOn: aStream
+	aStream
+		nextPutAll: '})(global_smalltalk,global_nil,global__st);';
+		lf
+!
+
 exportPackageExtensionsOf: package on: aStream
 	"Issue #143: sort classes and methods alphabetically"
 
@@ -190,6 +201,12 @@ exportPackageExtensionsOf: package on: aStream
 			((aClass methodDictionary values) sorted: [:a :b | a selector <= b selector]) do: [:method |
 				(method category match: '^\*', name) ifTrue: [
 					self exportMethod: method of: aClass on: aStream ]]]]
+!
+
+exportPackagePrologueOn: aStream
+	aStream
+		nextPutAll: '(function(smalltalk,nil,_st){';
+		lf
 ! !
 
 Exporter subclass: #ChunkExporter
@@ -291,6 +308,9 @@ exportPackageDefinitionOf: package on: aStream
 		lf
 !
 
+exportPackageEpilogueOn: aStream
+!
+
 exportPackageExtensionsOf: package on: aStream
 	"We need to override this one too since we need to group
 	all methods in a given protocol under a leading methodsFor: chunk
@@ -308,6 +328,9 @@ exportPackageExtensionsOf: package on: aStream
 			(map keys sorted: [:a :b | a <= b ]) do: [:category | | methods |
 				methods := map at: category.
 				self exportMethods: methods category: category of: aClass on: aStream ]]]
+!
+
+exportPackagePrologueOn: aStream
 ! !
 
 Exporter subclass: #StrippedExporter