Browse Source

First try at a new compiler architecture

Nicolas Petton 12 years ago
parent
commit
85133ae990

File diff suppressed because it is too large
+ 4 - 4
js/Compiler-Tests.deploy.js


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


+ 64 - 64
js/Kernel-Classes.deploy.js

@@ -4,7 +4,7 @@ smalltalk.addMethod(
 "_addCompiledMethod_",
 smalltalk.method({
 selector: "addCompiledMethod:",
-fn: function (aMethod){
+fn: function (aMethod) {
 var self=this;
 smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
 return self;}
@@ -15,7 +15,7 @@ smalltalk.addMethod(
 "_allInstanceVariableNames",
 smalltalk.method({
 selector: "allInstanceVariableNames",
-fn: function (){
+fn: function () {
 var self=this;
 var result=nil;
 (result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []));
@@ -29,7 +29,7 @@ smalltalk.addMethod(
 "_allSubclasses",
 smalltalk.method({
 selector: "allSubclasses",
-fn: function (){
+fn: function () {
 var self=this;
 var result=nil;
 (result=smalltalk.send(self, "_subclasses", []));
@@ -43,7 +43,7 @@ smalltalk.addMethod(
 "_basicNew",
 smalltalk.method({
 selector: "basicNew",
-fn: function (){
+fn: function () {
 var self=this;
 return new self.fn();
 return self;}
@@ -54,7 +54,7 @@ smalltalk.addMethod(
 "_canUnderstand_",
 smalltalk.method({
 selector: "canUnderstand:",
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_includes_", [smalltalk.send(aSelector, "_asString", [])]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_superclass", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_superclass", []), "_canUnderstand_", [aSelector]);})]);})]);
 return self;}
@@ -65,7 +65,7 @@ smalltalk.addMethod(
 "_comment",
 smalltalk.method({
 selector: "comment",
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;}
@@ -76,7 +76,7 @@ smalltalk.addMethod(
 "_comment_",
 smalltalk.method({
 selector: "comment:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
 return self;}
@@ -87,7 +87,7 @@ smalltalk.addMethod(
 "_commentStamp",
 smalltalk.method({
 selector: "commentStamp",
-fn: function (){
+fn: function () {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
 return self;}
@@ -98,7 +98,7 @@ smalltalk.addMethod(
 "_commentStamp_prior_",
 smalltalk.method({
 selector: "commentStamp:prior:",
-fn: function (aStamp, prior){
+fn: function (aStamp, prior) {
 var self=this;
 return smalltalk.send(self, "_commentStamp", []);
 return self;}
@@ -109,7 +109,7 @@ smalltalk.addMethod(
 "_compile_",
 smalltalk.method({
 selector: "compile:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_compile_category_", [aString, ""]);
 return self;}
@@ -120,7 +120,7 @@ smalltalk.addMethod(
 "_compile_category_",
 smalltalk.method({
 selector: "compile:category:",
-fn: function (aString, anotherString){
+fn: function (aString, anotherString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_install_forClass_category_", [aString, self, anotherString]);return smalltalk.send($rec, "_setupClass_", [self]);})(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []));
 return self;}
@@ -131,7 +131,7 @@ smalltalk.addMethod(
 "_inheritsFrom_",
 smalltalk.method({
 selector: "inheritsFrom:",
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
 return self;}
@@ -142,7 +142,7 @@ smalltalk.addMethod(
 "_instanceVariableNames",
 smalltalk.method({
 selector: "instanceVariableNames",
-fn: function (){
+fn: function () {
 var self=this;
 return self.iVarNames;
 return self;}
@@ -153,7 +153,7 @@ smalltalk.addMethod(
 "_methodAt_",
 smalltalk.method({
 selector: "methodAt:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return smalltalk.methods(self)[aString];
 return self;}
@@ -164,7 +164,7 @@ smalltalk.addMethod(
 "_methodDictionary",
 smalltalk.method({
 selector: "methodDictionary",
-fn: function (){
+fn: function () {
 var self=this;
 var dict = smalltalk.HashedCollection._new();
 	var methods = self.fn.prototype.methods;
@@ -182,7 +182,7 @@ smalltalk.addMethod(
 "_methodsFor_",
 smalltalk.method({
 selector: "methodsFor:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
 return self;}
@@ -193,7 +193,7 @@ smalltalk.addMethod(
 "_methodsFor_stamp_",
 smalltalk.method({
 selector: "methodsFor:stamp:",
-fn: function (aString, aStamp){
+fn: function (aString, aStamp) {
 var self=this;
 return smalltalk.send(self, "_methodsFor_", [aString]);
 return self;}
@@ -204,7 +204,7 @@ smalltalk.addMethod(
 "_name",
 smalltalk.method({
 selector: "name",
-fn: function (){
+fn: function () {
 var self=this;
 return self.className || nil;
 return self;}
@@ -215,7 +215,7 @@ smalltalk.addMethod(
 "_new",
 smalltalk.method({
 selector: "new",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
 return self;}
@@ -226,7 +226,7 @@ smalltalk.addMethod(
 "_protocols",
 smalltalk.method({
 selector: "protocols",
-fn: function (){
+fn: function () {
 var self=this;
 var protocols=nil;
 (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
@@ -240,7 +240,7 @@ smalltalk.addMethod(
 "_protocolsDo_",
 smalltalk.method({
 selector: "protocolsDo:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 var methodsByCategory=nil;
 (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
@@ -254,7 +254,7 @@ smalltalk.addMethod(
 "_prototype",
 smalltalk.method({
 selector: "prototype",
-fn: function (){
+fn: function () {
 var self=this;
 return self.fn.prototype;
 return self;}
@@ -265,7 +265,7 @@ smalltalk.addMethod(
 "_removeCompiledMethod_",
 smalltalk.method({
 selector: "removeCompiledMethod:",
-fn: function (aMethod){
+fn: function (aMethod) {
 var self=this;
 delete self.fn.prototype[aMethod.selector._asSelector()];
 	delete self.fn.prototype.methods[aMethod.selector];
@@ -278,7 +278,7 @@ smalltalk.addMethod(
 "_subclasses",
 smalltalk.method({
 selector: "subclasses",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.subclasses(self);
 return self;}
@@ -289,7 +289,7 @@ smalltalk.addMethod(
 "_superclass",
 smalltalk.method({
 selector: "superclass",
-fn: function (){
+fn: function () {
 var self=this;
 return self.superclass || nil;
 return self;}
@@ -300,7 +300,7 @@ smalltalk.addMethod(
 "_withAllSubclasses",
 smalltalk.method({
 selector: "withAllSubclasses",
-fn: function (){
+fn: function () {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
 return self;}
@@ -314,7 +314,7 @@ smalltalk.addMethod(
 "_category",
 smalltalk.method({
 selector: "category",
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
 return self;}
@@ -325,7 +325,7 @@ smalltalk.addMethod(
 "_isClass",
 smalltalk.method({
 selector: "isClass",
-fn: function (){
+fn: function () {
 var self=this;
 return true;
 return self;}
@@ -336,7 +336,7 @@ smalltalk.addMethod(
 "_package",
 smalltalk.method({
 selector: "package",
-fn: function (){
+fn: function () {
 var self=this;
 return self.pkg;
 return self;}
@@ -347,7 +347,7 @@ smalltalk.addMethod(
 "_package_",
 smalltalk.method({
 selector: "package:",
-fn: function (aPackage){
+fn: function (aPackage) {
 var self=this;
 self.pkg = aPackage;
 return self;}
@@ -358,7 +358,7 @@ smalltalk.addMethod(
 "_printString",
 smalltalk.method({
 selector: "printString",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_name", []);
 return self;}
@@ -369,7 +369,7 @@ smalltalk.addMethod(
 "_rename_",
 smalltalk.method({
 selector: "rename:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 
 		smalltalk[aString] = self;
@@ -384,7 +384,7 @@ smalltalk.addMethod(
 "_subclass_instanceVariableNames_",
 smalltalk.method({
 selector: "subclass:instanceVariableNames:",
-fn: function (aString, anotherString){
+fn: function (aString, anotherString) {
 var self=this;
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
 return self;}
@@ -395,7 +395,7 @@ smalltalk.addMethod(
 "_subclass_instanceVariableNames_category_",
 smalltalk.method({
 selector: "subclass:instanceVariableNames:category:",
-fn: function (aString, aString2, aString3){
+fn: function (aString, aString2, aString3) {
 var self=this;
 smalltalk.send(self, "_deprecatedAPI", []);
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
@@ -407,7 +407,7 @@ smalltalk.addMethod(
 "_subclass_instanceVariableNames_classVariableNames_poolDictionaries_category_",
 smalltalk.method({
 selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
-fn: function (aString, aString2, classVars, pools, aString3){
+fn: function (aString, aString2, classVars, pools, aString3) {
 var self=this;
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
 return self;}
@@ -418,7 +418,7 @@ smalltalk.addMethod(
 "_subclass_instanceVariableNames_package_",
 smalltalk.method({
 selector: "subclass:instanceVariableNames:package:",
-fn: function (aString, aString2, aString3){
+fn: function (aString, aString2, aString3) {
 var self=this;
 return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
 return self;}
@@ -432,7 +432,7 @@ smalltalk.addMethod(
 "_instanceClass",
 smalltalk.method({
 selector: "instanceClass",
-fn: function (){
+fn: function () {
 var self=this;
 return self.instanceClass;
 return self;}
@@ -443,7 +443,7 @@ smalltalk.addMethod(
 "_instanceVariableNames_",
 smalltalk.method({
 selector: "instanceVariableNames:",
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
 return self;}
@@ -454,7 +454,7 @@ smalltalk.addMethod(
 "_isMetaclass",
 smalltalk.method({
 selector: "isMetaclass",
-fn: function (){
+fn: function () {
 var self=this;
 return true;
 return self;}
@@ -465,7 +465,7 @@ smalltalk.addMethod(
 "_printString",
 smalltalk.method({
 selector: "printString",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
 return self;}
@@ -479,7 +479,7 @@ smalltalk.addMethod(
 "_addSubclassOf_named_instanceVariableNames_",
 smalltalk.method({
 selector: "addSubclassOf:named:instanceVariableNames:",
-fn: function (aClass, aString, aCollection){
+fn: function (aClass, aString, aCollection) {
 var self=this;
 smalltalk.addClass(aString, aClass, aCollection);
 	    return smalltalk[aString];
@@ -491,7 +491,7 @@ smalltalk.addMethod(
 "_addSubclassOf_named_instanceVariableNames_package_",
 smalltalk.method({
 selector: "addSubclassOf:named:instanceVariableNames:package:",
-fn: function (aClass, aString, aCollection, packageName){
+fn: function (aClass, aString, aCollection, packageName) {
 var self=this;
 smalltalk.addClass(aString, aClass, aCollection, packageName);
 	    return smalltalk[aString];
@@ -503,7 +503,7 @@ smalltalk.addMethod(
 "_class_instanceVariableNames_",
 smalltalk.method({
 selector: "class:instanceVariableNames:",
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]));
 smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
@@ -516,7 +516,7 @@ smalltalk.addMethod(
 "_copyClass_named_",
 smalltalk.method({
 selector: "copyClass:named:",
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 var newClass=nil;
 (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
@@ -533,7 +533,7 @@ smalltalk.addMethod(
 "_instanceVariableNamesFor_",
 smalltalk.method({
 selector: "instanceVariableNamesFor:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
 return self;}
@@ -544,7 +544,7 @@ smalltalk.addMethod(
 "_setupClass_",
 smalltalk.method({
 selector: "setupClass:",
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 smalltalk.init(aClass);;
 return self;}
@@ -555,7 +555,7 @@ smalltalk.addMethod(
 "_superclass_subclass_",
 smalltalk.method({
 selector: "superclass:subclass:",
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
 return self;}
@@ -566,7 +566,7 @@ smalltalk.addMethod(
 "_superclass_subclass_instanceVariableNames_package_",
 smalltalk.method({
 selector: "superclass:subclass:instanceVariableNames:package:",
-fn: function (aClass, aString, aString2, aString3){
+fn: function (aClass, aString, aString2, aString3) {
 var self=this;
 var newClass=nil;
 (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
@@ -583,7 +583,7 @@ smalltalk.addMethod(
 "_class_category_",
 smalltalk.method({
 selector: "class:category:",
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 (self['@class']=aClass);
 (self['@category']=aString);
@@ -595,7 +595,7 @@ smalltalk.addMethod(
 "_compileMethod_",
 smalltalk.method({
 selector: "compileMethod:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [aString, self['@class'], self['@category']]);
 return self;}
@@ -606,7 +606,7 @@ smalltalk.addMethod(
 "_initialize",
 smalltalk.method({
 selector: "initialize",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.ClassCategoryReader.superclass || nil);
 (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
@@ -618,7 +618,7 @@ smalltalk.addMethod(
 "_scanFrom_",
 smalltalk.method({
 selector: "scanFrom:",
-fn: function (aChunkParser){
+fn: function (aChunkParser) {
 var self=this;
 var chunk=nil;
 (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
@@ -634,7 +634,7 @@ smalltalk.addMethod(
 "_class_",
 smalltalk.method({
 selector: "class:",
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 (self['@class']=aClass);
 return self;}
@@ -645,7 +645,7 @@ smalltalk.addMethod(
 "_initialize",
 smalltalk.method({
 selector: "initialize",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.ClassCommentReader.superclass || nil);
 (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
@@ -657,7 +657,7 @@ smalltalk.addMethod(
 "_scanFrom_",
 smalltalk.method({
 selector: "scanFrom:",
-fn: function (aChunkParser){
+fn: function (aChunkParser) {
 var self=this;
 var chunk=nil;
 (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
@@ -670,7 +670,7 @@ smalltalk.addMethod(
 "_setComment_",
 smalltalk.method({
 selector: "setComment:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self['@class'], "_comment_", [aString]);
 return self;}
@@ -684,7 +684,7 @@ smalltalk.addMethod(
 "_getNodesFrom_",
 smalltalk.method({
 selector: "getNodesFrom:",
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 var children=nil;
 var others=nil;
@@ -700,7 +700,7 @@ smalltalk.addMethod(
 "_level",
 smalltalk.method({
 selector: "level",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@level'];
 return self;}
@@ -711,7 +711,7 @@ smalltalk.addMethod(
 "_level_",
 smalltalk.method({
 selector: "level:",
-fn: function (anInteger){
+fn: function (anInteger) {
 var self=this;
 (self['@level']=anInteger);
 return self;}
@@ -722,7 +722,7 @@ smalltalk.addMethod(
 "_nodes",
 smalltalk.method({
 selector: "nodes",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@nodes'];
 return self;}
@@ -733,7 +733,7 @@ smalltalk.addMethod(
 "_theClass",
 smalltalk.method({
 selector: "theClass",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@theClass'];
 return self;}
@@ -744,7 +744,7 @@ smalltalk.addMethod(
 "_theClass_",
 smalltalk.method({
 selector: "theClass:",
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 (self['@theClass']=aClass);
 return self;}
@@ -755,7 +755,7 @@ smalltalk.addMethod(
 "_traverseClassesWith_",
 smalltalk.method({
 selector: "traverseClassesWith:",
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
 smalltalk.send(smalltalk.send(smalltalk.send(self, "_nodes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]), "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [aCollection]);})]);
@@ -768,7 +768,7 @@ smalltalk.addMethod(
 "_on_classes_level_",
 smalltalk.method({
 selector: "on:classes:level:",
-fn: function (aClass, aCollection, anInteger){
+fn: function (aClass, aCollection, anInteger) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);smalltalk.send($rec, "_level_", [anInteger]);smalltalk.send($rec, "_getNodesFrom_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;}

+ 64 - 64
js/Kernel-Classes.js

@@ -6,7 +6,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addCompiledMethod:",
 category: 'compiling',
-fn: function (aMethod){
+fn: function (aMethod) {
 var self=this;
 smalltalk.addMethod(aMethod.selector._asSelector(), aMethod, self);
 return self;},
@@ -22,7 +22,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "allInstanceVariableNames",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var result=nil;
 (result=smalltalk.send(smalltalk.send(self, "_instanceVariableNames", []), "_copy", []));
@@ -41,7 +41,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "allSubclasses",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var result=nil;
 (result=smalltalk.send(self, "_subclasses", []));
@@ -60,7 +60,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "basicNew",
 category: 'instance creation',
-fn: function (){
+fn: function () {
 var self=this;
 return new self.fn();
 return self;},
@@ -76,7 +76,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "canUnderstand:",
 category: 'testing',
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_includes_", [smalltalk.send(aSelector, "_asString", [])]), "_or_", [(function(){return smalltalk.send(smalltalk.send(smalltalk.send(self, "_superclass", []), "_notNil", []), "_and_", [(function(){return smalltalk.send(smalltalk.send(self, "_superclass", []), "_canUnderstand_", [aSelector]);})]);})]);
 return self;},
@@ -92,7 +92,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "comment",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["comment"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;},
@@ -108,7 +108,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "comment:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["comment", aString]);
 return self;},
@@ -124,7 +124,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "commentStamp",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_class_", [self]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCommentReader || ClassCommentReader), "_new", []));
 return self;},
@@ -140,7 +140,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "commentStamp:prior:",
 category: 'accessing',
-fn: function (aStamp, prior){
+fn: function (aStamp, prior) {
 var self=this;
 return smalltalk.send(self, "_commentStamp", []);
 return self;},
@@ -156,7 +156,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "compile:",
 category: 'compiling',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_compile_category_", [aString, ""]);
 return self;},
@@ -172,7 +172,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "compile:category:",
 category: 'compiling',
-fn: function (aString, anotherString){
+fn: function (aString, anotherString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_install_forClass_category_", [aString, self, anotherString]);return smalltalk.send($rec, "_setupClass_", [self]);})(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []));
 return self;},
@@ -188,7 +188,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "inheritsFrom:",
 category: 'testing',
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 return smalltalk.send(smalltalk.send(aClass, "_allSubclasses", []), "_includes_", [self]);
 return self;},
@@ -204,7 +204,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "instanceVariableNames",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.iVarNames;
 return self;},
@@ -220,7 +220,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "methodAt:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return smalltalk.methods(self)[aString];
 return self;},
@@ -236,7 +236,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "methodDictionary",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var dict = smalltalk.HashedCollection._new();
 	var methods = self.fn.prototype.methods;
@@ -259,7 +259,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "methodsFor:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_class_category_", [self, aString]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.ClassCategoryReader || ClassCategoryReader), "_new", []));
 return self;},
@@ -275,7 +275,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "methodsFor:stamp:",
 category: 'accessing',
-fn: function (aString, aStamp){
+fn: function (aString, aStamp) {
 var self=this;
 return smalltalk.send(self, "_methodsFor_", [aString]);
 return self;},
@@ -291,7 +291,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "name",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.className || nil;
 return self;},
@@ -307,7 +307,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "new",
 category: 'instance creation',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
 return self;},
@@ -323,7 +323,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "protocols",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var protocols=nil;
 (protocols=smalltalk.send((smalltalk.Array || Array), "_new", []));
@@ -342,7 +342,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "protocolsDo:",
 category: 'accessing',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 var methodsByCategory=nil;
 (methodsByCategory=smalltalk.send((smalltalk.HashedCollection || HashedCollection), "_new", []));
@@ -361,7 +361,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "prototype",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.fn.prototype;
 return self;},
@@ -377,7 +377,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "removeCompiledMethod:",
 category: 'compiling',
-fn: function (aMethod){
+fn: function (aMethod) {
 var self=this;
 delete self.fn.prototype[aMethod.selector._asSelector()];
 	delete self.fn.prototype.methods[aMethod.selector];
@@ -395,7 +395,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "subclasses",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.subclasses(self);
 return self;},
@@ -411,7 +411,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "superclass",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.superclass || nil;
 return self;},
@@ -427,7 +427,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "withAllSubclasses",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_addAll_", [smalltalk.send(self, "_allSubclasses", [])]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send((smalltalk.Array || Array), "_with_", [self]));
 return self;},
@@ -447,7 +447,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_package", [])) == nil || $receiver == undefined) ? (function(){return "Unclassified";})() : (function(){return smalltalk.send(smalltalk.send(self, "_package", []), "_name", []);})();
 return self;},
@@ -463,7 +463,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "isClass",
 category: 'testing',
-fn: function (){
+fn: function () {
 var self=this;
 return true;
 return self;},
@@ -479,7 +479,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "package",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.pkg;
 return self;},
@@ -495,7 +495,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "package:",
 category: 'accessing',
-fn: function (aPackage){
+fn: function (aPackage) {
 var self=this;
 self.pkg = aPackage;
 return self;},
@@ -511,7 +511,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "printString",
 category: 'printing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_name", []);
 return self;},
@@ -527,7 +527,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "rename:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 
 		smalltalk[aString] = self;
@@ -547,7 +547,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "subclass:instanceVariableNames:",
 category: 'class creation',
-fn: function (aString, anotherString){
+fn: function (aString, anotherString) {
 var self=this;
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, anotherString, nil]);
 return self;},
@@ -563,7 +563,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "subclass:instanceVariableNames:category:",
 category: 'class creation',
-fn: function (aString, aString2, aString3){
+fn: function (aString, aString2, aString3) {
 var self=this;
 smalltalk.send(self, "_deprecatedAPI", []);
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
@@ -580,7 +580,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "subclass:instanceVariableNames:classVariableNames:poolDictionaries:category:",
 category: 'class creation',
-fn: function (aString, aString2, classVars, pools, aString3){
+fn: function (aString, aString2, classVars, pools, aString3) {
 var self=this;
 return smalltalk.send(self, "_subclass_instanceVariableNames_package_", [aString, aString2, aString3]);
 return self;},
@@ -596,7 +596,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "subclass:instanceVariableNames:package:",
 category: 'class creation',
-fn: function (aString, aString2, aString3){
+fn: function (aString, aString2, aString3) {
 var self=this;
 return smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_superclass_subclass_instanceVariableNames_package_", [self, smalltalk.send(aString, "_asString", []), aString2, aString3]);
 return self;},
@@ -616,7 +616,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "instanceClass",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.instanceClass;
 return self;},
@@ -632,7 +632,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "instanceVariableNames:",
 category: 'accessing',
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.ClassBuilder || ClassBuilder), "_new", []), "_class_instanceVariableNames_", [self, aCollection]);
 return self;},
@@ -648,7 +648,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "isMetaclass",
 category: 'testing',
-fn: function (){
+fn: function () {
 var self=this;
 return true;
 return self;},
@@ -664,7 +664,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "printString",
 category: 'printing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_instanceClass", []), "_name", []), "__comma", [" class"]);
 return self;},
@@ -684,7 +684,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addSubclassOf:named:instanceVariableNames:",
 category: 'private',
-fn: function (aClass, aString, aCollection){
+fn: function (aClass, aString, aCollection) {
 var self=this;
 smalltalk.addClass(aString, aClass, aCollection);
 	    return smalltalk[aString];
@@ -701,7 +701,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addSubclassOf:named:instanceVariableNames:package:",
 category: 'private',
-fn: function (aClass, aString, aCollection, packageName){
+fn: function (aClass, aString, aCollection, packageName) {
 var self=this;
 smalltalk.addClass(aString, aClass, aCollection, packageName);
 	    return smalltalk[aString];
@@ -718,7 +718,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "class:instanceVariableNames:",
 category: 'class creation',
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_error_", [smalltalk.send(smalltalk.send(aClass, "_name", []), "__comma", [" is not a metaclass"])]);})]));
 smalltalk.send(aClass, "_basicAt_put_", ["iVarNames", smalltalk.send(self, "_instanceVariableNamesFor_", [aString])]);
@@ -736,7 +736,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "copyClass:named:",
 category: 'private',
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 var newClass=nil;
 (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [smalltalk.send(aClass, "_superclass", []), aString, smalltalk.send(aClass, "_instanceVariableNames", []), smalltalk.send(smalltalk.send(aClass, "_package", []), "_name", [])]));
@@ -758,7 +758,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "instanceVariableNamesFor:",
 category: 'private',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 return smalltalk.send(smalltalk.send(aString, "_tokenize_", [" "]), "_reject_", [(function(each){return smalltalk.send(each, "_isEmpty", []);})]);
 return self;},
@@ -774,7 +774,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setupClass:",
 category: 'private',
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 smalltalk.init(aClass);;
 return self;},
@@ -790,7 +790,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "superclass:subclass:",
 category: 'class creation',
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 return smalltalk.send(self, "_superclass_subclass_instanceVariableNames_package_", [aClass, aString, "", nil]);
 return self;},
@@ -806,7 +806,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "superclass:subclass:instanceVariableNames:package:",
 category: 'class creation',
-fn: function (aClass, aString, aString2, aString3){
+fn: function (aClass, aString, aString2, aString3) {
 var self=this;
 var newClass=nil;
 (newClass=smalltalk.send(self, "_addSubclassOf_named_instanceVariableNames_package_", [aClass, aString, smalltalk.send(self, "_instanceVariableNamesFor_", [aString2]), (($receiver = aString3) == nil || $receiver == undefined) ? (function(){return "unclassified";})() : $receiver]));
@@ -829,7 +829,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "class:category:",
 category: 'accessing',
-fn: function (aClass, aString){
+fn: function (aClass, aString) {
 var self=this;
 (self['@class']=aClass);
 (self['@category']=aString);
@@ -846,7 +846,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "compileMethod:",
 category: 'private',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.Compiler || Compiler), "_new", []), "_install_forClass_category_", [aString, self['@class'], self['@category']]);
 return self;},
@@ -862,7 +862,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.ClassCategoryReader.superclass || nil);
 (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
@@ -879,7 +879,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "scanFrom:",
 category: 'fileIn',
-fn: function (aChunkParser){
+fn: function (aChunkParser) {
 var self=this;
 var chunk=nil;
 (function(){while(!(function(){(chunk=smalltalk.send(aChunkParser, "_nextChunk", []));return smalltalk.send(chunk, "_isEmpty", []);})()) {(function(){return smalltalk.send(self, "_compileMethod_", [chunk]);})()}})();
@@ -901,7 +901,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "class:",
 category: 'accessing',
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 (self['@class']=aClass);
 return self;},
@@ -917,7 +917,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.ClassCommentReader.superclass || nil);
 (self['@chunkParser']=smalltalk.send((smalltalk.ChunkParser || ChunkParser), "_new", []));
@@ -934,7 +934,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "scanFrom:",
 category: 'fileIn',
-fn: function (aChunkParser){
+fn: function (aChunkParser) {
 var self=this;
 var chunk=nil;
 (chunk=smalltalk.send(aChunkParser, "_nextChunk", []));
@@ -952,7 +952,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setComment:",
 category: 'private',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self['@class'], "_comment_", [aString]);
 return self;},
@@ -971,7 +971,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "getNodesFrom:",
 category: 'accessing',
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 var children=nil;
 var others=nil;
@@ -992,7 +992,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "level",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@level'];
 return self;},
@@ -1008,7 +1008,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "level:",
 category: 'accessing',
-fn: function (anInteger){
+fn: function (anInteger) {
 var self=this;
 (self['@level']=anInteger);
 return self;},
@@ -1024,7 +1024,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "nodes",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@nodes'];
 return self;},
@@ -1040,7 +1040,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@theClass'];
 return self;},
@@ -1056,7 +1056,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "theClass:",
 category: 'accessing',
-fn: function (aClass){
+fn: function (aClass) {
 var self=this;
 (self['@theClass']=aClass);
 return self;},
@@ -1072,7 +1072,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "traverseClassesWith:",
 category: 'visiting',
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 smalltalk.send(aCollection, "_add_", [smalltalk.send(self, "_theClass", [])]);
 smalltalk.send(smalltalk.send(smalltalk.send(self, "_nodes", []), "_sorted_", [(function(a, b){return ((($receiver = smalltalk.send(smalltalk.send(a, "_theClass", []), "_name", [])).klass === smalltalk.Number) ? $receiver <=smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", []) : smalltalk.send($receiver, "__lt_eq", [smalltalk.send(smalltalk.send(b, "_theClass", []), "_name", [])]));})]), "_do_", [(function(aNode){return smalltalk.send(aNode, "_traverseClassesWith_", [aCollection]);})]);
@@ -1090,7 +1090,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "on:classes:level:",
 category: 'instance creation',
-fn: function (aClass, aCollection, anInteger){
+fn: function (aClass, aCollection, anInteger) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_theClass_", [aClass]);smalltalk.send($rec, "_level_", [anInteger]);smalltalk.send($rec, "_getNodesFrom_", [aCollection]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;},

File diff suppressed because it is too large
+ 124 - 110
js/Kernel-Collections.deploy.js


File diff suppressed because it is too large
+ 128 - 109
js/Kernel-Collections.js


+ 57 - 46
js/Kernel-Methods.deploy.js

@@ -4,7 +4,7 @@ smalltalk.addMethod(
 "_applyTo_arguments_",
 smalltalk.method({
 selector: "applyTo:arguments:",
-fn: function (anObject, aCollection){
+fn: function (anObject, aCollection) {
 var self=this;
 return self.apply(anObject, aCollection);
 return self;}
@@ -15,7 +15,7 @@ smalltalk.addMethod(
 "_compiledSource",
 smalltalk.method({
 selector: "compiledSource",
-fn: function (){
+fn: function () {
 var self=this;
 return self.toString();
 return self;}
@@ -26,7 +26,7 @@ smalltalk.addMethod(
 "_ensure_",
 smalltalk.method({
 selector: "ensure:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 var success=nil;
 (success=false);
@@ -39,7 +39,7 @@ smalltalk.addMethod(
 "_new",
 smalltalk.method({
 selector: "new",
-fn: function (){
+fn: function () {
 var self=this;
 return new self();
 return self;}
@@ -50,7 +50,7 @@ smalltalk.addMethod(
 "_newValue_",
 smalltalk.method({
 selector: "newValue:",
-fn: function (anObject){
+fn: function (anObject) {
 var self=this;
 return new self(anObject);
 return self;}
@@ -61,7 +61,7 @@ smalltalk.addMethod(
 "_newValue_value_",
 smalltalk.method({
 selector: "newValue:value:",
-fn: function (anObject, anObject2){
+fn: function (anObject, anObject2) {
 var self=this;
 return new self(anObject, anObject2);
 return self;}
@@ -72,7 +72,7 @@ smalltalk.addMethod(
 "_newValue_value_value_",
 smalltalk.method({
 selector: "newValue:value:value:",
-fn: function (anObject, anObject2, anObject3){
+fn: function (anObject, anObject2, anObject3) {
 var self=this;
 return new self(anObject, anObject2);
 return self;}
@@ -83,7 +83,7 @@ smalltalk.addMethod(
 "_numArgs",
 smalltalk.method({
 selector: "numArgs",
-fn: function (){
+fn: function () {
 var self=this;
 return self.length;
 return self;}
@@ -94,7 +94,7 @@ smalltalk.addMethod(
 "_on_do_",
 smalltalk.method({
 selector: "on:do:",
-fn: function (anErrorClass, aBlock){
+fn: function (anErrorClass, aBlock) {
 var self=this;
 return smalltalk.send(self, "_try_catch_", [self, (function(error){return ((($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value_", [error]);})() : (function(){return smalltalk.send(error, "_signal", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]));})]);
 return self;}
@@ -105,7 +105,7 @@ smalltalk.addMethod(
 "_timeToRun",
 smalltalk.method({
 selector: "timeToRun",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
 return self;}
@@ -116,7 +116,7 @@ smalltalk.addMethod(
 "_value",
 smalltalk.method({
 selector: "value",
-fn: function (){
+fn: function () {
 var self=this;
 return self();;
 return self;}
@@ -127,7 +127,7 @@ smalltalk.addMethod(
 "_value_",
 smalltalk.method({
 selector: "value:",
-fn: function (anArg){
+fn: function (anArg) {
 var self=this;
 return self(anArg);;
 return self;}
@@ -138,7 +138,7 @@ smalltalk.addMethod(
 "_value_value_",
 smalltalk.method({
 selector: "value:value:",
-fn: function (firstArg, secondArg){
+fn: function (firstArg, secondArg) {
 var self=this;
 return self(firstArg, secondArg);;
 return self;}
@@ -149,7 +149,7 @@ smalltalk.addMethod(
 "_value_value_value_",
 smalltalk.method({
 selector: "value:value:value:",
-fn: function (firstArg, secondArg, thirdArg){
+fn: function (firstArg, secondArg, thirdArg) {
 var self=this;
 return self(firstArg, secondArg, thirdArg);;
 return self;}
@@ -160,7 +160,7 @@ smalltalk.addMethod(
 "_valueWithInterval_",
 smalltalk.method({
 selector: "valueWithInterval:",
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 return setInterval(self, aNumber);
 return self;}
@@ -171,7 +171,7 @@ smalltalk.addMethod(
 "_valueWithPossibleArguments_",
 smalltalk.method({
 selector: "valueWithPossibleArguments:",
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 return self.apply(null, aCollection);;
 return self;}
@@ -182,7 +182,7 @@ smalltalk.addMethod(
 "_valueWithTimeout_",
 smalltalk.method({
 selector: "valueWithTimeout:",
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 return setTimeout(self, aNumber);
 return self;}
@@ -193,7 +193,7 @@ smalltalk.addMethod(
 "_whileFalse",
 smalltalk.method({
 selector: "whileFalse",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
 return self;}
@@ -204,7 +204,7 @@ smalltalk.addMethod(
 "_whileFalse_",
 smalltalk.method({
 selector: "whileFalse:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 while(!self()) {aBlock()};
 return self;}
@@ -215,7 +215,7 @@ smalltalk.addMethod(
 "_whileTrue",
 smalltalk.method({
 selector: "whileTrue",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
 return self;}
@@ -226,7 +226,7 @@ smalltalk.addMethod(
 "_whileTrue_",
 smalltalk.method({
 selector: "whileTrue:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 while(self()) {aBlock()};
 return self;}
@@ -240,7 +240,7 @@ smalltalk.addMethod(
 "_arguments",
 smalltalk.method({
 selector: "arguments",
-fn: function (){
+fn: function () {
 var self=this;
 return self.args || [];
 return self;}
@@ -251,7 +251,7 @@ smalltalk.addMethod(
 "_category",
 smalltalk.method({
 selector: "category",
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;}
@@ -262,7 +262,7 @@ smalltalk.addMethod(
 "_category_",
 smalltalk.method({
 selector: "category:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["category", aString]);
 return self;}
@@ -273,7 +273,7 @@ smalltalk.addMethod(
 "_fn",
 smalltalk.method({
 selector: "fn",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["fn"]);
 return self;}
@@ -284,7 +284,7 @@ smalltalk.addMethod(
 "_fn_",
 smalltalk.method({
 selector: "fn:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
 return self;}
@@ -295,7 +295,7 @@ smalltalk.addMethod(
 "_messageSends",
 smalltalk.method({
 selector: "messageSends",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["messageSends"]);
 return self;}
@@ -306,7 +306,7 @@ smalltalk.addMethod(
 "_methodClass",
 smalltalk.method({
 selector: "methodClass",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["methodClass"]);
 return self;}
@@ -317,7 +317,7 @@ smalltalk.addMethod(
 "_referencedClasses",
 smalltalk.method({
 selector: "referencedClasses",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
 return self;}
@@ -328,7 +328,7 @@ smalltalk.addMethod(
 "_selector",
 smalltalk.method({
 selector: "selector",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["selector"]);
 return self;}
@@ -339,7 +339,7 @@ smalltalk.addMethod(
 "_selector_",
 smalltalk.method({
 selector: "selector:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
 return self;}
@@ -350,7 +350,7 @@ smalltalk.addMethod(
 "_source",
 smalltalk.method({
 selector: "source",
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;}
@@ -361,7 +361,7 @@ smalltalk.addMethod(
 "_source_",
 smalltalk.method({
 selector: "source:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["source", aString]);
 return self;}
@@ -375,7 +375,7 @@ smalltalk.addMethod(
 "_arguments",
 smalltalk.method({
 selector: "arguments",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@arguments'];
 return self;}
@@ -386,7 +386,7 @@ smalltalk.addMethod(
 "_arguments_",
 smalltalk.method({
 selector: "arguments:",
-fn: function (anArray){
+fn: function (anArray) {
 var self=this;
 (self['@arguments']=anArray);
 return self;}
@@ -397,7 +397,7 @@ smalltalk.addMethod(
 "_printString",
 smalltalk.method({
 selector: "printString",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Message.superclass || nil)]);smalltalk.send($rec, "_nextPutAll_", ["("]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [")"]);})(aStream);})]);
 return self;}
@@ -408,7 +408,7 @@ smalltalk.addMethod(
 "_selector",
 smalltalk.method({
 selector: "selector",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@selector'];
 return self;}
@@ -419,7 +419,7 @@ smalltalk.addMethod(
 "_selector_",
 smalltalk.method({
 selector: "selector:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (self['@selector']=aString);
 return self;}
@@ -430,7 +430,7 @@ smalltalk.addMethod(
 "_sendTo_",
 smalltalk.method({
 selector: "sendTo:",
-fn: function (anObject){
+fn: function (anObject) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
 return self;}
@@ -442,7 +442,7 @@ smalltalk.addMethod(
 "_selector_arguments_",
 smalltalk.method({
 selector: "selector:arguments:",
-fn: function (aString, anArray){
+fn: function (aString, anArray) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;}
@@ -455,7 +455,7 @@ smalltalk.addMethod(
 "_asString",
 smalltalk.method({
 selector: "asString",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [" >> "]), "__comma", [smalltalk.send(self, "_selector", [])]);
 return self;}
@@ -466,18 +466,29 @@ smalltalk.addMethod(
 "_home",
 smalltalk.method({
 selector: "home",
-fn: function (){
+fn: function () {
 var self=this;
 return self.homeContext;
 return self;}
 }),
 smalltalk.MethodContext);
 
+smalltalk.addMethod(
+"_pc",
+smalltalk.method({
+selector: "pc",
+fn: function () {
+var self=this;
+return self.pc;
+return self;}
+}),
+smalltalk.MethodContext);
+
 smalltalk.addMethod(
 "_printString",
 smalltalk.method({
 selector: "printString",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.MethodContext.superclass || nil), "__comma", ["("]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [")"]);
 return self;}
@@ -488,7 +499,7 @@ smalltalk.addMethod(
 "_receiver",
 smalltalk.method({
 selector: "receiver",
-fn: function (){
+fn: function () {
 var self=this;
 return self.receiver;
 return self;}
@@ -499,7 +510,7 @@ smalltalk.addMethod(
 "_selector",
 smalltalk.method({
 selector: "selector",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.convertSelector(self.selector);
 return self;}
@@ -510,7 +521,7 @@ smalltalk.addMethod(
 "_temps",
 smalltalk.method({
 selector: "temps",
-fn: function (){
+fn: function () {
 var self=this;
 return self.temps;
 return self;}

+ 62 - 46
js/Kernel-Methods.js

@@ -6,7 +6,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "applyTo:arguments:",
 category: 'evaluating',
-fn: function (anObject, aCollection){
+fn: function (anObject, aCollection) {
 var self=this;
 return self.apply(anObject, aCollection);
 return self;},
@@ -22,7 +22,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "compiledSource",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.toString();
 return self;},
@@ -38,7 +38,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "ensure:",
 category: 'evaluating',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 var success=nil;
 (success=false);
@@ -56,7 +56,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "new",
 category: 'evaluating',
-fn: function (){
+fn: function () {
 var self=this;
 return new self();
 return self;},
@@ -72,7 +72,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "newValue:",
 category: 'evaluating',
-fn: function (anObject){
+fn: function (anObject) {
 var self=this;
 return new self(anObject);
 return self;},
@@ -88,7 +88,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "newValue:value:",
 category: 'evaluating',
-fn: function (anObject, anObject2){
+fn: function (anObject, anObject2) {
 var self=this;
 return new self(anObject, anObject2);
 return self;},
@@ -104,7 +104,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "newValue:value:value:",
 category: 'evaluating',
-fn: function (anObject, anObject2, anObject3){
+fn: function (anObject, anObject2, anObject3) {
 var self=this;
 return new self(anObject, anObject2);
 return self;},
@@ -120,7 +120,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "numArgs",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.length;
 return self;},
@@ -136,7 +136,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "on:do:",
 category: 'error handling',
-fn: function (anErrorClass, aBlock){
+fn: function (anErrorClass, aBlock) {
 var self=this;
 return smalltalk.send(self, "_try_catch_", [self, (function(error){return ((($receiver = smalltalk.send(error, "_isKindOf_", [anErrorClass])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return smalltalk.send(aBlock, "_value_", [error]);})() : (function(){return smalltalk.send(error, "_signal", []);})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return smalltalk.send(aBlock, "_value_", [error]);}), (function(){return smalltalk.send(error, "_signal", []);})]));})]);
 return self;},
@@ -152,7 +152,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "timeToRun",
 category: 'evaluating',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send((smalltalk.Date || Date), "_millisecondsToRun_", [self]);
 return self;},
@@ -168,7 +168,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "value",
 category: 'evaluating',
-fn: function (){
+fn: function () {
 var self=this;
 return self();;
 return self;},
@@ -184,7 +184,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "value:",
 category: 'evaluating',
-fn: function (anArg){
+fn: function (anArg) {
 var self=this;
 return self(anArg);;
 return self;},
@@ -200,7 +200,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "value:value:",
 category: 'evaluating',
-fn: function (firstArg, secondArg){
+fn: function (firstArg, secondArg) {
 var self=this;
 return self(firstArg, secondArg);;
 return self;},
@@ -216,7 +216,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "value:value:value:",
 category: 'evaluating',
-fn: function (firstArg, secondArg, thirdArg){
+fn: function (firstArg, secondArg, thirdArg) {
 var self=this;
 return self(firstArg, secondArg, thirdArg);;
 return self;},
@@ -232,7 +232,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "valueWithInterval:",
 category: 'timeout/interval',
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 return setInterval(self, aNumber);
 return self;},
@@ -248,7 +248,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "valueWithPossibleArguments:",
 category: 'evaluating',
-fn: function (aCollection){
+fn: function (aCollection) {
 var self=this;
 return self.apply(null, aCollection);;
 return self;},
@@ -264,7 +264,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "valueWithTimeout:",
 category: 'timeout/interval',
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 return setTimeout(self, aNumber);
 return self;},
@@ -280,7 +280,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "whileFalse",
 category: 'controlling',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_whileFalse_", [(function(){return nil;})]);
 return self;},
@@ -296,7 +296,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "whileFalse:",
 category: 'controlling',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 while(!self()) {aBlock()};
 return self;},
@@ -312,7 +312,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "whileTrue",
 category: 'controlling',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_whileTrue_", [(function(){return nil;})]);
 return self;},
@@ -328,7 +328,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "whileTrue:",
 category: 'controlling',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 while(self()) {aBlock()};
 return self;},
@@ -348,7 +348,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "arguments",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.args || [];
 return self;},
@@ -364,7 +364,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "category",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["category"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;},
@@ -380,7 +380,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "category:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["category", aString]);
 return self;},
@@ -396,7 +396,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "fn",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["fn"]);
 return self;},
@@ -412,7 +412,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "fn:",
 category: 'accessing',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["fn", aBlock]);
 return self;},
@@ -428,7 +428,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "messageSends",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["messageSends"]);
 return self;},
@@ -444,7 +444,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "methodClass",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["methodClass"]);
 return self;},
@@ -460,7 +460,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "referencedClasses",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["referencedClasses"]);
 return self;},
@@ -476,7 +476,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_basicAt_", ["selector"]);
 return self;},
@@ -492,7 +492,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["selector", aString]);
 return self;},
@@ -508,7 +508,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "source",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (($receiver = smalltalk.send(self, "_basicAt_", ["source"])) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver;
 return self;},
@@ -524,7 +524,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "source:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 smalltalk.send(self, "_basicAt_put_", ["source", aString]);
 return self;},
@@ -544,7 +544,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "arguments",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@arguments'];
 return self;},
@@ -560,7 +560,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "arguments:",
 category: 'accessing',
-fn: function (anArray){
+fn: function (anArray) {
 var self=this;
 (self['@arguments']=anArray);
 return self;},
@@ -576,7 +576,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "printString",
 category: 'printing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send((smalltalk.String || String), "_streamContents_", [(function(aStream){return (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(self, "_printString", [], smalltalk.Message.superclass || nil)]);smalltalk.send($rec, "_nextPutAll_", ["("]);smalltalk.send($rec, "_nextPutAll_", [self['@selector']]);return smalltalk.send($rec, "_nextPutAll_", [")"]);})(aStream);})]);
 return self;},
@@ -592,7 +592,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@selector'];
 return self;},
@@ -608,7 +608,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector:",
 category: 'accessing',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (self['@selector']=aString);
 return self;},
@@ -624,7 +624,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "sendTo:",
 category: 'printing',
-fn: function (anObject){
+fn: function (anObject) {
 var self=this;
 smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_send_to_arguments_", [smalltalk.send(self, "_selector", []), anObject, smalltalk.send(self, "_arguments", [])]);
 return self;},
@@ -641,7 +641,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector:arguments:",
 category: 'instance creation',
-fn: function (aString, anArray){
+fn: function (aString, anArray) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_selector_", [aString]);smalltalk.send($rec, "_arguments_", [anArray]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;},
@@ -660,7 +660,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "asString",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_receiver", []), "_class", []), "_printString", []), "__comma", [" >> "]), "__comma", [smalltalk.send(self, "_selector", [])]);
 return self;},
@@ -676,7 +676,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "home",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.homeContext;
 return self;},
@@ -687,12 +687,28 @@ referencedClasses: []
 }),
 smalltalk.MethodContext);
 
+smalltalk.addMethod(
+"_pc",
+smalltalk.method({
+selector: "pc",
+category: 'accessing',
+fn: function () {
+var self=this;
+return self.pc;
+return self;},
+args: [],
+source: "pc\x0a\x09<return self.pc>",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.MethodContext);
+
 smalltalk.addMethod(
 "_printString",
 smalltalk.method({
 selector: "printString",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(self, "_printString", [], smalltalk.MethodContext.superclass || nil), "__comma", ["("]), "__comma", [smalltalk.send(self, "_asString", [])]), "__comma", [")"]);
 return self;},
@@ -708,7 +724,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "receiver",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.receiver;
 return self;},
@@ -724,7 +740,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.convertSelector(self.selector);
 return self;},
@@ -740,7 +756,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "temps",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self.temps;
 return self;},

File diff suppressed because it is too large
+ 121 - 110
js/Kernel-Objects.deploy.js


File diff suppressed because it is too large
+ 125 - 109
js/Kernel-Objects.js


+ 41 - 30
js/SUnit.deploy.js

@@ -4,7 +4,7 @@ smalltalk.addMethod(
 "_assert_",
 smalltalk.method({
 selector: "assert:",
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
 return self;}
@@ -15,7 +15,7 @@ smalltalk.addMethod(
 "_assert_description_",
 smalltalk.method({
 selector: "assert:description:",
-fn: function (aBoolean, aString){
+fn: function (aBoolean, aString) {
 var self=this;
 ((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;}
@@ -26,7 +26,7 @@ smalltalk.addMethod(
 "_assert_equals_",
 smalltalk.method({
 selector: "assert:equals:",
-fn: function (expected, actual){
+fn: function (expected, actual) {
 var self=this;
 return smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
 return self;}
@@ -37,7 +37,7 @@ smalltalk.addMethod(
 "_deny_",
 smalltalk.method({
 selector: "deny:",
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
 return self;}
@@ -48,7 +48,7 @@ smalltalk.addMethod(
 "_performTestFor_",
 smalltalk.method({
 selector: "performTestFor:",
-fn: function (aResult){
+fn: function (aResult) {
 var self=this;
 smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}), "_on_do_", [(smalltalk.TestFailure || TestFailure), (function(ex){return smalltalk.send(aResult, "_addFailure_", [self]);})]);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return smalltalk.send(aResult, "_addError_", [self]);})]);
 return self;}
@@ -59,7 +59,7 @@ smalltalk.addMethod(
 "_runCaseFor_",
 smalltalk.method({
 selector: "runCaseFor:",
-fn: function (aTestResult){
+fn: function (aTestResult) {
 var self=this;
 smalltalk.send(self, "_setUp", []);
 smalltalk.send(aTestResult, "_increaseRuns", []);
@@ -73,7 +73,7 @@ smalltalk.addMethod(
 "_selector",
 smalltalk.method({
 selector: "selector",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@testSelector'];
 return self;}
@@ -84,7 +84,7 @@ smalltalk.addMethod(
 "_setTestSelector_",
 smalltalk.method({
 selector: "setTestSelector:",
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 (self['@testSelector']=aSelector);
 return self;}
@@ -95,7 +95,7 @@ smalltalk.addMethod(
 "_setUp",
 smalltalk.method({
 selector: "setUp",
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;}
@@ -106,7 +106,7 @@ smalltalk.addMethod(
 "_should_",
 smalltalk.method({
 selector: "should:",
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
 return self;}
@@ -117,18 +117,29 @@ smalltalk.addMethod(
 "_should_raise_",
 smalltalk.method({
 selector: "should:raise:",
-fn: function (aBlock, anExceptionClass){
+fn: function (aBlock, anExceptionClass) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return false;}), "_on_do_", [anExceptionClass, (function(ex){return true;})])]);
 return self;}
 }),
 smalltalk.TestCase);
 
+smalltalk.addMethod(
+"_shouldnt_raise_",
+smalltalk.method({
+selector: "shouldnt:raise:",
+fn: function (aBlock, anExceptionClass) {
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return true;}), "_on_do_", [anExceptionClass, (function(ex){return false;})])]);
+return self;}
+}),
+smalltalk.TestCase);
+
 smalltalk.addMethod(
 "_signalFailure_",
 smalltalk.method({
 selector: "signalFailure:",
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
 return self;}
@@ -139,7 +150,7 @@ smalltalk.addMethod(
 "_tearDown",
 smalltalk.method({
 selector: "tearDown",
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;}
@@ -151,7 +162,7 @@ smalltalk.addMethod(
 "_allTestSelectors",
 smalltalk.method({
 selector: "allTestSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 var selectors=nil;
 (selectors=smalltalk.send(self, "_testSelectors", []));
@@ -165,7 +176,7 @@ smalltalk.addMethod(
 "_buildSuite",
 smalltalk.method({
 selector: "buildSuite",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [(function(each){return smalltalk.send(self, "_selector_", [each]);})]);
 return self;}
@@ -176,7 +187,7 @@ smalltalk.addMethod(
 "_lookupHierarchyRoot",
 smalltalk.method({
 selector: "lookupHierarchyRoot",
-fn: function (){
+fn: function () {
 var self=this;
 return (smalltalk.TestCase || TestCase);
 return self;}
@@ -187,7 +198,7 @@ smalltalk.addMethod(
 "_selector_",
 smalltalk.method({
 selector: "selector:",
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_setTestSelector_", [aSelector]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;}
@@ -198,7 +209,7 @@ smalltalk.addMethod(
 "_shouldInheritSelectors",
 smalltalk.method({
 selector: "shouldInheritSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
 return self;}
@@ -209,7 +220,7 @@ smalltalk.addMethod(
 "_testSelectors",
 smalltalk.method({
 selector: "testSelectors",
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", ["^test"]);})]);
 return self;}
@@ -225,7 +236,7 @@ smalltalk.addMethod(
 "_addError_",
 smalltalk.method({
 selector: "addError:",
-fn: function (anError){
+fn: function (anError) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
 return self;}
@@ -236,7 +247,7 @@ smalltalk.addMethod(
 "_addFailure_",
 smalltalk.method({
 selector: "addFailure:",
-fn: function (aFailure){
+fn: function (aFailure) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
 return self;}
@@ -247,7 +258,7 @@ smalltalk.addMethod(
 "_errors",
 smalltalk.method({
 selector: "errors",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@errors'];
 return self;}
@@ -258,7 +269,7 @@ smalltalk.addMethod(
 "_failures",
 smalltalk.method({
 selector: "failures",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@failures'];
 return self;}
@@ -269,7 +280,7 @@ smalltalk.addMethod(
 "_increaseRuns",
 smalltalk.method({
 selector: "increaseRuns",
-fn: function (){
+fn: function () {
 var self=this;
 (self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
 return self;}
@@ -280,7 +291,7 @@ smalltalk.addMethod(
 "_initialize",
 smalltalk.method({
 selector: "initialize",
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.TestResult.superclass || nil);
 (self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
@@ -296,7 +307,7 @@ smalltalk.addMethod(
 "_runs",
 smalltalk.method({
 selector: "runs",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@runs'];
 return self;}
@@ -307,7 +318,7 @@ smalltalk.addMethod(
 "_status",
 smalltalk.method({
 selector: "status",
-fn: function (){
+fn: function () {
 var self=this;
 return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;}
@@ -318,7 +329,7 @@ smalltalk.addMethod(
 "_timestamp",
 smalltalk.method({
 selector: "timestamp",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@timestamp'];
 return self;}
@@ -329,7 +340,7 @@ smalltalk.addMethod(
 "_total",
 smalltalk.method({
 selector: "total",
-fn: function (){
+fn: function () {
 var self=this;
 return self['@total'];
 return self;}
@@ -340,7 +351,7 @@ smalltalk.addMethod(
 "_total_",
 smalltalk.method({
 selector: "total:",
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 (self['@total']=aNumber);
 return self;}

+ 46 - 30
js/SUnit.js

@@ -5,7 +5,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:",
 category: 'testing',
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_description_", [aBoolean, "Assertion failed"]);
 return self;},
@@ -21,7 +21,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:description:",
 category: 'testing',
-fn: function (aBoolean, aString){
+fn: function (aBoolean, aString) {
 var self=this;
 ((($receiver = aBoolean).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_signalFailure_", [aString]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_signalFailure_", [aString]);})]));
 return self;},
@@ -37,7 +37,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "assert:equals:",
 category: 'testing',
-fn: function (expected, actual){
+fn: function (expected, actual) {
 var self=this;
 return smalltalk.send(self, "_assert_description_", [smalltalk.send(expected, "__eq", [actual]), smalltalk.send(smalltalk.send(smalltalk.send("Expected: ", "__comma", [smalltalk.send(expected, "_asString", [])]), "__comma", [" but was: "]), "__comma", [smalltalk.send(actual, "_asString", [])])]);
 return self;},
@@ -53,7 +53,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "deny:",
 category: 'testing',
-fn: function (aBoolean){
+fn: function (aBoolean) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBoolean, "_not", [])]);
 return self;},
@@ -69,7 +69,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "performTestFor:",
 category: 'running',
-fn: function (aResult){
+fn: function (aResult) {
 var self=this;
 smalltalk.send((function(){return smalltalk.send((function(){return smalltalk.send(self, "_perform_", [smalltalk.send(self, "_selector", [])]);}), "_on_do_", [(smalltalk.TestFailure || TestFailure), (function(ex){return smalltalk.send(aResult, "_addFailure_", [self]);})]);}), "_on_do_", [(smalltalk.Error || Error), (function(ex){return smalltalk.send(aResult, "_addError_", [self]);})]);
 return self;},
@@ -85,7 +85,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "runCaseFor:",
 category: 'running',
-fn: function (aTestResult){
+fn: function (aTestResult) {
 var self=this;
 smalltalk.send(self, "_setUp", []);
 smalltalk.send(aTestResult, "_increaseRuns", []);
@@ -104,7 +104,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@testSelector'];
 return self;},
@@ -120,7 +120,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setTestSelector:",
 category: 'accessing',
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 (self['@testSelector']=aSelector);
 return self;},
@@ -136,7 +136,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "setUp",
 category: 'running',
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;},
@@ -152,7 +152,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "should:",
 category: 'testing',
-fn: function (aBlock){
+fn: function (aBlock) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send(aBlock, "_value", [])]);
 return self;},
@@ -168,7 +168,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "should:raise:",
 category: 'testing',
-fn: function (aBlock, anExceptionClass){
+fn: function (aBlock, anExceptionClass) {
 var self=this;
 smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return false;}), "_on_do_", [anExceptionClass, (function(ex){return true;})])]);
 return self;},
@@ -179,12 +179,28 @@ referencedClasses: []
 }),
 smalltalk.TestCase);
 
+smalltalk.addMethod(
+"_shouldnt_raise_",
+smalltalk.method({
+selector: "shouldnt:raise:",
+category: 'testing',
+fn: function (aBlock, anExceptionClass) {
+var self=this;
+smalltalk.send(self, "_assert_", [smalltalk.send((function(){smalltalk.send(aBlock, "_value", []);return true;}), "_on_do_", [anExceptionClass, (function(ex){return false;})])]);
+return self;},
+args: ["aBlock", "anExceptionClass"],
+source: "shouldnt: aBlock raise: anExceptionClass\x0a\x09self assert: ([aBlock value. true] \x0a\x09\x09on: anExceptionClass \x0a\x09\x09do: [:ex | false])",
+messageSends: ["assert:", "on:do:", "value"],
+referencedClasses: []
+}),
+smalltalk.TestCase);
+
 smalltalk.addMethod(
 "_signalFailure_",
 smalltalk.method({
 selector: "signalFailure:",
 category: 'private',
-fn: function (aString){
+fn: function (aString) {
 var self=this;
 (function($rec){smalltalk.send($rec, "_messageText_", [aString]);return smalltalk.send($rec, "_signal", []);})(smalltalk.send((smalltalk.TestFailure || TestFailure), "_new", []));
 return self;},
@@ -200,7 +216,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "tearDown",
 category: 'running',
-fn: function (){
+fn: function () {
 var self=this;
 
 return self;},
@@ -217,7 +233,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "allTestSelectors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 var selectors=nil;
 (selectors=smalltalk.send(self, "_testSelectors", []));
@@ -236,7 +252,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "buildSuite",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(self, "_allTestSelectors", []), "_collect_", [(function(each){return smalltalk.send(self, "_selector_", [each]);})]);
 return self;},
@@ -252,7 +268,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "lookupHierarchyRoot",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return (smalltalk.TestCase || TestCase);
 return self;},
@@ -268,7 +284,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "selector:",
 category: 'accessing',
-fn: function (aSelector){
+fn: function (aSelector) {
 var self=this;
 return (function($rec){smalltalk.send($rec, "_setTestSelector_", [aSelector]);return smalltalk.send($rec, "_yourself", []);})(smalltalk.send(self, "_new", []));
 return self;},
@@ -284,7 +300,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "shouldInheritSelectors",
 category: 'testing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(self, "_~_eq", [smalltalk.send(self, "_lookupHierarchyRoot", [])]);
 return self;},
@@ -300,7 +316,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "testSelectors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return smalltalk.send(smalltalk.send(smalltalk.send(self, "_methodDictionary", []), "_keys", []), "_select_", [(function(each){return smalltalk.send(each, "_match_", ["^test"]);})]);
 return self;},
@@ -321,7 +337,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addError:",
 category: 'accessing',
-fn: function (anError){
+fn: function (anError) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_errors", []), "_add_", [anError]);
 return self;},
@@ -337,7 +353,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "addFailure:",
 category: 'accessing',
-fn: function (aFailure){
+fn: function (aFailure) {
 var self=this;
 smalltalk.send(smalltalk.send(self, "_failures", []), "_add_", [aFailure]);
 return self;},
@@ -353,7 +369,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "errors",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@errors'];
 return self;},
@@ -369,7 +385,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "failures",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@failures'];
 return self;},
@@ -385,7 +401,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "increaseRuns",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 (self['@runs']=((($receiver = self['@runs']).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])));
 return self;},
@@ -401,7 +417,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "initialize",
 category: 'initialization',
-fn: function (){
+fn: function () {
 var self=this;
 smalltalk.send(self, "_initialize", [], smalltalk.TestResult.superclass || nil);
 (self['@timestamp']=smalltalk.send((smalltalk.Date || Date), "_now", []));
@@ -422,7 +438,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "runs",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@runs'];
 return self;},
@@ -438,7 +454,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "status",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return ((($receiver = smalltalk.send(smalltalk.send(self, "_errors", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));})() : (function(){return "error";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return ((($receiver = smalltalk.send(smalltalk.send(self, "_failures", []), "_isEmpty", [])).klass === smalltalk.Boolean) ? ($receiver ? (function(){return "success";})() : (function(){return "failure";})()) : smalltalk.send($receiver, "_ifTrue_ifFalse_", [(function(){return "success";}), (function(){return "failure";})]));}), (function(){return "error";})]));
 return self;},
@@ -454,7 +470,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "timestamp",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@timestamp'];
 return self;},
@@ -470,7 +486,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "total",
 category: 'accessing',
-fn: function (){
+fn: function () {
 var self=this;
 return self['@total'];
 return self;},
@@ -486,7 +502,7 @@ smalltalk.addMethod(
 smalltalk.method({
 selector: "total:",
 category: 'accessing',
-fn: function (aNumber){
+fn: function (aNumber) {
 var self=this;
 (self['@total']=aNumber);
 return self;},

+ 8 - 2
js/amber.js

@@ -83,10 +83,16 @@ amber = (function() {
 				'Kernel-Transcript',
 				'Kernel-Announcements',
 				'Canvas',
-				'Compiler',
+				'SUnit',
+				'Importer-Exporter',
+				'Compiler-Core',
+				'Compiler-AST',
+				'Compiler-Visitors',
+				'Compiler-Semantic',
+				'Compiler-IR',
+				'Compiler-Tests',
 				'parser',
 				'IDE',
-				'SUnit',
 				'Examples',
 				'Benchfib',
 				'Kernel-Tests'

+ 14 - 12
js/boot.js

@@ -187,11 +187,11 @@ function Smalltalk(){
 
 			//Methods linking
 			for(var keys=Object.keys(methods),i=0,l=keys.length; i<l; ++i) {
-				var k = keys[i]
+				var k = keys[i];
 				if(!proto.methods[k]) {
 					proto.inheritedMethods[k] = methods[k];
 					Object.defineProperty(proto, methods[k].jsSelector, {
-						value: methods[k].fn, configurable: true // no writable - in par with ES6 methods
+						value: methods[k].fn, configurable: true, writable: true
 					});
 				}
 			}
@@ -326,7 +326,7 @@ function Smalltalk(){
 
 	st.addMethod = function(jsSelector, method, klass) {
 		Object.defineProperty(klass.fn.prototype, jsSelector, {
-			value: method.fn, configurable: true // not writable - in par with ES6 methods
+			value: method.fn, configurable: true, writable: true
 		});
 		klass.fn.prototype.methods[method.selector] = method;
 		method.methodClass = klass;
@@ -512,22 +512,24 @@ function Smalltalk(){
 	};
 };
 
-function SmalltalkMethodContext(receiver, selector, temps, home) {
-	this.receiver = receiver;
-	this.selector = selector;
-	this.temps = temps || {};
+function SmalltalkMethodContext(receiver, selector, temps, home, pc) {
+	this.receiver    = receiver;
+	this.selector    = selector;
+	this.temps       = temps || {};
 	this.homeContext = home;
+    this.pc          = pc || 1;
 };
 
 SmalltalkMethodContext.prototype.copy = function() {
 	var home = this.homeContext;
 	if(home) {home = home.copy()}
 	return new SmalltalkMethodContext(
-			this.receiver, 
-			this.selector, 
-			this.temps, 
-			home
-			);
+		this.receiver, 
+		this.selector, 
+		this.temps, 
+		home,
+        this.pc
+	);
 };
 
 /* Global Smalltalk objects. */

+ 93 - 432
st/Compiler-Tests.st

@@ -1,471 +1,132 @@
 Smalltalk current createPackage: 'Compiler-Tests' properties: #{}!
-TestCase subclass: #ImporterTest
-	instanceVariableNames: ''
-	category: 'Compiler-Tests'!
+TestCase subclass: #SemanticAnalyzerTest
+	instanceVariableNames: 'analyzer'
+	package: 'Compiler-Tests'!
 
-!ImporterTest methodsFor: 'private'!
+!SemanticAnalyzerTest methodsFor: 'running'!
 
-chunkString
+setUp
+	analyzer := SemanticAnalyzer on: Object
+! !
 
-	^'!!Object methodsFor: ''importer test method''!!
+!SemanticAnalyzerTest methodsFor: 'tests'!
 
-importerTestMethod
+testAssignment
+	| src ast |
 
-	^''success''
-!! !!
-'
+	src := 'foo self  := 1'.
+	ast := smalltalk parse: src.
+	self should: [analyzer visit: ast] raise: InvalidAssignmentError
 !
 
-bigChunkString
-
-	^'Smalltalk current createPackage: ''Cypress-Definitions'' properties: #{}!!
-Object subclass: #CypressSnapshot
-	instanceVariableNames: ''definitions''
-	package: ''Cypress-Definitions''!!
-
-!!CypressSnapshot methodsFor: ''not yet classified''!!
-
-definitions: aDefinitions
-
-	definitions := aDefinitions
-!!
-
-definitions
-
-	^definitions
-!! !!
-
-!!CypressSnapshot class methodsFor: ''not yet classified''!!
-
-definitions: aDefinitions
-
-	^(self new) definitions: aDefinitions
-!! !!
-
-Object subclass: #CypressPackage
-	instanceVariableNames: ''name''
-	package: ''Cypress-Definitions''!!
-
-!!CypressPackage methodsFor: ''not yet classified''!!
-
-= other
-	^ other species = self species and: [other name sameAs: name]
-!!
-
-name
-	^ name
-!!
-
-name: aString
-	name := aString
-!!
-
-snapshot
-	| package definitions name  |
-	package := Package named: self name.
-	definitions := OrderedCollection new.
-	package sortedClasses do: [:cls |
-        	definitions add: cls asCypressClassDefinition.
-                cls methodDictionary values do: [:method |
-			(method category match: ''^\*'') ifFalse: [ 
-				definitions add: method asCypressMethodDefinition ]].
-                cls class methodDictionary values do: [:method |
-			(method category match: ''^\*'') ifFalse: [ 
-				definitions add: method asCypressMethodDefinition ]]].
-	name := package name.
-	Smalltalk current classes, (Smalltalk current classes collect: [:each | each class]) do: [:each |
-		each methodDictionary values do: [:method |
-			method category = (''*'', name) ifTrue: [
-				definitions add: method asCypressMethodDefinition ]]].
-	^ CypressSnapshot definitions: definitions
-!!
-
-printString
-	^super printString, ''('', name, '')''
-!! !!
-
-Object subclass: #CypressDefinition
-	instanceVariableNames: ''''
-	package: ''Cypress-Definitions''!!
-
-!!CypressDefinition methodsFor: ''not yet classified''!!
-
-= aDefinition
-	^(aDefinition isKindOf: CypressDefinition) and: [self isRevisionOf: aDefinition]
-!!
-
-isRevisionOf: aDefinition
-	^ (aDefinition isKindOf: CypressDefinition) and: [aDefinition description = self description]
-!!
-
-description
-	self subclassResponsibility
-!!
-
-isSameRevisionAs: aDefinition
-	^ self = aDefinition
-!! !!
-
-Object subclass: #CypressPatch
-	instanceVariableNames: ''operations''
-	package: ''Cypress-Definitions''!!
-
-!!CypressPatch methodsFor: ''not yet classified''!!
-
-fromBase: baseSnapshot toTarget: targetSnapshot
-	| base target |	
-	operations := OrderedCollection new.
-	base := CypressDefinitionIndex definitions: baseSnapshot definitions.
-	target := CypressDefinitionIndex definitions: targetSnapshot definitions.
-	
-	target definitions do:
-		[:t |
-		base
-			definitionLike: t
-			ifPresent: [:b | (b isSameRevisionAs: t) ifFalse: [operations add: (CypressModification of: b to: t)]]
-			ifAbsent: [operations add: (CypressAddition of: t)]].
-		
-	base definitions do:
-		[:b |
-		target
-			definitionLike: b
-			ifPresent: [:t | ]
-			ifAbsent: [operations add: (CypressRemoval of: b)]]
-!!
-
-operations
-
-	^operations
-!! !!
-
-!!CypressPatch class methodsFor: ''not yet classified''!!
-
-fromBase: baseSnapshot toTarget: targetSnapshot
-	^ (self new)
-		fromBase: baseSnapshot
-		toTarget: targetSnapshot
-!! !!
-
-Object subclass: #CypressDefinitionIndex
-	instanceVariableNames: ''definitionMap''
-	package: ''Cypress-Definitions''!!
-
-!!CypressDefinitionIndex methodsFor: ''not yet classified''!!
-
-add: aDefinition
-	^ self definitionMap at: aDefinition description put: aDefinition
-!!
-
-addAll: aCollection
-	aCollection do: [:ea | self add: ea]
-!!
-
-definitionLike: aDefinition ifPresent: foundBlock ifAbsent: errorBlock
-	| definition |
-	definition := self definitionMap at: aDefinition description ifAbsent: [].
-	^ definition
-		ifNil: errorBlock
-		ifNotNil: [foundBlock value: definition]
-!!
-
-definitions
-	^self definitionMap values
-!!
-
-definitionMap
-	definitionMap ifNil: [ definitionMap := Dictionary new ].
-	^ definitionMap
-!!
-
-remove: aDefinition
-	self definitionMap removeKey: aDefinition description ifAbsent: []
-!! !!
-
-!!CypressDefinitionIndex class methodsFor: ''not yet classified''!!
-
-definitions: aCollection
-	^ self new addAll: aCollection
-!! !!
-
-Object subclass: #CypressPatchOperation
-	instanceVariableNames: ''''
-	package: ''Cypress-Definitions''!!
-
-CypressDefinition subclass: #CypressClassDefinition
-	instanceVariableNames: ''name superclassName category comment instVarNames classInstVarNames''
-	package: ''Cypress-Definitions''!!
-
-!!CypressClassDefinition methodsFor: ''not yet classified''!!
-
-name: aClassName superclassName: aSuperclassName category: aCategory instVarNames: anInstanceVariableNames classInstVarNames: aClassInstanceVariableNames comment: aComment
-
-	name := aClassName.
-	superclassName := aSuperclassName.
-	category := aCategory.
-	instVarNames := anInstanceVariableNames.
-	classInstVarNames := aClassInstanceVariableNames.
-	comment := aComment
-!!
-
-= aDefinition
-	^(super = aDefinition)
-		and: [superclassName = aDefinition superclassName
-		and: [category = aDefinition category
-		and: [instVarNames = aDefinition instVarNames
-		and: [classInstVarNames = aDefinition classInstVarNames
-		and: [comment = aDefinition comment]]]]]
-!!
-
-superclassName
-
-	^superclassName
-!!
-
-name
-
-	^name
-!!
-
-category
-
-	^category
-!!
-
-comment
-
-	^comment
-!!
-
-description
-
-	^ Array with: name
-!!
-
-instVarNames
-
-	^instVarNames
-!!
-
-classInstVarNames
-
-	^classInstVarNames
-!! !!
-
-!!CypressClassDefinition class methodsFor: ''not yet classified''!!
-
-name: aClassName 
-superclassName: aSuperclassName
-category: aCategory
-instVarNames: anInstanceVariableNames
-classInstVarNames: aClassInstanceVariableNames
-comment: aComment
-
-	^(self new) 
-		name: aClassName 
-		superclassName: aSuperclassName
-		category: aCategory
-		instVarNames: anInstanceVariableNames
-		classInstVarNames: aClassInstanceVariableNames
-		comment: aComment
-!! !!
-
-CypressDefinition subclass: #CypressMethodDefinition
-	instanceVariableNames: ''classIsMeta source category selector className''
-	package: ''Cypress-Definitions''!!
-
-!!CypressMethodDefinition methodsFor: ''not yet classified''!!
-
-className: aName classIsMeta: isMetaclass selector: aSelector category: aCategory source: aSource
-
-	className := aName.
-	classIsMeta := isMetaclass.
-	selector := aSelector.
-	category := aCategory.
-	source := aSource.
-!!
-
-= aDefinition
-    ^ super = aDefinition
-        and: [ aDefinition source = self source
-                and: [ aDefinition category = self category ] ]
-!!
-
-source
-
-	^source
-!!
-
-category
-
-	^category
-!!
-
-description
-	^ Array	
-		with: className
-		with: selector
-		with: classIsMeta
-!! !!
+testNonLocalReturn
+	| src ast |
 
-!!CypressMethodDefinition class methodsFor: ''not yet classified''!!
+	src := 'foo | a | a + 1. ^ a'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-className: aName
-classIsMeta: isMetaclass
-selector: aSelector
-category: aCategory
-source: aSource
-
-	^(self new)
-		className: aName
-		classIsMeta: isMetaclass
-		selector: aSelector
-		category: aCategory
-		source: aSource
-!! !!
-
-CypressPatchOperation subclass: #CypressAddition
-	instanceVariableNames: ''definition''
-	package: ''Cypress-Definitions''!!
-
-!!CypressAddition methodsFor: ''not yet classified''!!
-
-definition: aDefinition
-
-	definition := aDefinition
-!! !!
-
-!!CypressAddition class methodsFor: ''not yet classified''!!
-
-of: aDefinition
-	^ self new definition: aDefinition
-!! !!
-
-CypressPatchOperation subclass: #CypressModification
-	instanceVariableNames: ''obsoletion modification''
-	package: ''Cypress-Definitions''!!
-
-!!CypressModification methodsFor: ''not yet classified''!!
-
-base: base target: target
-
-	obsoletion := base.
-	modification := target.
-!! !!
-
-!!CypressModification class methodsFor: ''not yet classified''!!
-
-of: base to: target
-	^ self new base: base target: target
-!! !!
-
-CypressPatchOperation subclass: #CypressRemoval
-	instanceVariableNames: ''definition''
-	package: ''Cypress-Definitions''!!
-
-!!CypressRemoval methodsFor: ''not yet classified''!!
-
-definition: aDefinition
-
-	definition := aDefinition
-!! !!
-
-!!CypressRemoval class methodsFor: ''not yet classified''!!
-
-of: aDefinition
-	^ self new definition: aDefinition
-!! !!
+	self deny: ast hasNonLocalReturn
+!
 
-!!Object methodsFor: ''*Cypress-Definitions''!!
+testNonLocalReturn2
+	| src ast |
 
-species
+	src := 'foo | a | a + 1. [ [ ^ a] ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-	^self class
-!! !!
+	self assert: ast hasNonLocalReturn
+!
 
-!!Class methodsFor: ''*Cypress-Definitions''!!
+testScope
+	| src ast |
 
-asCypressClassDefinition
-	^CypressClassDefinition
-		name: self name
-		superclassName: self superclass name
-		category: self category 
-		instVarNames: self instanceVariableNames
-		classInstVarNames: self class instanceVariableNames
-		comment: self comment
-!! !!
+	src := 'foo | a | a + 1. [ | b | b := a ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-!!CompiledMethod methodsFor: ''*Cypress-Definitions''!!
+	self deny: ast nodes first nodes last scope == ast scope.
+!
 
-asCypressMethodDefinition
+testScope2
+	| src ast |
 
-	^CypressMethodDefinition 
-        	className: self methodClass name
-		classIsMeta: self methodClass isMetaclass
-		selector: self selector
-		category: self category
-		source: self source
-!! !!
+	src := 'foo | a | a + 1. [ [ | b | b := a ] ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-!!CharacterArray methodsFor: ''*Cypress-Definitions''!!
+	self deny: ast nodes first nodes last nodes first nodes first scope == ast scope.
+!
 
-sameAs: aString
+testUnknownVariables
+	| src ast |
 
-	^self asUppercase = aString asUppercase
-!! !!
+	src := 'foo | a | b + a'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-'
-! !
+	self assert: ast scope unknownVariables = #('b')
+!
 
-!ImporterTest methodsFor: 'running'!
+testUnknownVariablesWithScope
+	| src ast |
 
-setUp
+	src := 'foo | a b | [ c + 1. [ a + 1. d + 1 ]]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-	super setUp.
-	self cleanUp
+	self assert: ast scope unknownVariables = #('c' 'd' )
 !
 
-tearDown
-
-	super tearDown.
-	self cleanUp
+testVariableShadowing
+	| src ast |
+	src := 'foo | a | a + 1'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast
 !
 
-cleanUp
-
-	(Object methodDictionary includesKey: #importerTestMethod)
-		ifTrue: [ Object removeCompiledMethod: (Object methodAt: #importerTestMethod)].
-! !
-
-!ImporterTest methodsFor: 'tests'!
-
-testBigChunkString
-	"importer does not correctly add extension methods.
-
-	 After loading in AmberProjectImporter, the following import fails...get a MNU from `CypressPackage new species`:
-
-    		AmberProjectImporter
-			importSTPackage: 'Cypress-Definitions' 
-			prefix: 'tests/'.
-
-		CypressPackage new species. 
+testVariableShadowing2
+	| src ast |
+	src := 'foo | a | a + 1. [ | a | a := 2 ]'.
+	ast := smalltalk parse: src.
+	self should: [analyzer visit: ast] raise: ShadowingVariableError
+!
 
-	WARNING this guy isn't cleaned up automatically"
+testVariableShadowing3
+	| src ast |
+	src := 'foo | a | a + 1. [ | b | b := 2 ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast
+!
 
-	Importer new import: self bigChunkString readStream.
-	CypressPackage new species.
+testVariableShadowing4
+	| src ast |
+	src := 'foo | a | a + 1. [ [ [ | b | b := 2 ] ] ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast
 !
 
-testChunkString
+testVariableShadowing5
+	| src ast |
+	src := 'foo | a | a + 1. [ [ [ | a | a := 2 ] ] ]'.
+	ast := smalltalk parse: src.
+	self should: [analyzer visit: ast] raise: ShadowingVariableError
+!
 
-	Importer new import: self chunkString readStream.
-	self assert: (Object methodDictionary includesKey: 'importerTestMethod').
-	self assert: (Object new importerTestMethod = 'success').
-! !
+testVariablesLookup
+	| src ast |
 
-!Object methodsFor: '*Compiler-Tests'!
+	src := 'foo | a | a + 1. [ | b | b := a ]'.
+	ast := smalltalk parse: src.
+	analyzer visit: ast.
 
-importerLoadMethod
+	"Binding for `a` in the message send"
+	self assert: ast nodes first nodes first receiver binding isTempVar.
+	self assert: ast nodes first nodes first receiver binding scope == ast scope.
 
-	^'success'
+	"Binding for `b`"
+	self assert: ast nodes first nodes last nodes first nodes first left binding isTempVar.
+	self assert: ast nodes first nodes last nodes first nodes first left binding scope == ast nodes first nodes last scope.
 ! !
 

+ 9 - 0
st/Kernel-Collections.st

@@ -54,6 +54,15 @@ Object subclass: #Collection
 
 !Collection methodsFor: 'accessing'!
 
+occurrencesOf: anObject 
+	"Answer how many of the receiver's elements are equal to anObject."
+
+	| tally |
+	tally := 0.
+	self do: [:each | anObject = each ifTrue: [tally := tally + 1]].
+	^tally
+!
+
 readStream
 	^self stream
 !

+ 4 - 0
st/Kernel-Methods.st

@@ -273,6 +273,10 @@ home
 	<return self.homeContext>
 !
 
+pc
+	<return self.pc>
+!
+
 printString
 	^super printString, '(', self asString, ')'
 !

+ 4 - 0
st/Kernel-Objects.st

@@ -83,6 +83,10 @@ size
 	self error: 'Object not indexable'
 !
 
+value
+	^ self
+!
+
 yourself
 	^self
 ! !

+ 6 - 0
st/SUnit.st

@@ -68,6 +68,12 @@ should: aBlock raise: anExceptionClass
 	self assert: ([aBlock value. false] 
 		on: anExceptionClass 
 		do: [:ex | true])
+!
+
+shouldnt: aBlock raise: anExceptionClass
+	self assert: ([aBlock value. true] 
+		on: anExceptionClass 
+		do: [:ex | false])
 ! !
 
 !TestCase class methodsFor: 'accessing'!

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