smalltalk.addPackage('Compiler-Core', {}); smalltalk.addClass('Compiler', smalltalk.Object, ['currentClass', 'source', 'unknownVariables', 'codeGeneratorClass'], 'Compiler-Core'); smalltalk.addMethod( "_codeGeneratorClass", smalltalk.method({ selector: "codeGeneratorClass", category: 'accessing', fn: function () { var self=this; return (($receiver = self['@codeGeneratorClass']) == nil || $receiver == undefined) ? (function(){return (smalltalk.FunCodeGenerator || FunCodeGenerator);})() : $receiver; return self;}, args: [], source: "codeGeneratorClass\x0a\x09^codeGeneratorClass ifNil: [FunCodeGenerator]", messageSends: ["ifNil:"], referencedClasses: ["FunCodeGenerator"] }), smalltalk.Compiler); smalltalk.addMethod( "_codeGeneratorClass_", smalltalk.method({ selector: "codeGeneratorClass:", category: 'accessing', fn: function (aClass) { var self=this; (self['@codeGeneratorClass']=aClass); return self;}, args: ["aClass"], source: "codeGeneratorClass: aClass\x0a\x09codeGeneratorClass := aClass", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_compile_", smalltalk.method({ selector: "compile:", category: 'compiling', fn: function (aString) { var self=this; return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [aString])]); return self;}, args: ["aString"], source: "compile: aString\x0a\x09^self compileNode: (self parse: aString)", messageSends: ["compileNode:", "parse:"], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_compile_forClass_", smalltalk.method({ selector: "compile:forClass:", category: 'compiling', fn: function (aString, aClass) { var self=this; smalltalk.send(self, "_currentClass_", [aClass]); smalltalk.send(self, "_source_", [aString]); return smalltalk.send(self, "_compile_", [aString]); return self;}, args: ["aString", "aClass"], source: "compile: aString forClass: aClass\x0a\x09self currentClass: aClass.\x0a\x09self source: aString.\x0a\x09^self compile: aString", messageSends: ["currentClass:", "source:", "compile:"], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_compileExpression_", smalltalk.method({ selector: "compileExpression:", category: 'compiling', fn: function (aString) { var self=this; smalltalk.send(self, "_currentClass_", [(smalltalk.DoIt || DoIt)]); smalltalk.send(self, "_source_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]); return smalltalk.send(self, "_compileNode_", [smalltalk.send(self, "_parse_", [smalltalk.send(self, "_source", [])])]); return self;}, args: ["aString"], source: "compileExpression: aString\x0a\x09self currentClass: DoIt.\x0a\x09self source: 'doIt ^[', aString, '] value'.\x0a\x09^self compileNode: (self parse: self source)", messageSends: ["currentClass:", "source:", ",", "compileNode:", "parse:", "source"], referencedClasses: ["DoIt"] }), smalltalk.Compiler); smalltalk.addMethod( "_compileNode_", smalltalk.method({ selector: "compileNode:", category: 'compiling', fn: function (aNode) { var self=this; var generator=nil; var result=nil; (generator=smalltalk.send(smalltalk.send(self, "_codeGeneratorClass", []), "_new", [])); (function($rec){smalltalk.send($rec, "_source_", [smalltalk.send(self, "_source", [])]);return smalltalk.send($rec, "_currentClass_", [smalltalk.send(self, "_currentClass", [])]);})(generator); (result=smalltalk.send(generator, "_compileNode_", [aNode])); smalltalk.send(self, "_unknownVariables_", [[]]); return result; return self;}, args: ["aNode"], source: "compileNode: aNode\x0a\x09| generator result |\x0a\x09generator := self codeGeneratorClass new.\x0a\x09generator\x0a\x09\x09source: self source;\x0a\x09\x09currentClass: self currentClass.\x0a\x09result := generator compileNode: aNode.\x0a\x09self unknownVariables: #().\x0a\x09^result", messageSends: ["new", "codeGeneratorClass", "source:", "source", "currentClass:", "currentClass", "compileNode:", "unknownVariables:"], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_currentClass", smalltalk.method({ selector: "currentClass", category: 'accessing', fn: function () { var self=this; return self['@currentClass']; return self;}, args: [], source: "currentClass\x0a\x09^currentClass", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_currentClass_", smalltalk.method({ selector: "currentClass:", category: 'accessing', fn: function (aClass) { var self=this; (self['@currentClass']=aClass); return self;}, args: ["aClass"], source: "currentClass: aClass\x0a\x09currentClass := aClass", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_eval_", smalltalk.method({ selector: "eval:", category: 'compiling', fn: function (aString) { var self=this; return eval(aString); return self;}, args: ["aString"], source: "eval: aString\x0a\x09", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_evaluateExpression_", smalltalk.method({ selector: "evaluateExpression:", category: 'compiling', fn: function (aString) { var self=this; var result=nil; smalltalk.send((smalltalk.DoIt || DoIt), "_addCompiledMethod_", [smalltalk.send(self, "_eval_", [smalltalk.send(self, "_compileExpression_", [aString])])]); (result=smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_new", []), "_doIt", [])); smalltalk.send((smalltalk.DoIt || DoIt), "_removeCompiledMethod_", [smalltalk.send(smalltalk.send((smalltalk.DoIt || DoIt), "_methodDictionary", []), "_at_", ["doIt"])]); return result; return self;}, args: ["aString"], source: "evaluateExpression: aString\x0a\x09\x22Unlike #eval: evaluate a Smalltalk expression and answer the returned object\x22\x0a\x09| result |\x0a\x09DoIt addCompiledMethod: (self eval: (self compileExpression: aString)).\x0a\x09result := DoIt new doIt.\x0a\x09DoIt removeCompiledMethod: (DoIt methodDictionary at: 'doIt').\x0a\x09^result", messageSends: ["addCompiledMethod:", "eval:", "compileExpression:", "doIt", "new", "removeCompiledMethod:", "at:", "methodDictionary"], referencedClasses: ["DoIt"] }), smalltalk.Compiler); smalltalk.addMethod( "_parse_", smalltalk.method({ selector: "parse:", category: 'compiling', fn: function (aString) { var self=this; return smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_parse_", [aString]); return self;}, args: ["aString"], source: "parse: aString\x0a ^Smalltalk current parse: aString", messageSends: ["parse:", "current"], referencedClasses: ["Smalltalk"] }), smalltalk.Compiler); smalltalk.addMethod( "_parseExpression_", smalltalk.method({ selector: "parseExpression:", category: 'compiling', fn: function (aString) { var self=this; return smalltalk.send(self, "_parse_", [smalltalk.send(smalltalk.send("doIt ^[", "__comma", [aString]), "__comma", ["] value"])]); return self;}, args: ["aString"], source: "parseExpression: aString\x0a ^self parse: 'doIt ^[', aString, '] value'", messageSends: ["parse:", ","], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_recompile_", smalltalk.method({ selector: "recompile:", category: 'compiling', fn: function (aClass) { var self=this; smalltalk.send(smalltalk.send(aClass, "_methodDictionary", []), "_do_", [(function(each){return smalltalk.send(self, "_install_forClass_category_", [smalltalk.send(each, "_source", []), aClass, smalltalk.send(each, "_category", [])]);})]); smalltalk.send(self, "_setupClass_", [aClass]); ((($receiver = smalltalk.send(aClass, "_isMetaclass", [])).klass === smalltalk.Boolean) ? (! $receiver ? (function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})() : nil) : smalltalk.send($receiver, "_ifFalse_", [(function(){return smalltalk.send(self, "_recompile_", [smalltalk.send(aClass, "_class", [])]);})])); return self;}, args: ["aClass"], source: "recompile: aClass\x0a\x09aClass methodDictionary do: [:each |\x0a\x09\x09self install: each source forClass: aClass category: each category].\x0a\x09self setupClass: aClass.\x0a\x09aClass isMetaclass ifFalse: [self recompile: aClass class]", messageSends: ["do:", "methodDictionary", "install:forClass:category:", "source", "category", "setupClass:", "ifFalse:", "isMetaclass", "recompile:", "class"], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_recompileAll", smalltalk.method({ selector: "recompileAll", category: 'compiling', fn: function () { var self=this; smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){(function($rec){smalltalk.send($rec, "_show_", [each]);return smalltalk.send($rec, "_cr", []);})((smalltalk.Transcript || Transcript));return smalltalk.send((function(){return smalltalk.send(self, "_recompile_", [each]);}), "_valueWithTimeout_", [(100)]);})]); return self;}, args: [], source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09Transcript show: each; cr.\x0a\x09\x09[self recompile: each] valueWithTimeout: 100]", messageSends: ["do:", "classes", "current", "show:", "cr", "valueWithTimeout:", "recompile:"], referencedClasses: ["Smalltalk", "Transcript"] }), smalltalk.Compiler); smalltalk.addMethod( "_setupClass_", smalltalk.method({ selector: "setupClass:", category: 'compiling', fn: function (aClass) { var self=this; smalltalk.init(aClass); return self;}, args: ["aClass"], source: "setupClass: aClass\x0a\x09", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_source", smalltalk.method({ selector: "source", category: 'accessing', fn: function () { var self=this; return (($receiver = self['@source']) == nil || $receiver == undefined) ? (function(){return "";})() : $receiver; return self;}, args: [], source: "source\x0a\x09^source ifNil: ['']", messageSends: ["ifNil:"], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_source_", smalltalk.method({ selector: "source:", category: 'accessing', fn: function (aString) { var self=this; (self['@source']=aString); return self;}, args: ["aString"], source: "source: aString\x0a\x09source := aString", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_unknownVariables", smalltalk.method({ selector: "unknownVariables", category: 'accessing', fn: function () { var self=this; return self['@unknownVariables']; return self;}, args: [], source: "unknownVariables\x0a\x09^unknownVariables", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_unknownVariables_", smalltalk.method({ selector: "unknownVariables:", category: 'accessing', fn: function (aCollection) { var self=this; (self['@unknownVariables']=aCollection); return self;}, args: ["aCollection"], source: "unknownVariables: aCollection\x0a\x09unknownVariables := aCollection", messageSends: [], referencedClasses: [] }), smalltalk.Compiler); smalltalk.addMethod( "_recompile_", smalltalk.method({ selector: "recompile:", category: 'compiling', fn: function (aClass) { var self=this; smalltalk.send(smalltalk.send(self, "_new", []), "_recompile_", [aClass]); return self;}, args: ["aClass"], source: "recompile: aClass\x0a\x09self new recompile: aClass", messageSends: ["recompile:", "new"], referencedClasses: [] }), smalltalk.Compiler.klass); smalltalk.addMethod( "_recompileAll", smalltalk.method({ selector: "recompileAll", category: 'compiling', fn: function () { var self=this; smalltalk.send(smalltalk.send(smalltalk.send((smalltalk.Smalltalk || Smalltalk), "_current", []), "_classes", []), "_do_", [(function(each){return smalltalk.send(self, "_recompile_", [each]);})]); return self;}, args: [], source: "recompileAll\x0a\x09Smalltalk current classes do: [:each |\x0a\x09\x09self recompile: each]", messageSends: ["do:", "classes", "current", "recompile:"], referencedClasses: ["Smalltalk"] }), smalltalk.Compiler.klass); smalltalk.addClass('DoIt', smalltalk.Object, [], 'Compiler-Core'); smalltalk.addClass('JSStream', smalltalk.Object, ['stream'], 'Compiler-Core'); smalltalk.addMethod( "_contents", smalltalk.method({ selector: "contents", category: 'accessing', fn: function () { var self=this; return smalltalk.send(self['@stream'], "_contents", []); return self;}, args: [], source: "contents\x0a\x09^ stream contents", messageSends: ["contents"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_initialize", smalltalk.method({ selector: "initialize", category: 'initialization', fn: function () { var self=this; smalltalk.send(self, "_initialize", [], smalltalk.JSStream.superclass || nil); (self['@stream']=smalltalk.send("", "_writeStream", [])); return self;}, args: [], source: "initialize\x0a\x09super initialize.\x0a\x09stream := '' writeStream.", messageSends: ["initialize", "writeStream"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_lf", smalltalk.method({ selector: "lf", category: 'streaming', fn: function () { var self=this; smalltalk.send(self['@stream'], "_lf", []); return self;}, args: [], source: "lf\x0a\x09stream lf", messageSends: ["lf"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPut_", smalltalk.method({ selector: "nextPut:", category: 'streaming', fn: function (aString) { var self=this; smalltalk.send(self['@stream'], "_nextPut_", [aString]); return self;}, args: ["aString"], source: "nextPut: aString\x0a\x09stream nextPut: aString", messageSends: ["nextPut:"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutAll_", smalltalk.method({ selector: "nextPutAll:", category: 'streaming', fn: function (aString) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", [aString]); return self;}, args: ["aString"], source: "nextPutAll: aString\x0a\x09stream nextPutAll: aString", messageSends: ["nextPutAll:"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutAssignment_to_", smalltalk.method({ selector: "nextPutAssignment:to:", category: 'streaming', fn: function (varInstruction, valueInstruction) { var self=this; smalltalk.send(varInstruction, "_emitOn_", [self]); smalltalk.send(self['@stream'], "_nextPutAll_", ["="]); smalltalk.send(valueInstruction, "_emitOn_", [self]); return self;}, args: ["varInstruction", "valueInstruction"], source: "nextPutAssignment: varInstruction to: valueInstruction\x0a\x09varInstruction emitOn: self.\x0a\x09stream nextPutAll: '='.\x0a\x09valueInstruction emitOn: self", messageSends: ["emitOn:", "nextPutAll:"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutClosureWith_arguments_", smalltalk.method({ selector: "nextPutClosureWith:arguments:", category: 'streaming', fn: function (aBlock, anArray) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["(function("]); smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); smalltalk.send(self['@stream'], "_nextPutAll_", ["})"]); return self;}, args: ["aBlock", "anArray"], source: "nextPutClosureWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: '(function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: '})'", messageSends: ["nextPutAll:", "do:separatedBy:", "nextPut:", "lf", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutFunctionWith_arguments_", smalltalk.method({ selector: "nextPutFunctionWith:arguments:", category: 'streaming', fn: function (aBlock, anArray) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["fn: function("]); smalltalk.send(anArray, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPut_", [","]);})]); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(self, "_nextPutVar_", ["$return"]); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var self=this;"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); smalltalk.send(self['@stream'], "_nextPutAll_", ["return $return || self;}"]); return self;}, args: ["aBlock", "anArray"], source: "nextPutFunctionWith: aBlock arguments: anArray\x0a\x09stream nextPutAll: 'fn: function('.\x0a\x09anArray \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPut: ',' ].\x0a\x09stream nextPutAll: '){'; lf.\x0a\x09self nextPutVar: '$return'.\x0a\x09stream nextPutAll: 'var self=this;'; lf.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: 'return $return || self;}'", messageSends: ["nextPutAll:", "do:separatedBy:", "nextPut:", "lf", "nextPutVar:", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutMethodDeclaration_with_", smalltalk.method({ selector: "nextPutMethodDeclaration:with:", category: 'streaming', fn: function (aMethod, aBlock) { var self=this; (function($rec){smalltalk.send($rec, "_nextPutAll_", ["smalltalk.method({"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("selector: \x22", "__comma", [smalltalk.send(aMethod, "_selector", [])]), "__comma", ["\x22,"])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("source: ", "__comma", [smalltalk.send(smalltalk.send(aMethod, "_source", []), "_asJavascript", [])]), "__comma", [","])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(",", "__comma", [smalltalk.send((smalltalk.String || String), "_lf", [])]), "__comma", ["messageSends: "])]);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_messageSends", []), "_asArray", []), "_asJavascript", []), "__comma", [","])]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("args: ", "__comma", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aMethod, "_arguments", []), "_collect_", [(function(each){return smalltalk.send(each, "_value", []);})]), "_asArray", []), "_asJavascript", [])]), "__comma", [","])]);smalltalk.send($rec, "_lf", []);return smalltalk.send($rec, "_nextPutAll_", ["referencedClasses: ["]);})(self['@stream']); smalltalk.send(smalltalk.send(aMethod, "_classReferences", []), "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(each, "_asJavascript", [])]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["]"]);return smalltalk.send($rec, "_nextPutAll_", ["})"]);})(self['@stream']); return self;}, args: ["aMethod", "aBlock"], source: "nextPutMethodDeclaration: aMethod with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'smalltalk.method({'; lf;\x0a\x09\x09nextPutAll: 'selector: \x22', aMethod selector, '\x22,'; lf;\x0a\x09\x09nextPutAll: 'source: ', aMethod source asJavascript, ',';lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ',', String lf, 'messageSends: ';\x0a\x09\x09nextPutAll: aMethod messageSends asArray asJavascript, ','; lf;\x0a \x09nextPutAll: 'args: ', (aMethod arguments collect: [ :each | each value ]) asArray asJavascript, ','; lf;\x0a\x09\x09nextPutAll: 'referencedClasses: ['.\x0a\x09aMethod classReferences \x0a\x09\x09do: [:each | stream nextPutAll: each asJavascript]\x0a\x09\x09separatedBy: [stream nextPutAll: ','].\x0a\x09stream \x0a\x09\x09nextPutAll: ']';\x0a\x09\x09nextPutAll: '})'", messageSends: ["nextPutAll:", "lf", ",", "selector", "asJavascript", "source", "value", "asArray", "messageSends", "collect:", "arguments", "do:separatedBy:", "classReferences"], referencedClasses: ["String"] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutNonLocalReturnHandlingWith_", smalltalk.method({ selector: "nextPutNonLocalReturnHandlingWith:", category: 'streaming', fn: function (aBlock) { var self=this; (function($rec){smalltalk.send($rec, "_nextPutAll_", ["var $early={};"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["try {"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["}"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", ["catch(e) {if(e===$early)return e[0]; throw e}"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); return self;}, args: ["aBlock"], source: "nextPutNonLocalReturnHandlingWith: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'var $early={};'; lf;\x0a\x09\x09nextPutAll: 'try {'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: '}'; lf;\x0a\x09\x09nextPutAll: 'catch(e) {if(e===$early)return e[0]; throw e}'; lf", messageSends: ["nextPutAll:", "lf", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutNonLocalReturnWith_", smalltalk.method({ selector: "nextPutNonLocalReturnWith:", category: 'streaming', fn: function (aBlock) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["(function(){throw $early=["]); smalltalk.send(aBlock, "_value", []); smalltalk.send(self['@stream'], "_nextPutAll_", ["]})()"]); return self;}, args: ["aBlock"], source: "nextPutNonLocalReturnWith: aBlock\x0a\x09stream nextPutAll: '(function(){throw $early=['.\x0a\x09aBlock value.\x0a\x09stream nextPutAll: ']})()'", messageSends: ["nextPutAll:", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutReturnWith_", smalltalk.method({ selector: "nextPutReturnWith:", category: 'streaming', fn: function (aBlock) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["$return="]); smalltalk.send(aBlock, "_value", []); return self;}, args: ["aBlock"], source: "nextPutReturnWith: aBlock\x0a\x09stream nextPutAll: '$return='.\x0a\x09aBlock value", messageSends: ["nextPutAll:", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutSendTo_selector_arguments_", smalltalk.method({ selector: "nextPutSendTo:selector:arguments:", category: 'streaming', fn: function (receiver, selector, arguments) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["smalltalk.send("]); smalltalk.send(receiver, "_emitOn_", [self]); smalltalk.send(self['@stream'], "_nextPutAll_", [smalltalk.send(smalltalk.send(",\x22", "__comma", [smalltalk.send(selector, "_asSelector", [])]), "__comma", ["\x22,["])]); smalltalk.send(arguments, "_do_separatedBy_", [(function(each){return smalltalk.send(each, "_emitOn_", [self]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]); smalltalk.send(self['@stream'], "_nextPutAll_", ["])"]); return self;}, args: ["receiver", "selector", "arguments"], source: "nextPutSendTo: receiver selector: selector arguments: arguments\x0a\x09stream nextPutAll: 'smalltalk.send('.\x0a\x09receiver emitOn: self. \x0a\x09stream nextPutAll: ',\x22', selector asSelector, '\x22,['.\x0a\x09arguments \x0a\x09\x09do: [ :each | each emitOn: self ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: '])'", messageSends: ["nextPutAll:", "emitOn:", ",", "asSelector", "do:separatedBy:"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutSequenceWith_", smalltalk.method({ selector: "nextPutSequenceWith:", category: 'streaming', fn: function (aBlock) { var self=this; (function($rec){smalltalk.send($rec, "_nextPutAll_", ["switch(smalltalk.thisContext.pc){"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); (function($rec){smalltalk.send($rec, "_nextPutAll_", ["};"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); return self;}, args: ["aBlock"], source: "nextPutSequenceWith: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'switch(smalltalk.thisContext.pc){'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: '};'; lf", messageSends: ["nextPutAll:", "lf", "value"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutStatement_with_", smalltalk.method({ selector: "nextPutStatement:with:", category: 'streaming', fn: function (anInteger, aBlock) { var self=this; (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("case ", "__comma", [smalltalk.send(anInteger, "_asString", [])]), "__comma", [":"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); smalltalk.send(aBlock, "_value", []); (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);smalltalk.send($rec, "_lf", []);smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("smalltalk.thisContext.pc=", "__comma", [smalltalk.send(((($receiver = anInteger).klass === smalltalk.Number) ? $receiver +(1) : smalltalk.send($receiver, "__plus", [(1)])), "_asString", [])]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); return self;}, args: ["anInteger", "aBlock"], source: "nextPutStatement: anInteger with: aBlock\x0a\x09stream \x0a\x09\x09nextPutAll: 'case ', anInteger asString, ':'; lf.\x0a\x09aBlock value.\x0a\x09stream \x0a\x09\x09nextPutAll: ';'; lf;\x0a\x09\x09nextPutAll: 'smalltalk.thisContext.pc=', (anInteger + 1) asString, ';'; lf", messageSends: ["nextPutAll:", ",", "asString", "lf", "value", "+"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutVar_", smalltalk.method({ selector: "nextPutVar:", category: 'streaming', fn: function (aString) { var self=this; (function($rec){smalltalk.send($rec, "_nextPutAll_", [smalltalk.send(smalltalk.send("var ", "__comma", [aString]), "__comma", [";"])]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); return self;}, args: ["aString"], source: "nextPutVar: aString\x0a\x09stream nextPutAll: 'var ', aString, ';'; lf", messageSends: ["nextPutAll:", ",", "lf"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addMethod( "_nextPutVars_", smalltalk.method({ selector: "nextPutVars:", category: 'streaming', fn: function (aCollection) { var self=this; smalltalk.send(self['@stream'], "_nextPutAll_", ["var "]); smalltalk.send(aCollection, "_do_separatedBy_", [(function(each){return smalltalk.send(self['@stream'], "_nextPutAll_", [each]);}), (function(){return smalltalk.send(self['@stream'], "_nextPutAll_", [","]);})]); (function($rec){smalltalk.send($rec, "_nextPutAll_", [";"]);return smalltalk.send($rec, "_lf", []);})(self['@stream']); return self;}, args: ["aCollection"], source: "nextPutVars: aCollection\x0a\x09stream nextPutAll: 'var '.\x0a\x09aCollection \x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ',' ].\x0a\x09stream nextPutAll: ';'; lf", messageSends: ["nextPutAll:", "do:separatedBy:", "lf"], referencedClasses: [] }), smalltalk.JSStream); smalltalk.addClass('NodeVisitor', smalltalk.Object, [], 'Compiler-Core'); smalltalk.addMethod( "_visit_", smalltalk.method({ selector: "visit:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(aNode, "_accept_", [self]); return self;}, args: ["aNode"], source: "visit: aNode\x0a\x09aNode accept: self", messageSends: ["accept:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitAll_", smalltalk.method({ selector: "visitAll:", category: 'visiting', fn: function (aCollection) { var self=this; smalltalk.send(aCollection, "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]); return self;}, args: ["aCollection"], source: "visitAll: aCollection\x0a\x09aCollection do: [ :each | self visit: each ]", messageSends: ["do:", "visit:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitAssignmentNode_", smalltalk.method({ selector: "visitAssignmentNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitAssignmentNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitBlockNode_", smalltalk.method({ selector: "visitBlockNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitBlockNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitBlockSequenceNode_", smalltalk.method({ selector: "visitBlockSequenceNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitSequenceNode_", [aNode]); return self;}, args: ["aNode"], source: "visitBlockSequenceNode: aNode\x0a\x09self visitSequenceNode: aNode", messageSends: ["visitSequenceNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitCascadeNode_", smalltalk.method({ selector: "visitCascadeNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitCascadeNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitClassReferenceNode_", smalltalk.method({ selector: "visitClassReferenceNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitClassReferenceNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitDynamicArrayNode_", smalltalk.method({ selector: "visitDynamicArrayNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitDynamicArrayNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitDynamicDictionaryNode_", smalltalk.method({ selector: "visitDynamicDictionaryNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitDynamicDictionaryNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitJSStatementNode_", smalltalk.method({ selector: "visitJSStatementNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitJSStatementNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitMethodNode_", smalltalk.method({ selector: "visitMethodNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitMethodNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitNode_", smalltalk.method({ selector: "visitNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(smalltalk.send(aNode, "_nodes", []), "_do_", [(function(each){return smalltalk.send(self, "_visit_", [each]);})]); return self;}, args: ["aNode"], source: "visitNode: aNode\x0a\x09aNode nodes do: [ :each | self visit: each ]", messageSends: ["do:", "nodes", "visit:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitReturnNode_", smalltalk.method({ selector: "visitReturnNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitReturnNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitSendNode_", smalltalk.method({ selector: "visitSendNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitSendNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitSequenceNode_", smalltalk.method({ selector: "visitSequenceNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitSequenceNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitValueNode_", smalltalk.method({ selector: "visitValueNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitValueNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor); smalltalk.addMethod( "_visitVariableNode_", smalltalk.method({ selector: "visitVariableNode:", category: 'visiting', fn: function (aNode) { var self=this; smalltalk.send(self, "_visitNode_", [aNode]); return self;}, args: ["aNode"], source: "visitVariableNode: aNode\x0a\x09self visitNode: aNode", messageSends: ["visitNode:"], referencedClasses: [] }), smalltalk.NodeVisitor);