Some code clean-up.

This commit is contained in:
Jürg Lehni 2014-10-08 16:36:22 +02:00
parent 8983953ccc
commit f29f3c8b11
2 changed files with 3 additions and 4 deletions

View file

@ -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.

View file

@ -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;