瀏覽代碼

Merge branch 'master' into moka

Nicolas Petton 10 年之前
父節點
當前提交
337845a7ce
共有 15 個文件被更改,包括 1511 次插入1577 次删除
  1. 19 0
      API-CHANGES.txt
  2. 15 0
      CHANGELOG
  3. 2 2
      js/Canvas.js
  4. 132 0
      js/Kernel-ImportExport.js
  5. 705 998
      js/Kernel-Infrastructure.js
  6. 295 245
      js/Kernel-Objects.js
  7. 25 0
      js/Kernel-Tests.js
  8. 1 1
      st/Canvas.st
  9. 41 0
      st/Kernel-ImportExport.st
  10. 152 250
      st/Kernel-Infrastructure.st
  11. 106 74
      st/Kernel-Objects.st
  12. 9 0
      st/Kernel-Tests.st
  13. 1 1
      support/amber.js
  14. 7 5
      support/boot.js
  15. 1 1
      support/helpers.js

+ 19 - 0
API-CHANGES.txt

@@ -1,3 +1,22 @@
+0.12.3 (wip):
+
+* Package Import-Export renamed to Kernel-ImportExport
+
+
++ Package
+  + >>load
+  + >>loadFromNamespace:
++ Package class
+  + >>load:
+  + >>load:fromNamespace:
++ PackageTransport
+  + >>load
++ PackageHandler
+  + >>load:
++ AmdPackageHandler
+  + >>load:
+
+
 0.12.2:
 
 * Collection >> contains: is deprecated in favor of anySatisfy:

+ 15 - 0
CHANGELOG

@@ -1,3 +1,18 @@
+??th ??? 20?? - Release 0.12.3
+===================================
+
+Highlights:
+
+* JQuery updated to ~1.10.2; jquery-ui updated to match
+* You can create subclasses of `nil`
+* Amber loads in IE8
+
+Commits: https://github.com/amber-smalltalk/amber/compare/0.12.2...0.12.2
+Issues:  https://github.com/amber-smalltalk/amber/issues?milestone=__&state=closed
+
+For the most important API related changes see the file API-CHANGES.txt.
+
+
 03rd December 2013 - Release 0.12.2
 ===================================
 

+ 2 - 2
js/Canvas.js

@@ -2704,10 +2704,10 @@ category: 'attributes',
 fn: function (aString,aValue){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-self['@element'].setAttribute(aString, aValue);
+self['@element'].setAttribute(aString, aValue); return aValue;
 return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,aValue:aValue},smalltalk.TagBrush)})},
 args: ["aString", "aValue"],
-source: "at: aString put: aValue\x0a\x09<self['@element'].setAttribute(aString, aValue)>",
+source: "at: aString put: aValue\x0a\x09<self['@element'].setAttribute(aString, aValue); return aValue>",
 messageSends: [],
 referencedClasses: []
 }),

+ 132 - 0
js/Kernel-ImportExport.js

@@ -1601,6 +1601,22 @@ referencedClasses: ["Exporter"]
 }),
 smalltalk.PackageHandler);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load:",
+category: 'loading',
+fn: function (aPackage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._subclassResponsibility();
+return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},smalltalk.PackageHandler)})},
+args: ["aPackage"],
+source: "load: aPackage\x0a\x09self subclassResponsibility",
+messageSends: ["subclassResponsibility"],
+referencedClasses: []
+}),
+smalltalk.PackageHandler);
+
 
 
 smalltalk.addClass('AmdPackageHandler', smalltalk.PackageHandler, [], 'Kernel-ImportExport');
@@ -1658,6 +1674,35 @@ referencedClasses: ["AmdExporter"]
 }),
 smalltalk.AmdPackageHandler);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load:",
+category: 'loading',
+fn: function (aPackage){
+var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$3,$2;
+$1=_st(_st($Smalltalk())._current())._amdRequire();
+if(($receiver = $1) == nil || $receiver == null){
+self._error_("AMD loader not present");
+} else {
+var require;
+require=$receiver;
+$3=_st(_st(self._namespaceFor_(aPackage)).__comma("/")).__comma(_st(aPackage)._name());
+$ctx1.sendIdx[","]=1;
+$2=_st($Array())._new_($3);
+_st(require)._value_($2);
+};
+return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackage:aPackage},smalltalk.AmdPackageHandler)})},
+args: ["aPackage"],
+source: "load: aPackage\x0a\x09Smalltalk current amdRequire\x0a\x09\x09ifNil: [ self error: 'AMD loader not present' ]\x0a\x09\x09ifNotNil: [ :require |\x0a\x09\x09\x09require value: (Array new: (self namespaceFor: aPackage), '/', aPackage name ) ]",
+messageSends: ["ifNil:ifNotNil:", "amdRequire", "current", "error:", "value:", "new:", ",", "namespaceFor:", "name"],
+referencedClasses: ["Smalltalk", "Array"]
+}),
+smalltalk.AmdPackageHandler);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "namespaceFor:",
@@ -1826,6 +1871,22 @@ referencedClasses: []
 }),
 smalltalk.PackageTransport);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load",
+category: 'loading',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._commitHandler())._load_(self._package());
+return self}, function($ctx1) {$ctx1.fill(self,"load",{},smalltalk.PackageTransport)})},
+args: [],
+source: "load\x0a\x09self commitHandler load: self package",
+messageSends: ["load:", "commitHandler", "package"],
+referencedClasses: []
+}),
+smalltalk.PackageTransport);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "package",
@@ -2274,4 +2335,75 @@ referencedClasses: []
 }),
 smalltalk.Package);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load",
+category: '*Kernel-ImportExport',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(self._transport())._load();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"load",{},smalltalk.Package)})},
+args: [],
+source: "load\x0a\x09^ self transport load",
+messageSends: ["load", "transport"],
+referencedClasses: []
+}),
+smalltalk.Package);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "loadFromNamespace:",
+category: '*Kernel-ImportExport',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
+$2=self._transport();
+_st($2)._namespace_(aString);
+$3=_st($2)._load();
+$1=$3;
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"loadFromNamespace:",{aString:aString},smalltalk.Package)})},
+args: ["aString"],
+source: "loadFromNamespace: aString\x0a\x09^ self transport\x0a\x09\x09namespace: aString;\x0a\x09\x09load",
+messageSends: ["namespace:", "transport", "load"],
+referencedClasses: []
+}),
+smalltalk.Package);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load:",
+category: '*Kernel-ImportExport',
+fn: function (aPackageName){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._named_(aPackageName))._load();
+return self}, function($ctx1) {$ctx1.fill(self,"load:",{aPackageName:aPackageName},smalltalk.Package.klass)})},
+args: ["aPackageName"],
+source: "load: aPackageName\x0a\x09(self named: aPackageName) load",
+messageSends: ["load", "named:"],
+referencedClasses: []
+}),
+smalltalk.Package.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "load:fromNamespace:",
+category: '*Kernel-ImportExport',
+fn: function (aPackageName,aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._named_(aPackageName))._loadFromNamespace_(aString);
+return self}, function($ctx1) {$ctx1.fill(self,"load:fromNamespace:",{aPackageName:aPackageName,aString:aString},smalltalk.Package.klass)})},
+args: ["aPackageName", "aString"],
+source: "load: aPackageName fromNamespace: aString\x0a\x09(self named: aPackageName) loadFromNamespace: aString",
+messageSends: ["loadFromNamespace:", "named:"],
+referencedClasses: []
+}),
+smalltalk.Package.klass);
+
 });

+ 705 - 998
js/Kernel-Infrastructure.js

@@ -2,1425 +2,1132 @@ define("amber_core/Kernel-Infrastructure", ["amber_vm/smalltalk", "amber_vm/nil"
 smalltalk.addPackage('Kernel-Infrastructure');
 smalltalk.packages["Kernel-Infrastructure"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-smalltalk.addClass('AbstractProxy', smalltalk.nil, [], 'Kernel-Infrastructure');
-smalltalk.AbstractProxy.comment="I provide a basic set of methods for proxies handling `#doesNotUnderstand:` so that inspectors, debuggers, etc. won't fail.";
+smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
+smalltalk.InspectorHandler.comment="I am responsible for inspecting object.\x0a\x0aMy class-side `inspector` inst var holds the current inspector I'm delegating object inspection to.\x0a\x0aThe default inspector object is the transcript.";
+
+smalltalk.InspectorHandler.klass.iVarNames = ['inspector'];
 smalltalk.addMethod(
 smalltalk.method({
-selector: "asString",
-category: 'converting',
-fn: function (){
+selector: "inspect:",
+category: 'registration',
+fn: function (anObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=self._printString();
+$1=_st(self._inspector())._inspect_(anObject);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.AbstractProxy)})},
-args: [],
-source: "asString\x0a\x09^ self printString",
-messageSends: ["printString"],
-referencedClasses: []
-}),
-smalltalk.AbstractProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "class",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self.klass;
-return self}, function($ctx1) {$ctx1.fill(self,"class",{},smalltalk.AbstractProxy)})},
-args: [],
-source: "class\x0a\x09<return self.klass>",
-messageSends: [],
+}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.InspectorHandler.klass)})},
+args: ["anObject"],
+source: "inspect: anObject\x0a\x09^ self inspector inspect: anObject",
+messageSends: ["inspect:", "inspector"],
 referencedClasses: []
 }),
-smalltalk.AbstractProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "doesNotUnderstand:",
-category: 'error handling',
-fn: function (aMessage){
-var self=this;
-function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st($MessageNotUnderstood())._new();
-_st($1)._receiver_(self);
-_st($1)._message_(aMessage);
-$2=_st($1)._signal();
-return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.AbstractProxy)})},
-args: ["aMessage"],
-source: "doesNotUnderstand: aMessage\x0a\x09MessageNotUnderstood new\x0a\x09\x09receiver: self;\x0a\x09\x09message: aMessage;\x0a\x09\x09signal",
-messageSends: ["receiver:", "new", "message:", "signal"],
-referencedClasses: ["MessageNotUnderstood"]
-}),
-smalltalk.AbstractProxy);
+smalltalk.InspectorHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "identityHash",
+selector: "inspector",
 category: 'accessing',
 fn: function (){
 var self=this;
+function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
 return smalltalk.withContext(function($ctx1) { 
-
-		var hash=self.identityHash;
-		if (hash) return hash;
-		hash=smalltalk.nextId();
-		Object.defineProperty(self, 'identityHash', {value:hash});
-		return hash;
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"identityHash",{},smalltalk.AbstractProxy)})},
+var $2,$1;
+$2=self["@inspector"];
+if(($receiver = $2) == nil || $receiver == null){
+self["@inspector"]=$Transcript();
+$1=self["@inspector"];
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"inspector",{},smalltalk.InspectorHandler.klass)})},
 args: [],
-source: "identityHash\x0a\x09<\x0a\x09\x09var hash=self.identityHash;\x0a\x09\x09if (hash) return hash;\x0a\x09\x09hash=smalltalk.nextId();\x0a\x09\x09Object.defineProperty(self, 'identityHash', {value:hash});\x0a\x09\x09return hash;\x0a\x09>",
-messageSends: [],
-referencedClasses: []
+source: "inspector\x0a\x09^ inspector ifNil: [ inspector := Transcript ]",
+messageSends: ["ifNil:"],
+referencedClasses: ["Transcript"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.InspectorHandler.klass);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
+selector: "register:",
+category: 'registration',
+fn: function (anInspector){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AbstractProxy)})},
-args: [],
-source: "initialize",
+self["@inspector"]=anInspector;
+return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
+args: ["anInspector"],
+source: "register: anInspector\x0a\x09inspector := anInspector",
 messageSends: [],
 referencedClasses: []
 }),
-smalltalk.AbstractProxy);
+smalltalk.InspectorHandler.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inspect",
-category: 'inspecting',
-fn: function (){
-var self=this;
-function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st($InspectorHandler())._inspect_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"inspect",{},smalltalk.AbstractProxy)})},
-args: [],
-source: "inspect\x0a\x09InspectorHandler inspect: self",
-messageSends: ["inspect:"],
-referencedClasses: ["InspectorHandler"]
-}),
-smalltalk.AbstractProxy);
 
+smalltalk.addClass('InterfacingObject', smalltalk.Object, [], 'Kernel-Infrastructure');
+smalltalk.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "inspectOn:",
-category: 'inspecting',
-fn: function (anInspector){
+selector: "ajax:",
+category: 'actions',
+fn: function (anObject){
 var self=this;
+function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
 return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector},smalltalk.AbstractProxy)})},
-args: ["anInspector"],
-source: "inspectOn: anInspector",
-messageSends: [],
-referencedClasses: []
+var $1;
+$1=_st($PlatformInterface())._ajax_(anObject);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.InterfacingObject)})},
+args: ["anObject"],
+source: "ajax: anObject\x0a\x09^ PlatformInterface ajax: anObject",
+messageSends: ["ajax:"],
+referencedClasses: ["PlatformInterface"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.InterfacingObject);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "instVarAt:",
-category: 'accessing',
+selector: "alert:",
+category: 'actions',
 fn: function (aString){
 var self=this;
+function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
 return smalltalk.withContext(function($ctx1) { 
- return self['@'+aString] ;
-return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:",{aString:aString},smalltalk.AbstractProxy)})},
+var $1;
+$1=_st($PlatformInterface())._alert_(aString);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.InterfacingObject)})},
 args: ["aString"],
-source: "instVarAt: aString\x0a\x09< return self['@'+aString] >",
-messageSends: [],
-referencedClasses: []
+source: "alert: aString\x0a\x09^ PlatformInterface alert: aString",
+messageSends: ["alert:"],
+referencedClasses: ["PlatformInterface"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.InterfacingObject);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "instVarAt:put:",
-category: 'accessing',
-fn: function (aString,anObject){
+selector: "confirm:",
+category: 'actions',
+fn: function (aString){
 var self=this;
+function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
 return smalltalk.withContext(function($ctx1) { 
- self['@' + aString] = anObject ;
-return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:put:",{aString:aString,anObject:anObject},smalltalk.AbstractProxy)})},
-args: ["aString", "anObject"],
-source: "instVarAt: aString put: anObject\x0a\x09< self['@' + aString] = anObject >",
-messageSends: [],
-referencedClasses: []
+var $1;
+$1=_st($PlatformInterface())._confirm_(aString);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.InterfacingObject)})},
+args: ["aString"],
+source: "confirm: aString\x0a\x09^ PlatformInterface confirm: aString",
+messageSends: ["confirm:"],
+referencedClasses: ["PlatformInterface"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.InterfacingObject);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "perform:",
-category: 'message handling',
+selector: "prompt:",
+category: 'actions',
 fn: function (aString){
 var self=this;
+function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=self._perform_withArguments_(aString,[]);
+$1=_st($PlatformInterface())._prompt_(aString);
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"perform:",{aString:aString},smalltalk.AbstractProxy)})},
+}, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.InterfacingObject)})},
 args: ["aString"],
