domain-browser
Advanced tools
Comparing version 2.0.0-next.1574050827.e77f42e5bb08a270b573797c84f18582e4a07ba8 to 2.0.0-next.1574051249.7e249e2d60bff73c856da83c88e69af93e22db11
@@ -6,3 +6,3 @@ # History | ||
- Updated dependencies, [base files](https://github.com/bevry/base), and [editions](https://editions.bevry.me) using [boundation](https://github.com/bevry/boundation) | ||
- Minimum required node version changed from `node: >=0.4,` to `node: >=0.8,` to keep up with mandatory ecosystem changes | ||
- Minimum required node version changed from `node: >=0.4` to `node: >=0.8` to keep up with mandatory ecosystem changes | ||
@@ -9,0 +9,0 @@ ## v1.2.0 2018 January 26 |
{ | ||
"name": "domain-browser", | ||
"version": "2.0.0-next.1574050827.e77f42e5bb08a270b573797c84f18582e4a07ba8", | ||
"version": "2.0.0-next.1574051249.7e249e2d60bff73c856da83c88e69af93e22db11", | ||
"description": "Node's domain module for the web browser. This is merely an evented try...catch with the same API as node, nothing more.", | ||
@@ -70,4 +70,3 @@ "homepage": "https://github.com/bevry/domain-browser", | ||
"engines": { | ||
"node": ">=0.8", | ||
"npm": ">=1.2" | ||
"node": ">=0.8" | ||
}, | ||
@@ -74,0 +73,0 @@ "editions": [ |
// This file should be ES5 compatible | ||
/* eslint prefer-spread:0, no-var:0, prefer-reflect:0, no-magic-numbers:0 */ | ||
'use strict' | ||
"use strict"; | ||
module.exports = (function () { | ||
module.exports = function() { | ||
// Import Events | ||
var events = require('events') | ||
var events = require("events"); | ||
// Export Domain | ||
var domain = {} | ||
domain.createDomain = domain.create = function () { | ||
var d = new events.EventEmitter() | ||
var domain = {}; | ||
domain.createDomain = domain.create = function() { | ||
var d = new events.EventEmitter(); | ||
function emitError (e) { | ||
d.emit('error', e) | ||
function emitError(e) { | ||
d.emit("error", e); | ||
} | ||
d.add = function (emitter) { | ||
emitter.on('error', emitError) | ||
} | ||
d.remove = function (emitter) { | ||
emitter.removeListener('error', emitError) | ||
} | ||
d.bind = function (fn) { | ||
return function () { | ||
var args = Array.prototype.slice.call(arguments) | ||
d.add = function(emitter) { | ||
emitter.on("error", emitError); | ||
}; | ||
d.remove = function(emitter) { | ||
emitter.removeListener("error", emitError); | ||
}; | ||
d.bind = function(fn) { | ||
return function() { | ||
var args = Array.prototype.slice.call(arguments); | ||
try { | ||
fn.apply(null, args) | ||
fn.apply(null, args); | ||
} catch (err) { | ||
emitError(err); | ||
} | ||
catch (err) { | ||
emitError(err) | ||
} | ||
} | ||
} | ||
d.intercept = function (fn) { | ||
return function (err) { | ||
if ( err ) { | ||
emitError(err) | ||
} | ||
else { | ||
var args = Array.prototype.slice.call(arguments, 1) | ||
}; | ||
}; | ||
d.intercept = function(fn) { | ||
return function(err) { | ||
if (err) { | ||
emitError(err); | ||
} else { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
try { | ||
fn.apply(null, args) | ||
fn.apply(null, args); | ||
} catch (err) { | ||
emitError(err); | ||
} | ||
catch (err) { | ||
emitError(err) | ||
} | ||
} | ||
} | ||
} | ||
d.run = function (fn) { | ||
}; | ||
}; | ||
d.run = function(fn) { | ||
try { | ||
fn() | ||
fn(); | ||
} catch (err) { | ||
emitError(err); | ||
} | ||
catch (err) { | ||
emitError(err) | ||
} | ||
return this | ||
} | ||
d.dispose = function () { | ||
this.removeAllListeners() | ||
return this | ||
} | ||
d.enter = d.exit = function () { | ||
return this | ||
} | ||
return d | ||
} | ||
return domain | ||
}).call(this) | ||
return this; | ||
}; | ||
d.dispose = function() { | ||
this.removeAllListeners(); | ||
return this; | ||
}; | ||
d.enter = d.exit = function() { | ||
return this; | ||
}; | ||
return d; | ||
}; | ||
return domain; | ||
}.call(this); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17449
62