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

domain-browser

Package Overview
Dependencies
Maintainers
3
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-browser - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

11

index.js

@@ -10,2 +10,13 @@ /*global define:false require:false */

var d = new events.EventEmitter();
function emitError(e) {
d.emit('error', e)
}
d.add = function(emitter){
emitter.on('error', emitError);
}
d.remove = function(emitter){
emitter.removeListener('error', emitError);
}
d.run = function(fn){

@@ -12,0 +23,0 @@ try {

5

package.json
{
"title": "Node's [domain module](http://nodejs.org/api/domain.html) for the web browser",
"name": "domain-browser",
"version": "1.1.2",
"version": "1.1.3",
"description": "Note, this is merely an evented try...catch with the same API as node. Nothing more.",

@@ -41,3 +41,4 @@ "homepage": "https://github.com/bevry/domain-browser",

"contributors": [
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)"
"Benjamin Lupton <b@lupton.cc> (https://github.com/balupton)",
"substack (https://github.com/substack)"
],

@@ -44,0 +45,0 @@ "bugs": {

3

README.md

@@ -42,3 +42,3 @@

- Install: `npm install --save domain-browser`
- CDN URL: `//wzrd.in/bundle/domain-browser@1.1.2`
- CDN URL: `//wzrd.in/bundle/domain-browser@1.1.3`

@@ -85,2 +85,3 @@ ### [Ender](http://ender.jit.su/)

- [Benjamin Lupton](https://github.com/balupton) <b@lupton.cc> — [view contributions](https://github.com/bevry/domain-browser/commits?author=balupton)
- [substack](https://github.com/substack) — [view contributions](https://github.com/bevry/domain-browser/commits?author=substack)

@@ -87,0 +88,0 @@ [Become a contributor!](https://github.com/bevry/domain-browser/blob/master/CONTRIBUTING.md#files)

// Import
var events = require('events');
var expect = require('chai').expect;

@@ -20,2 +21,39 @@ var joe = require('joe');

});
it('should be able to add emitters', function(done){
var d = domain.create();
var emitter = new events.EventEmitter();
d.add(emitter);
d.on('error', function (err) {
expect(err && err.message).to.eql('an emitted error');
done();
});
emitter.emit('error', new Error('an emitted error'));
});
it('should be able to remove emitters', function (done){
var emitter = new events.EventEmitter();
var d = domain.create();
d.add(emitter);
var domainGotError = false;
d.on('error', function (err) {
domainGotError = true
});
emitter.on('error', function (err) {
expect(err && err.message).to.eql('This error should not go to the domain')
// Make sure nothing race condition-y is happening
setTimeout(function () {
expect(domainGotError).to.eql(false)
done()
}, 0)
})
d.remove(emitter);
emitter.emit('error', new Error('This error should not go to the domain'));
})
});

Sorry, the diff of this file is not supported yet

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