-source: "perform: aString\x0a\x09^ self perform: aString withArguments: #()",
-messageSends: ["perform:withArguments:"],
-referencedClasses: []
+source: "prompt: aString\x0a\x09^ PlatformInterface prompt: aString",
+messageSends: ["prompt:"],
+referencedClasses: ["PlatformInterface"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.InterfacingObject);
 
+
+
+smalltalk.addClass('Environment', smalltalk.InterfacingObject, [], 'Kernel-Infrastructure');
+smalltalk.Environment.comment="I provide an unified entry point to manipulate Amber packages, classes and methods.\x0a\x0aTypical use cases include IDEs, remote access and restricting browsing.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "perform:withArguments:",
-category: 'message handling',
-fn: function (aString,aCollection){
+selector: "addInstVarNamed:to:",
+category: 'compiling',
+fn: function (aString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-return smalltalk.send(self, aString._asSelector(), aCollection);
-return self}, function($ctx1) {$ctx1.fill(self,"perform:withArguments:",{aString:aString,aCollection:aCollection},smalltalk.AbstractProxy)})},
-args: ["aString", "aCollection"],
-source: "perform: aString withArguments: aCollection\x0a\x09<return smalltalk.send(self, aString._asSelector(), aCollection)>",
-messageSends: [],
+var $1,$2,$3,$4,$5;
+$1=self._classBuilder();
+$2=_st(aClass)._superclass();
+$3=_st(aClass)._name();
+$ctx1.sendIdx["name"]=1;
+$4=_st(_st(aClass)._instanceVariableNames())._copy();
+_st($4)._add_(aString);
+$5=_st($4)._yourself();
+_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,_st(_st(aClass)._package())._name());
+return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
+args: ["aString", "aClass"],
+source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
+messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "classBuilder", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"],
 referencedClasses: []
 }),
-smalltalk.AbstractProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "printOn:",
-category: 'printing',
-fn: function (aStream){
+selector: "allSelectors",
+category: 'accessing',
+fn: function (){
 var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $5,$4,$3,$2,$1;
-$5=self._class();
-$ctx1.sendIdx["class"]=1;
-$4=_st($5)._name();
-$ctx1.sendIdx["name"]=1;
-$3=_st($4)._first();
-$2=_st($3)._isVowel();
-if(smalltalk.assert($2)){
-$1="an ";
-} else {
-$1="a ";
-};
-_st(aStream)._nextPutAll_($1);
-$ctx1.sendIdx["nextPutAll:"]=1;
-_st(aStream)._nextPutAll_(_st(self._class())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.AbstractProxy)})},
-args: ["aStream"],
-source: "printOn: aStream\x0a\x09aStream nextPutAll: (self class name first isVowel\x0a\x09\x09ifTrue: [ 'an ' ]\x0a\x09\x09ifFalse: [ 'a ' ]).\x0a\x09aStream nextPutAll: self class name",
-messageSends: ["nextPutAll:", "ifTrue:ifFalse:", "isVowel", "first", "name", "class"],
-referencedClasses: []
+var $1;
+$1=_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Environment)})},
+args: [],
+source: "allSelectors\x0a\x09^ (Smalltalk current at: 'allSelectors') value",
+messageSends: ["value", "at:", "current"],
+referencedClasses: ["Smalltalk"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "printString",
-category: 'printing',
+selector: "availableClassNames",
+category: 'accessing',
 fn: function (){
 var self=this;
-function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st($String())._streamContents_((function(str){
+$1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
 return smalltalk.withContext(function($ctx2) {
-return self._printOn_(str);
-}, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
+return _st(each)._name();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.AbstractProxy)})},
+}, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.Environment)})},
 args: [],
-source: "printString\x0a\x09^ String streamContents: [ :str | \x0a\x09\x09self printOn: str ]",
-messageSends: ["streamContents:", "printOn:"],
-referencedClasses: ["String"]
+source: "availableClassNames\x0a\x09^ Smalltalk current classes \x0a\x09\x09collect: [ :each | each name ]",
+messageSends: ["collect:", "classes", "current", "name"],
+referencedClasses: ["Smalltalk"]
 }),
-smalltalk.AbstractProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "yourself",
+selector: "availablePackageNames",
 category: 'accessing',
 fn: function (){
 var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-return self;
-}, function($ctx1) {$ctx1.fill(self,"yourself",{},smalltalk.AbstractProxy)})},
+var $1;
+$1=_st(_st(_st($Smalltalk())._current())._packages())._collect_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._name();
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.Environment)})},
 args: [],
-source: "yourself\x0a\x09^ self",
-messageSends: [],
-referencedClasses: []
+source: "availablePackageNames\x0a\x09^ Smalltalk current packages \x0a\x09\x09collect: [ :each | each name ]",
+messageSends: ["collect:", "packages", "current", "name"],
+referencedClasses: ["Smalltalk"]
 }),
-smalltalk.AbstractProxy);
-
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "heliosClass",
-category: 'helios',
-fn: function (){
+selector: "availableProtocolsFor:",
+category: 'accessing',
+fn: function (aClass){
 var self=this;
+var protocols;
 return smalltalk.withContext(function($ctx1) { 
-return "class";
-}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.AbstractProxy.klass)})},
-args: [],
-source: "heliosClass\x0a\x09^ 'class'",
-messageSends: [],
+var $1,$2;
+protocols=_st(aClass)._protocols();
+$1=_st(aClass)._superclass();
+$ctx1.sendIdx["superclass"]=1;
+if(($receiver = $1) == nil || $receiver == null){
+$1;
+} else {
+_st(protocols)._addAll_(self._availableProtocolsFor_(_st(aClass)._superclass()));
+};
+$2=_st(_st(protocols)._asSet())._asArray();
+return $2;
+}, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.Environment)})},
+args: ["aClass"],
+source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray",
+messageSends: ["protocols", "ifNotNil:", "superclass", "addAll:", "availableProtocolsFor:", "asArray", "asSet"],
 referencedClasses: []
 }),
-smalltalk.AbstractProxy.klass);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "initialize",
-category: 'initialization',
+selector: "classBuilder",
+category: 'accessing',
 fn: function (){
 var self=this;
+function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.AbstractProxy.klass)})},
+var $1;
+$1=_st($ClassBuilder())._new();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.Environment)})},
 args: [],
-source: "initialize",
-messageSends: [],
-referencedClasses: []
+source: "classBuilder\x0a\x09^ ClassBuilder new",
+messageSends: ["new"],
+referencedClasses: ["ClassBuilder"]
 }),
-smalltalk.AbstractProxy.klass);
-
+smalltalk.Environment);
 
-smalltalk.addClass('JSObjectProxy', smalltalk.AbstractProxy, ['jsObject'], 'Kernel-Infrastructure');
-smalltalk.JSObjectProxy.comment="I handle sending messages to JavaScript objects, making  JavaScript object accessing from Amber fully transparent.\x0aMy instances make intensive use of `#doesNotUnderstand:`.\x0a\x0aMy instances are automatically created by Amber whenever a message is sent to a JavaScript object.\x0a\x0a## Usage examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a\x09window alert: 'hello world'.\x0a\x09window inspect.\x0a\x09(window jQuery: 'body') append: 'hello world'\x0a\x0aAmber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.\x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "addObjectVariablesTo:",
-category: 'proxy',
-fn: function (aDictionary){
+selector: "classNamed:",
+category: 'accessing',
+fn: function (aString){
 var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-
-		for(var i in self['@jsObject']) {
-			aDictionary._at_put_(i, self['@jsObject'][i]);
-		}
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary},smalltalk.JSObjectProxy)})},
-args: ["aDictionary"],
-source: "addObjectVariablesTo: aDictionary\x0a\x09<\x0a\x09\x09for(var i in self['@jsObject']) {\x0a\x09\x09\x09aDictionary._at_put_(i, self['@jsObject'][i]);\x0a\x09\x09}\x0a\x09>",
-messageSends: [],
-referencedClasses: []
+var $2,$1;
+$2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
+if(($receiver = $2) == nil || $receiver == null){
+$1=self._error_("Invalid class name");
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.Environment)})},
+args: ["aString"],
+source: "classNamed: aString\x0a\x09^ (Smalltalk current at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
+messageSends: ["ifNil:", "at:", "current", "asSymbol", "error:"],
+referencedClasses: ["Smalltalk"]
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "asJSON",
-category: 'enumerating',
+selector: "classes",
+category: 'accessing',
 fn: function (){
 var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=self["@jsObject"];
+$1=_st(_st($Smalltalk())._current())._classes();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.JSObjectProxy)})},
+}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Environment)})},
 args: [],
-source: "asJSON\x0a\x09\x22Answers the receiver in a stringyfy-friendly fashion\x22\x0a\x0a\x09^ jsObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "at:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self['@jsObject'][aString];
-return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.JSObjectProxy)})},
-args: ["aString"],
-source: "at: aString\x0a\x09<return self['@jsObject'][aString]>",
-messageSends: [],
-referencedClasses: []
+source: "classes\x0a\x09^ Smalltalk current classes",
+messageSends: ["classes", "current"],
+referencedClasses: ["Smalltalk"]
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "at:ifAbsent:",
-category: 'accessing',
-fn: function (aString,aBlock){
+selector: "commitPackage:",
+category: 'actions',
+fn: function (aPackage){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-
-		var obj = self['@jsObject'];
-		return aString in obj ? obj[aString] : aBlock._value();
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
-args: ["aString", "aBlock"],
-source: "at: aString ifAbsent: aBlock\x0a\x09\x22return the aString property or evaluate aBlock if the property is not defined on the object\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09>",
-messageSends: [],
+_st(aPackage)._commit();
+return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.Environment)})},
+args: ["aPackage"],
+source: "commitPackage: aPackage\x0a\x09aPackage commit",
+messageSends: ["commit"],
 referencedClasses: []
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "at:ifPresent:",
-category: 'accessing',
-fn: function (aString,aBlock){
+selector: "compileClassComment:for:",
+category: 'compiling',
+fn: function (aString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-
-		var obj = self['@jsObject'];
-		return aString in obj ? aBlock._value_(obj[aString]) : nil;
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
-args: ["aString", "aBlock"],
-source: "at: aString ifPresent: aBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined or return nil\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09>",
-messageSends: [],
+_st(aClass)._comment_(aString);
+return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
+args: ["aString", "aClass"],
+source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
+messageSends: ["comment:"],
 referencedClasses: []
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "at:ifPresent:ifAbsent:",
-category: 'accessing',
-fn: function (aString,aBlock,anotherBlock){
+selector: "compileClassDefinition:",
+category: 'compiling',
+fn: function (aString){
 var self=this;
+function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
-
-		var obj = self['@jsObject'];
-		return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
-args: ["aString", "aBlock", "anotherBlock"],
-source: "at: aString ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined\x0a\x09or return value of anotherBlock\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09>",
-messageSends: [],
-referencedClasses: []
+self._eval_on_(aString,_st($DoIt())._new());
+return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.Environment)})},
+args: ["aString"],
+source: "compileClassDefinition: aString\x0a\x09self eval: aString on: DoIt new",
+messageSends: ["eval:on:", "new"],
+referencedClasses: ["DoIt"]
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "at:put:",
-category: 'accessing',
-fn: function (aString,anObject){
+selector: "compileMethod:for:protocol:",
+category: 'compiling',
+fn: function (sourceCode,class_,protocol){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-self['@jsObject'][aString] = anObject;
-return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},smalltalk.JSObjectProxy)})},
-args: ["aString", "anObject"],
-source: "at: aString put: anObject\x0a\x09<self['@jsObject'][aString] = anObject>",
-messageSends: [],
+var $1;
+$1=_st(class_)._compile_category_(sourceCode,protocol);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.Environment)})},
+args: ["sourceCode", "class", "protocol"],
+source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09^ class\x0a\x09\x09compile: sourceCode\x0a\x09\x09category: protocol",
+messageSends: ["compile:category:"],
 referencedClasses: []
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "doesNotUnderstand:",
-category: 'proxy',
-fn: function (aMessage){
+selector: "copyClass:to:",
+category: 'actions',
+fn: function (aClass,aClassName){
 var self=this;
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=self._lookupProperty_(_st(_st(aMessage)._selector())._asJavaScriptSelector());
-if(($receiver = $2) == nil || $receiver == null){
-$1=smalltalk.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
+var $1,$2;
+$1=_st(_st($Smalltalk())._current())._at_(aClassName);
+if(($receiver = $1) == nil || $receiver == null){
+$1;
 } else {
-var jsSelector;
-jsSelector=$receiver;
-$1=self._forwardMessage_withArguments_(jsSelector,_st(aMessage)._arguments());
+$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
+$ctx1.sendIdx[","]=1;
+self._error_($2);
 };
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.JSObjectProxy)})},
-args: ["aMessage"],
-source: "doesNotUnderstand: aMessage\x0a\x09^ (self lookupProperty: aMessage selector asJavaScriptSelector)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments ]",
-messageSends: ["ifNil:ifNotNil:", "lookupProperty:", "asJavaScriptSelector", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:", "arguments"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "forwardMessage:withArguments:",
-category: 'proxy',
-fn: function (aString,anArray){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-
-		return smalltalk.send(self._jsObject(), aString, anArray);
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:",{aString:aString,anArray:anArray},smalltalk.JSObjectProxy)})},
-args: ["aString", "anArray"],
-source: "forwardMessage: aString withArguments: anArray\x0a\x09<\x0a\x09\x09return smalltalk.send(self._jsObject(), aString, anArray);\x0a\x09>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inspectOn:",
-category: 'proxy',
-fn: function (anInspector){
-var self=this;
-var variables;
-function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
-return smalltalk.withContext(function($ctx1) { 
-variables=_st($Dictionary())._new();
-_st(variables)._at_put_("#self",self._jsObject());
-_st(anInspector)._setLabel_(self._printString());
-self._addObjectVariablesTo_(variables);
-_st(anInspector)._setVariables_(variables);
-return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.JSObjectProxy)})},
-args: ["anInspector"],
-source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09self addObjectVariablesTo: variables.\x0a\x09anInspector setVariables: variables",
-messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"],
-referencedClasses: ["Dictionary"]
+_st(_st($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
+return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
+args: ["aClass", "aClassName"],
+source: "copyClass: aClass to: aClassName\x0a\x09(Smalltalk current at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new copyClass: aClass named: aClassName",
+messageSends: ["ifNotNil:", "at:", "current", "error:", ",", "copyClass:named:", "new"],
+referencedClasses: ["Smalltalk", "ClassBuilder"]
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "jsObject",
+selector: "doItReceiver",
 category: 'accessing',
 fn: function (){
 var self=this;
+function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=self["@jsObject"];
+$1=_st($DoIt())._new();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxy)})},
+}, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},smalltalk.Environment)})},
 args: [],
