asynctrace
Advanced tools
Comparing version 1.5.0 to 1.6.2
'use strict'; | ||
const tracing = process; | ||
try { | ||
var tracing = require('tracing'); | ||
} catch (e) { | ||
if (e.code !== 'MODULE_NOT_FOUND') throw e; | ||
require('../node_modules/async-listener'); | ||
tracing = process; | ||
} | ||
try { | ||
require('async-listener'); | ||
var util = require('util'); | ||
@@ -11,0 +6,0 @@ var debug = util.debuglog('asynctrace'); |
'use strict'; | ||
// JavaScriptStackTraceApi | ||
function ErrorWithCaller(caller) { | ||
Error.prepareStackTrace = function justStoreStackStace(error, frames) { | ||
error.__StackStace = frames; | ||
return ''; | ||
}; | ||
Error.captureStackTrace(this, caller); | ||
this.stack; // jshint ignore:line | ||
delete Error.prepareStackTrace; | ||
} | ||
@@ -6,0 +12,0 @@ function getError(caller) { |
{ | ||
"author": "Refael Ackerkmann <me@refack.com>", | ||
"dependencies": { | ||
"async-listener": "> 0.5.0", | ||
"shimmer": "latest" | ||
"async-listener": "^0.6.3", | ||
"shimmer": "^1.1.0" | ||
}, | ||
@@ -13,2 +13,5 @@ "description": "Deep stack traces based on AsyncListener API", | ||
}, | ||
"engines": { | ||
"node": "4" | ||
}, | ||
"jshintConfig": { | ||
@@ -41,6 +44,5 @@ "globals": { | ||
"scripts": { | ||
"test": "mocha --require .", | ||
"mypublish": "npm test && npm version patch && npm publish && git push --follow-tags" | ||
"test": "mocha --require ." | ||
}, | ||
"version": "1.5.0" | ||
"version": "1.6.2" | ||
} |
'use strict'; | ||
/*globals log */ | ||
var domain = require('domain'); | ||
var expect = require('chai').expect; | ||
const domain = require('domain'); | ||
const expect = require('chai').expect; | ||
require('./common.js'); | ||
describe('setImmediate', function () { | ||
it('show what happens to a local Exception', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function (e) { | ||
@@ -38,4 +39,4 @@ log(e.stack); | ||
it('show what happens to a exception in itertwining contexts', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function (e) { | ||
@@ -86,4 +87,4 @@ expect(e.message).to.be.equal('gaga1'); | ||
it('show what happens to a local Exception', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function y(e) { | ||
@@ -117,4 +118,4 @@ log(e.stack); | ||
it('show what happens to a exception in itertwining contexts', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function y(e) { | ||
@@ -164,6 +165,6 @@ expect(e.message).to.be.equal('gaga5'); | ||
describe('fs.readFile', function () { | ||
var fs = require('fs'); | ||
const fs = require('fs'); | ||
it('show what happens to a local Exception', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function y(e) { | ||
@@ -197,4 +198,4 @@ log(e.stack); | ||
it('show what happens to a exception in itertwining contexts', function (done) { | ||
var i = 0; | ||
var d = domain.createDomain(); | ||
const d = domain.createDomain(); | ||
let i = 0; | ||
d.once('error', function y(e) { | ||
@@ -230,8 +231,10 @@ log(e.stack); | ||
}); | ||
fs.readFile('package.json', function d21() { | ||
fs.readFile('package.json', function e21() { | ||
++i; | ||
throw new Error('gaga9'); | ||
setTimeout(() => { | ||
fs.readFile('package.json', function d21() { | ||
fs.readFile('package.json', function e21() { | ||
++i; | ||
throw new Error('gaga9'); | ||
}); | ||
}); | ||
}); | ||
}, 100); | ||
}); | ||
@@ -238,0 +241,0 @@ }); |
'use strict'; | ||
var fs = require('fs'); | ||
var fd = fs.openSync("raw_out.log", 'a'); | ||
const fs = require('fs'); | ||
const fd = fs.openSync("raw_out.log", 'a'); | ||
function writeSync(str) { | ||
console._stdout.write(str); | ||
fs.write(fd, str); | ||
fs.writeSync(fd, str); | ||
} | ||
global.log = writeSync; | ||
require('..'); |
'use strict'; | ||
/*globals log */ | ||
var net = require('net'); | ||
var Domain = require('domain'); | ||
var expect = require('chai').expect; | ||
const net = require('net'); | ||
const Domain = require('domain'); | ||
const expect = require('chai').expect; | ||
require('./common.js'); | ||
@@ -14,11 +15,11 @@ function mySignal(n) { setImmediate(function () {throw new Error(n);}); } | ||
it("client server", function (done) { | ||
var DATUM1 = "Hello"; | ||
var DATUM2 = "GoodBye"; | ||
var server; | ||
var address; | ||
const DATUM1 = "Hello"; | ||
const DATUM2 = "GoodBye"; | ||
let server; | ||
let address; | ||
var domain = Domain.create(); | ||
const domain = Domain.create(); | ||
domain.on('error', function (err) { | ||
var msg = err.message; | ||
var stack = err.stack; | ||
const msg = err.message; | ||
const stack = err.stack; | ||
log(stack); | ||
@@ -70,5 +71,3 @@ switch (msg) { | ||
Error._frames = null; | ||
server = net.createServer(); | ||
mySignal('1'); | ||
server.on('connection', function onServerConnection(socket) { | ||
server = net.createServer(function onServerConnection(socket) { | ||
mySignal('5a'); | ||
@@ -84,2 +83,3 @@ socket.on("data", function onServerSocketData(data) { | ||
}); | ||
mySignal('1'); | ||
}); | ||
@@ -93,5 +93,3 @@ | ||
mySignal('3'); | ||
var client = net.connect(address.port); | ||
mySignal('4'); | ||
client.on('connect', function onClientConnect() { | ||
const client = net.connect(address.port, function onClientConnect() { | ||
mySignal('5b'); | ||
@@ -108,2 +106,3 @@ client.write(DATUM1); | ||
}); | ||
mySignal('4'); | ||
}); | ||
@@ -110,0 +109,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
35923
661
2
Updatedasync-listener@^0.6.3
Updatedshimmer@^1.1.0