From f29f3c8b1164673b2907f5c73cb93bb3f82ea13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 8 Oct 2014 16:36:22 +0200 Subject: [PATCH] Some code clean-up. --- src/core/Base.js | 2 +- src/core/Emitter.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) 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;