-source: "jsObject\x0a\x09^ jsObject",
-messageSends: [],
-referencedClasses: []
+source: "doItReceiver\x0a\x09^ DoIt new",
+messageSends: ["new"],
+referencedClasses: ["DoIt"]
 }),
-smalltalk.JSObjectProxy);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "jsObject:",
-category: 'accessing',
-fn: function (aJSObject){
+selector: "eval:on:",
+category: 'actions',
+fn: function (aString,aReceiver){
 var self=this;
+var compiler;
+function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
+function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
-self["@jsObject"]=aJSObject;
-return self}, function($ctx1) {$ctx1.fill(self,"jsObject:",{aJSObject:aJSObject},smalltalk.JSObjectProxy)})},
-args: ["aJSObject"],
-source: "jsObject: aJSObject\x0a\x09jsObject := aJSObject",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "keysAndValuesDo:",
-category: 'enumerating',
-fn: function (aBlock){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-
-		var o = self['@jsObject'];
-		for(var i in o) {
-			aBlock._value_value_(i, o[i]);
-		}
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.JSObjectProxy)})},
-args: ["aBlock"],
-source: "keysAndValuesDo: aBlock\x0a\x09<\x0a\x09\x09var o = self['@jsObject'];\x0a\x09\x09for(var i in o) {\x0a\x09\x09\x09aBlock._value_value_(i, o[i]);\x0a\x09\x09}\x0a\x09>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "lookupProperty:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return aString in self._jsObject() ? aString : nil;
-return self}, function($ctx1) {$ctx1.fill(self,"lookupProperty:",{aString:aString},smalltalk.JSObjectProxy)})},
-args: ["aString"],
-source: "lookupProperty: aString\x0a\x09\x22Looks up a property in JS object.\x0a\x09Answer the property if it is present, or nil if it is not present.\x22\x0a\x09\x0a\x09<return aString in self._jsObject() ? aString : nil>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "printOn:",
-category: 'printing',
-fn: function (aStream){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-_st(aStream)._nextPutAll_(self._printString());
-return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.JSObjectProxy)})},
-args: ["aStream"],
-source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
-messageSends: ["nextPutAll:", "printString"],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "printString",
-category: 'printing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-
-		var js = self['@jsObject'];
-		return js.toString
-			? js.toString()
-			: Object.prototype.toString.call(js)
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.JSObjectProxy)})},
-args: [],
-source: "printString\x0a\x09<\x0a\x09\x09var js = self['@jsObject'];\x0a\x09\x09return js.toString\x0a\x09\x09\x09? js.toString()\x0a\x09\x09\x09: Object.prototype.toString.call(js)\x0a\x09>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.JSObjectProxy);
-
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "on:",
-category: 'instance creation',
-fn: function (aJSObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $2,$3,$1;
-$2=self._new();
-_st($2)._jsObject_(aJSObject);
-$3=_st($2)._yourself();
-$1=$3;
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
-args: ["aJSObject"],
-source: "on: aJSObject\x0a\x09^ self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
-messageSends: ["jsObject:", "new", "yourself"],
-referencedClasses: []
+var $1,$2;
+var $early={};
+try {
+compiler=_st($Compiler())._new();
+_st((function(){
+return smalltalk.withContext(function($ctx2) {
+return _st(compiler)._parseExpression_(aString);
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
+return smalltalk.withContext(function($ctx2) {
+$1=self._alert_(_st(ex)._messageText());
+throw $early=[$1];
+}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
+$2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
+return $2;
+}
+catch(e) {if(e===$early)return e[0]; throw e}
+}, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.Environment)})},
+args: ["aString", "aReceiver"],
+source: "eval: aString on: aReceiver\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[ compiler parseExpression: aString ] on: Error do: [ :ex |\x0a\x09\x09^ self alert: ex messageText ].\x0a\x09^ compiler evaluateExpression: aString on: aReceiver",
+messageSends: ["new", "on:do:", "parseExpression:", "alert:", "messageText", "evaluateExpression:on:"],
+referencedClasses: ["Compiler", "Error"]
 }),
-smalltalk.JSObjectProxy.klass);
-
-
-smalltalk.addClass('InspectorHandler', smalltalk.Object, [], 'Kernel-Infrastructure');
-smalltalk.InspectorHandler.comment="I am responsible for inspecting object.\x0a\x0aMy class-side `inspector` inst var holds the current inspector I'm delegating object inspection to.\x0a\x0aThe default inspector object is the transcript.";
+smalltalk.Environment);
 
-smalltalk.InspectorHandler.klass.iVarNames = ['inspector'];
 smalltalk.addMethod(
 smalltalk.method({
-selector: "inspect:",
-category: 'registration',
-fn: function (anObject){
+selector: "evaluate:on:do:",
+category: 'error handling',
+fn: function (aBlock,anErrorClass,exceptionBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(self._inspector())._inspect_(anObject);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.InspectorHandler.klass)})},
-args: ["anObject"],
-source: "inspect: anObject\x0a\x09^ self inspector inspect: anObject",
-messageSends: ["inspect:", "inspector"],
-referencedClasses: []
-}),
-smalltalk.InspectorHandler.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inspector",
-category: 'accessing',
-fn: function (){
-var self=this;
-function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
-return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=self["@inspector"];
-if(($receiver = $2) == nil || $receiver == null){
-self["@inspector"]=$Transcript();
-$1=self["@inspector"];
+self._try_catch_(aBlock,(function(exception){
+return smalltalk.withContext(function($ctx2) {
+$1=_st(exception)._isKindOf_(self._classNamed_(_st(anErrorClass)._name()));
+if(smalltalk.assert($1)){
+return _st(exceptionBlock)._value_(exception);
 } else {
-$1=$2;
+return _st(exception)._signal();
 };
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"inspector",{},smalltalk.InspectorHandler.klass)})},
-args: [],
-source: "inspector\x0a\x09^ inspector ifNil: [ inspector := Transcript ]",
-messageSends: ["ifNil:"],
-referencedClasses: ["Transcript"]
-}),
-smalltalk.InspectorHandler.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "register:",
-category: 'registration',
-fn: function (anInspector){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-self["@inspector"]=anInspector;
-return self}, function($ctx1) {$ctx1.fill(self,"register:",{anInspector:anInspector},smalltalk.InspectorHandler.klass)})},
-args: ["anInspector"],
-source: "register: anInspector\x0a\x09inspector := anInspector",
-messageSends: [],
+}, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,1)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},smalltalk.Environment)})},
+args: ["aBlock", "anErrorClass", "exceptionBlock"],
+source: "evaluate: aBlock on: anErrorClass do: exceptionBlock\x0a\x09\x22Evaluate a block and catch exceptions happening on the environment stack\x22\x0a\x09\x0a\x09self try: aBlock catch: [ :exception | \x0a\x09\x09(exception isKindOf: (self classNamed: anErrorClass name))\x0a\x09\x09\x09ifTrue: [ exceptionBlock value: exception ]\x0a \x09\x09\x09ifFalse: [ exception signal ] ]",
+messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "signal"],
 referencedClasses: []
 }),
-smalltalk.InspectorHandler.klass);
-
+smalltalk.Environment);
 
-smalltalk.addClass('InterfacingObject', smalltalk.Object, [], 'Kernel-Infrastructure');
-smalltalk.InterfacingObject.comment="I am superclass of all object that interface with user or environment. `Widget` and a few other classes are subclasses of me. I delegate all of the above APIs to `PlatformInterface`.\x0a\x0a## API\x0a\x0a    self alert: 'Hey, there is a problem'.\x0a    self confirm: 'Affirmative?'.\x0a    self prompt: 'Your name:'.\x0a\x0a    self ajax: #{\x0a        'url' -> '/patch.js'. 'type' -> 'GET'. dataType->'script'\x0a    }.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "ajax:",
+selector: "inspect:",
 category: 'actions',
 fn: function (anObject){
 var self=this;
-function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($PlatformInterface())._ajax_(anObject);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"ajax:",{anObject:anObject},smalltalk.InterfacingObject)})},
+_st(_st($InspectorHandler())._inspector())._inspect_(anObject);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
 args: ["anObject"],
-source: "ajax: anObject\x0a\x09^ PlatformInterface ajax: anObject",
-messageSends: ["ajax:"],
-referencedClasses: ["PlatformInterface"]
-}),
-smalltalk.InterfacingObject);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "alert:",
-category: 'actions',
-fn: function (aString){
-var self=this;
-function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($PlatformInterface())._alert_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.InterfacingObject)})},
-args: ["aString"],
-source: "alert: aString\x0a\x09^ PlatformInterface alert: aString",
-messageSends: ["alert:"],
-referencedClasses: ["PlatformInterface"]
-}),
-smalltalk.InterfacingObject);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "confirm:",
-category: 'actions',
-fn: function (aString){
-var self=this;
-function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($PlatformInterface())._confirm_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"confirm:",{aString:aString},smalltalk.InterfacingObject)})},
-args: ["aString"],
-source: "confirm: aString\x0a\x09^ PlatformInterface confirm: aString",
-messageSends: ["confirm:"],
-referencedClasses: ["PlatformInterface"]
+source: "inspect: anObject\x0a\x09InspectorHandler inspector inspect: anObject",
+messageSends: ["inspect:", "inspector"],
+referencedClasses: ["InspectorHandler"]
 }),
-smalltalk.InterfacingObject);
+smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "prompt:",
+selector: "moveClass:toPackage:",
 category: 'actions',
-fn: function (aString){
-var self=this;
-function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($PlatformInterface())._prompt_(aString);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"prompt:",{aString:aString},smalltalk.InterfacingObject)})},
-args: ["aString"],
-source: "prompt: aString\x0a\x09^ PlatformInterface prompt: aString",
-messageSends: ["prompt:"],
-referencedClasses: ["PlatformInterface"]
-}),
-smalltalk.InterfacingObject);
-
-
-
-smalltalk.addClass('Environment', smalltalk.InterfacingObject, [], 'Kernel-Infrastructure');
-smalltalk.Environment.comment="I provide an unified entry point to manipulate Amber packages, classes and methods.\x0a\x0aTypical use cases include IDEs, remote access and restricting browsing.";
-smalltalk.addMethod(
-smalltalk.method({
-selector: "addInstVarNamed:to:",
-category: 'compiling',
-fn: function (aString,aClass){
+fn: function (aClass,aPackageName){
 var self=this;
+var package_;
+function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2,$3,$4,$5;
-$1=self._classBuilder();
-$2=_st(aClass)._superclass();
-$3=_st(aClass)._name();
-$ctx1.sendIdx["name"]=1;
-$4=_st(_st(aClass)._instanceVariableNames())._copy();
-_st($4)._add_(aString);
-$5=_st($4)._yourself();
-_st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,_st(_st(aClass)._package())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:to:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
-args: ["aString", "aClass"],
-source: "addInstVarNamed: aString to: aClass\x0a\x09self classBuilder\x0a\x09\x09addSubclassOf: aClass superclass \x0a\x09\x09named: aClass name \x0a\x09\x09instanceVariableNames: (aClass instanceVariableNames copy add: aString; yourself)\x0a\x09\x09package: aClass package name",
-messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "classBuilder", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"],
-referencedClasses: []
+var $1,$2;
+package_=_st($Package())._named_(aPackageName);
+$1=package_;
+if(($receiver = $1) == nil || $receiver == null){
+self._error_("Invalid package name");
+} else {
+$1;
+};
+$2=_st(package_).__eq_eq(_st(aClass)._package());
+if(smalltalk.assert($2)){
+return self;
+};
+_st(aClass)._package_(package_);
+return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},smalltalk.Environment)})},
+args: ["aClass", "aPackageName"],
+source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09aClass package: package",
+messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"],
+referencedClasses: ["Package"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "allSelectors",
-category: 'accessing',
-fn: function (){
+selector: "moveMethod:toClass:",
+category: 'actions',
+fn: function (aMethod,aClassName){
 var self=this;
+var destinationClass;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.Environment)})},
-args: [],
-source: "allSelectors\x0a\x09^ (Smalltalk current at: 'allSelectors') value",
-messageSends: ["value", "at:", "current"],
+var $1,$3,$4,$2;
+destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
+$1=destinationClass;
+if(($receiver = $1) == nil || $receiver == null){
+self._error_("Invalid class name");
+} else {
+$1;
+};
+$3=destinationClass;
+$4=_st(aMethod)._methodClass();
+$ctx1.sendIdx["methodClass"]=1;
+$2=_st($3).__eq_eq($4);
+if(smalltalk.assert($2)){
+return self;
+};
+_st(destinationClass)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
+_st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.Environment)})},
+args: ["aMethod", "aClassName"],
+source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ self error: 'Invalid class name' ].\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09category: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
+messageSends: ["at:", "current", "asSymbol", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "compile:category:", "source", "protocol", "removeCompiledMethod:"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "availableClassNames",
-category: 'accessing',
-fn: function (){
+selector: "moveMethod:toProtocol:",
+category: 'actions',
+fn: function (aMethod,aProtocol){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._name();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.Environment)})},
-args: [],
-source: "availableClassNames\x0a\x09^ Smalltalk current classes \x0a\x09\x09collect: [ :each | each name ]",
-messageSends: ["collect:", "classes", "current", "name"],
-referencedClasses: ["Smalltalk"]
+_st(aMethod)._category_(aProtocol);
+return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.Environment)})},
+args: ["aMethod", "aProtocol"],
+source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod category: aProtocol",
+messageSends: ["category:"],
+referencedClasses: []
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "availablePackageNames",
+selector: "packages",
 category: 'accessing',
 fn: function (){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st(_st(_st($Smalltalk())._current())._packages())._collect_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._name();
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
+$1=_st(_st($Smalltalk())._current())._packages();
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.Environment)})},
+}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Environment)})},
 args: [],
