|
@@ -250,13 +250,6 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
- st.initMethodInClass = function(klass, method) {
|
|
|
|
- if(klass.wrapped) {
|
|
|
|
- copySuperclass(klass);
|
|
|
|
- dnu.installHandlers(klass);
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
function copySuperclass(klass, superclass) {
|
|
function copySuperclass(klass, superclass) {
|
|
var inheritedMethods = Object.create(null);
|
|
var inheritedMethods = Object.create(null);
|
|
deinstallAllMethods(klass);
|
|
deinstallAllMethods(klass);
|
|
@@ -580,7 +573,6 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
|
|
var SmalltalkObject = brikz.ensure("root").Object;
|
|
var SmalltalkObject = brikz.ensure("root").Object;
|
|
brikz.ensure("selectorConversion");
|
|
brikz.ensure("selectorConversion");
|
|
brikz.ensure("classes");
|
|
brikz.ensure("classes");
|
|
- brikz.ensure("classInit");
|
|
|
|
|
|
|
|
function SmalltalkMethod() {}
|
|
function SmalltalkMethod() {}
|
|
inherits(SmalltalkMethod, SmalltalkObject);
|
|
inherits(SmalltalkMethod, SmalltalkObject);
|
|
@@ -656,14 +648,23 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
|
|
// propagation (for wrapped classes, not using the prototype
|
|
// propagation (for wrapped classes, not using the prototype
|
|
// chain).
|
|
// chain).
|
|
|
|
|
|
- //TODO: optimize, only one method need to be updated, not all of them
|
|
|
|
if (stInit.initialized()) {
|
|
if (stInit.initialized()) {
|
|
st.allSubclasses(klass).forEach(function (subclass) {
|
|
st.allSubclasses(klass).forEach(function (subclass) {
|
|
- st.initMethodInClass(subclass, method);
|
|
|
|
|
|
+ initMethodInClass(subclass, method);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function initMethodInClass (klass, method) {
|
|
|
|
+ if (klass.wrapped && !klass.methods[method.selector]) {
|
|
|
|
+ var jsSelector = method.jsSelector;
|
|
|
|
+ manip.installMethod({
|
|
|
|
+ jsSelector: jsSelector,
|
|
|
|
+ fn: klass.superclass.fn.prototype[jsSelector]
|
|
|
|
+ }, klass);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
st.removeMethod = function(method, klass) {
|
|
st.removeMethod = function(method, klass) {
|
|
if (klass !== method.methodClass) {
|
|
if (klass !== method.methodClass) {
|
|
throw new Error(
|
|
throw new Error(
|
|
@@ -677,7 +678,7 @@ define("amber/boot", [ 'require', './browser-compatibility' ], function (require
|
|
delete klass.fn.prototype[method.jsSelector];
|
|
delete klass.fn.prototype[method.jsSelector];
|
|
delete klass.methods[method.selector];
|
|
delete klass.methods[method.selector];
|
|
|
|
|
|
- st.initMethodInClass(klass, method);
|
|
|
|
|
|
+ initMethodInClass(klass, method);
|
|
propagateMethodChange(klass, method);
|
|
propagateMethodChange(klass, method);
|
|
|
|
|
|
// Do *not* delete protocols from here.
|
|
// Do *not* delete protocols from here.
|