Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

protoblast

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

protoblast - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 0.1.7 (2015-03-04)
* Fixed event listeners stop() context function
## 0.1.6 (2015-02-27)

@@ -2,0 +6,0 @@

14

lib/informer.js

@@ -630,3 +630,3 @@ module.exports = function BlastInformer(Blast, Collection) {

* @since 0.1.3
* @version 0.1.6
* @version 0.1.7
*

@@ -706,4 +706,4 @@ * @param {String|Object} type

// Skip the first 2 items, or if we've been stopped
if (index < 2 || shouldBeStopped) return;
// Skip the first 2 items
if (index < 2) return;

@@ -718,2 +718,3 @@ listener = list[0];

context.wait = wait;
context.stop = stop;

@@ -727,2 +728,6 @@ // Store async config in another object,

if (shouldBeStopped) {
return next();
}
// Start execusting the function

@@ -748,4 +753,5 @@ switch (argLength) {

if (this.ListenerSaysStop) {
if (context.ListenerSaysStop) {
shouldBeStopped = true;
return next();
}

@@ -752,0 +758,0 @@

{
"name": "protoblast",
"description": "Handy functions for several classes' prototype",
"version": "0.1.6",
"version": "0.1.7",
"author": "Jelle De Loecker <jelle@codedor.be>",

@@ -6,0 +6,0 @@ "keywords": ["prototype", "util", "functional", "server", "client", "browser"],

@@ -134,2 +134,38 @@ var assert = require('assert'),

describe('addListener("type", listener) -- stop propagation', function() {
it('should stop propagation', function() {
var aTest = new Blast.Classes.Informer(),
val = 0;
aTest.on('test', function t1() {
// Increment the value
val++;
// Stop propagation
this.stop();
});
// Add some other listeners
aTest.on('test', function shouldnotrun() {
// Increment value
val++;
});
// Add some other listeners
aTest.on('test', function shouldnotruneither() {
// Increment value
val++;
});
aTest.emit('test');
assert.equal(1, val);
aTest.emit('test');
assert.equal(2, val);
});
});
describe('addListener("typeName", listener, context)', function() {

@@ -136,0 +172,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc