1
0
فهرست منبع

Merge pull request #391 from herby/gh-384

Fixes #384
Nicolas Petton 12 سال پیش
والد
کامیت
53fde412e1

+ 139 - 72
js/Importer-Exporter.deploy.js

@@ -7,16 +7,19 @@ selector: "nextChunk",
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 var char,result,chunk;
 var char,result,chunk;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
 var $early={};
 var $early={};
 try {
 try {
 result=_st("")._writeStream();
 result=_st("")._writeStream();
 _st((function(){
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
char=_st(self["@stream"])._next();
+return smalltalk.withContext(function($ctx2) {
+char=_st(self["@stream"])._next();
 char;
 char;
 return _st(char)._notNil();
 return _st(char)._notNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
-return smalltalk.withContext(function($ctx2) {
$1=_st(char).__eq("!");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(char).__eq("!");
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 $2=_st(_st(self["@stream"])._peek()).__eq("!");
 $2=_st(_st(self["@stream"])._peek()).__eq("!");
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
@@ -41,7 +44,8 @@ smalltalk.method({
 selector: "stream:",
 selector: "stream:",
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@stream"]=aStream;
+return smalltalk.withContext(function($ctx1) { 
+self["@stream"]=aStream;
 return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})},
 return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})},
 messageSends: []}),
 messageSends: []}),
 smalltalk.ChunkParser);
 smalltalk.ChunkParser);
@@ -53,7 +57,8 @@ smalltalk.method({
 selector: "on:",
 selector: "on:",
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._stream_(aStream);
 $1=_st(_st(self)._new())._stream_(aStream);
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})},
 }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})},
@@ -68,7 +73,8 @@ smalltalk.method({
 selector: "classNameFor:",
 selector: "classNameFor:",
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(aClass)._isMetaclass();
 $2=_st(aClass)._isMetaclass();
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
@@ -91,10 +97,13 @@ smalltalk.method({
 selector: "exportAll",
 selector: "exportAll",
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages())._do_((function(pkg){
-return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportPackage_(_st(pkg)._name()));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages())._do_((function(pkg){
+return smalltalk.withContext(function($ctx3) {
+return _st(stream)._nextPutAll_(_st(self)._exportPackage_(_st(pkg)._name()));
 }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 return $1;
 return $1;
@@ -108,9 +117,11 @@ smalltalk.method({
 selector: "exportClass:",
 selector: "exportClass:",
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
_st(self)._exportDefinitionOf_on_(aClass,stream);
+return smalltalk.withContext(function($ctx2) {
+_st(self)._exportDefinitionOf_on_(aClass,stream);
 _st(self)._exportMethodsOf_on_(aClass,stream);
 _st(self)._exportMethodsOf_on_(aClass,stream);
 _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
 _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
 return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
 return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
@@ -126,16 +137,19 @@ smalltalk.method({
 selector: "exportDefinitionOf:on:",
 selector: "exportDefinitionOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5,$6,$7;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5,$6,$7;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 $2=_st($1)._nextPutAll_(", [");
 $2=_st($1)._nextPutAll_(", [");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(", ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("], '");
 _st($3)._nextPutAll_("], '");
@@ -162,7 +176,8 @@ smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 selector: "exportMetaDefinitionOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 $2=aStream;
 $2=aStream;
@@ -170,9 +185,11 @@ _st($2)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aCla
 $3=_st($2)._nextPutAll_(".iVarNames = [");
 $3=_st($2)._nextPutAll_(".iVarNames = [");
 $3;
 $3;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(",");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(",");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
 _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
 };
 };
@@ -186,7 +203,8 @@ smalltalk.method({
 selector: "exportMethod:of:on:",
 selector: "exportMethod:of:on:",
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
 _st($1)._lf();
@@ -225,11 +243,14 @@ smalltalk.method({
 selector: "exportMethodsOf:on:",
 selector: "exportMethodsOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
 _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
$1=_st(_st(each)._category())._match_("^\x5c*");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(_st(each)._category())._match_("^\x5c*");
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 };
 };
@@ -246,13 +267,16 @@ selector: "exportPackage:",
 fn: function (packageName){
 fn: function (packageName){
 var self=this;
 var self=this;
 var package_;
 var package_;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
package_=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(packageName);
+return smalltalk.withContext(function($ctx2) {
+package_=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(packageName);
 package_;
 package_;
 _st(self)._exportPackageDefinitionOf_on_(package_,stream);
 _st(self)._exportPackageDefinitionOf_on_(package_,stream);
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
-return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportClass_(each));
+return smalltalk.withContext(function($ctx3) {
+return _st(stream)._nextPutAll_(_st(self)._exportClass_(each));
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
 return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
 return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
@@ -267,13 +291,14 @@ smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 selector: "exportPackageDefinitionOf:on:",
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addPackage(");
 _st($1)._nextPutAll_("smalltalk.addPackage(");
-$2=_st($1)._nextPutAll_(_st(_st(_st(_st("'").__comma(_st(package_)._name())).__comma("', ")).__comma(_st(package_)._propertiesAsJSON())).__comma(");"));
-_st(aStream)._lf();
+_st($1)._nextPutAll_(_st(_st("'").__comma(_st(package_)._name())).__comma("');"));
+$2=_st($1)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})},
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})},
-messageSends: ["nextPutAll:", ",", "propertiesAsJSON", "name", "lf"]}),
+messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.Exporter);
 smalltalk.Exporter);
 
 
 smalltalk.addMethod(
 smalltalk.addMethod(
@@ -283,14 +308,19 @@ selector: "exportPackageExtensionsOf:on:",
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
 var name;
 var name;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 name=_st(package_)._name();
 name=_st(package_)._name();
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st([each,_st(each)._class()])._do_((function(aClass){
-return smalltalk.withContext(function($ctx3) {
return _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st([each,_st(each)._class()])._do_((function(aClass){
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(method){
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(method){
-return smalltalk.withContext(function($ctx4) {
$1=_st(_st(method)._category())._match_(_st("^\x5c*").__comma(name));
+return smalltalk.withContext(function($ctx4) {
+$1=_st(_st(method)._category())._match_(_st("^\x5c*").__comma(name));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(self)._exportMethod_of_on_(method,aClass,aStream);
 return _st(self)._exportMethod_of_on_(method,aClass,aStream);
 };
 };
@@ -310,7 +340,8 @@ smalltalk.method({
 selector: "chunkEscape:",
 selector: "chunkEscape:",
 fn: function (aString){
 fn: function (aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
 $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})},
 }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})},
@@ -323,7 +354,8 @@ smalltalk.method({
 selector: "classNameFor:",
 selector: "classNameFor:",
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(aClass)._isMetaclass();
 $2=_st(aClass)._isMetaclass();
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
@@ -346,16 +378,19 @@ smalltalk.method({
 selector: "exportDefinitionOf:on:",
 selector: "exportDefinitionOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5,$6,$7;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5,$6,$7;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._lf();
 _st($1)._lf();
 $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
 $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(" ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("'");
 _st($3)._nextPutAll_("'");
@@ -382,7 +417,8 @@ smalltalk.method({
 selector: "exportMetaDefinitionOf:on:",
 selector: "exportMetaDefinitionOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5;
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 $2=aStream;
 $2=aStream;
@@ -390,9 +426,11 @@ _st($2)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._class()));
 $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
 $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
 $3;
 $3;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(" ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $4=aStream;
 $4=aStream;
 _st($4)._nextPutAll_("'!");
 _st($4)._nextPutAll_("'!");
@@ -410,7 +448,8 @@ smalltalk.method({
 selector: "exportMethod:of:on:",
 selector: "exportMethod:of:on:",
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._lf();
 _st($1)._lf();
 _st($1)._lf();
 _st($1)._lf();
@@ -427,14 +466,17 @@ smalltalk.method({
 selector: "exportMethods:category:of:on:",
 selector: "exportMethods:category:of:on:",
 fn: function (methods,category,aClass,aStream){
 fn: function (methods,category,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
 $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
 $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
 _st(_st(methods)._sorted_((function(a,b){
 _st(_st(methods)._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._exportMethod_of_on_(each,aClass,aStream);
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_(" !");
 _st($3)._nextPutAll_(" !");
@@ -451,19 +493,23 @@ selector: "exportMethodsOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
 var map;
 var map;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 map=_st((smalltalk.Dictionary || Dictionary))._new();
 map=_st((smalltalk.Dictionary || Dictionary))._new();
 _st(aClass)._protocolsDo_((function(category,methods){
 _st(aClass)._protocolsDo_((function(category,methods){
-return smalltalk.withContext(function($ctx2) {
$1=_st(category)._match_("^\x5c*");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(category)._match_("^\x5c*");
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 return _st(map)._at_put_(category,methods);
 return _st(map)._at_put_(category,methods);
 };
 };
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 _st(_st(_st(map)._keys())._sorted_((function(a,b){
 _st(_st(_st(map)._keys())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(a).__lt_eq(b);
+return smalltalk.withContext(function($ctx2) {
+return _st(a).__lt_eq(b);
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 var methods;
 var methods;
-return smalltalk.withContext(function($ctx2) {
methods=_st(map)._at_(category);
+return smalltalk.withContext(function($ctx2) {
+methods=_st(map)._at_(category);
 methods;
 methods;
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
@@ -477,12 +523,13 @@ smalltalk.method({
 selector: "exportPackageDefinitionOf:on:",
 selector: "exportPackageDefinitionOf:on:",
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
-_st($1)._nextPutAll_(_st(_st(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("' properties: ")).__comma(_st(_st(package_)._properties())._storeString())).__comma("!"));
+_st($1)._nextPutAll_(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("'!"));
 $2=_st($1)._lf();
 $2=_st($1)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})},
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})},
-messageSends: ["nextPutAll:", ",", "storeString", "properties", "name", "lf"]}),
+messageSends: ["nextPutAll:", ",", "name", "lf"]}),
 smalltalk.ChunkExporter);
 smalltalk.ChunkExporter);
 
 
 smalltalk.addMethod(
 smalltalk.addMethod(
@@ -492,23 +539,29 @@ selector: "exportPackageExtensionsOf:on:",
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
 var name,map;
 var name,map;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 name=_st(package_)._name();
 name=_st(package_)._name();
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st([each,_st(each)._class()])._do_((function(aClass){
-return smalltalk.withContext(function($ctx3) {
map=_st((smalltalk.Dictionary || Dictionary))._new();
+return smalltalk.withContext(function($ctx2) {
+return _st([each,_st(each)._class()])._do_((function(aClass){
+return smalltalk.withContext(function($ctx3) {
+map=_st((smalltalk.Dictionary || Dictionary))._new();
 map;
 map;
 _st(aClass)._protocolsDo_((function(category,methods){
 _st(aClass)._protocolsDo_((function(category,methods){
-return smalltalk.withContext(function($ctx4) {
$1=_st(category)._match_(_st("^\x5c*").__comma(name));
+return smalltalk.withContext(function($ctx4) {
+$1=_st(category)._match_(_st("^\x5c*").__comma(name));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(map)._at_put_(category,methods);
 return _st(map)._at_put_(category,methods);
 };
 };
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 return _st(_st(_st(map)._keys())._sorted_((function(a,b){
 return _st(_st(_st(map)._keys())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx4) {
return _st(a).__lt_eq(b);
+return smalltalk.withContext(function($ctx4) {
+return _st(a).__lt_eq(b);
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 var methods;
 var methods;
-return smalltalk.withContext(function($ctx4) {
methods=_st(map)._at_(category);
+return smalltalk.withContext(function($ctx4) {
+methods=_st(map)._at_(category);
 methods;
 methods;
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
@@ -527,16 +580,19 @@ smalltalk.method({
 selector: "exportDefinitionOf:on:",
 selector: "exportDefinitionOf:on:",
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 $2=_st($1)._nextPutAll_(", [");
 $2=_st($1)._nextPutAll_(", [");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(", ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("], '");
 _st($3)._nextPutAll_("], '");
@@ -553,7 +609,8 @@ smalltalk.method({
 selector: "exportMethod:of:on:",
 selector: "exportMethod:of:on:",
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
 _st($1)._lf();
@@ -586,15 +643,18 @@ selector: "import:",
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
 var chunk,result,parser,lastEmpty;
 var chunk,result,parser,lastEmpty;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
 parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
 lastEmpty=false;
 lastEmpty=false;
 _st((function(){
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
chunk=_st(parser)._nextChunk();
+return smalltalk.withContext(function($ctx2) {
+chunk=_st(parser)._nextChunk();
 chunk;
 chunk;
 return _st(chunk)._isNil();
 return _st(chunk)._isNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
$1=_st(chunk)._isEmpty();
+return smalltalk.withContext(function($ctx2) {
+$1=_st(chunk)._isEmpty();
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 lastEmpty=true;
 lastEmpty=true;
 return lastEmpty;
 return lastEmpty;
@@ -622,7 +682,8 @@ smalltalk.method({
 selector: "initializePackageNamed:prefix:",
 selector: "initializePackageNamed:prefix:",
 fn: function (packageName,aString){
 fn: function (packageName,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=_st((smalltalk.Package || Package))._named_(packageName);
 $1=_st((smalltalk.Package || Package))._named_(packageName);
 _st($1)._setupClasses();
 _st($1)._setupClasses();
 _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
 _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
@@ -638,15 +699,18 @@ selector: "loadPackage:prefix:",
 fn: function (packageName,aString){
 fn: function (packageName,aString){
 var self=this;
 var self=this;
 var url;
 var url;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
 url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
 _st(jQuery)._ajax_options_(url,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("GET"),_st("dataType").__minus_gt("script"),_st("complete").__minus_gt((function(jqXHR,textStatus){
 _st(jQuery)._ajax_options_(url,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("GET"),_st("dataType").__minus_gt("script"),_st("complete").__minus_gt((function(jqXHR,textStatus){
-return smalltalk.withContext(function($ctx2) {
$1=_st(_st(jqXHR)._readyState()).__eq((4));
+return smalltalk.withContext(function($ctx2) {
+$1=_st(_st(jqXHR)._readyState()).__eq((4));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(self)._initializePackageNamed_prefix_(packageName,aString);
 return _st(self)._initializePackageNamed_prefix_(packageName,aString);
 };
 };
 }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),_st("error").__minus_gt((function(){
 }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),_st("error").__minus_gt((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(window)._alert_(_st("Could not load package at:  ").__comma(url));
+return smalltalk.withContext(function($ctx2) {
+return _st(window)._alert_(_st("Could not load package at:  ").__comma(url));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})},
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})},
 messageSends: [",", "ajax:options:", "->", "ifTrue:", "initializePackageNamed:prefix:", "=", "readyState", "alert:"]}),
 messageSends: [",", "ajax:options:", "->", "ifTrue:", "initializePackageNamed:prefix:", "=", "readyState", "alert:"]}),
@@ -658,8 +722,10 @@ smalltalk.method({
 selector: "loadPackages:prefix:",
 selector: "loadPackages:prefix:",
 fn: function (aCollection,aString){
 fn: function (aCollection,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aCollection)._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._loadPackage_prefix_(each,aString);
+return smalltalk.withContext(function($ctx1) { 
+_st(aCollection)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._loadPackage_prefix_(each,aString);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})},
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})},
 messageSends: ["do:", "loadPackage:prefix:"]}),
 messageSends: ["do:", "loadPackage:prefix:"]}),
@@ -672,7 +738,8 @@ smalltalk.method({
 selector: "loadPackages:prefix:",
 selector: "loadPackages:prefix:",
 fn: function (aCollection,aString){
 fn: function (aCollection,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
 $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})},
 }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})},

+ 141 - 74
js/Importer-Exporter.js

@@ -8,16 +8,19 @@ category: 'reading',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
 var char,result,chunk;
 var char,result,chunk;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
 var $early={};
 var $early={};
 try {
 try {
 result=_st("")._writeStream();
 result=_st("")._writeStream();
 _st((function(){
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
char=_st(self["@stream"])._next();
+return smalltalk.withContext(function($ctx2) {
+char=_st(self["@stream"])._next();
 char;
 char;
 return _st(char)._notNil();
 return _st(char)._notNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileTrue_((function(){
-return smalltalk.withContext(function($ctx2) {
$1=_st(char).__eq("!");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(char).__eq("!");
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 $2=_st(_st(self["@stream"])._peek()).__eq("!");
 $2=_st(_st(self["@stream"])._peek()).__eq("!");
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
@@ -47,7 +50,8 @@ selector: "stream:",
 category: 'accessing',
 category: 'accessing',
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
self["@stream"]=aStream;
+return smalltalk.withContext(function($ctx1) { 
+self["@stream"]=aStream;
 return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})},
 return self}, function($ctx1) {$ctx1.fill(self,"stream:",{aStream:aStream}, smalltalk.ChunkParser)})},
 args: ["aStream"],
 args: ["aStream"],
 source: "stream: aStream\x0a\x09stream := aStream",
 source: "stream: aStream\x0a\x09stream := aStream",
@@ -64,7 +68,8 @@ selector: "on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._stream_(aStream);
 $1=_st(_st(self)._new())._stream_(aStream);
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})},
 }, function($ctx1) {$ctx1.fill(self,"on:",{aStream:aStream}, smalltalk.ChunkParser.klass)})},
@@ -84,7 +89,8 @@ selector: "classNameFor:",
 category: 'private',
 category: 'private',
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(aClass)._isMetaclass();
 $2=_st(aClass)._isMetaclass();
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(".klass");
@@ -112,10 +118,13 @@ selector: "exportAll",
 category: 'fileOut',
 category: 'fileOut',
 fn: function (){
 fn: function (){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages())._do_((function(pkg){
-return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportPackage_(_st(pkg)._name()));
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packages())._do_((function(pkg){
+return smalltalk.withContext(function($ctx3) {
+return _st(stream)._nextPutAll_(_st(self)._exportPackage_(_st(pkg)._name()));
 }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({pkg:pkg},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 return $1;
 return $1;
@@ -134,9 +143,11 @@ selector: "exportClass:",
 category: 'fileOut',
 category: 'fileOut',
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
_st(self)._exportDefinitionOf_on_(aClass,stream);
+return smalltalk.withContext(function($ctx2) {
+_st(self)._exportDefinitionOf_on_(aClass,stream);
 _st(self)._exportMethodsOf_on_(aClass,stream);
 _st(self)._exportMethodsOf_on_(aClass,stream);
 _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
 _st(self)._exportMetaDefinitionOf_on_(aClass,stream);
 return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
 return _st(self)._exportMethodsOf_on_(_st(aClass)._class(),stream);
@@ -157,16 +168,19 @@ selector: "exportDefinitionOf:on:",
 category: 'private',
 category: 'private',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5,$6,$7;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5,$6,$7;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 $2=_st($1)._nextPutAll_(", [");
 $2=_st($1)._nextPutAll_(", [");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(", ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("], '");
 _st($3)._nextPutAll_("], '");
@@ -198,7 +212,8 @@ selector: "exportMetaDefinitionOf:on:",
 category: 'private',
 category: 'private',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3;
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 $2=aStream;
 $2=aStream;
@@ -206,9 +221,11 @@ _st($2)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aCla
 $3=_st($2)._nextPutAll_(".iVarNames = [");
 $3=_st($2)._nextPutAll_(".iVarNames = [");
 $3;
 $3;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(",");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(",");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
 _st(aStream)._nextPutAll_(_st("];").__comma(_st((smalltalk.String || String))._lf()));
 };
 };
@@ -227,7 +244,8 @@ selector: "exportMethod:of:on:",
 category: 'private',
 category: 'private',
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
 _st($1)._lf();
@@ -271,11 +289,14 @@ selector: "exportMethodsOf:on:",
 category: 'private',
 category: 'private',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
 _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
$1=_st(_st(each)._category())._match_("^\x5c*");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(_st(each)._category())._match_("^\x5c*");
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 };
 };
@@ -297,13 +318,16 @@ category: 'fileOut',
 fn: function (packageName){
 fn: function (packageName){
 var self=this;
 var self=this;
 var package_;
 var package_;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
 $1=_st((smalltalk.String || String))._streamContents_((function(stream){
-return smalltalk.withContext(function($ctx2) {
package_=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(packageName);
+return smalltalk.withContext(function($ctx2) {
+package_=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._packageAt_(packageName);
 package_;
 package_;
 _st(self)._exportPackageDefinitionOf_on_(package_,stream);
 _st(self)._exportPackageDefinitionOf_on_(package_,stream);
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
 _st(_st(_st(package_)._sortedClasses())._asSet())._do_((function(each){
-return smalltalk.withContext(function($ctx3) {
return _st(stream)._nextPutAll_(_st(self)._exportClass_(each));
+return smalltalk.withContext(function($ctx3) {
+return _st(stream)._nextPutAll_(_st(self)._exportClass_(each));
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
 }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
 return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
 return _st(self)._exportPackageExtensionsOf_on_(package_,stream);
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})}));
@@ -323,15 +347,16 @@ selector: "exportPackageDefinitionOf:on:",
 category: 'private',
 category: 'private',
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addPackage(");
 _st($1)._nextPutAll_("smalltalk.addPackage(");
-$2=_st($1)._nextPutAll_(_st(_st(_st(_st("'").__comma(_st(package_)._name())).__comma("', ")).__comma(_st(package_)._propertiesAsJSON())).__comma(");"));
-_st(aStream)._lf();
+_st($1)._nextPutAll_(_st(_st("'").__comma(_st(package_)._name())).__comma("');"));
+$2=_st($1)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})},
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.Exporter)})},
 args: ["package", "aStream"],
 args: ["package", "aStream"],
-source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09    nextPutAll: 'smalltalk.addPackage(';\x0a\x09    nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.\x0a\x09aStream lf",
-messageSends: ["nextPutAll:", ",", "propertiesAsJSON", "name", "lf"],
+source: "exportPackageDefinitionOf: package on: aStream\x0a\x09aStream \x0a\x09    nextPutAll: 'smalltalk.addPackage(';\x0a\x09    nextPutAll: '''', package name, ''');';\x0a        lf",
+messageSends: ["nextPutAll:", ",", "name", "lf"],
 referencedClasses: []
 referencedClasses: []
 }),
 }),
 smalltalk.Exporter);
 smalltalk.Exporter);
@@ -344,14 +369,19 @@ category: 'private',
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
 var name;
 var name;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 name=_st(package_)._name();
 name=_st(package_)._name();
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st([each,_st(each)._class()])._do_((function(aClass){
-return smalltalk.withContext(function($ctx3) {
return _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx4) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st([each,_st(each)._class()])._do_((function(aClass){
+return smalltalk.withContext(function($ctx3) {
+return _st(_st(_st(_st(aClass)._methodDictionary())._values())._sorted_((function(a,b){
+return smalltalk.withContext(function($ctx4) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(method){
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(method){
-return smalltalk.withContext(function($ctx4) {
$1=_st(_st(method)._category())._match_(_st("^\x5c*").__comma(name));
+return smalltalk.withContext(function($ctx4) {
+$1=_st(_st(method)._category())._match_(_st("^\x5c*").__comma(name));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(self)._exportMethod_of_on_(method,aClass,aStream);
 return _st(self)._exportMethod_of_on_(method,aClass,aStream);
 };
 };
@@ -376,7 +406,8 @@ selector: "chunkEscape:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aString){
 fn: function (aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
 $1=_st(_st(aString)._replace_with_("!","!!"))._trimBoth();
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})},
 }, function($ctx1) {$ctx1.fill(self,"chunkEscape:",{aString:aString}, smalltalk.ChunkExporter)})},
@@ -394,7 +425,8 @@ selector: "classNameFor:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aClass){
 fn: function (aClass){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $2,$3,$1;
+return smalltalk.withContext(function($ctx1) { 
+var $2,$3,$1;
 $2=_st(aClass)._isMetaclass();
 $2=_st(aClass)._isMetaclass();
 if(smalltalk.assert($2)){
 if(smalltalk.assert($2)){
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
 $1=_st(_st(_st(aClass)._instanceClass())._name()).__comma(" class");
@@ -422,16 +454,19 @@ selector: "exportDefinitionOf:on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5,$6,$7;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5,$6,$7;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._superclass()));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._nextPutAll_(_st(" subclass: #").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._lf();
 _st($1)._lf();
 $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
 $2=_st($1)._nextPutAll_("\x09instanceVariableNames: '");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(" ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("'");
 _st($3)._nextPutAll_("'");
@@ -463,7 +498,8 @@ selector: "exportMetaDefinitionOf:on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4,$5;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4,$5;
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 $1=_st(_st(_st(aClass)._class())._instanceVariableNames())._isEmpty();
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 $2=aStream;
 $2=aStream;
@@ -471,9 +507,11 @@ _st($2)._nextPutAll_(_st(self)._classNameFor_(_st(aClass)._class()));
 $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
 $3=_st($2)._nextPutAll_(" instanceVariableNames: '");
 $3;
 $3;
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(_st(aClass)._class())._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(each);
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(each);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(" ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(" ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $4=aStream;
 $4=aStream;
 _st($4)._nextPutAll_("'!");
 _st($4)._nextPutAll_("'!");
@@ -496,7 +534,8 @@ selector: "exportMethod:of:on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._lf();
 _st($1)._lf();
 _st($1)._lf();
 _st($1)._lf();
@@ -518,14 +557,17 @@ selector: "exportMethods:category:of:on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (methods,category,aClass,aStream){
 fn: function (methods,category,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
 _st($1)._nextPutAll_(_st("!").__comma(_st(self)._classNameFor_(aClass)));
 $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
 $2=_st($1)._nextPutAll_(_st(_st(" methodsFor: '").__comma(category)).__comma("'!"));
 _st(_st(methods)._sorted_((function(a,b){
 _st(_st(methods)._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
+return smalltalk.withContext(function($ctx2) {
+return _st(_st(a)._selector()).__lt_eq(_st(b)._selector());
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._exportMethod_of_on_(each,aClass,aStream);
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._exportMethod_of_on_(each,aClass,aStream);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_(" !");
 _st($3)._nextPutAll_(" !");
@@ -547,19 +589,23 @@ category: 'not yet classified',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
 var map;
 var map;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 map=_st((smalltalk.Dictionary || Dictionary))._new();
 map=_st((smalltalk.Dictionary || Dictionary))._new();
 _st(aClass)._protocolsDo_((function(category,methods){
 _st(aClass)._protocolsDo_((function(category,methods){
-return smalltalk.withContext(function($ctx2) {
$1=_st(category)._match_("^\x5c*");
+return smalltalk.withContext(function($ctx2) {
+$1=_st(category)._match_("^\x5c*");
 if(! smalltalk.assert($1)){
 if(! smalltalk.assert($1)){
 return _st(map)._at_put_(category,methods);
 return _st(map)._at_put_(category,methods);
 };
 };
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 _st(_st(_st(map)._keys())._sorted_((function(a,b){
 _st(_st(_st(map)._keys())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx2) {
return _st(a).__lt_eq(b);
+return smalltalk.withContext(function($ctx2) {
+return _st(a).__lt_eq(b);
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 var methods;
 var methods;
-return smalltalk.withContext(function($ctx2) {
methods=_st(map)._at_(category);
+return smalltalk.withContext(function($ctx2) {
+methods=_st(map)._at_(category);
 methods;
 methods;
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({category:category,methods:methods},$ctx1)})}));
@@ -578,14 +624,15 @@ selector: "exportPackageDefinitionOf:on:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
-_st($1)._nextPutAll_(_st(_st(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("' properties: ")).__comma(_st(_st(package_)._properties())._storeString())).__comma("!"));
+_st($1)._nextPutAll_(_st(_st("Smalltalk current createPackage: '").__comma(_st(package_)._name())).__comma("'!"));
 $2=_st($1)._lf();
 $2=_st($1)._lf();
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})},
 return self}, function($ctx1) {$ctx1.fill(self,"exportPackageDefinitionOf:on:",{package_:package_,aStream:aStream}, smalltalk.ChunkExporter)})},
 args: ["package", "aStream"],
 args: ["package", "aStream"],
-source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09    nextPutAll: 'Smalltalk current createPackage: ''', package name,\x0a\x09\x09''' properties: ', package properties storeString, '!'; lf.",
-messageSends: ["nextPutAll:", ",", "storeString", "properties", "name", "lf"],
+source: "exportPackageDefinitionOf: package on: aStream\x0a\x09\x22Chunk format.\x22\x0a\x0a\x09aStream \x0a\x09\x09nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!';\x0a\x09\x09lf",
+messageSends: ["nextPutAll:", ",", "name", "lf"],
 referencedClasses: []
 referencedClasses: []
 }),
 }),
 smalltalk.ChunkExporter);
 smalltalk.ChunkExporter);
@@ -598,23 +645,29 @@ category: 'not yet classified',
 fn: function (package_,aStream){
 fn: function (package_,aStream){
 var self=this;
 var self=this;
 var name,map;
 var name,map;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 name=_st(package_)._name();
 name=_st(package_)._name();
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
 _st(_st((smalltalk.Package || Package))._sortedClasses_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()))._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st([each,_st(each)._class()])._do_((function(aClass){
-return smalltalk.withContext(function($ctx3) {
map=_st((smalltalk.Dictionary || Dictionary))._new();
+return smalltalk.withContext(function($ctx2) {
+return _st([each,_st(each)._class()])._do_((function(aClass){
+return smalltalk.withContext(function($ctx3) {
+map=_st((smalltalk.Dictionary || Dictionary))._new();
 map;
 map;
 _st(aClass)._protocolsDo_((function(category,methods){
 _st(aClass)._protocolsDo_((function(category,methods){
-return smalltalk.withContext(function($ctx4) {
$1=_st(category)._match_(_st("^\x5c*").__comma(name));
+return smalltalk.withContext(function($ctx4) {
+$1=_st(category)._match_(_st("^\x5c*").__comma(name));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(map)._at_put_(category,methods);
 return _st(map)._at_put_(category,methods);
 };
 };
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 return _st(_st(_st(map)._keys())._sorted_((function(a,b){
 return _st(_st(_st(map)._keys())._sorted_((function(a,b){
-return smalltalk.withContext(function($ctx4) {
return _st(a).__lt_eq(b);
+return smalltalk.withContext(function($ctx4) {
+return _st(a).__lt_eq(b);
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(category){
 var methods;
 var methods;
-return smalltalk.withContext(function($ctx4) {
methods=_st(map)._at_(category);
+return smalltalk.withContext(function($ctx4) {
+methods=_st(map)._at_(category);
 methods;
 methods;
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 return _st(self)._exportMethods_category_of_on_(methods,category,aClass,aStream);
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
 }, function($ctx4) {$ctx4.fillBlock({category:category,methods:methods},$ctx1)})}));
@@ -638,16 +691,19 @@ selector: "exportDefinitionOf:on:",
 category: 'private',
 category: 'private',
 fn: function (aClass,aStream){
 fn: function (aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2,$3,$4;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2,$3,$4;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_("smalltalk.addClass(");
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st(_st("'").__comma(_st(self)._classNameFor_(aClass))).__comma("', "));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 _st($1)._nextPutAll_(_st("smalltalk.").__comma(_st(self)._classNameFor_(_st(aClass)._superclass())));
 $2=_st($1)._nextPutAll_(", [");
 $2=_st($1)._nextPutAll_(", [");
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
 _st(_st(aClass)._instanceVariableNames())._do_separatedBy_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(_st(_st("'").__comma(each)).__comma("'"));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}),(function(){
-return smalltalk.withContext(function($ctx2) {
return _st(aStream)._nextPutAll_(", ");
+return smalltalk.withContext(function($ctx2) {
+return _st(aStream)._nextPutAll_(", ");
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
 $3=aStream;
 $3=aStream;
 _st($3)._nextPutAll_("], '");
 _st($3)._nextPutAll_("], '");
@@ -669,7 +725,8 @@ selector: "exportMethod:of:on:",
 category: 'private',
 category: 'private',
 fn: function (aMethod,aClass,aStream){
 fn: function (aMethod,aClass,aStream){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=aStream;
 $1=aStream;
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._nextPutAll_("smalltalk.addMethod(");
 _st($1)._lf();
 _st($1)._lf();
@@ -707,15 +764,18 @@ category: 'fileIn',
 fn: function (aStream){
 fn: function (aStream){
 var self=this;
 var self=this;
 var chunk,result,parser,lastEmpty;
 var chunk,result,parser,lastEmpty;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
 parser=_st((smalltalk.ChunkParser || ChunkParser))._on_(aStream);
 lastEmpty=false;
 lastEmpty=false;
 _st((function(){
 _st((function(){
-return smalltalk.withContext(function($ctx2) {
chunk=_st(parser)._nextChunk();
+return smalltalk.withContext(function($ctx2) {
+chunk=_st(parser)._nextChunk();
 chunk;
 chunk;
 return _st(chunk)._isNil();
 return _st(chunk)._isNil();
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._whileFalse_((function(){
-return smalltalk.withContext(function($ctx2) {
$1=_st(chunk)._isEmpty();
+return smalltalk.withContext(function($ctx2) {
+$1=_st(chunk)._isEmpty();
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 lastEmpty=true;
 lastEmpty=true;
 return lastEmpty;
 return lastEmpty;
@@ -748,7 +808,8 @@ selector: "initializePackageNamed:prefix:",
 category: 'laoding',
 category: 'laoding',
 fn: function (packageName,aString){
 fn: function (packageName,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1,$2;
+return smalltalk.withContext(function($ctx1) { 
+var $1,$2;
 $1=_st((smalltalk.Package || Package))._named_(packageName);
 $1=_st((smalltalk.Package || Package))._named_(packageName);
 _st($1)._setupClasses();
 _st($1)._setupClasses();
 _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
 _st($1)._commitPathJs_(_st(_st("/").__comma(aString)).__comma("/js"));
@@ -769,15 +830,18 @@ category: 'laoding',
 fn: function (packageName,aString){
 fn: function (packageName,aString){
 var self=this;
 var self=this;
 var url;
 var url;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
 url=_st(_st(_st(_st("/").__comma(aString)).__comma("/js/")).__comma(packageName)).__comma(".js");
 _st(jQuery)._ajax_options_(url,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("GET"),_st("dataType").__minus_gt("script"),_st("complete").__minus_gt((function(jqXHR,textStatus){
 _st(jQuery)._ajax_options_(url,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("GET"),_st("dataType").__minus_gt("script"),_st("complete").__minus_gt((function(jqXHR,textStatus){
-return smalltalk.withContext(function($ctx2) {
$1=_st(_st(jqXHR)._readyState()).__eq((4));
+return smalltalk.withContext(function($ctx2) {
+$1=_st(_st(jqXHR)._readyState()).__eq((4));
 if(smalltalk.assert($1)){
 if(smalltalk.assert($1)){
 return _st(self)._initializePackageNamed_prefix_(packageName,aString);
 return _st(self)._initializePackageNamed_prefix_(packageName,aString);
 };
 };
 }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),_st("error").__minus_gt((function(){
 }, function($ctx2) {$ctx2.fillBlock({jqXHR:jqXHR,textStatus:textStatus},$ctx1)})})),_st("error").__minus_gt((function(){
-return smalltalk.withContext(function($ctx2) {
return _st(window)._alert_(_st("Could not load package at:  ").__comma(url));
+return smalltalk.withContext(function($ctx2) {
+return _st(window)._alert_(_st("Could not load package at:  ").__comma(url));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
 }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))]));
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})},
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackage:prefix:",{packageName:packageName,aString:aString,url:url}, smalltalk.PackageLoader)})},
 args: ["packageName", "aString"],
 args: ["packageName", "aString"],
@@ -794,8 +858,10 @@ selector: "loadPackages:prefix:",
 category: 'laoding',
 category: 'laoding',
 fn: function (aCollection,aString){
 fn: function (aCollection,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
_st(aCollection)._do_((function(each){
-return smalltalk.withContext(function($ctx2) {
return _st(self)._loadPackage_prefix_(each,aString);
+return smalltalk.withContext(function($ctx1) { 
+_st(aCollection)._do_((function(each){
+return smalltalk.withContext(function($ctx2) {
+return _st(self)._loadPackage_prefix_(each,aString);
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})},
 return self}, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader)})},
 args: ["aCollection", "aString"],
 args: ["aCollection", "aString"],
@@ -813,7 +879,8 @@ selector: "loadPackages:prefix:",
 category: 'not yet classified',
 category: 'not yet classified',
 fn: function (aCollection,aString){
 fn: function (aCollection,aString){
 var self=this;
 var self=this;
-return smalltalk.withContext(function($ctx1) { 
var $1;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
 $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
 $1=_st(_st(self)._new())._loadPackages_prefix_(aCollection,aString);
 return $1;
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})},
 }, function($ctx1) {$ctx1.fill(self,"loadPackages:prefix:",{aCollection:aCollection,aString:aString}, smalltalk.PackageLoader.klass)})},

+ 1 - 1
st/Benchfib.st

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

+ 1 - 1
st/Canvas.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Canvas' properties: #{}!
+Smalltalk current createPackage: 'Canvas'!
 Object subclass: #HTMLCanvas
 Object subclass: #HTMLCanvas
 	instanceVariableNames: 'root'
 	instanceVariableNames: 'root'
 	package: 'Canvas'!
 	package: 'Canvas'!

+ 1 - 1
st/Compiler-AST.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-AST' properties: #{}!
+Smalltalk current createPackage: 'Compiler-AST'!
 Object subclass: #Node
 Object subclass: #Node
 	instanceVariableNames: 'position nodes shouldBeInlined shouldBeAliased'
 	instanceVariableNames: 'position nodes shouldBeInlined shouldBeAliased'
 	package: 'Compiler-AST'!
 	package: 'Compiler-AST'!

+ 1 - 1
st/Compiler-Core.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Core' properties: #{}!
+Smalltalk current createPackage: 'Compiler-Core'!
 Object subclass: #Compiler
 Object subclass: #Compiler
 	instanceVariableNames: 'currentClass source unknownVariables codeGeneratorClass'
 	instanceVariableNames: 'currentClass source unknownVariables codeGeneratorClass'
 	package: 'Compiler-Core'!
 	package: 'Compiler-Core'!

+ 1 - 1
st/Compiler-Exceptions.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Exceptions' properties: #{}!
+Smalltalk current createPackage: 'Compiler-Exceptions'!
 Error subclass: #CompilerError
 Error subclass: #CompilerError
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Compiler-Exceptions'!
 	package: 'Compiler-Exceptions'!

+ 1 - 1
st/Compiler-IR.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-IR' properties: #{}!
+Smalltalk current createPackage: 'Compiler-IR'!
 NodeVisitor subclass: #IRASTTranslator
 NodeVisitor subclass: #IRASTTranslator
 	instanceVariableNames: 'source theClass method sequence nextAlias'
 	instanceVariableNames: 'source theClass method sequence nextAlias'
 	package: 'Compiler-IR'!
 	package: 'Compiler-IR'!

+ 1 - 1
st/Compiler-Inlining.st

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

+ 1 - 1
st/Compiler-Interpreter.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Interpreter' properties: #{}!
+Smalltalk current createPackage: 'Compiler-Interpreter'!
 NodeVisitor subclass: #AIContext
 NodeVisitor subclass: #AIContext
 	instanceVariableNames: 'outerContext pc locals method'
 	instanceVariableNames: 'outerContext pc locals method'
 	package: 'Compiler-Interpreter'!
 	package: 'Compiler-Interpreter'!

+ 1 - 1
st/Compiler-Semantic.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Semantic' properties: #{}!
+Smalltalk current createPackage: 'Compiler-Semantic'!
 Object subclass: #LexicalScope
 Object subclass: #LexicalScope
 	instanceVariableNames: 'node instruction temps args outerScope'
 	instanceVariableNames: 'node instruction temps args outerScope'
 	package: 'Compiler-Semantic'!
 	package: 'Compiler-Semantic'!

+ 1 - 1
st/Compiler-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler-Tests' properties: #{}!
+Smalltalk current createPackage: 'Compiler-Tests'!
 TestCase subclass: #AbstractASTInterpreterTest
 TestCase subclass: #AbstractASTInterpreterTest
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Compiler-Tests'!
 	package: 'Compiler-Tests'!

+ 652 - 118
st/Compiler.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Compiler' properties: #{}!
+Smalltalk current createPackage: 'Compiler'!
 Object subclass: #ChunkParser
 Object subclass: #ChunkParser
 	instanceVariableNames: 'stream'
 	instanceVariableNames: 'stream'
 	package:'Compiler'!
 	package:'Compiler'!
@@ -155,8 +155,8 @@ exportMethodsOf: aClass on: aStream
 exportPackageDefinitionOf: package on: aStream
 exportPackageDefinitionOf: package on: aStream
 	aStream 
 	aStream 
 	    nextPutAll: 'smalltalk.addPackage(';
 	    nextPutAll: 'smalltalk.addPackage(';
-	    nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.
-	aStream lf
+	    nextPutAll: '''', package name, ''');';
+        lf
 !
 !
 
 
 exportPackageExtensionsOf: package on: aStream
 exportPackageExtensionsOf: package on: aStream
@@ -262,8 +262,8 @@ exportPackageDefinitionOf: package on: aStream
 	"Chunk format."
 	"Chunk format."
 
 
 	aStream 
 	aStream 
-	    nextPutAll: 'Smalltalk current createPackage: ''', package name,
-		''' properties: ', package properties storeString, '!!'; lf.
+		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
+		lf
 !
 !
 
 
 exportPackageExtensionsOf: package on: aStream
 exportPackageExtensionsOf: package on: aStream
@@ -313,7 +313,8 @@ exportMethod: aMethod of: aClass on: aStream
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: aMethod selector asSelector asJavascript, ',';lf;
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'smalltalk.method({';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
 		nextPutAll: 'selector: ', aMethod selector asJavascript, ',';lf;
-		nextPutAll: 'fn: ', aMethod fn compiledSource;lf;
+		nextPutAll: 'fn: ', aMethod fn compiledSource, ',';lf;
+		nextPutAll: 'messageSends: ', aMethod messageSends asJavascript;
 		nextPutAll: '}),';lf;
 		nextPutAll: '}),';lf;
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass);
 		nextPutAll: 'smalltalk.', (self classNameFor: aClass);
 		nextPutAll: ');';lf;lf
 		nextPutAll: ');';lf;lf
@@ -459,6 +460,10 @@ The default behavior is to allow it, as this is how Amber currently is able to s
 
 
 !UnknownVariableError methodsFor: '*Compiler'!
 !UnknownVariableError methodsFor: '*Compiler'!
 
 
+messageText
+	^ 'Unknown Variable error: ', self variableName, ' is not defined'
+!
+
 variableName
 variableName
 	^ variableName
 	^ variableName
 !
 !
@@ -467,6 +472,25 @@ variableName: aString
 	variableName := aString
 	variableName := aString
 ! !
 ! !
 
 
+ErrorHandler subclass: #RethrowErrorHandler
+	instanceVariableNames: ''
+	package:'Compiler'!
+!RethrowErrorHandler commentStamp!
+This class is used in the commandline version of the compiler.
+It uses the handleError: message of ErrorHandler for printing the stacktrace and throws the error again as JS exception.
+As a result Smalltalk errors are not swallowd by the Amber runtime and compilation can be aborted.!
+
+!RethrowErrorHandler methodsFor: '*Compiler'!
+
+basicSignal: anError
+	<throw anError>
+!
+
+handleError: anError
+	super handleError: anError.
+    self basicSignal: anError
+! !
+
 Object subclass: #Compiler
 Object subclass: #Compiler
 	instanceVariableNames: 'currentClass source unknownVariables codeGeneratorClass'
 	instanceVariableNames: 'currentClass source unknownVariables codeGeneratorClass'
 	package:'Compiler'!
 	package:'Compiler'!
@@ -553,12 +577,10 @@ evaluateExpression: aString
 !
 !
 
 
 install: aString forClass: aBehavior category: anotherString
 install: aString forClass: aBehavior category: anotherString
-	| compiled |
-	compiled := self eval: (self compile: aString forClass: aBehavior).
-	compiled category: anotherString.
-	aBehavior addCompiledMethod: compiled.
-    self setupClass: aBehavior.
-	^compiled
+   	^ ClassBuilder new
+    	installMethod: (self eval: (self compile: aString forClass: aBehavior))
+        forClass: aBehavior
+        category: anotherString
 !
 !
 
 
 parse: aString
 parse: aString
@@ -573,7 +595,7 @@ recompile: aClass
 	aClass methodDictionary do: [:each |
 	aClass methodDictionary do: [:each |
 		console log: aClass name, ' >> ', each selector.
 		console log: aClass name, ' >> ', each selector.
 		self install: each source forClass: aClass category: each category].
 		self install: each source forClass: aClass category: each category].
-	self setupClass: aClass.
+	"self setupClass: aClass."
 	aClass isMetaclass ifFalse: [self recompile: aClass class]
 	aClass isMetaclass ifFalse: [self recompile: aClass class]
 !
 !
 
 
@@ -581,10 +603,6 @@ recompileAll
 	Smalltalk current classes do: [:each |
 	Smalltalk current classes do: [:each |
 		Transcript show: each; cr.
 		Transcript show: each; cr.
 		[self recompile: each] valueWithTimeout: 100]
 		[self recompile: each] valueWithTimeout: 100]
-!
-
-setupClass: aClass
-	<smalltalk.init(aClass)>
 ! !
 ! !
 
 
 !Compiler class methodsFor: '*Compiler'!
 !Compiler class methodsFor: '*Compiler'!
@@ -617,7 +635,7 @@ visit: aNode
 !
 !
 
 
 visitAll: aCollection
 visitAll: aCollection
-	^ aCollection do: [ :each | self visit: each ]
+	^ aCollection collect: [ :each | self visit: each ]
 !
 !
 
 
 visitAssignmentNode: aNode
 visitAssignmentNode: aNode
@@ -828,6 +846,10 @@ isImmutable
 	^false
 	^false
 !
 !
 
 
+isNode
+	^ true
+!
+
 isReturnNode
 isReturnNode
 	^false
 	^false
 !
 !
@@ -915,6 +937,10 @@ scope: aLexicalScope
 
 
 isBlockNode
 isBlockNode
 	^true
 	^true
+!
+
+subtreeNeedsAliasing
+    ^ self shouldBeAliased or: [ self shouldBeInlined ]
 ! !
 ! !
 
 
 !BlockNode methodsFor: '*Compiler'!
 !BlockNode methodsFor: '*Compiler'!
@@ -1303,6 +1329,12 @@ accept: aVisitor
 	^ aVisitor visitClassReferenceNode: self
 	^ aVisitor visitClassReferenceNode: self
 ! !
 ! !
 
 
+!Object methodsFor: '*Compiler'!
+
+isNode
+	^ false
+! !
+
 Object subclass: #LexicalScope
 Object subclass: #LexicalScope
 	instanceVariableNames: 'node instruction temps args outerScope'
 	instanceVariableNames: 'node instruction temps args outerScope'
 	package:'Compiler'!
 	package:'Compiler'!
@@ -1663,12 +1695,6 @@ I am an temporary variable of a method or block.!
 
 
 !TempVar methodsFor: '*Compiler'!
 !TempVar methodsFor: '*Compiler'!
 
 
-alias
-	^ self scope alias, '.locals.', super alias
-! !
-
-!TempVar methodsFor: '*Compiler'!
-
 isTempVar
 isTempVar
 	^ true
 	^ true
 ! !
 ! !
@@ -1722,16 +1748,24 @@ errorShadowingVariable: aString
 !
 !
 
 
 errorUnknownVariable: aNode
 errorUnknownVariable: aNode
-	"Throw an error if the variable is undeclared in the global JS scope (i.e. window)"
+	"Throw an error if the variable is undeclared in the global JS scope (i.e. window).
+    We allow four variable names in addition: `jQuery`, `window`, `process` and `global` 
+    for nodejs and browser environments. 
+    
+    This is only to make sure compilation works on both browser-based and nodejs environments.
+    The ideal solution would be to use a pragma instead"
 
 
 	| identifier |
 	| identifier |
     identifier := aNode value.
     identifier := aNode value.
-	((#('jQuery' 'window' 'process' 'global') includes: identifier) not and: [ self isVariableGloballyUndefined: identifier ]) ifTrue: [
-			UnknownVariableError new
-				variableName: aNode value;
-				signal ]
-		ifFalse: [
-			currentScope methodScope unknownVariables add: aNode value. ]
+    
+	((#('jQuery' 'window' 'document' 'process' 'global') includes: identifier) not 
+        and: [ self isVariableGloballyUndefined: identifier ]) 
+        	ifTrue: [
+				UnknownVariableError new
+					variableName: aNode value;
+					signal ]
+			ifFalse: [
+				currentScope methodScope unknownVariables add: aNode value ]
 ! !
 ! !
 
 
 !SemanticAnalyzer methodsFor: '*Compiler'!
 !SemanticAnalyzer methodsFor: '*Compiler'!
@@ -2148,6 +2182,10 @@ instructions
 	^ instructions ifNil: [ instructions := OrderedCollection new ]
 	^ instructions ifNil: [ instructions := OrderedCollection new ]
 !
 !
 
 
+method
+	^ self parent method
+!
+
 parent
 parent
 	^ parent
 	^ parent
 !
 !
@@ -2200,6 +2238,10 @@ isLocalReturn
 	^ false
 	^ false
 !
 !
 
 
+isMethod
+	^ false
+!
+
 isReturn
 isReturn
 	^ false
 	^ false
 !
 !
@@ -2278,11 +2320,11 @@ scope: aScope
 	scope := aScope
 	scope := aScope
 ! !
 ! !
 
 
-IRScopedInstruction subclass: #IRClosure
+IRScopedInstruction subclass: #IRClosureInstruction
 	instanceVariableNames: 'arguments'
 	instanceVariableNames: 'arguments'
 	package:'Compiler'!
 	package:'Compiler'!
 
 
-!IRClosure methodsFor: '*Compiler'!
+!IRClosureInstruction methodsFor: '*Compiler'!
 
 
 arguments
 arguments
 	^ arguments ifNil: [ #() ]
 	^ arguments ifNil: [ #() ]
@@ -2292,11 +2334,28 @@ arguments: aCollection
 	arguments := aCollection
 	arguments := aCollection
 !
 !
 
 
+locals
+	^ self arguments copy
+    	addAll: (self tempDeclarations collect: [ :each | each name ]); 
+        yourself
+!
+
 scope: aScope
 scope: aScope
 	super scope: aScope.
 	super scope: aScope.
 	aScope instruction: self
 	aScope instruction: self
 !
 !
 
 
+tempDeclarations
+	^ self instructions select: [ :each | 
+    	each isTempDeclaration ]
+! !
+
+IRClosureInstruction subclass: #IRClosure
+	instanceVariableNames: ''
+	package:'Compiler'!
+
+!IRClosure methodsFor: '*Compiler'!
+
 sequence
 sequence
 	^ self instructions last
 	^ self instructions last
 ! !
 ! !
@@ -2313,22 +2372,14 @@ accept: aVisitor
 	^ aVisitor visitIRClosure: self
 	^ aVisitor visitIRClosure: self
 ! !
 ! !
 
 
-IRScopedInstruction subclass: #IRMethod
-	instanceVariableNames: 'theClass source selector classReferences messageSends superSends arguments internalVariables'
+IRClosureInstruction subclass: #IRMethod
+	instanceVariableNames: 'theClass source selector classReferences messageSends superSends internalVariables'
 	package:'Compiler'!
 	package:'Compiler'!
 !IRMethod commentStamp!
 !IRMethod commentStamp!
 I am a method instruction!
 I am a method instruction!
 
 
 !IRMethod methodsFor: '*Compiler'!
 !IRMethod methodsFor: '*Compiler'!
 
 
-arguments
-	^ arguments
-!
-
-arguments: aCollection
-	arguments := aCollection
-!
-
 classReferences
 classReferences
 	^ classReferences
 	^ classReferences
 !
 !
@@ -2341,6 +2392,10 @@ internalVariables
 	^ internalVariables ifNil: [ internalVariables := Set new ]
 	^ internalVariables ifNil: [ internalVariables := Set new ]
 !
 !
 
 
+isMethod
+	^ true
+!
+
 messageSends
 messageSends
 	^ messageSends
 	^ messageSends
 !
 !
@@ -2349,9 +2404,8 @@ messageSends: aCollection
 	messageSends := aCollection
 	messageSends := aCollection
 !
 !
 
 
-scope: aScope
-	super scope: aScope.
-	aScope instruction: self
+method
+	^ self
 !
 !
 
 
 selector
 selector
@@ -2481,6 +2535,12 @@ name: aString
 
 
 !IRTempDeclaration methodsFor: '*Compiler'!
 !IRTempDeclaration methodsFor: '*Compiler'!
 
 
+isTempDeclaration
+	^ true
+! !
+
+!IRTempDeclaration methodsFor: '*Compiler'!
+
 accept: aVisitor
 accept: aVisitor
 	^ aVisitor visitIRTempDeclaration: self
 	^ aVisitor visitIRTempDeclaration: self
 ! !
 ! !
@@ -2754,6 +2814,8 @@ visitIRAssignment: anIRAssignment
 visitIRClosure: anIRClosure
 visitIRClosure: anIRClosure
 	self stream 
 	self stream 
 		nextPutClosureWith: [ 
 		nextPutClosureWith: [ 
+        	self stream nextPutVars: (anIRClosure tempDeclarations collect: [ :each |
+    				each name asVariableName ]).
         	self stream 
         	self stream 
             	nextPutBlockContextFor: anIRClosure
             	nextPutBlockContextFor: anIRClosure
                 during: [ super visitIRClosure: anIRClosure ] ]
                 during: [ super visitIRClosure: anIRClosure ] ]
@@ -2777,10 +2839,13 @@ visitIRDynamicDictionary: anIRDynamicDictionary
 !
 !
 
 
 visitIRMethod: anIRMethod
 visitIRMethod: anIRMethod
+
 	self stream
 	self stream
 		nextPutMethodDeclaration: anIRMethod 
 		nextPutMethodDeclaration: anIRMethod 
 		with: [ self stream 
 		with: [ self stream 
 			nextPutFunctionWith: [ 
 			nextPutFunctionWith: [ 
+            	self stream nextPutVars: (anIRMethod tempDeclarations collect: [ :each |
+    				each name asVariableName ]).
             	self stream nextPutContextFor: anIRMethod during: [
             	self stream nextPutContextFor: anIRMethod during: [
 				anIRMethod internalVariables notEmpty ifTrue: [
 				anIRMethod internalVariables notEmpty ifTrue: [
 					self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |
 					self stream nextPutVars: (anIRMethod internalVariables asArray collect: [ :each |
@@ -2833,9 +2898,9 @@ visitIRSequence: anIRSequence
 !
 !
 
 
 visitIRTempDeclaration: anIRTempDeclaration
 visitIRTempDeclaration: anIRTempDeclaration
-	self stream 
-    	nextPutAll: anIRTempDeclaration scope alias, '.locals.', anIRTempDeclaration name, '=nil;'; 
-        lf
+	"self stream 
+    	nextPutAll: 'var ', anIRTempDeclaration name asVariableName, ';'; 
+        lf"
 !
 !
 
 
 visitIRValue: anIRValue
 visitIRValue: anIRValue
@@ -2890,10 +2955,26 @@ nextPutAssignment
 
 
 nextPutBlockContextFor: anIRClosure during: aBlock
 nextPutBlockContextFor: anIRClosure during: aBlock
 	self 
 	self 
-    	nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') { '; 
+    	nextPutAll: 'return smalltalk.withContext(function(', anIRClosure scope alias, ') {'; 
         nextPutAll: String cr.
         nextPutAll: String cr.
+    
     aBlock value.
     aBlock value.
-    self nextPutAll: '})'
+    
+    self 
+    	nextPutAll: '}, function(', anIRClosure scope alias, ') {';
+        nextPutAll: anIRClosure scope alias, '.fillBlock({'.
+    
+    anIRClosure locals 
+    	do: [ :each |
+    		self 
+        		nextPutAll: each asVariableName;
+           	 	nextPutAll: ':';
+        		nextPutAll: each asVariableName]
+		separatedBy: [ self nextPutAll: ',' ].
+    
+    self
+    	nextPutAll: '},';
+        nextPutAll:  anIRClosure method scope alias, ')})'
 !
 !
 
 
 nextPutClosureWith: aBlock arguments: anArray
 nextPutClosureWith: aBlock arguments: anArray
@@ -2911,15 +2992,23 @@ nextPutContextFor: aMethod during: aBlock
     	nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; 
     	nextPutAll: 'return smalltalk.withContext(function(', aMethod scope alias, ') { '; 
         nextPutAll: String cr.
         nextPutAll: String cr.
     aBlock value.
     aBlock value.
+    
     self 
     self 
-    	nextPutAll: '}, self, ';
-        nextPutAll: aMethod selector asJavascript, ', ['.
-    aMethod arguments 
-    	do: [ :each | self nextPutAll: each asVariableName ]
-      	separatedBy: [ self nextPutAll: ','  ].
-    self nextPutAll: '], ';
+    	nextPutAll: '}, function(', aMethod scope alias, ') {', aMethod scope alias; 
+        nextPutAll: '.fill(self,', aMethod selector asJavascript, ',{'.
+
+    aMethod locals 
+    	do: [ :each |
+    		self 
+        		nextPutAll: each asVariableName;
+           	 	nextPutAll: ':';
+        		nextPutAll: each asVariableName]
+		separatedBy: [ self nextPutAll: ',' ].
+    
+    self
+    	nextPutAll: '}, ';
         nextPutAll: aMethod theClass asJavascript;
         nextPutAll: aMethod theClass asJavascript;
-        nextPutAll: ')'
+        nextPutAll: ')})'
 !
 !
 
 
 nextPutFunctionWith: aBlock arguments: anArray
 nextPutFunctionWith: aBlock arguments: anArray
@@ -3019,6 +3108,8 @@ nextPutVar: aString
 !
 !
 
 
 nextPutVars: aCollection
 nextPutVars: aCollection
+	aCollection ifEmpty: [ ^self ].
+    
 	stream nextPutAll: 'var '.
 	stream nextPutAll: 'var '.
 	aCollection 
 	aCollection 
 		do: [ :each | stream nextPutAll: each ]
 		do: [ :each | stream nextPutAll: each ]
@@ -3690,25 +3781,36 @@ irTranslator
 ! !
 ! !
 
 
 NodeVisitor subclass: #AIContext
 NodeVisitor subclass: #AIContext
-	instanceVariableNames: 'outerContext pc locals receiver selector'
+	instanceVariableNames: 'outerContext pc locals method'
 	package:'Compiler'!
 	package:'Compiler'!
+!AIContext commentStamp!
+AIContext is like a `MethodContext`, used by the `ASTInterpreter`.
+Unlike a `MethodContext`, it is not read-only.
+
+When debugging, `AIContext` instances are created by copying the current `MethodContext` (thisContext)!
 
 
 !AIContext methodsFor: '*Compiler'!
 !AIContext methodsFor: '*Compiler'!
 
 
-initializeFromMethodContext: aMethodContext
-	self pc: aMethodContext pc.
-    self receiver: aMethodContext receiver.
-    self selector: aMethodContext selector.
-    aMethodContext outerContext ifNotNil: [
-		self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].
-    aMethodContext locals keysAndValuesDo: [ :key :value |
-    	self locals at: key put: value ]
+localAt: aString
+	^ self locals at: aString ifAbsent: [ nil ]
+!
+
+localAt: aString put: anObject
+	self locals at: aString put: anObject
 !
 !
 
 
 locals
 locals
 	^ locals ifNil: [ locals := Dictionary new ]
 	^ locals ifNil: [ locals := Dictionary new ]
 !
 !
 
 
+method
+	^ method
+!
+
+method: aCompiledMethod
+	method := aCompiledMethod
+!
+
 outerContext
 outerContext
 	^ outerContext
 	^ outerContext
 !
 !
@@ -3726,41 +3828,177 @@ pc: anInteger
 !
 !
 
 
 receiver
 receiver
-	^ receiver
+	^ self localAt: 'self'
 !
 !
 
 
 receiver: anObject
 receiver: anObject
-	receiver := anObject
+	self localAt: 'self' put: anObject
 !
 !
 
 
 selector
 selector
-	^ selector
-!
+	^ self metod
+    	ifNotNil: [ self method selector ]
+! !
 
 
-selector: aString
-	selector := aString
+!AIContext methodsFor: '*Compiler'!
+
+initializeFromMethodContext: aMethodContext
+	self pc: aMethodContext pc.
+    self receiver: aMethodContext receiver.
+    self method: aMethodContext method.
+    aMethodContext outerContext ifNotNil: [
+		self outerContext: (self class fromMethodContext: aMethodContext outerContext) ].
+    aMethodContext locals keysAndValuesDo: [ :key :value |
+    	self locals at: key put: value ]
 ! !
 ! !
 
 
 !AIContext class methodsFor: '*Compiler'!
 !AIContext class methodsFor: '*Compiler'!
 
 
 fromMethodContext: aMethodContext
 fromMethodContext: aMethodContext
-	^ self new 
+	^ self new
     	initializeFromMethodContext: aMethodContext;
     	initializeFromMethodContext: aMethodContext;
         yourself
         yourself
 ! !
 ! !
 
 
-NodeVisitor subclass: #ASTInterpreter
-	instanceVariableNames: 'currentNode context shouldReturn'
+Object subclass: #ASTDebugger
+	instanceVariableNames: 'interpreter context'
 	package:'Compiler'!
 	package:'Compiler'!
+!ASTDebugger commentStamp!
+ASTDebugger is a debugger to Amber.
+It uses an AST interpreter to step through the code.
 
 
-!ASTInterpreter methodsFor: '*Compiler'!
+ASTDebugger instances are created from a `MethodContext` with `ASTDebugger class >> context:`.
+They hold an `AIContext` instance internally, recursive copy of the `MethodContext`.
+
+Use the methods of the 'stepping' protocol to do stepping.!
+
+!ASTDebugger methodsFor: '*Compiler'!
 
 
 context
 context
 	^ context
 	^ context
 !
 !
 
 
+context: aContext
+	context := AIContext new.
+!
+
+interpreter
+	^ interpreter ifNil: [ interpreter := self defaultInterpreterClass new ]
+!
+
+interpreter: anInterpreter
+	interpreter := anInterpreter
+!
+
+method
+	^ self context method
+! !
+
+!ASTDebugger methodsFor: '*Compiler'!
+
+defaultInterpreterClass
+	^ ASTSteppingInterpreter
+! !
+
+!ASTDebugger methodsFor: '*Compiler'!
+
+buildAST
+	"Build the AST tree from the method source code.
+    The AST is annotated with a SemanticAnalyzer, 
+    to know the semantics and bindings of each node needed for later debugging"
+    
+    | ast |
+    
+    ast := Smalltalk current parse: self method source.
+    (SemanticAnalyzer on: self context receiver class)
+    	visit: ast.    
+    
+    ^ ast
+!
+
+initializeInterpreter
+	self interpreter interpret: self buildAST nodes first
+!
+
+initializeWithContext: aMethodContext
+	"TODO: do we need to handle block contexts?"
+    
+    self context: (AIContext fromMethodContext: aMethodContext).
+    self initializeInterpreter
+! !
+
+!ASTDebugger methodsFor: '*Compiler'!
+
+restart
+	self shouldBeImplemented
+!
+
+resume
+	self shouldBeImplemented
+!
+
+step
+	"The ASTSteppingInterpreter stops at each node interpretation. 
+    One step will interpret nodes until:
+    - we get at the end
+    - the next node is a stepping node (send, assignment, etc.)"
+    
+	[ (self interpreter nextNode notNil and: [ self interpreter nextNode stopOnStepping ])
+		or: [ self interpreter atEnd not ] ] 
+ 			whileFalse: [
+				self interpreter step. 
+                self step ]
+!
+
+stepInto
+	self shouldBeImplemented
+!
+
+stepOver
+	self step
+! !
+
+!ASTDebugger class methodsFor: '*Compiler'!
+
+context: aMethodContext
+	^ self new
+    	initializeWithContext: aMethodContext;
+        yourself
+! !
+
+Object subclass: #ASTInterpreter
+	instanceVariableNames: 'currentNode context shouldReturn result'
+	package:'Compiler'!
+!ASTInterpreter commentStamp!
+ASTIntepreter is like a `NodeVisitor`, interpreting nodes one after each other.
+It is built using Continuation Passing Style for stepping purposes.
+
+Usage example:
+
+    | ast interpreter |
+    ast := Smalltalk current parse: 'foo 1+2+4'.
+    (SemanticAnalyzer on: Object) visit: ast.
+
+    ASTInterpreter new
+        interpret: ast nodes first;
+        result "Answers 7"!
+
+!ASTInterpreter methodsFor: '*Compiler'!
+
+context
+	^ context ifNil: [ context := AIContext new ]
+!
+
 context: anAIContext
 context: anAIContext
 	context := anAIContext
 	context := anAIContext
+!
+
+currentNode
+	^ currentNode
+!
+
+result
+	^ result
 ! !
 ! !
 
 
 !ASTInterpreter methodsFor: '*Compiler'!
 !ASTInterpreter methodsFor: '*Compiler'!
@@ -3774,71 +4012,367 @@ initialize
 
 
 interpret: aNode
 interpret: aNode
 	shouldReturn := false.
 	shouldReturn := false.
-    ^ self interpretNode: aNode
+    self interpret: aNode continue: [ :value |
+    	result := value ]
 !
 !
 
 
-interpretNode: aNode
-	currentNode := aNode.
-    ^ self visit: aNode
+interpret: aNode continue: aBlock
+	shouldReturn ifTrue: [ ^ self ].
+
+	aNode isNode 
+    	ifTrue: [ 	
+        	currentNode := aNode.
+            self interpretNode: aNode continue: [ :value |
+  				self continue: aBlock value: value ] ]
+        ifFalse: [ self continue: aBlock value: aNode ]
 !
 !
 
 
-messageFromSendNode: aSendNode
-	^ Message new
-    	selector: aSendNode selector;
-        arguments: (aSendNode arguments collect: [ :each |
-        	self interpretNode: each ]);
-        yourself
-! !
+interpretAssignmentNode: aNode continue: aBlock
+	self interpret: aNode right continue: [ :value |
+    	self 
+        	continue: aBlock
+            value: (self assign: aNode left to: value) ]
+!
 
 
-!ASTInterpreter methodsFor: '*Compiler'!
+interpretBlockNode: aNode continue: aBlock
+	"TODO: Context should be set"
+    
+    self 
+    	continue: aBlock 
+        value: [ self interpret: aNode nodes first; result ]
+!
 
 
-visitBlockNode: aNode
-    ^ [ self interpretNode: aNode nodes first ]
+interpretBlockSequenceNode: aNode continue: aBlock
+	self interpretSequenceNode: aNode continue: aBlock
 !
 !
 
 
-visitCascadeNode: aNode
+interpretCascadeNode: aNode continue: aBlock
 	"TODO: Handle super sends"
 	"TODO: Handle super sends"
-	| receiver |
-    
-    receiver := self interpretNode: aNode receiver.
-
-    aNode nodes allButLast
-    	do: [ :each | 
-        	(self messageFromSendNode: each)
-            	sendTo: receiver ].
+	
+    self interpret: aNode receiver continue: [ :receiver |
+		"Only interpret the receiver once"
+        aNode nodes do: [ :each | each receiver: receiver ].
+  
+    	self 
+        	interpretAll: aNode nodes allButLast
+    		continue: [
+              	self 
+                	interpret: aNode nodes last
+                	continue: [ :val | self continue: aBlock value: val ] ] ]
+!
 
 
-    ^ (self messageFromSendNode: aNode nodes last)
-            	sendTo: receiver
+interpretClassReferenceNode: aNode continue: aBlock
+	self continue: aBlock value: (Smalltalk current at: aNode value)
 !
 !
 
 
-visitClassReferenceNode: aNode
-	^ Smalltalk current at: aNode value
+interpretDynamicArrayNode: aNode continue: aBlock
+	self interpretAll: aNode nodes continue: [ :array |
+    	self 
+        	continue: aBlock
+			value: array ]
 !
 !
 
 
-visitJSStatementNode: aNode
-	self halt
+interpretDynamicDictionaryNode: aNode continue: aBlock
+    self interpretAll: aNode nodes continue: [ :array | | hashedCollection |
+    	hashedCollection := HashedCollection new.
+        array do: [ :each | hashedCollection add: each ].
+        self 	
+        	continue: aBlock
+            value: hashedCollection ]
 !
 !
 
 
-visitReturnNode: aNode
+interpretJSStatementNode: aNode continue: aBlock
 	shouldReturn := true.
 	shouldReturn := true.
-    ^ self interpretNode: aNode nodes first
+	self continue: aBlock value: (self eval: aNode source)
 !
 !
 
 
-visitSendNode: aNode
+interpretMethodNode: aNode continue: aBlock
+	self interpretAll: aNode nodes continue: [ :array |
+    	self continue: aBlock value: array first ]
+!
+
+interpretNode: aNode continue: aBlock
+    aNode interpreter: self continue: aBlock
+!
+
+interpretReturnNode: aNode continue: aBlock
+    self interpret: aNode nodes first continue: [ :value |
+    	shouldReturn := true.
+		self continue: aBlock value: value ]
+!
+
+interpretSendNode: aNode continue: aBlock
 	"TODO: Handle super sends"
 	"TODO: Handle super sends"
     
     
-    ^ (self messageFromSendNode: aNode)
-    	sendTo: (self interpretNode: aNode receiver)
+    self interpret: aNode receiver continue: [ :receiver |
+    	self interpretAll: aNode arguments continue: [ :args |
+    		self 
+            	messageFromSendNode: aNode 
+                arguments: args
+                do: [ :message |
+        			self context pc: self context pc + 1.
+        			self 
+            			continue: aBlock 
+                		value: (message sendTo: receiver) ] ] ]
 !
 !
 
 
-visitSequenceNode: aNode
-	aNode nodes allButLast do: [ :each | | value |
-        value := self interpretNode: each.
-		shouldReturn ifTrue: [ ^ value ] ].
-    ^ self interpretNode: aNode nodes last
+interpretSequenceNode: aNode continue: aBlock
+	self interpretAll: aNode nodes continue: [ :array |
+    	self continue: aBlock value: array last ]
 !
 !
 
 
-visitValueNode: aNode
-	^ aNode value
+interpretValueNode: aNode continue: aBlock
+	self continue: aBlock value: aNode value
+!
+
+interpretVariableNode: aNode continue: aBlock
+    self 
+    	continue: aBlock
+        value: (aNode binding isInstanceVar
+			ifTrue: [ self context receiver instVarAt: aNode value ]
+			ifFalse: [ self context localAt: aNode value ])
+! !
+
+!ASTInterpreter methodsFor: '*Compiler'!
+
+assign: aNode to: anObject
+	^ aNode binding isInstanceVar 
+    	ifTrue: [ self context receiver instVarAt: aNode value put: anObject ]
+      	ifFalse: [ self context localAt: aNode value put: anObject ]
+!
+
+continue: aBlock value: anObject
+	result := anObject.
+    aBlock value: anObject
+!
+
+eval: aString
+	"Evaluate aString as JS source inside an JS function. 
+    aString is not sandboxed."
+    
+    | source function |
+    
+    source := String streamContents: [ :str |
+    	str nextPutAll: '(function('.
+        self context locals keys 
+        	do: [ :each | str nextPutAll: each ]
+          	separatedBy: [ str nextPutAll: ',' ].
+        str 
+        	nextPutAll: '){ return (function() {';
+        	nextPutAll: aString;
+            nextPutAll: '})() })' ].
+            
+	function := Compiler new eval: source.
+    
+	^ function valueWithPossibleArguments: self context locals values
+!
+
+interpretAll: aCollection continue: aBlock
+	self 
+    	interpretAll: aCollection 
+        continue: aBlock 
+        result: OrderedCollection new
+!
+
+interpretAll: nodes continue: aBlock result: aCollection
+	nodes isEmpty 
+    	ifTrue: [ self continue: aBlock value: aCollection ]
+    	ifFalse: [
+    		self interpret: nodes first continue: [:value |
+    			self 
+                	interpretAll: nodes allButFirst 
+                    continue: aBlock
+  					result: aCollection, { value } ] ]
+!
+
+messageFromSendNode: aSendNode arguments: aCollection do: aBlock
+    self 
+        continue: aBlock
+        value: (Message new
+    		selector: aSendNode selector;
+        	arguments: aCollection;
+        	yourself)
+! !
+
+!ASTInterpreter methodsFor: '*Compiler'!
+
+shouldReturn
+	^ shouldReturn ifNil: [ false ]
+! !
+
+ASTInterpreter subclass: #ASTSteppingInterpreter
+	instanceVariableNames: 'continuation nextNode'
+	package:'Compiler'!
+!ASTSteppingInterpreter commentStamp!
+ASTSteppingInterpreter is an interpreter with stepping capabilities.
+Use `#step` to actually interpret the next node.
+
+Usage example:
+
+    | ast interpreter |
+    ast := Smalltalk current parse: 'foo 1+2+4'.
+    (SemanticAnalyzer on: Object) visit: ast.
+
+    interpreter := ASTSteppingInterpreter new
+        interpret: ast nodes first;
+        yourself.
+        
+    debugger step; step.
+    debugger step; step.
+    debugger result."Answers 1"
+    debugger step.
+    debugger result. "Answers 3"
+    debugger step.
+    debugger result. "Answers 7"!
+
+!ASTSteppingInterpreter methodsFor: '*Compiler'!
+
+nextNode
+	^ nextNode
+! !
+
+!ASTSteppingInterpreter methodsFor: '*Compiler'!
+
+initialize
+	super initialize.
+    continuation := [  ]
+! !
+
+!ASTSteppingInterpreter methodsFor: '*Compiler'!
+
+interpret: aNode continue: aBlock
+	nextNode := aNode.
+	continuation := [ 
+    	super interpret: aNode continue: aBlock ]
+! !
+
+!ASTSteppingInterpreter methodsFor: '*Compiler'!
+
+step
+	continuation value
+! !
+
+!ASTSteppingInterpreter methodsFor: '*Compiler'!
+
+atEnd
+	^ self shouldReturn or: [ self nextNode == self currentNode ]
+! !
+
+!Node methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ false
+! !
+
+!AssignmentNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretAssignmentNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!BlockNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretBlockNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!CascadeNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretCascadeNode: self continue: aBlock
+! !
+
+!DynamicArrayNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretDynamicArrayNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!DynamicDictionaryNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretDynamicDictionaryNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!JSStatementNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretJSStatementNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!MethodNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretMethodNode: self continue: aBlock
+! !
+
+!ReturnNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretReturnNode: self continue: aBlock
+! !
+
+!SendNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretSendNode: self continue: aBlock
+!
+
+isSteppingNode
+	^ true
+! !
+
+!SequenceNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretSequenceNode: self continue: aBlock
+! !
+
+!BlockSequenceNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretBlockSequenceNode: self continue: aBlock
+! !
+
+!ValueNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretValueNode: self continue: aBlock
+! !
+
+!VariableNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretVariableNode: self continue: aBlock
+! !
+
+!ClassReferenceNode methodsFor: '*Compiler'!
+
+interpreter: anInterpreter continue: aBlock
+	^ anInterpreter interpretClassReferenceNode: self continue: aBlock
 ! !
 ! !
 
 

+ 1 - 1
st/Examples.st

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

+ 1 - 1
st/IDE.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'IDE' properties: #{}!
+Smalltalk current createPackage: 'IDE'!
 Widget subclass: #ClassesList
 Widget subclass: #ClassesList
 	instanceVariableNames: 'browser ul nodes'
 	instanceVariableNames: 'browser ul nodes'
 	package: 'IDE'!
 	package: 'IDE'!

+ 5 - 5
st/Importer-Exporter.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Importer-Exporter' properties: #{}!
+Smalltalk current createPackage: 'Importer-Exporter'!
 Object subclass: #ChunkParser
 Object subclass: #ChunkParser
 	instanceVariableNames: 'stream'
 	instanceVariableNames: 'stream'
 	package: 'Importer-Exporter'!
 	package: 'Importer-Exporter'!
@@ -155,8 +155,8 @@ exportMethodsOf: aClass on: aStream
 exportPackageDefinitionOf: package on: aStream
 exportPackageDefinitionOf: package on: aStream
 	aStream 
 	aStream 
 	    nextPutAll: 'smalltalk.addPackage(';
 	    nextPutAll: 'smalltalk.addPackage(';
-	    nextPutAll: '''', package name, ''', ', package propertiesAsJSON , ');'.
-	aStream lf
+	    nextPutAll: '''', package name, ''');';
+        lf
 !
 !
 
 
 exportPackageExtensionsOf: package on: aStream
 exportPackageExtensionsOf: package on: aStream
@@ -262,8 +262,8 @@ exportPackageDefinitionOf: package on: aStream
 	"Chunk format."
 	"Chunk format."
 
 
 	aStream 
 	aStream 
-	    nextPutAll: 'Smalltalk current createPackage: ''', package name,
-		''' properties: ', package properties storeString, '!!'; lf.
+		nextPutAll: 'Smalltalk current createPackage: ''', package name, '''!!';
+		lf
 !
 !
 
 
 exportPackageExtensionsOf: package on: aStream
 exportPackageExtensionsOf: package on: aStream

+ 1 - 1
st/Kernel-Announcements.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Announcements' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Announcements'!
 Object subclass: #AnnouncementSubscription
 Object subclass: #AnnouncementSubscription
 	instanceVariableNames: 'block announcementClass'
 	instanceVariableNames: 'block announcementClass'
 	package: 'Kernel-Announcements'!
 	package: 'Kernel-Announcements'!

+ 1 - 1
st/Kernel-Classes.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Classes' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Classes'!
 Object subclass: #Behavior
 Object subclass: #Behavior
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Classes'!
 	package: 'Kernel-Classes'!

+ 1 - 1
st/Kernel-Collections.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Collections' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Collections'!
 Object subclass: #Association
 Object subclass: #Association
 	instanceVariableNames: 'key value'
 	instanceVariableNames: 'key value'
 	package: 'Kernel-Collections'!
 	package: 'Kernel-Collections'!

+ 1 - 1
st/Kernel-Exceptions.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Exceptions' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Exceptions'!
 Object subclass: #Error
 Object subclass: #Error
 	instanceVariableNames: 'messageText'
 	instanceVariableNames: 'messageText'
 	package: 'Kernel-Exceptions'!
 	package: 'Kernel-Exceptions'!

+ 1 - 1
st/Kernel-Methods.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Methods' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Methods'!
 Object subclass: #BlockClosure
 Object subclass: #BlockClosure
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Methods'!
 	package: 'Kernel-Methods'!

+ 1 - 1
st/Kernel-Objects.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Objects' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Objects'!
 nil subclass: #Object
 nil subclass: #Object
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Objects'!
 	package: 'Kernel-Objects'!

+ 1 - 1
st/Kernel-Tests.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Tests' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Tests'!
 TestCase subclass: #BlockClosureTest
 TestCase subclass: #BlockClosureTest
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Kernel-Tests'!
 	package: 'Kernel-Tests'!

+ 1 - 1
st/Kernel-Transcript.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Kernel-Transcript' properties: #{}!
+Smalltalk current createPackage: 'Kernel-Transcript'!
 Object subclass: #ConsoleTranscript
 Object subclass: #ConsoleTranscript
 	instanceVariableNames: 'textarea'
 	instanceVariableNames: 'textarea'
 	package: 'Kernel-Transcript'!
 	package: 'Kernel-Transcript'!

+ 1 - 1
st/SUnit-Tests.st

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

+ 1 - 1
st/SUnit.st

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

+ 1 - 1
st/Spaces.st

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

+ 1 - 1
test/Test.st

@@ -1,4 +1,4 @@
-Smalltalk current createPackage: 'Test' properties: #{}!
+Smalltalk current createPackage: 'Test'!
 Object subclass: #NodeTestRunner
 Object subclass: #NodeTestRunner
 	instanceVariableNames: ''
 	instanceVariableNames: ''
 	package: 'Test'!
 	package: 'Test'!