-source: "availablePackageNames\x0a\x09^ Smalltalk current packages \x0a\x09\x09collect: [ :each | each name ]",
-messageSends: ["collect:", "packages", "current", "name"],
+source: "packages\x0a\x09^ Smalltalk current packages",
+messageSends: ["packages", "current"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "availableProtocolsFor:",
-category: 'accessing',
-fn: function (aClass){
+selector: "registerErrorHandler:",
+category: 'actions',
+fn: function (anErrorHandler){
 var self=this;
-var protocols;
+function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-protocols=_st(aClass)._protocols();
-$1=_st(aClass)._superclass();
-$ctx1.sendIdx["superclass"]=1;
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-_st(protocols)._addAll_(self._availableProtocolsFor_(_st(aClass)._superclass()));
-};
-$2=_st(_st(protocols)._asSet())._asArray();
-return $2;
-}, function($ctx1) {$ctx1.fill(self,"availableProtocolsFor:",{aClass:aClass,protocols:protocols},smalltalk.Environment)})},
-args: ["aClass"],
-source: "availableProtocolsFor: aClass\x0a\x09| protocols |\x0a\x09\x0a\x09protocols := aClass protocols.\x0a\x09aClass superclass ifNotNil: [ protocols addAll: (self availableProtocolsFor: aClass superclass) ].\x0a\x09^ protocols asSet asArray",
-messageSends: ["protocols", "ifNotNil:", "superclass", "addAll:", "availableProtocolsFor:", "asArray", "asSet"],
-referencedClasses: []
+_st($ErrorHandler())._setCurrent_(anErrorHandler);
+return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
+args: ["anErrorHandler"],
+source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler setCurrent: anErrorHandler",
+messageSends: ["setCurrent:"],
+referencedClasses: ["ErrorHandler"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "classBuilder",
-category: 'accessing',
-fn: function (){
+selector: "registerInspector:",
+category: 'actions',
+fn: function (anInspector){
 var self=this;
-function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($ClassBuilder())._new();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classBuilder",{},smalltalk.Environment)})},
-args: [],
-source: "classBuilder\x0a\x09^ ClassBuilder new",
-messageSends: ["new"],
-referencedClasses: ["ClassBuilder"]
+_st($InspectorHandler())._register_(anInspector);
+return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
+args: ["anInspector"],
+source: "registerInspector: anInspector\x0a\x09InspectorHandler register: anInspector",
+messageSends: ["register:"],
+referencedClasses: ["InspectorHandler"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "classNamed:",
-category: 'accessing',
-fn: function (aString){
+selector: "registerProgressHandler:",
+category: 'actions',
+fn: function (aProgressHandler){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
 return smalltalk.withContext(function($ctx1) { 
-var $2,$1;
-$2=_st(_st($Smalltalk())._current())._at_(_st(aString)._asSymbol());
-if(($receiver = $2) == nil || $receiver == null){
-$1=self._error_("Invalid class name");
-} else {
-$1=$2;
-};
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classNamed:",{aString:aString},smalltalk.Environment)})},
-args: ["aString"],
-source: "classNamed: aString\x0a\x09^ (Smalltalk current at: aString asSymbol)\x0a\x09\x09ifNil: [ self error: 'Invalid class name' ]",
-messageSends: ["ifNil:", "at:", "current", "asSymbol", "error:"],
-referencedClasses: ["Smalltalk"]
+_st($ProgressHandler())._setCurrent_(aProgressHandler);
+return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.Environment)})},
+args: ["aProgressHandler"],
+source: "registerProgressHandler: aProgressHandler\x0a\x09ProgressHandler setCurrent: aProgressHandler",
+messageSends: ["setCurrent:"],
+referencedClasses: ["ProgressHandler"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "classes",
-category: 'accessing',
-fn: function (){
+selector: "removeClass:",
+category: 'actions',
+fn: function (aClass){
 var self=this;
 function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st($Smalltalk())._current())._classes();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Environment)})},
-args: [],
-source: "classes\x0a\x09^ Smalltalk current classes",
-messageSends: ["classes", "current"],
+_st(_st($Smalltalk())._current())._removeClass_(aClass);
+return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Environment)})},
+args: ["aClass"],
+source: "removeClass: aClass\x0a\x09Smalltalk current removeClass: aClass",
+messageSends: ["removeClass:", "current"],
 referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "commitPackage:",
+selector: "removeMethod:",
 category: 'actions',
-fn: function (aPackage){
+fn: function (aMethod){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(aPackage)._commit();
-return self}, function($ctx1) {$ctx1.fill(self,"commitPackage:",{aPackage:aPackage},smalltalk.Environment)})},
-args: ["aPackage"],
-source: "commitPackage: aPackage\x0a\x09aPackage commit",
-messageSends: ["commit"],
+_st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
+return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.Environment)})},
+args: ["aMethod"],
+source: "removeMethod: aMethod\x0a\x09aMethod methodClass removeCompiledMethod: aMethod",
+messageSends: ["removeCompiledMethod:", "methodClass"],
 referencedClasses: []
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "compileClassComment:for:",
-category: 'compiling',
+selector: "removeProtocol:from:",
+category: 'actions',
 fn: function (aString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(aClass)._comment_(aString);
-return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:for:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
+_st(_st(_st(aClass)._methods())._select_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(each)._protocol()).__eq(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(aClass)._removeCompiledMethod_(each);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
 args: ["aString", "aClass"],
-source: "compileClassComment: aString for: aClass\x0a\x09aClass comment: aString",
-messageSends: ["comment:"],
+source: "removeProtocol: aString from: aClass\x0a\x09(aClass methods\x0a\x09\x09select: [ :each | each protocol = aString ])\x0a\x09\x09do: [ :each | aClass removeCompiledMethod: each ]",
+messageSends: ["do:", "select:", "methods", "=", "protocol", "removeCompiledMethod:"],
 referencedClasses: []
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "compileClassDefinition:",
-category: 'compiling',
-fn: function (aString){
+selector: "renameClass:to:",
+category: 'actions',
+fn: function (aClass,aClassName){
 var self=this;
-function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
+function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-self._eval_on_(aString,_st($DoIt())._new());
-return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.Environment)})},
-args: ["aString"],
-source: "compileClassDefinition: aString\x0a\x09self eval: aString on: DoIt new",
-messageSends: ["eval:on:", "new"],
-referencedClasses: ["DoIt"]
+var $1,$2;
+$1=_st(_st($Smalltalk())._current())._at_(aClassName);
+if(($receiver = $1) == nil || $receiver == null){
+$1;
+} else {
+$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
+$ctx1.sendIdx[","]=1;
+self._error_($2);
+};
+_st(_st($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
+return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
+args: ["aClass", "aClassName"],
+source: "renameClass: aClass to: aClassName\x0a\x09(Smalltalk current at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new renameClass: aClass to: aClassName",
+messageSends: ["ifNotNil:", "at:", "current", "error:", ",", "renameClass:to:", "new"],
+referencedClasses: ["Smalltalk", "ClassBuilder"]
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "compileMethod:for:protocol:",
-category: 'compiling',
-fn: function (sourceCode,class_,protocol){
+selector: "renameProtocol:to:in:",
+category: 'actions',
+fn: function (aString,anotherString,aClass){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(class_)._compile_category_(sourceCode,protocol);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"compileMethod:for:protocol:",{sourceCode:sourceCode,class_:class_,protocol:protocol},smalltalk.Environment)})},
-args: ["sourceCode", "class", "protocol"],
-source: "compileMethod: sourceCode for: class protocol: protocol\x0a\x09^ class\x0a\x09\x09compile: sourceCode\x0a\x09\x09category: protocol",
-messageSends: ["compile:category:"],
+_st(_st(_st(aClass)._methods())._select_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(each)._protocol()).__eq(aString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(each)._protocol_(anotherString);
+}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
+return self}, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},smalltalk.Environment)})},
+args: ["aString", "anotherString", "aClass"],
+source: "renameProtocol: aString to: anotherString in: aClass\x0a\x09(aClass methods\x0a\x09\x09select: [ :each | each protocol = aString ])\x0a\x09\x09do: [ :each | each protocol: anotherString ]",
+messageSends: ["do:", "select:", "methods", "=", "protocol", "protocol:"],
 referencedClasses: []
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "copyClass:to:",
+selector: "setClassCommentOf:to:",
 category: 'actions',
-fn: function (aClass,aClassName){
+fn: function (aClass,aString){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
-function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(_st($Smalltalk())._current())._at_(aClassName);
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
-$ctx1.sendIdx[","]=1;
-self._error_($2);
-};
-_st(_st($ClassBuilder())._new())._copyClass_named_(aClass,aClassName);
-return self}, function($ctx1) {$ctx1.fill(self,"copyClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
-args: ["aClass", "aClassName"],
-source: "copyClass: aClass to: aClassName\x0a\x09(Smalltalk current at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new copyClass: aClass named: aClassName",
-messageSends: ["ifNotNil:", "at:", "current", "error:", ",", "copyClass:named:", "new"],
-referencedClasses: ["Smalltalk", "ClassBuilder"]
+_st(aClass)._comment_(aString);
+return self}, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},smalltalk.Environment)})},
+args: ["aClass", "aString"],
+source: "setClassCommentOf: aClass to: aString\x0a\x09aClass comment: aString",
+messageSends: ["comment:"],
+referencedClasses: []
 }),
 smalltalk.Environment);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "doItReceiver",
+selector: "systemAnnouncer",
 category: 'accessing',
 fn: function (){
 var self=this;
-function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
+function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st($DoIt())._new();
+$1=_st(_st(_st($Smalltalk())._current())._at_("SystemAnnouncer"))._current();
+$ctx1.sendIdx["current"]=1;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"doItReceiver",{},smalltalk.Environment)})},
+}, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.Environment)})},
 args: [],
-source: "doItReceiver\x0a\x09^ DoIt new",
-messageSends: ["new"],
-referencedClasses: ["DoIt"]
+source: "systemAnnouncer\x0a\x09^ (Smalltalk current at: #SystemAnnouncer) current",
+messageSends: ["current", "at:"],
+referencedClasses: ["Smalltalk"]
 }),
 smalltalk.Environment);
 
