diff options
Diffstat (limited to 'node_modules/montage/core/core.js')
-rwxr-xr-x | node_modules/montage/core/core.js | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/node_modules/montage/core/core.js b/node_modules/montage/core/core.js index ff94f303..8fcf7977 100755 --- a/node_modules/montage/core/core.js +++ b/node_modules/montage/core/core.js | |||
@@ -71,14 +71,14 @@ Object.defineProperty(M, "create", { | |||
71 | 71 | ||
72 | var newObject = Object.create(typeof aPrototype === "undefined" ? this : aPrototype); | 72 | var newObject = Object.create(typeof aPrototype === "undefined" ? this : aPrototype); |
73 | 73 | ||
74 | if (typeof newObject.didCreate === "function") { | ||
75 | newObject.didCreate(); | ||
76 | } | ||
77 | |||
78 | if (newObject._dependenciesForProperty) { | 74 | if (newObject._dependenciesForProperty) { |
79 | newObject._dependencyListeners = {}; | 75 | newObject._dependencyListeners = {}; |
80 | } | 76 | } |
81 | 77 | ||
78 | if (typeof newObject.didCreate === "function") { | ||
79 | newObject.didCreate(); | ||
80 | } | ||
81 | |||
82 | return newObject; | 82 | return newObject; |
83 | } else { | 83 | } else { |
84 | var result = Object.create(aPrototype); | 84 | var result = Object.create(aPrototype); |
@@ -713,13 +713,17 @@ if (!Object.seal) { | |||
713 | */ | 713 | */ |
714 | Object.defineProperty(M, "callDelegateMethod", { | 714 | Object.defineProperty(M, "callDelegateMethod", { |
715 | value: function(name) { | 715 | value: function(name) { |
716 | var delegate, delegateFunctionName, delegateFunction; | 716 | var delegate = this.delegate, delegateFunctionName, delegateFunction; |
717 | if (typeof this.identifier === "string") { | 717 | if (typeof this.identifier === "string") { |
718 | delegateFunctionName = this.identifier + name.toCapitalized(); | 718 | delegateFunctionName = this.identifier + name.toCapitalized(); |
719 | } else { | 719 | if (delegate && typeof (delegateFunction = delegate[delegateFunctionName]) === "function") { |
720 | delegateFunctionName = name; | 720 | // remove first argument |
721 | Array.prototype.shift.call(arguments); | ||
722 | return delegateFunction.apply(delegate, arguments); | ||
723 | } | ||
721 | } | 724 | } |
722 | if ((delegate = this.delegate) && typeof (delegateFunction = delegate[delegateFunctionName]) === "function") { | 725 | |
726 | if (delegate && typeof (delegateFunction = delegate[name]) === "function") { | ||
723 | // remove first argument | 727 | // remove first argument |
724 | Array.prototype.shift.call(arguments); | 728 | Array.prototype.shift.call(arguments); |
725 | return delegateFunction.apply(delegate, arguments); | 729 | return delegateFunction.apply(delegate, arguments); |