| 
														
															@@ -33,7 +33,6 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    | 
														 | 
														
														 | 
														
															    | 
														 | 
													
												
											
												
													
														| 
														 | 
														
															    ==================================================================== */ 
														 | 
														
														 | 
														
															    ==================================================================== */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															- 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /* Smalltalk constructors definition */ 
														 | 
														
														 | 
														
															 /* Smalltalk constructors definition */ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 function SmalltalkObject(){}; 
														 | 
														
														 | 
														
															 function SmalltalkObject(){}; 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -55,7 +54,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,22 +208,29 @@ 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 jsSelector = selector.replace(/_/g, ''); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	var jsProperty = receiver[jsSelector]; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	var jsArguments; 
														 | 
														
														 | 
														
															 	var jsArguments; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	if(receiver.klass === undefined && typeof jsFunction === "function") { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	    if(args[0].constructor === Array) { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		jsArguments = args[0] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	    } else { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-		jsArguments = [args[0]] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	if(receiver.klass === undefined) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	    if(typeof jsProperty === "function") { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		if(args[0] && args[0].constructor === Array) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		    jsArguments = args[0] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		} else { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		    jsArguments = [args[0]] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		return jsProperty.apply(receiver, jsArguments); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	    } else if(jsProperty !== undefined) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+		return jsProperty 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    } 
														 | 
														
														 | 
														
															 	    } 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-	    return jsFunction.apply(receiver, jsArguments); 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	} 
														 | 
														
														 | 
														
															 	} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	/* 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 and ' + jsSelector + ' is undefined')} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+	 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	return receiver._doesNotUnderstand_( 
														 | 
														
														 | 
														
															 	return receiver._doesNotUnderstand_( 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 	    st.Message._new() 
														 | 
														
														 | 
														
															 	    st.Message._new() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 		._selector_(convertSelector(selector)) 
														 | 
														
														 | 
														
															 		._selector_(convertSelector(selector)) 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -236,7 +242,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 +250,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 +307,7 @@ var nil = new SmalltalkNil(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 var smalltalk = new Smalltalk(); 
														 | 
														
														 | 
														
															 var smalltalk = new Smalltalk(); 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 var thisContext = nil; 
														 | 
														
														 | 
														
															 var thisContext = nil; 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 /****************************************************************************************/ 
														 | 
														
														 | 
														
															 /****************************************************************************************/ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 |