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

eventemitter3

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventemitter3 - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

benchmarks/run/hundereds.js

6

index.js

@@ -43,2 +43,4 @@ 'use strict';

if (1 === length) {
if (fn.__EE3_once) this.removeListener(event, fn);
switch (len) {

@@ -71,4 +73,2 @@ case 1:

}
if (fn.__EE3_once) this.removeListener(event, fn);
} else {

@@ -80,4 +80,4 @@ for (i = 1, args = new Array(len -1); i < len; i++) {

for (i = 0; i < length; fn = listeners[++i]) {
if (fn.__EE3_once) this.removeListener(event, fn);
fn.apply(fn.__EE3_context || this, args);
if (fn.__EE3_once) this.removeListener(event, fn);
}

@@ -84,0 +84,0 @@ }

{
"name": "eventemitter3",
"version": "0.1.1",
"version": "0.1.2",
"description": "EventEmitter3 focuses on performance while maintaining a Node.js AND browser compatible interface. This the source of the same EventEmitter that is used in Primus.",

@@ -20,4 +20,8 @@ "main": "index.js",

"pub/sub",
"publish",
"subscribe",
"event",
"emitter"
"emitter",
"addListener",
"addEventListener"
],

@@ -30,6 +34,6 @@ "author": "Arnout Kazemier",

"devDependencies": {
"mocha": "1.13.x",
"mocha": "1.18.x",
"pre-commit": "0.0.x",
"chai": "1.8.x"
"chai": "1.9.x"
}
}

@@ -125,2 +125,16 @@ 'use strict';

it('only emits once if emits are nested inside the listener', function () {
var e = new EventEmitter()
, calls = 0;
e.once('foo', function () {
calls++;
e.emit('foo');
});
e.emit('foo');
expect(e.listeners('foo').length).to.equal(0);
expect(calls).to.equal(1);
});
it('only emits once for multiple events', function () {

@@ -127,0 +141,0 @@ var e = new EventEmitter()

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