Browse Source

Every method installed via installMethod.

Herbert Vojčík 12 years ago
parent
commit
742fe92f5e
1 changed files with 3 additions and 8 deletions
  1. 3 8
      js/boot.js

+ 3 - 8
js/boot.js

@@ -324,9 +324,7 @@ function Smalltalk() {
 	function installDnuHandler(string, klass) {
         var selector = st.selector(string);
         if(!klass.fn.prototype[selector]) {
-            Object.defineProperty(klass.fn.prototype, selector, {
-                value: dnu(selector), configurable: true, writable: true
-            });
+			installMethod({jsSelector: selector, fn: dnu(selector)}, klass);
         }
 	}
 
@@ -465,13 +463,10 @@ function Smalltalk() {
 	/* Add/remove a method to/from a class */
 
 	st.addMethod = function(jsSelector, method, klass) {
-		Object.defineProperty(klass.fn.prototype, jsSelector, {
-			value: method.fn, configurable: true, writable: true
-		});
-
+		method.jsSelector = jsSelector;
+		installMethod(method, klass);
 		klass.methods[method.selector] = method;
 		method.methodClass = klass;
-		method.jsSelector = jsSelector;
 
         klass.organization.elements.addElement(method.category);