Comparing version 0.4.2 to 0.5.0
@@ -0,0 +0,0 @@ /* |
@@ -15,2 +15,6 @@ /* | ||
constructor: function(stoppable){ | ||
this._stoppable = stoppable | ||
}, | ||
on: function(event, fn){ | ||
@@ -26,3 +30,3 @@ var listeners = this._listeners || (this._listeners = {}), | ||
off: function(event, fn){ | ||
var listeners = this._listeners, events, key, length = 0 | ||
var listeners = this._listeners, events | ||
if (listeners && (events = listeners[event])){ | ||
@@ -47,3 +51,4 @@ | ||
forEach(events.slice(0), function(event){ | ||
return event.apply(self, args) | ||
var result = event.apply(self, args) | ||
if (self._stoppable) return result | ||
}) | ||
@@ -50,0 +55,0 @@ } |
@@ -0,0 +0,0 @@ /* |
@@ -0,0 +0,0 @@ /* |
{ | ||
"name": "prime", | ||
"homepage": "https://github.com/mootools/prime", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"main": "./index.js", | ||
@@ -28,14 +28,14 @@ "description": "prime, an OOP JavaScript library for node and the web.", | ||
"dependencies": { | ||
"mout": "~0.9" | ||
"mout": "^0.11.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": ">=1.18.2 < 2.0.0", | ||
"coveralls": "^2.11.2", | ||
"expect.js": "~0.3.1", | ||
"istanbul": "~0.2.6", | ||
"coveralls": "~2.10.0", | ||
"mocha-lcov-reporter": "0.0.1" | ||
"istanbul": "^0.3.13", | ||
"mocha": "^2.2.4", | ||
"mocha-lcov-reporter": "0.0.2" | ||
}, | ||
"scripts": { | ||
"test": "istanbul cover _mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" | ||
"test": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # ![prime](http://kamicane.github.io/assets/prime.png) |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var emitter = require('../emitter') | ||
var defer = require('../defer') | ||
@@ -56,3 +57,9 @@ describe('emitter', function(){ | ||
var events = new emitter(), called = 0 | ||
var listener = function(){ done() } | ||
var listener = function(){ | ||
called++ | ||
defer(function() { | ||
expect(called).to.be(1) | ||
done() | ||
}) | ||
} | ||
events.on('thing', listener) | ||
@@ -88,3 +95,33 @@ events.on('thing', listener) | ||
it('should not stop immediate propagation', function(done){ | ||
var publisher = new emitter() | ||
publisher.on('publish', function(){ | ||
return false; | ||
}) | ||
publisher.on('publish', function(){ | ||
done() | ||
}) | ||
publisher.emit('publish') | ||
}) | ||
it('should allow stopping immediate propagation', function(done){ | ||
var publisher = new emitter(true) | ||
publisher.on('publish', function(){ | ||
defer(function() { | ||
done(); | ||
}) | ||
return false; | ||
}) | ||
publisher.on('publish', function(){ | ||
expect().fail() | ||
}) | ||
publisher.emit('publish') | ||
}) | ||
}) | ||
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict" |
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
0
36776
11
925
+ Addedmout@0.11.1(transitive)
- Removedmout@0.9.1(transitive)
Updatedmout@^0.11.0