+
+
+smalltalk.addClass('JSObjectProxy', smalltalk.ProtoObject, ['jsObject'], 'Kernel-Infrastructure');
+smalltalk.JSObjectProxy.comment="I handle sending messages to JavaScript objects, making  JavaScript object accessing from Amber fully transparent.\x0aMy instances make intensive use of `#doesNotUnderstand:`.\x0a\x0aMy instances are automatically created by Amber whenever a message is sent to a JavaScript object.\x0a\x0a## Usage examples\x0a\x0aJSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.\x0a\x0a\x09window alert: 'hello world'.\x0a\x09window inspect.\x0a\x09(window jQuery: 'body') append: 'hello world'\x0a\x0aAmber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.\x0a\x0a## Message conversion rules\x0a\x0a- `someUser name` becomes `someUser.name`\x0a- `someUser name: 'John'` becomes `someUser name = \x22John\x22`\x0a- `console log: 'hello world'` becomes `console.log('hello world')`\x0a- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`\x0a\x0a__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.";
 smalltalk.addMethod(
 smalltalk.method({
-selector: "eval:on:",
-category: 'actions',
-fn: function (aString,aReceiver){
+selector: "addObjectVariablesTo:",
+category: 'proxy',
+fn: function (aDictionary){
 var self=this;
-var compiler;
-function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
-function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-var $early={};
-try {
-compiler=_st($Compiler())._new();
-_st((function(){
-return smalltalk.withContext(function($ctx2) {
-return _st(compiler)._parseExpression_(aString);
-}, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
-return smalltalk.withContext(function($ctx2) {
-$1=self._alert_(_st(ex)._messageText());
-throw $early=[$1];
-}, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
-$2=_st(compiler)._evaluateExpression_on_(aString,aReceiver);
-return $2;
-}
-catch(e) {if(e===$early)return e[0]; throw e}
-}, function($ctx1) {$ctx1.fill(self,"eval:on:",{aString:aString,aReceiver:aReceiver,compiler:compiler},smalltalk.Environment)})},
-args: ["aString", "aReceiver"],
-source: "eval: aString on: aReceiver\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[ compiler parseExpression: aString ] on: Error do: [ :ex |\x0a\x09\x09^ self alert: ex messageText ].\x0a\x09^ compiler evaluateExpression: aString on: aReceiver",
-messageSends: ["new", "on:do:", "parseExpression:", "alert:", "messageText", "evaluateExpression:on:"],
-referencedClasses: ["Compiler", "Error"]
+
+		for(var i in self['@jsObject']) {
+			aDictionary._at_put_(i, self['@jsObject'][i]);
+		}
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"addObjectVariablesTo:",{aDictionary:aDictionary},smalltalk.JSObjectProxy)})},
+args: ["aDictionary"],
+source: "addObjectVariablesTo: aDictionary\x0a\x09<\x0a\x09\x09for(var i in self['@jsObject']) {\x0a\x09\x09\x09aDictionary._at_put_(i, self['@jsObject'][i]);\x0a\x09\x09}\x0a\x09>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "evaluate:on:do:",
-category: 'error handling',
-fn: function (aBlock,anErrorClass,exceptionBlock){
+selector: "asJSON",
+category: 'enumerating',
+fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-self._try_catch_(aBlock,(function(exception){
-return smalltalk.withContext(function($ctx2) {
-$1=_st(exception)._isKindOf_(self._classNamed_(_st(anErrorClass)._name()));
-if(smalltalk.assert($1)){
-return _st(exceptionBlock)._value_(exception);
-} else {
-return _st(exception)._signal();
-};
-}, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,1)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"evaluate:on:do:",{aBlock:aBlock,anErrorClass:anErrorClass,exceptionBlock:exceptionBlock},smalltalk.Environment)})},
-args: ["aBlock", "anErrorClass", "exceptionBlock"],
-source: "evaluate: aBlock on: anErrorClass do: exceptionBlock\x0a\x09\x22Evaluate a block and catch exceptions happening on the environment stack\x22\x0a\x09\x0a\x09self try: aBlock catch: [ :exception | \x0a\x09\x09(exception isKindOf: (self classNamed: anErrorClass name))\x0a\x09\x09\x09ifTrue: [ exceptionBlock value: exception ]\x0a \x09\x09\x09ifFalse: [ exception signal ] ]",
-messageSends: ["try:catch:", "ifTrue:ifFalse:", "isKindOf:", "classNamed:", "name", "value:", "signal"],
+$1=self["@jsObject"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asJSON",{},smalltalk.JSObjectProxy)})},
+args: [],
+source: "asJSON\x0a\x09\x22Answers the receiver in a stringyfy-friendly fashion\x22\x0a\x0a\x09^ jsObject",
+messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "inspect:",
-category: 'actions',
-fn: function (anObject){
+selector: "at:",
+category: 'accessing',
+fn: function (aString){
 var self=this;
-function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st($InspectorHandler())._inspector())._inspect_(anObject);
-return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Environment)})},
-args: ["anObject"],
-source: "inspect: anObject\x0a\x09InspectorHandler inspector inspect: anObject",
-messageSends: ["inspect:", "inspector"],
-referencedClasses: ["InspectorHandler"]
+return self['@jsObject'][aString];
+return self}, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.JSObjectProxy)})},
+args: ["aString"],
+source: "at: aString\x0a\x09<return self['@jsObject'][aString]>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "moveClass:toPackage:",
-category: 'actions',
-fn: function (aClass,aPackageName){
+selector: "at:ifAbsent:",
+category: 'accessing',
+fn: function (aString,aBlock){
 var self=this;
-var package_;
-function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-package_=_st($Package())._named_(aPackageName);
-$1=package_;
-if(($receiver = $1) == nil || $receiver == null){
-self._error_("Invalid package name");
-} else {
-$1;
-};
-$2=_st(package_).__eq_eq(_st(aClass)._package());
-if(smalltalk.assert($2)){
-return self;
-};
-_st(aClass)._package_(package_);
-return self}, function($ctx1) {$ctx1.fill(self,"moveClass:toPackage:",{aClass:aClass,aPackageName:aPackageName,package_:package_},smalltalk.Environment)})},
-args: ["aClass", "aPackageName"],
-source: "moveClass: aClass toPackage: aPackageName\x0a\x09| package |\x0a\x09\x0a\x09package := Package named: aPackageName.\x0a\x09package ifNil: [ self error: 'Invalid package name' ].\x0a\x09package == aClass package ifTrue: [ ^ self ].\x0a\x09\x0a\x09aClass package: package",
-messageSends: ["named:", "ifNil:", "error:", "ifTrue:", "==", "package", "package:"],
-referencedClasses: ["Package"]
+
+		var obj = self['@jsObject'];
+		return aString in obj ? obj[aString] : aBlock._value();
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifAbsent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
+args: ["aString", "aBlock"],
+source: "at: aString ifAbsent: aBlock\x0a\x09\x22return the aString property or evaluate aBlock if the property is not defined on the object\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? obj[aString] : aBlock._value();\x0a\x09>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "moveMethod:toClass:",
-category: 'actions',
-fn: function (aMethod,aClassName){
+selector: "at:ifPresent:",
+category: 'accessing',
+fn: function (aString,aBlock){
 var self=this;
-var destinationClass;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$3,$4,$2;
-destinationClass=_st(_st($Smalltalk())._current())._at_(_st(aClassName)._asSymbol());
-$1=destinationClass;
-if(($receiver = $1) == nil || $receiver == null){
-self._error_("Invalid class name");
-} else {
-$1;
-};
-$3=destinationClass;
-$4=_st(aMethod)._methodClass();
-$ctx1.sendIdx["methodClass"]=1;
-$2=_st($3).__eq_eq($4);
-if(smalltalk.assert($2)){
-return self;
-};
-_st(destinationClass)._compile_category_(_st(aMethod)._source(),_st(aMethod)._protocol());
-_st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toClass:",{aMethod:aMethod,aClassName:aClassName,destinationClass:destinationClass},smalltalk.Environment)})},
-args: ["aMethod", "aClassName"],
-source: "moveMethod: aMethod toClass: aClassName\x0a\x09| destinationClass |\x0a\x09\x0a\x09destinationClass := Smalltalk current at: aClassName asSymbol.\x0a\x09destinationClass ifNil: [ self error: 'Invalid class name' ].\x0a\x09destinationClass == aMethod methodClass ifTrue: [ ^ self ].\x0a\x09\x0a\x09destinationClass \x0a\x09\x09compile: aMethod source\x0a\x09\x09category: aMethod protocol.\x0a\x09aMethod methodClass \x0a\x09\x09removeCompiledMethod: aMethod",
-messageSends: ["at:", "current", "asSymbol", "ifNil:", "error:", "ifTrue:", "==", "methodClass", "compile:category:", "source", "protocol", "removeCompiledMethod:"],
-referencedClasses: ["Smalltalk"]
+
+		var obj = self['@jsObject'];
+		return aString in obj ? aBlock._value_(obj[aString]) : nil;
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:",{aString:aString,aBlock:aBlock},smalltalk.JSObjectProxy)})},
+args: ["aString", "aBlock"],
+source: "at: aString ifPresent: aBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined or return nil\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : nil;\x0a\x09>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "moveMethod:toProtocol:",
-category: 'actions',
-fn: function (aMethod,aProtocol){
+selector: "at:ifPresent:ifAbsent:",
+category: 'accessing',
+fn: function (aString,aBlock,anotherBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(aMethod)._category_(aProtocol);
-return self}, function($ctx1) {$ctx1.fill(self,"moveMethod:toProtocol:",{aMethod:aMethod,aProtocol:aProtocol},smalltalk.Environment)})},
-args: ["aMethod", "aProtocol"],
-source: "moveMethod: aMethod toProtocol: aProtocol\x0a\x09aMethod category: aProtocol",
-messageSends: ["category:"],
+
+		var obj = self['@jsObject'];
+		return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"at:ifPresent:ifAbsent:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},smalltalk.JSObjectProxy)})},
+args: ["aString", "aBlock", "anotherBlock"],
+source: "at: aString ifPresent: aBlock ifAbsent: anotherBlock\x0a\x09\x22return the evaluation of aBlock with the value if the property is defined\x0a\x09or return value of anotherBlock\x22\x0a\x09<\x0a\x09\x09var obj = self['@jsObject'];\x0a\x09\x09return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();\x0a\x09>",
+messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "packages",
+selector: "at:put:",
 category: 'accessing',
-fn: function (){
+fn: function (aString,anObject){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st($Smalltalk())._current())._packages();
+return self['@jsObject'][aString] = anObject;
+return self}, function($ctx1) {$ctx1.fill(self,"at:put:",{aString:aString,anObject:anObject},smalltalk.JSObjectProxy)})},
+args: ["aString", "anObject"],
+source: "at: aString put: anObject\x0a\x09<return self['@jsObject'][aString] = anObject>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxy);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doesNotUnderstand:",
+category: 'proxy',
+fn: function (aMessage){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self._lookupProperty_(_st(_st(aMessage)._selector())._asJavaScriptSelector());
+if(($receiver = $2) == nil || $receiver == null){
+$1=smalltalk.JSObjectProxy.superclass.fn.prototype._doesNotUnderstand_.apply(_st(self), [aMessage]);
+} else {
+var jsSelector;
+jsSelector=$receiver;
+$1=self._forwardMessage_withArguments_(jsSelector,_st(aMessage)._arguments());
+};
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.Environment)})},
-args: [],
-source: "packages\x0a\x09^ Smalltalk current packages",
-messageSends: ["packages", "current"],
-referencedClasses: ["Smalltalk"]
+}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.JSObjectProxy)})},
+args: ["aMessage"],
+source: "doesNotUnderstand: aMessage\x0a\x09^ (self lookupProperty: aMessage selector asJavaScriptSelector)\x0a\x09\x09ifNil: [ super doesNotUnderstand: aMessage ]\x0a\x09\x09ifNotNil: [ :jsSelector | \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09forwardMessage: jsSelector \x0a\x09\x09\x09\x09withArguments: aMessage arguments ]",
+messageSends: ["ifNil:ifNotNil:", "lookupProperty:", "asJavaScriptSelector", "selector", "doesNotUnderstand:", "forwardMessage:withArguments:", "arguments"],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "registerErrorHandler:",
-category: 'actions',
-fn: function (anErrorHandler){
+selector: "forwardMessage:withArguments:",
+category: 'proxy',
+fn: function (aString,anArray){
 var self=this;
-function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
 return smalltalk.withContext(function($ctx1) { 
-_st($ErrorHandler())._setCurrent_(anErrorHandler);
-return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.Environment)})},
-args: ["anErrorHandler"],
-source: "registerErrorHandler: anErrorHandler\x0a\x09ErrorHandler setCurrent: anErrorHandler",
-messageSends: ["setCurrent:"],
-referencedClasses: ["ErrorHandler"]
+
+		return smalltalk.send(self._jsObject(), aString, anArray);
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"forwardMessage:withArguments:",{aString:aString,anArray:anArray},smalltalk.JSObjectProxy)})},
+args: ["aString", "anArray"],
+source: "forwardMessage: aString withArguments: anArray\x0a\x09<\x0a\x09\x09return smalltalk.send(self._jsObject(), aString, anArray);\x0a\x09>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "registerInspector:",
-category: 'actions',
+selector: "inspectOn:",
+category: 'proxy',
 fn: function (anInspector){
 var self=this;
-function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+var variables;
+function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
 return smalltalk.withContext(function($ctx1) { 
-_st($InspectorHandler())._register_(anInspector);
-return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.Environment)})},
+variables=_st($Dictionary())._new();
+_st(variables)._at_put_("#self",self._jsObject());
+_st(anInspector)._setLabel_(self._printString());
+self._addObjectVariablesTo_(variables);
+_st(anInspector)._setVariables_(variables);
+return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.JSObjectProxy)})},
 args: ["anInspector"],
-source: "registerInspector: anInspector\x0a\x09InspectorHandler register: anInspector",
-messageSends: ["register:"],
-referencedClasses: ["InspectorHandler"]
-}),
-smalltalk.Environment);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "registerProgressHandler:",
-category: 'actions',
-fn: function (aProgressHandler){
-var self=this;
-function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st($ProgressHandler())._setCurrent_(aProgressHandler);
-return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.Environment)})},
-args: ["aProgressHandler"],
-source: "registerProgressHandler: aProgressHandler\x0a\x09ProgressHandler setCurrent: aProgressHandler",
-messageSends: ["setCurrent:"],
-referencedClasses: ["ProgressHandler"]
+source: "inspectOn: anInspector\x0a\x09| variables |\x0a\x09variables := Dictionary new.\x0a\x09variables at: '#self' put: self jsObject.\x0a\x09anInspector setLabel: self printString.\x0a\x09self addObjectVariablesTo: variables.\x0a\x09anInspector setVariables: variables",
+messageSends: ["new", "at:put:", "jsObject", "setLabel:", "printString", "addObjectVariablesTo:", "setVariables:"],
+referencedClasses: ["Dictionary"]
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "removeClass:",
-category: 'actions',
-fn: function (aClass){
+selector: "jsObject",
+category: 'accessing',
+fn: function (){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-_st(_st($Smalltalk())._current())._removeClass_(aClass);
-return self}, function($ctx1) {$ctx1.fill(self,"removeClass:",{aClass:aClass},smalltalk.Environment)})},
-args: ["aClass"],
-source: "removeClass: aClass\x0a\x09Smalltalk current removeClass: aClass",
-messageSends: ["removeClass:", "current"],
-referencedClasses: ["Smalltalk"]
+var $1;
+$1=self["@jsObject"];
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"jsObject",{},smalltalk.JSObjectProxy)})},
+args: [],
+source: "jsObject\x0a\x09^ jsObject",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "removeMethod:",
-category: 'actions',
-fn: function (aMethod){
+selector: "jsObject:",
+category: 'accessing',
+fn: function (aJSObject){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(aMethod)._methodClass())._removeCompiledMethod_(aMethod);
-return self}, function($ctx1) {$ctx1.fill(self,"removeMethod:",{aMethod:aMethod},smalltalk.Environment)})},
-args: ["aMethod"],
-source: "removeMethod: aMethod\x0a\x09aMethod methodClass removeCompiledMethod: aMethod",
-messageSends: ["removeCompiledMethod:", "methodClass"],
+self["@jsObject"]=aJSObject;
+return self}, function($ctx1) {$ctx1.fill(self,"jsObject:",{aJSObject:aJSObject},smalltalk.JSObjectProxy)})},
+args: ["aJSObject"],
+source: "jsObject: aJSObject\x0a\x09jsObject := aJSObject",
+messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "removeProtocol:from:",
-category: 'actions',
-fn: function (aString,aClass){
+selector: "keysAndValuesDo:",
+category: 'enumerating',
+fn: function (aBlock){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(aClass)._methods())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(each)._protocol()).__eq(aString);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(aClass)._removeCompiledMethod_(each);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol:from:",{aString:aString,aClass:aClass},smalltalk.Environment)})},
-args: ["aString", "aClass"],
-source: "removeProtocol: aString from: aClass\x0a\x09(aClass methods\x0a\x09\x09select: [ :each | each protocol = aString ])\x0a\x09\x09do: [ :each | aClass removeCompiledMethod: each ]",
-messageSends: ["do:", "select:", "methods", "=", "protocol", "removeCompiledMethod:"],
+
+		var o = self['@jsObject'];
+		for(var i in o) {
+			aBlock._value_value_(i, o[i]);
+		}
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"keysAndValuesDo:",{aBlock:aBlock},smalltalk.JSObjectProxy)})},
+args: ["aBlock"],
+source: "keysAndValuesDo: aBlock\x0a\x09<\x0a\x09\x09var o = self['@jsObject'];\x0a\x09\x09for(var i in o) {\x0a\x09\x09\x09aBlock._value_value_(i, o[i]);\x0a\x09\x09}\x0a\x09>",
+messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "renameClass:to:",
-category: 'actions',
-fn: function (aClass,aClassName){
+selector: "lookupProperty:",
+category: 'accessing',
+fn: function (aString){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
-function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
 return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st(_st($Smalltalk())._current())._at_(aClassName);
-if(($receiver = $1) == nil || $receiver == null){
-$1;
-} else {
-$2=_st("A class named ".__comma(aClassName)).__comma(" already exists");
-$ctx1.sendIdx[","]=1;
-self._error_($2);
-};
-_st(_st($ClassBuilder())._new())._renameClass_to_(aClass,aClassName);
-return self}, function($ctx1) {$ctx1.fill(self,"renameClass:to:",{aClass:aClass,aClassName:aClassName},smalltalk.Environment)})},
-args: ["aClass", "aClassName"],
-source: "renameClass: aClass to: aClassName\x0a\x09(Smalltalk current at: aClassName)\x0a\x09\x09ifNotNil: [ self error: 'A class named ', aClassName, ' already exists' ].\x0a\x09\x09\x0a\x09ClassBuilder new renameClass: aClass to: aClassName",
-messageSends: ["ifNotNil:", "at:", "current", "error:", ",", "renameClass:to:", "new"],
-referencedClasses: ["Smalltalk", "ClassBuilder"]
+return aString in self._jsObject() ? aString : nil;
+return self}, function($ctx1) {$ctx1.fill(self,"lookupProperty:",{aString:aString},smalltalk.JSObjectProxy)})},
+args: ["aString"],
+source: "lookupProperty: aString\x0a\x09\x22Looks up a property in JS object.\x0a\x09Answer the property if it is present, or nil if it is not present.\x22\x0a\x09\x0a\x09<return aString in self._jsObject() ? aString : nil>",
+messageSends: [],
+referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "renameProtocol:to:in:",
-category: 'actions',
-fn: function (aString,anotherString,aClass){
+selector: "printOn:",
+category: 'printing',
+fn: function (aStream){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(_st(_st(aClass)._methods())._select_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(_st(each)._protocol()).__eq(aString);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
-return _st(each)._protocol_(anotherString);
-}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
-return self}, function($ctx1) {$ctx1.fill(self,"renameProtocol:to:in:",{aString:aString,anotherString:anotherString,aClass:aClass},smalltalk.Environment)})},
-args: ["aString", "anotherString", "aClass"],
-source: "renameProtocol: aString to: anotherString in: aClass\x0a\x09(aClass methods\x0a\x09\x09select: [ :each | each protocol = aString ])\x0a\x09\x09do: [ :each | each protocol: anotherString ]",
-messageSends: ["do:", "select:", "methods", "=", "protocol", "protocol:"],
+_st(aStream)._nextPutAll_(self._printString());
+return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.JSObjectProxy)})},
+args: ["aStream"],
+source: "printOn: aStream\x0a\x09aStream nextPutAll: self printString",
+messageSends: ["nextPutAll:", "printString"],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "setClassCommentOf:to:",
-category: 'actions',
-fn: function (aClass,aString){
+selector: "printString",
+category: 'printing',
+fn: function (){
 var self=this;
 return smalltalk.withContext(function($ctx1) { 
-_st(aClass)._comment_(aString);
-return self}, function($ctx1) {$ctx1.fill(self,"setClassCommentOf:to:",{aClass:aClass,aString:aString},smalltalk.Environment)})},
-args: ["aClass", "aString"],
-source: "setClassCommentOf: aClass to: aString\x0a\x09aClass comment: aString",
-messageSends: ["comment:"],
+
+		var js = self['@jsObject'];
+		return js.toString
+			? js.toString()
+			: Object.prototype.toString.call(js)
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.JSObjectProxy)})},
+args: [],
+source: "printString\x0a\x09<\x0a\x09\x09var js = self['@jsObject'];\x0a\x09\x09return js.toString\x0a\x09\x09\x09? js.toString()\x0a\x09\x09\x09: Object.prototype.toString.call(js)\x0a\x09>",
+messageSends: [],
 referencedClasses: []
 }),
