Comparing version 2.0.0 to 2.0.1
@@ -61,4 +61,6 @@ // Eventify | ||
} | ||
var args = (arguments.length === 1 ? | ||
[arguments[0]] : Array.apply(null, arguments)); | ||
ran = true; | ||
memo = func.apply(this, arguments); | ||
memo = func.apply(this, args); | ||
func = null; | ||
@@ -125,3 +127,5 @@ return memo; | ||
self.off(name, onceListener); | ||
callback.apply(this, arguments); | ||
var args = (arguments.length === 1 ? | ||
[arguments[0]] : Array.apply(null, arguments)); | ||
callback.apply(this, args); | ||
}); | ||
@@ -177,9 +181,15 @@ | ||
// receive the true name of the event as the first argument). | ||
trigger: function (name) { | ||
trigger: function () { | ||
if (!this._events) { | ||
return this; | ||
} | ||
var events, allEvents, | ||
args = slice.call(arguments, 1); | ||
if (!eventsApi(this, 'trigger', name, args)) { | ||
// #6 arguments should not be leaked in order to allow V8 optimizations. | ||
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers | ||
var args = (arguments.length === 1 ? | ||
[arguments[0]] : Array.apply(null, arguments)); | ||
var events, allEvents; | ||
var name = args[0]; | ||
var extraArgs = args.slice(1); | ||
if (!eventsApi(this, 'trigger', name, extraArgs)) { | ||
return this; | ||
@@ -190,6 +200,6 @@ } | ||
if (events) { | ||
triggerEvents(events, args); | ||
triggerEvents(events, extraArgs); | ||
} | ||
if (allEvents) { | ||
triggerEvents(allEvents, arguments); | ||
triggerEvents(allEvents, args); | ||
} | ||
@@ -196,0 +206,0 @@ return this; |
{ | ||
"name": "eventify", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Lightweight module that can be mixed in to any object in order to provide it with custom events. For node.js and the browser. Based on Backbone.Events", | ||
@@ -57,3 +57,3 @@ "author": "Bermi Ferrer <bermi@bermilabs.com>", | ||
"browsers": [ | ||
"iexplore/7..latest", | ||
"iexplore/8..latest", | ||
"firefox/17..latest", | ||
@@ -60,0 +60,0 @@ "chrome/30..latest", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47462
1015
0