diff --git a/src/core/Base.js b/src/core/Base.js index 6f716cd8..8aed4cbd 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -69,7 +69,7 @@ Base.inject(/** @lends Base# */{ var orig = props._filtering || props; for (var key in orig) { if (key in this && orig.hasOwnProperty(key) - && (!exclude || !exclude[key])) { + && !(exclude && exclude[key])) { var value = props[key]; // Due to the _filtered inheritance trick, undefined is used // to mask already consumed named arguments. diff --git a/src/core/Emitter.js b/src/core/Emitter.js index e1588903..ecdc78be 100644 --- a/src/core/Emitter.js +++ b/src/core/Emitter.js @@ -76,12 +76,11 @@ var Emitter = { var handlers = this._callbacks && this._callbacks[type]; if (!handlers) return false; - var args = [].slice.call(arguments, 1), - that = this; + var args = [].slice.call(arguments, 1); for (var i = 0, l = handlers.length; i < l; i++) { // When the handler function returns false, prevent the default // behaviour and stop propagation of the event by calling stop() - if (handlers[i].apply(that, args) === false + if (handlers[i].apply(this, args) === false && event && event.stop) { event.stop(); break;