-smalltalk.Environment);
+smalltalk.JSObjectProxy);
+
 
 smalltalk.addMethod(
 smalltalk.method({
-selector: "systemAnnouncer",
-category: 'accessing',
-fn: function (){
+selector: "on:",
+category: 'instance creation',
+fn: function (aJSObject){
 var self=this;
-function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
 return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st(_st(_st($Smalltalk())._current())._at_("SystemAnnouncer"))._current();
-$ctx1.sendIdx["current"]=1;
+var $2,$3,$1;
+$2=self._new();
+_st($2)._jsObject_(aJSObject);
+$3=_st($2)._yourself();
+$1=$3;
 return $1;
-}, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.Environment)})},
-args: [],
-source: "systemAnnouncer\x0a\x09^ (Smalltalk current at: #SystemAnnouncer) current",
-messageSends: ["current", "at:"],
-referencedClasses: ["Smalltalk"]
+}, function($ctx1) {$ctx1.fill(self,"on:",{aJSObject:aJSObject},smalltalk.JSObjectProxy.klass)})},
+args: ["aJSObject"],
+source: "on: aJSObject\x0a\x09^ self new\x0a\x09\x09jsObject: aJSObject;\x0a\x09\x09yourself",
+messageSends: ["jsObject:", "new", "yourself"],
+referencedClasses: []
 }),
-smalltalk.Environment);
-
+smalltalk.JSObjectProxy.klass);
 
 
 smalltalk.addClass('Organizer', smalltalk.Object, [], 'Kernel-Infrastructure');

+ 295 - 245
js/Kernel-Objects.js

@@ -2,8 +2,301 @@ define("amber_core/Kernel-Objects", ["amber_vm/smalltalk", "amber_vm/nil", "ambe
 smalltalk.addPackage('Kernel-Objects');
 smalltalk.packages["Kernel-Objects"].transport = {"type":"amd","amdNamespace":"amber_core"};
 
-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.";
+smalltalk.addClass('ProtoObject', smalltalk.nil, [], 'Kernel-Objects');
+smalltalk.ProtoObject.comment="I implement the basic behavior required for any object in Amber.\x0a\x0aIn most cases, subclassing `ProtoObject` is wrong and `Object` should be used instead. However subclassing `ProtoObject` can be useful in some special cases like proxy implementations. ";
+smalltalk.addMethod(
+smalltalk.method({
+selector: "asString",
+category: 'converting',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self._printString();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.ProtoObject)})},
+args: [],
+source: "asString\x0a\x09^ self printString",
+messageSends: ["printString"],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "class",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self.klass;
+return self}, function($ctx1) {$ctx1.fill(self,"class",{},smalltalk.ProtoObject)})},
+args: [],
+source: "class\x0a\x09<return self.klass>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "doesNotUnderstand:",
+category: 'error handling',
+fn: function (aMessage){
+var self=this;
+function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
+$1=_st($MessageNotUnderstood())._new();
+_st($1)._receiver_(self);
+_st($1)._message_(aMessage);
+$2=_st($1)._signal();
+return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.ProtoObject)})},
+args: ["aMessage"],
+source: "doesNotUnderstand: aMessage\x0a\x09MessageNotUnderstood new\x0a\x09\x09receiver: self;\x0a\x09\x09message: aMessage;\x0a\x09\x09signal",
+messageSends: ["receiver:", "new", "message:", "signal"],
+referencedClasses: ["MessageNotUnderstood"]
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "identityHash",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+
+		var hash=self.identityHash;
+		if (hash) return hash;
+		hash=smalltalk.nextId();
+		Object.defineProperty(self, 'identityHash', {value:hash});
+		return hash;
+	;
+return self}, function($ctx1) {$ctx1.fill(self,"identityHash",{},smalltalk.ProtoObject)})},
+args: [],
+source: "identityHash\x0a\x09<\x0a\x09\x09var hash=self.identityHash;\x0a\x09\x09if (hash) return hash;\x0a\x09\x09hash=smalltalk.nextId();\x0a\x09\x09Object.defineProperty(self, 'identityHash', {value:hash});\x0a\x09\x09return hash;\x0a\x09>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+category: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProtoObject)})},
+args: [],
+source: "initialize",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspect",
+category: 'inspecting',
+fn: function (){
+var self=this;
+function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
+return smalltalk.withContext(function($ctx1) { 
+_st($InspectorHandler())._inspect_(self);
+return self}, function($ctx1) {$ctx1.fill(self,"inspect",{},smalltalk.ProtoObject)})},
+args: [],
+source: "inspect\x0a\x09InspectorHandler inspect: self",
+messageSends: ["inspect:"],
+referencedClasses: ["InspectorHandler"]
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "inspectOn:",
+category: 'inspecting',
+fn: function (anInspector){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector},smalltalk.ProtoObject)})},
+args: ["anInspector"],
+source: "inspectOn: anInspector",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "instVarAt:",
+category: 'accessing',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+ return self['@'+aString] ;
+return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:",{aString:aString},smalltalk.ProtoObject)})},
+args: ["aString"],
+source: "instVarAt: aString\x0a\x09< return self['@'+aString] >",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "instVarAt:put:",
+category: 'accessing',
+fn: function (aString,anObject){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+ self['@' + aString] = anObject ;
+return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:put:",{aString:aString,anObject:anObject},smalltalk.ProtoObject)})},
+args: ["aString", "anObject"],
+source: "instVarAt: aString put: anObject\x0a\x09< self['@' + aString] = anObject >",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "perform:",
+category: 'message handling',
+fn: function (aString){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=self._perform_withArguments_(aString,[]);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"perform:",{aString:aString},smalltalk.ProtoObject)})},
+args: ["aString"],
+source: "perform: aString\x0a\x09^ self perform: aString withArguments: #()",
+messageSends: ["perform:withArguments:"],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "perform:withArguments:",
+category: 'message handling',
+fn: function (aString,aCollection){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return smalltalk.send(self, aString._asSelector(), aCollection);
+return self}, function($ctx1) {$ctx1.fill(self,"perform:withArguments:",{aString:aString,aCollection:aCollection},smalltalk.ProtoObject)})},
+args: ["aString", "aCollection"],
+source: "perform: aString withArguments: aCollection\x0a\x09<return smalltalk.send(self, aString._asSelector(), aCollection)>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "printOn:",
+category: 'printing',
+fn: function (aStream){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $5,$4,$3,$2,$1;
+$5=self._class();
+$ctx1.sendIdx["class"]=1;
+$4=_st($5)._name();
+$ctx1.sendIdx["name"]=1;
+$3=_st($4)._first();
+$2=_st($3)._isVowel();
+if(smalltalk.assert($2)){
+$1="an ";
+} else {
+$1="a ";
+};
+_st(aStream)._nextPutAll_($1);
+$ctx1.sendIdx["nextPutAll:"]=1;
+_st(aStream)._nextPutAll_(_st(self._class())._name());
+return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.ProtoObject)})},
+args: ["aStream"],
+source: "printOn: aStream\x0a\x09aStream nextPutAll: (self class name first isVowel\x0a\x09\x09ifTrue: [ 'an ' ]\x0a\x09\x09ifFalse: [ 'a ' ]).\x0a\x09aStream nextPutAll: self class name",
+messageSends: ["nextPutAll:", "ifTrue:ifFalse:", "isVowel", "first", "name", "class"],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "printString",
+category: 'printing',
+fn: function (){
+var self=this;
+function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st($String())._streamContents_((function(str){
+return smalltalk.withContext(function($ctx2) {
+return self._printOn_(str);
+}, function($ctx2) {$ctx2.fillBlock({str:str},$ctx1,1)})}));
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.ProtoObject)})},
+args: [],
+source: "printString\x0a\x09^ String streamContents: [ :str | \x0a\x09\x09self printOn: str ]",
+messageSends: ["streamContents:", "printOn:"],
+referencedClasses: ["String"]
+}),
+smalltalk.ProtoObject);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "yourself",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self;
+}, function($ctx1) {$ctx1.fill(self,"yourself",{},smalltalk.ProtoObject)})},
+args: [],
+source: "yourself\x0a\x09^ self",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "heliosClass",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "class";
+}, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.ProtoObject.klass)})},
+args: [],
+source: "heliosClass\x0a\x09\x22Should be an Helios extension. Unfortunately, since helios can browse remote\x0a\x09environments, we can't extend base classes\x22\x0a\x09\x0a\x09^ 'class'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "initialize",
+category: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ProtoObject.klass)})},
+args: [],
+source: "initialize",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.ProtoObject.klass);
+
+
+smalltalk.addClass('Object', smalltalk.ProtoObject, [], 'Kernel-Objects');
+smalltalk.Object.comment="**I am the root of the Smalltalk class system**. With the exception of unual subclasses of `ProtoObject`, all other classes in the system are subclasses of me.\x0a\x0aI provide default behavior common to all normal objects (some of it inherited from `ProtoObject`), 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.";
 smalltalk.addMethod(
 smalltalk.method({
 selector: "->",
@@ -123,24 +416,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "asString",
-category: 'converting',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self._printString();
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"asString",{},smalltalk.Object)})},
-args: [],
-source: "asString\x0a\x09^ self printString",
-messageSends: ["printString"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "basicAt:",
@@ -223,22 +498,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "class",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self.klass;
-return self}, function($ctx1) {$ctx1.fill(self,"class",{},smalltalk.Object)})},
-args: [],
-source: "class\x0a\x09<return self.klass>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "copy",
@@ -311,27 +570,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "doesNotUnderstand:",
-category: 'error handling',
-fn: function (aMessage){
-var self=this;
-function $MessageNotUnderstood(){return smalltalk.MessageNotUnderstood||(typeof MessageNotUnderstood=="undefined"?nil:MessageNotUnderstood)}
-return smalltalk.withContext(function($ctx1) { 
-var $1,$2;
-$1=_st($MessageNotUnderstood())._new();
-_st($1)._receiver_(self);
-_st($1)._message_(aMessage);
-$2=_st($1)._signal();
-return self}, function($ctx1) {$ctx1.fill(self,"doesNotUnderstand:",{aMessage:aMessage},smalltalk.Object)})},
-args: ["aMessage"],
-source: "doesNotUnderstand: aMessage\x0a\x09MessageNotUnderstood new\x0a\x09\x09receiver: self;\x0a\x09\x09message: aMessage;\x0a\x09\x09signal",
-messageSends: ["receiver:", "new", "message:", "signal"],
-referencedClasses: ["MessageNotUnderstood"]
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "error:",
@@ -365,28 +603,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "identityHash",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-
-		var hash=self.identityHash;
-		if (hash) return hash;
-		hash=smalltalk.nextId();
-		Object.defineProperty(self, 'identityHash', {value:hash});
-		return hash;
-	;
-return self}, function($ctx1) {$ctx1.fill(self,"identityHash",{},smalltalk.Object)})},
-args: [],
-source: "identityHash\x0a\x09<\x0a\x09\x09var hash=self.identityHash;\x0a\x09\x09if (hash) return hash;\x0a\x09\x09hash=smalltalk.nextId();\x0a\x09\x09Object.defineProperty(self, 'identityHash', {value:hash});\x0a\x09\x09return hash;\x0a\x09>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "ifNil:",
@@ -457,38 +673,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "initialize",
-category: 'initialization',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Object)})},
-args: [],
-source: "initialize",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "inspect",
-category: 'inspecting',
-fn: function (){
-var self=this;
-function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
-return smalltalk.withContext(function($ctx1) { 
-_st($InspectorHandler())._inspect_(self);
-return self}, function($ctx1) {$ctx1.fill(self,"inspect",{},smalltalk.Object)})},
-args: [],
-source: "inspect\x0a\x09InspectorHandler inspect: self",
-messageSends: ["inspect:"],
-referencedClasses: ["InspectorHandler"]
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "inspectOn:",
@@ -516,38 +700,6 @@ referencedClasses: ["Dictionary"]
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "instVarAt:",
-category: 'accessing',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
- return self['@'+aString] ;
-return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:",{aString:aString},smalltalk.Object)})},
-args: ["aString"],
-source: "instVarAt: aString\x0a\x09< return self['@'+aString] >",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "instVarAt:put:",
-category: 'accessing',
-fn: function (aString,anObject){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
- self['@' + aString] = anObject ;
-return self}, function($ctx1) {$ctx1.fill(self,"instVarAt:put:",{aString:aString,anObject:anObject},smalltalk.Object)})},
-args: ["aString", "anObject"],
-source: "instVarAt: aString put: anObject\x0a\x09< self['@' + aString] = anObject >",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "isBehavior",
@@ -799,40 +951,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "perform:",
-category: 'message handling',
-fn: function (aString){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=self._perform_withArguments_(aString,[]);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"perform:",{aString:aString},smalltalk.Object)})},
-args: ["aString"],
-source: "perform: aString\x0a\x09^ self perform: aString withArguments: #()",
-messageSends: ["perform:withArguments:"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "perform:withArguments:",
-category: 'message handling',
-fn: function (aString,aCollection){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return smalltalk.send(self, aString._asSelector(), aCollection);
-return self}, function($ctx1) {$ctx1.fill(self,"perform:withArguments:",{aString:aString,aCollection:aCollection},smalltalk.Object)})},
-args: ["aString", "aCollection"],
-source: "perform: aString withArguments: aCollection\x0a\x09<return smalltalk.send(self, aString._asSelector(), aCollection)>",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "postCopy",
@@ -848,58 +966,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "printOn:",
-category: 'printing',
-fn: function (aStream){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $5,$4,$3,$2,$1;
-$5=self._class();
-$ctx1.sendIdx["class"]=1;
-$4=_st($5)._name();
-$ctx1.sendIdx["name"]=1;
-$3=_st($4)._first();
-$2=_st($3)._isVowel();
-if(smalltalk.assert($2)){
-$1="an ";
-} else {
-$1="a ";
-};
-_st(aStream)._nextPutAll_($1);
-$ctx1.sendIdx["nextPutAll:"]=1;
-_st(aStream)._nextPutAll_(_st(self._class())._name());
-return self}, function($ctx1) {$ctx1.fill(self,"printOn:",{aStream:aStream},smalltalk.Object)})},
-args: ["aStream"],
-source: "printOn: aStream\x0a\x09\x22Append to the aStream, a string representing the receiver.\x22\x0a\x09\x0a\x09aStream nextPutAll: (self class name first isVowel\x0a\x09\x09ifTrue: [ 'an ' ]\x0a\x09\x09ifFalse: [ 'a ' ]).\x0a\x09aStream nextPutAll: self class name",
-messageSends: ["nextPutAll:", "ifTrue:ifFalse:", "isVowel", "first", "name", "class"],
-referencedClasses: []
-}),
-smalltalk.Object);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "printString",
-category: 'printing',
-fn: function (){
-var self=this;
-function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=_st($String())._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
-return self._printOn_(stream);
-}, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})}));
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"printString",{},smalltalk.Object)})},
-args: [],
-source: "printString\x0a\x09\x22Answer a String representation of the receiver.\x22\x0a\x0a\x09^ String streamContents: [ :stream | self printOn: stream ]",
-messageSends: ["streamContents:", "printOn:"],
-referencedClasses: ["String"]
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "putOn:",
@@ -1054,22 +1120,6 @@ referencedClasses: []
 }),
 smalltalk.Object);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "yourself",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return self;
