| 
														
															@@ -55,7 +55,7 @@ function Smalltalk(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        should be added to the smalltalk object, see smalltalk.addClass(). 
														 | 
														
														 | 
														
															        should be added to the smalltalk object, see smalltalk.addClass(). 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        Superclass linking is *not* handled here, see smalltalk.init()  */ 
														 | 
														
														 | 
														
															        Superclass linking is *not* handled here, see smalltalk.init()  */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    klass = function(spec) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    function klass(spec) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var spec = spec || {}; 
														 | 
														
														 | 
														
															 	var spec = spec || {}; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var that; 
														 | 
														
														 | 
														
															 	var that; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	if(spec.meta) { 
														 | 
														
														 | 
														
															 	if(spec.meta) { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -209,13 +209,13 @@ function Smalltalk(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        if the receiver has no klass, we consider it a JS object (outside of the 
														 | 
														
														 | 
														
															        if the receiver has no klass, we consider it a JS object (outside of the 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        Jtalk system). Else assume that the receiver understands #doesNotUnderstand: */ 
														 | 
														
														 | 
														
															        Jtalk system). Else assume that the receiver understands #doesNotUnderstand: */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    messageNotUnderstood = function(receiver, selector, args) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    function messageNotUnderstood(receiver, selector, args) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	/* Handles JS method calls. Assumes that a single array or single argument was passed from Jtalk. 
														 | 
														
														 | 
														
															 	/* Handles JS method calls. Assumes that a single array or single argument was passed from Jtalk. 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	   Example: someJSObject foo: #(1 2 3) -> someJSObject.foo(1,2,3); */ 
														 | 
														
														 | 
														
															 	   Example: someJSObject foo: #(1 2 3) -> someJSObject.foo(1,2,3); */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var jsFunction = receiver[selector.replace(/_/g, '')]; 
														 | 
														
														 | 
														
															 	var jsFunction = receiver[selector.replace(/_/g, '')]; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var jsArguments; 
														 | 
														
														 | 
														
															 	var jsArguments; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	if(receiver.klass === undefined && typeof jsFunction === "function") { 
														 | 
														
														 | 
														
															 	if(receiver.klass === undefined && typeof jsFunction === "function") { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	    if(args[0].constructor === Array) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	    if(args[0] && args[0].constructor === Array) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		jsArguments = args[0] 
														 | 
														
														 | 
														
															 		jsArguments = args[0] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    } else { 
														 | 
														
														 | 
														
															 	    } else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		jsArguments = [args[0]] 
														 | 
														
														 | 
														
															 		jsArguments = [args[0]] 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -225,6 +225,8 @@ function Smalltalk(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	/* Handles not understood messages. Also see the Jtalk counter-part  
														 | 
														
														 | 
														
															 	/* Handles not understood messages. Also see the Jtalk counter-part  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	   Object>>doesNotUnderstand: */ 
														 | 
														
														 | 
														
															 	   Object>>doesNotUnderstand: */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	if(!receiver.klass) {throw(receiver + ' is not a Jtalk object')} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	return receiver._doesNotUnderstand_( 
														 | 
														
														 | 
														
															 	return receiver._doesNotUnderstand_( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    st.Message._new() 
														 | 
														
														 | 
														
															 	    st.Message._new() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		._selector_(convertSelector(selector)) 
														 | 
														
														 | 
														
															 		._selector_(convertSelector(selector)) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -236,7 +238,7 @@ function Smalltalk(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        if you modify the following functions, also change String>>asSelector 
														 | 
														
														 | 
														
															        if you modify the following functions, also change String>>asSelector 
														 | 
													
												
											
												
													
														| 
														 | 
														
															        accordingly */ 
														 | 
														
														 | 
														
															        accordingly */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    convertSelector = function(selector) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    function convertSelector(selector) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	if(selector.match(/__/)) { 
														 | 
														
														 | 
														
															 	if(selector.match(/__/)) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    return convertBinarySelector(selector); 
														 | 
														
														 | 
														
															 	    return convertBinarySelector(selector); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} else { 
														 | 
														
														 | 
														
															 	} else { 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -244,11 +246,11 @@ function Smalltalk(){ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }; 
														 | 
														
														 | 
														
															     }; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    convertKeywordSelector = function(selector) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    function convertKeywordSelector(selector) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	return selector.replace(/^_/, '').replace(/_/g, ':'); 
														 | 
														
														 | 
														
															 	return selector.replace(/^_/, '').replace(/_/g, ':'); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     }; 
														 | 
														
														 | 
														
															     }; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    convertBinarySelector = function(selector) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    function convertBinarySelector(selector) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	return selector 
														 | 
														
														 | 
														
															 	return selector 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    .replace(/^_/, '') 
														 | 
														
														 | 
														
															 	    .replace(/^_/, '') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    .replace(/_plus/, '+') 
														 | 
														
														 | 
														
															 	    .replace(/_plus/, '+') 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -301,6 +303,7 @@ var nil = new SmalltalkNil(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 var smalltalk = new Smalltalk(); 
														 | 
														
														 | 
														
															 var smalltalk = new Smalltalk(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 var thisContext = nil; 
														 | 
														
														 | 
														
															 var thisContext = nil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /****************************************************************************************/ 
														 | 
														
														 | 
														
															 /****************************************************************************************/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 |