|
@@ -10,7 +10,7 @@ define(['./junk-drawer'], function ($goodies) {
|
|
var deleteKeysFrom = $goodies.deleteKeysFrom;
|
|
var deleteKeysFrom = $goodies.deleteKeysFrom;
|
|
var extendWithMethods = $goodies.extendWithMethods;
|
|
var extendWithMethods = $goodies.extendWithMethods;
|
|
|
|
|
|
- function uninstallMethodOfJsObjectEx (obj, name) {
|
|
|
|
|
|
+ function cleanMethodOfJsObjectEx (obj, name) {
|
|
var attachments;
|
|
var attachments;
|
|
var old = Object.getOwnPropertyDescriptor(obj, name);
|
|
var old = Object.getOwnPropertyDescriptor(obj, name);
|
|
if (old != null && (old = old.value) != null) {
|
|
if (old != null && (old = old.value) != null) {
|
|
@@ -19,11 +19,10 @@ define(['./junk-drawer'], function ($goodies) {
|
|
deleteKeysFrom(Object.keys(attachments), obj);
|
|
deleteKeysFrom(Object.keys(attachments), obj);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- delete obj[name];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function installMethodOfJsObjectEx (obj, name, fn) {
|
|
function installMethodOfJsObjectEx (obj, name, fn) {
|
|
- uninstallMethodOfJsObjectEx(obj, name);
|
|
|
|
|
|
+ cleanMethodOfJsObjectEx(obj, name);
|
|
var attachments = fn.a$atx;
|
|
var attachments = fn.a$atx;
|
|
if (attachments != null) {
|
|
if (attachments != null) {
|
|
extendWithMethods(obj, attachments);
|
|
extendWithMethods(obj, attachments);
|
|
@@ -258,7 +257,8 @@ define(['./junk-drawer'], function ($goodies) {
|
|
};
|
|
};
|
|
|
|
|
|
emit.behaviorMethodRemoved = function (method, klass) {
|
|
emit.behaviorMethodRemoved = function (method, klass) {
|
|
- uninstallMethodOfJsObjectEx(klass.fn.prototype, method.jsSelector);
|
|
|
|
|
|
+ cleanMethodOfJsObjectEx(klass.fn.prototype, method.jsSelector);
|
|
|
|
+ delete klass.fn.prototype[method.jsSelector];
|
|
propagateMethodChange(klass, method, null);
|
|
propagateMethodChange(klass, method, null);
|
|
};
|
|
};
|
|
|
|
|