-}, function($ctx1) {$ctx1.fill(self,"yourself",{},smalltalk.Object)})},
-args: [],
-source: "yourself\x0a\x09^ self",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.Object);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "~=",

+ 25 - 0
js/Kernel-Tests.js

@@ -4083,6 +4083,31 @@ referencedClasses: []
 }),
 smalltalk.JSObjectProxyTest);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "testAtPut",
+category: 'tests',
+fn: function (){
+var self=this;
+var testObject;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+testObject=self._jsObject();
+$2=_st(testObject)._at_("abc");
+$ctx1.sendIdx["at:"]=1;
+$1=_st($2).__tild_eq("xyz");
+self._assert_($1);
+self._assert_equals_(_st(testObject)._at_put_("abc","xyz"),"xyz");
+$ctx1.sendIdx["assert:equals:"]=1;
+self._assert_equals_(_st(testObject)._at_("abc"),"xyz");
+return self}, function($ctx1) {$ctx1.fill(self,"testAtPut",{testObject:testObject},smalltalk.JSObjectProxyTest)})},
+args: [],
+source: "testAtPut\x0a\x09| testObject |\x0a\x09testObject := self jsObject.\x0a\x09\x0a\x09self assert: (testObject at: 'abc') ~= 'xyz'.\x0a\x09self assert: (testObject at: 'abc' put: 'xyz') equals: 'xyz'.\x0a\x09self assert: (testObject at: 'abc') equals: 'xyz'",
+messageSends: ["jsObject", "assert:", "~=", "at:", "assert:equals:", "at:put:"],
+referencedClasses: []
+}),
+smalltalk.JSObjectProxyTest);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "testDNU",

+ 1 - 1
st/Canvas.st

@@ -807,7 +807,7 @@ at: aString ifAbsent: aBlock
 !
 
 at: aString put: aValue
-	<self['@element'].setAttribute(aString, aValue)>
+	<self['@element'].setAttribute(aString, aValue); return aValue>
 !
 
 class: aString

+ 41 - 0
st/Kernel-ImportExport.st

@@ -590,6 +590,12 @@ exporter
 	^ self exporterClass new
 ! !
 
+!PackageHandler methodsFor: 'loading'!
+
+load: aPackage
+	self subclassResponsibility
+! !
+
 !PackageHandler methodsFor: 'private'!
 
 ajaxPutAt: aURL data: aString
@@ -631,6 +637,15 @@ namespaceFor: aPackage
 	^ aPackage transport namespace
 ! !
 
+!AmdPackageHandler methodsFor: 'loading'!
+
+load: aPackage
+	Smalltalk current amdRequire
+		ifNil: [ self error: 'AMD loader not present' ]
+		ifNotNil: [ :require |
+			require value: (Array new: (self namespaceFor: aPackage), '/', aPackage name ) ]
+! !
+
 !AmdPackageHandler methodsFor: 'private'!
 
 toUrl: aString
@@ -703,6 +718,12 @@ setupFromJson: anObject
 	"no op. override if needed in subclasses"
 ! !
 
+!PackageTransport methodsFor: 'loading'!
+
+load
+	self commitHandler load: self package
+! !
+
 PackageTransport class instanceVariableNames: 'registry'!
 
 !PackageTransport class methodsFor: 'accessing'!
@@ -831,5 +852,25 @@ namespace: aString
 
 commit
 	^ self transport commit
+!
+
+load
+	^ self transport load
+!
+
+loadFromNamespace: aString
+	^ self transport
+		namespace: aString;
+		load
+! !
+
+!Package class methodsFor: '*Kernel-ImportExport'!
+
+load: aPackageName
+	(self named: aPackageName) load
+!
+
+load: aPackageName fromNamespace: aString
+	(self named: aPackageName) loadFromNamespace: aString
 ! !
 

+ 152 - 250
st/Kernel-Infrastructure.st

@@ -1,254 +1,4 @@
 Smalltalk current createPackage: 'Kernel-Infrastructure'!
-nil subclass: #AbstractProxy
-	instanceVariableNames: ''
-	package: 'Kernel-Infrastructure'!
-!AbstractProxy commentStamp!
-I provide a basic set of methods for proxies handling `#doesNotUnderstand:` so that inspectors, debuggers, etc. won't fail.!
-
-!AbstractProxy methodsFor: 'accessing'!
-
-class
-	<return self.klass>
-!
-
-identityHash
-	<
-		var hash=self.identityHash;
-		if (hash) return hash;
-		hash=smalltalk.nextId();
-		Object.defineProperty(self, 'identityHash', {value:hash});
-		return hash;
-	>
-!
-
-instVarAt: aString
-	< return self['@'+aString] >
-!
-
-instVarAt: aString put: anObject
-	< self['@' + aString] = anObject >
-!
-
-yourself
-	^ self
-! !
-
-!AbstractProxy methodsFor: 'converting'!
-
-asString
-	^ self printString
-! !
-
-!AbstractProxy methodsFor: 'error handling'!
-
-doesNotUnderstand: aMessage
-	MessageNotUnderstood new
-		receiver: self;
-		message: aMessage;
-		signal
-! !
-
-!AbstractProxy methodsFor: 'initialization'!
-
-initialize
-! !
-
-!AbstractProxy methodsFor: 'inspecting'!
-
-inspect
-	InspectorHandler inspect: self
-!
-
-inspectOn: anInspector
-! !
-
-!AbstractProxy methodsFor: 'message handling'!
-
-perform: aString
-	^ self perform: aString withArguments: #()
-!
-
-perform: aString withArguments: aCollection
-	<return smalltalk.send(self, aString._asSelector(), aCollection)>
-! !
-
-!AbstractProxy methodsFor: 'printing'!
-
-printOn: aStream
-	aStream nextPutAll: (self class name first isVowel
-		ifTrue: [ 'an ' ]
-		ifFalse: [ 'a ' ]).
-	aStream nextPutAll: self class name
-!
-
-printString
-	^ String streamContents: [ :str | 
-		self printOn: str ]
-! !
-
-!AbstractProxy class methodsFor: 'helios'!
-
-heliosClass
-	^ 'class'
-! !
-
-!AbstractProxy class methodsFor: 'initialization'!
-
-initialize
-! !
-
-AbstractProxy subclass: #JSObjectProxy
-	instanceVariableNames: 'jsObject'
-	package: 'Kernel-Infrastructure'!
-!JSObjectProxy commentStamp!
-I handle sending messages to JavaScript objects, making  JavaScript object accessing from Amber fully transparent.
-My instances make intensive use of `#doesNotUnderstand:`.
-
-My instances are automatically created by Amber whenever a message is sent to a JavaScript object.
-
-## Usage examples
-
-JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
-
-	window alert: 'hello world'.
-	window inspect.
-	(window jQuery: 'body') append: 'hello world'
-
-Amber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.
-
-## Message conversion rules
-
-- `someUser name` becomes `someUser.name`
-- `someUser name: 'John'` becomes `someUser name = "John"`
-- `console log: 'hello world'` becomes `console.log('hello world')`
-- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
-
-__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.!
-
-!JSObjectProxy methodsFor: 'accessing'!
-
-at: aString
-	<return self['@jsObject'][aString]>
-!
-
-at: aString ifAbsent: aBlock
-	"return the aString property or evaluate aBlock if the property is not defined on the object"
-	<
-		var obj = self['@jsObject'];
-		return aString in obj ? obj[aString] : aBlock._value();
-	>
-!
-
-at: aString ifPresent: aBlock
-	"return the evaluation of aBlock with the value if the property is defined or return nil"
-	<
-		var obj = self['@jsObject'];
-		return aString in obj ? aBlock._value_(obj[aString]) : nil;
-	>
-!
-
-at: aString ifPresent: aBlock ifAbsent: anotherBlock
-	"return the evaluation of aBlock with the value if the property is defined
-	or return value of anotherBlock"
-	<
-		var obj = self['@jsObject'];
-		return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
-	>
-!
-
-at: aString put: anObject
-	<self['@jsObject'][aString] = anObject>
-!
-
-jsObject
-	^ jsObject
-!
-
-jsObject: aJSObject
-	jsObject := aJSObject
-!
-
-lookupProperty: aString
-	"Looks up a property in JS object.
-	Answer the property if it is present, or nil if it is not present."
-	
-	<return aString in self._jsObject() ? aString : nil>
-! !
-
-!JSObjectProxy methodsFor: 'enumerating'!
-
-asJSON
-	"Answers the receiver in a stringyfy-friendly fashion"
-
-	^ jsObject
-!
-
-keysAndValuesDo: aBlock
-	<
-		var o = self['@jsObject'];
-		for(var i in o) {
-			aBlock._value_value_(i, o[i]);
-		}
-	>
-! !
-
-!JSObjectProxy methodsFor: 'printing'!
-
-printOn: aStream
-	aStream nextPutAll: self printString
-!
-
-printString
-	<
-		var js = self['@jsObject'];
-		return js.toString
-			? js.toString()
-			: Object.prototype.toString.call(js)
-	>
-! !
-
-!JSObjectProxy methodsFor: 'proxy'!
-
-addObjectVariablesTo: aDictionary
-	<
-		for(var i in self['@jsObject']) {
-			aDictionary._at_put_(i, self['@jsObject'][i]);
-		}
-	>
-!
-
-doesNotUnderstand: aMessage
-	^ (self lookupProperty: aMessage selector asJavaScriptSelector)
-		ifNil: [ super doesNotUnderstand: aMessage ]
-		ifNotNil: [ :jsSelector | 
-			self 
-				forwardMessage: jsSelector 
-				withArguments: aMessage arguments ]
-!
-
-forwardMessage: aString withArguments: anArray
-	<
-		return smalltalk.send(self._jsObject(), aString, anArray);
-	>
-!
-
-inspectOn: anInspector
-	| variables |
-	variables := Dictionary new.
-	variables at: '#self' put: self jsObject.
-	anInspector setLabel: self printString.
-	self addObjectVariablesTo: variables.
-	anInspector setVariables: variables
-! !
-
-!JSObjectProxy class methodsFor: 'instance creation'!
-
-on: aJSObject
-	^ self new
-		jsObject: aJSObject;
-		yourself
-! !
-
 Object subclass: #InspectorHandler
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!
@@ -499,6 +249,158 @@ evaluate: aBlock on: anErrorClass do: exceptionBlock
  			ifFalse: [ exception signal ] ]
 ! !
 
+ProtoObject subclass: #JSObjectProxy
+	instanceVariableNames: 'jsObject'
+	package: 'Kernel-Infrastructure'!
+!JSObjectProxy commentStamp!
+I handle sending messages to JavaScript objects, making  JavaScript object accessing from Amber fully transparent.
+My instances make intensive use of `#doesNotUnderstand:`.
+
+My instances are automatically created by Amber whenever a message is sent to a JavaScript object.
+
+## Usage examples
+
+JSObjectProxy objects are instanciated by Amber when a Smalltalk message is sent to a JavaScript object.
+
+	window alert: 'hello world'.
+	window inspect.
+	(window jQuery: 'body') append: 'hello world'
+
+Amber messages sends are converted to JavaScript function calls or object property access _(in this order)_. If n one of them match, a `MessageNotUnderstood` error will be thrown.
+
+## Message conversion rules
+
+- `someUser name` becomes `someUser.name`
+- `someUser name: 'John'` becomes `someUser name = "John"`
+- `console log: 'hello world'` becomes `console.log('hello world')`
+- `(window jQuery: 'foo') css: 'background' color: 'red'` becomes `window.jQuery('foo').css('background', 'red')`
+
+__Note:__ For keyword-based messages, only the first keyword is kept: `window foo: 1 bar: 2` is equivalent to `window foo: 1 baz: 2`.!
+
+!JSObjectProxy methodsFor: 'accessing'!
+
+at: aString
+	<return self['@jsObject'][aString]>
+!
+
+at: aString ifAbsent: aBlock
+	"return the aString property or evaluate aBlock if the property is not defined on the object"
+	<
+		var obj = self['@jsObject'];
+		return aString in obj ? obj[aString] : aBlock._value();
+	>
+!
+
+at: aString ifPresent: aBlock
+	"return the evaluation of aBlock with the value if the property is defined or return nil"
+	<
+		var obj = self['@jsObject'];
+		return aString in obj ? aBlock._value_(obj[aString]) : nil;
+	>
+!
+
+at: aString ifPresent: aBlock ifAbsent: anotherBlock
+	"return the evaluation of aBlock with the value if the property is defined
+	or return value of anotherBlock"
+	<
+		var obj = self['@jsObject'];
+		return aString in obj ? aBlock._value_(obj[aString]) : anotherBlock._value();
+	>
+!
+
+at: aString put: anObject
+	<return self['@jsObject'][aString] = anObject>
+!
+
+jsObject
+	^ jsObject
+!
+
+jsObject: aJSObject
+	jsObject := aJSObject
+!
+
+lookupProperty: aString
+	"Looks up a property in JS object.
+	Answer the property if it is present, or nil if it is not present."
+	
+	<return aString in self._jsObject() ? aString : nil>
+! !
+
+!JSObjectProxy methodsFor: 'enumerating'!
+
+asJSON
+	"Answers the receiver in a stringyfy-friendly fashion"
+
+	^ jsObject
+!
+
+keysAndValuesDo: aBlock
+	<
+		var o = self['@jsObject'];
+		for(var i in o) {
+			aBlock._value_value_(i, o[i]);
+		}
+	>
+! !
+
+!JSObjectProxy methodsFor: 'printing'!
+
+printOn: aStream
+	aStream nextPutAll: self printString
+!
+
+printString
+	<
+		var js = self['@jsObject'];
+		return js.toString
+			? js.toString()
+			: Object.prototype.toString.call(js)
+	>
+! !
+
+!JSObjectProxy methodsFor: 'proxy'!
+
+addObjectVariablesTo: aDictionary
+	<
+		for(var i in self['@jsObject']) {
+			aDictionary._at_put_(i, self['@jsObject'][i]);
+		}
+	>
+!
+
+doesNotUnderstand: aMessage
+	^ (self lookupProperty: aMessage selector asJavaScriptSelector)
+		ifNil: [ super doesNotUnderstand: aMessage ]
+		ifNotNil: [ :jsSelector | 
+			self 
+				forwardMessage: jsSelector 
+				withArguments: aMessage arguments ]
+!
+
+forwardMessage: aString withArguments: anArray
+	<
+		return smalltalk.send(self._jsObject(), aString, anArray);
+	>
+!
+
+inspectOn: anInspector
+	| variables |
+	variables := Dictionary new.
+	variables at: '#self' put: self jsObject.
+	anInspector setLabel: self printString.
+	self addObjectVariablesTo: variables.
+	anInspector setVariables: variables
+! !
+
+!JSObjectProxy class methodsFor: 'instance creation'!
+
+on: aJSObject
+	^ self new
+		jsObject: aJSObject;
+		yourself
+! !
+
 Object subclass: #Organizer
 	instanceVariableNames: ''
 	package: 'Kernel-Infrastructure'!

+ 106 - 74
st/Kernel-Objects.st

@@ -1,11 +1,114 @@
 Smalltalk current createPackage: 'Kernel-Objects'!
-nil subclass: #Object
+nil subclass: #ProtoObject
+	instanceVariableNames: ''
+	package: 'Kernel-Objects'!
+!ProtoObject commentStamp!
+I implement the basic behavior required for any object in Amber.
+
+In most cases, subclassing `ProtoObject` is wrong and `Object` should be used instead. However subclassing `ProtoObject` can be useful in some special cases like proxy implementations.!
+
+!ProtoObject methodsFor: 'accessing'!
+
+class
+	<return self.klass>
+!
+
+identityHash
+	<
+		var hash=self.identityHash;
+		if (hash) return hash;
+		hash=smalltalk.nextId();
+		Object.defineProperty(self, 'identityHash', {value:hash});
+		return hash;
+	>
+!
+
+instVarAt: aString
+	< return self['@'+aString] >
+!
+
+instVarAt: aString put: anObject
+	< self['@' + aString] = anObject >
+!
+
+yourself
+	^ self
+! !
+
+!ProtoObject methodsFor: 'converting'!
+
+asString
+	^ self printString
+! !
+
+!ProtoObject methodsFor: 'error handling'!
+
+doesNotUnderstand: aMessage
+	MessageNotUnderstood new
+		receiver: self;
+		message: aMessage;
+		signal
+! !
+
+!ProtoObject methodsFor: 'initialization'!
+
+initialize
+! !
+
+!ProtoObject methodsFor: 'inspecting'!
+
+inspect
+	InspectorHandler inspect: self
+!
+
+inspectOn: anInspector
+! !
+
+!ProtoObject methodsFor: 'message handling'!
+
+perform: aString
+	^ self perform: aString withArguments: #()
+!
+
+perform: aString withArguments: aCollection
+	<return smalltalk.send(self, aString._asSelector(), aCollection)>
+! !
+
+!ProtoObject methodsFor: 'printing'!
+
+printOn: aStream
+	aStream nextPutAll: (self class name first isVowel
+		ifTrue: [ 'an ' ]
+		ifFalse: [ 'a ' ]).
+	aStream nextPutAll: self class name
+!
+
+printString
+	^ String streamContents: [ :str | 
+		self printOn: str ]
+! !
+
+!ProtoObject class methodsFor: 'accessing'!
+
+heliosClass
+	"Should be an Helios extension. Unfortunately, since helios can browse remote
+	environments, we can't extend base classes"
+	
+	^ 'class'
+! !
+
+!ProtoObject class methodsFor: 'initialization'!
+
+initialize
+! !
+
+ProtoObject subclass: #Object
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 !Object commentStamp!
-**I am the root of the Smalltalk class system**. All classes in the system are subclasses of me.
+**I am the root of the Smalltalk class system**. With the exception of unual subclasses of `ProtoObject`, all other classes in the system are subclasses of me.
 
-I provide default behavior common to all normal objects, such as:
+I provide default behavior common to all normal objects (some of it inherited from `ProtoObject`), such as:
 
 - accessing
 - copying
@@ -53,38 +156,12 @@ basicDelete: aString
 	<delete self[aString]; return aString>
 !
 
-class
-	<return self.klass>
-!
-
-identityHash
-	<
-		var hash=self.identityHash;
-		if (hash) return hash;
-		hash=smalltalk.nextId();
-		Object.defineProperty(self, 'identityHash', {value:hash});
-		return hash;
-	>
-!
-
-instVarAt: aString
-	< return self['@'+aString] >
-!
-
-instVarAt: aString put: anObject
-	< self['@' + aString] = anObject >
-!
-
 size
 	self error: 'Object not indexable'
 !
 
 value
 	<return self.valueOf()>
-!
-
-yourself
-	^ self
 ! !
 
 !Object methodsFor: 'comparing'!
@@ -125,10 +202,6 @@ asJSONString
 
 asJavascript
 	^ self asString
-!
-
-asString
-	^ self printString
 ! !
 
 !Object methodsFor: 'copying'!
@@ -173,13 +246,6 @@ deprecatedAPI
 	console warn: thisContext home asString, ' is deprecated!! (in ', thisContext home home asString, ')'
 !
 
-doesNotUnderstand: aMessage
-	MessageNotUnderstood new
-		receiver: self;
-		message: aMessage;
-		signal
-!
-
 error: aString
 	Error signal: aString
 !
@@ -204,17 +270,8 @@ try: aBlock catch: anotherBlock
 	<try{return aBlock._value()} catch(e) {return anotherBlock._value_(e)}>
 ! !
 
-!Object methodsFor: 'initialization'!
-
-initialize
-! !
-
 !Object methodsFor: 'inspecting'!
 
-inspect
-	InspectorHandler inspect: self
-!
-
 inspectOn: anInspector
 	| variables |
 	variables := Dictionary new.
@@ -234,31 +291,6 @@ basicPerform: aString
 
 basicPerform: aString withArguments: aCollection
 	<return self[aString].apply(self, aCollection);>
-!
-
-perform: aString
-	^ self perform: aString withArguments: #()
-!
-
-perform: aString withArguments: aCollection
-	<return smalltalk.send(self, aString._asSelector(), aCollection)>
-! !
-
-!Object methodsFor: 'printing'!
-
-printOn: aStream
-	"Append to the aStream, a string representing the receiver."
-	
-	aStream nextPutAll: (self class name first isVowel
-		ifTrue: [ 'an ' ]
-		ifFalse: [ 'a ' ]).
-	aStream nextPutAll: self class name
-!
-
-printString
-	"Answer a String representation of the receiver."
-
-	^ String streamContents: [ :stream | self printOn: stream ]
 ! !
 
 !Object methodsFor: 'streaming'!

+ 9 - 0
st/Kernel-Tests.st

@@ -1224,6 +1224,15 @@ testAtIfPresentIfAbsent
 	self assert: (testObject at: 'f' ifPresent: [ :x|'hello ',x asString ] ifAbsent: [ 'not present' ]) equals: 'hello nil'.
 !
 
+testAtPut
+	| testObject |
+	testObject := self jsObject.
+	
+	self assert: (testObject at: 'abc') ~= 'xyz'.
+	self assert: (testObject at: 'abc' put: 'xyz') equals: 'xyz'.
+	self assert: (testObject at: 'abc') equals: 'xyz'
+!
+
 testDNU
 	self should: [ self jsObject foo ] raise: MessageNotUnderstood
 !

+ 1 - 1
support/amber.js

@@ -53,7 +53,7 @@ require = function (require) {
             'amber_inc': amber_home + '/support',
             'amber_core': amber_home + '/js',
             'amber_core/_source': amber_home + '/st',
-            'amber_html': amber_home,
+            'amber_helios/html': amber_home,
             'jquery': library_home + '/jquery/jquery.min',
             'jquery-ui': library_home + '/jquery-ui/ui/minified/jquery-ui.min',
 			'mousewheel': library_home + '/jquery-mousewheel/jquery.mousewheel'

+ 7 - 5
support/boot.js

@@ -97,8 +97,10 @@ function inherits(child, parent) {
 /* SmalltalkRoot is the hidden root of the Amber hierarchy.
  All objects including `Object` inherit from SmalltalkRoot */
 function SmalltalkRoot() {}
+function SmalltalkProtoObject() {}
+inherits(SmalltalkProtoObject, SmalltalkRoot);
 function SmalltalkObject() {}
-inherits(SmalltalkObject, SmalltalkRoot);
+inherits(SmalltalkObject, SmalltalkProtoObject);
 
 function Smalltalk() {}
 inherits(Smalltalk, SmalltalkObject);
@@ -119,7 +121,8 @@ function RootBrik(brikz, st) {
 	this.__init__ = function () {
 		st.addPackage("Kernel-Objects");
 		st.addPackage("Kernel-Infrastructure");
-		st.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, undefined, false);
+		st.wrapClassName("ProtoObject", "Kernel-Objects", SmalltalkProtoObject, undefined, false);
+		st.wrapClassName("Object", "Kernel-Objects", SmalltalkObject, st.ProtoObject, false);
 		st.wrapClassName("Smalltalk", "Kernel-Infrastructure", Smalltalk, st.Object, false);
 		st.wrapClassName("UndefinedObject", "Kernel-Objects", SmalltalkNil, st.Object, false);
 	};
@@ -326,8 +329,8 @@ function ClassesBrik(brikz, st) {
 		st.wrapClassName("Class", "Kernel-Classes", SmalltalkClass, st.Behavior, false);
 
 		// Manually bootstrap the metaclass hierarchy
-		st.Object.klass.superclass = rootAsClass.klass = st.Class;
-		addSubclass(st.Object.klass);
+		st.ProtoObject.klass.superclass = rootAsClass.klass = st.Class;
+		addSubclass(st.ProtoObject.klass);
 
 		st.wrapClassName("Package", "Kernel-Infrastructure", SmalltalkPackage, st.Object, false);
 	};
@@ -589,7 +592,6 @@ function MethodsBrik(brikz, st) {
 	};
 
 	function installNewDnuHandler(newHandler) {
-		manip.installMethodIfAbsent(newHandler, st.Object);
 		var wrappedClasses = st.wrappedClasses();
 		for(var i = 0; i < wrappedClasses.length; i++) {
 			manip.installMethodIfAbsent(newHandler, wrappedClasses[i]);

+ 1 - 1
support/helpers.js

@@ -1,7 +1,7 @@
 define("amber/helpers", ["amber_vm/smalltalk", "require"], function (smalltalk, require) {
     var exports = {
         popupHelios: function () {
-            window.open(require.toUrl('amber_html/helios.html'), "Helios", "menubar=no, status=no, scrollbars=no, menubar=no, width=1000, height=600");
+            window.open(require.toUrl('amber_helios/html/helios.html'), "Helios", "menubar=no, status=no, scrollbars=no, menubar=no, width=1000, height=600");
         }
     };
     Object.defineProperty(exports, "smalltalk", {