asynctrace
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -20,3 +20,3 @@ { | ||
}, | ||
"version": "1.0.1" | ||
"version": "1.0.2" | ||
} |
10
trace.js
@@ -15,6 +15,6 @@ 'use strict'; | ||
function asyncFunctionInitialized() { | ||
function asyncFunctionInitialized(oldFrames) { | ||
var frames = StackError.getStackFrames(asyncFunctionInitialized); | ||
frames.push(BOUNDRY); | ||
frames.push.apply(frames, Error._frames); | ||
frames.push.apply(frames, oldFrames || Error._frames); | ||
Error._frames = frames; | ||
@@ -35,5 +35,7 @@ return frames; | ||
function asyncCallbackError(oldFrames, error) { | ||
if (error._passed) return; | ||
var frames = (oldFrames || []).reduce(reducer, []); | ||
frames.unshift(BOUNDRY); | ||
error.stack += v8StackFormating('', frames); | ||
error._passed = true; | ||
} | ||
@@ -52,3 +54,3 @@ | ||
var name = callSite && callSite.getFileName(); | ||
if (name && !~name.indexOf('node_modules') && ~name.indexOf(sep)) seed.push(callSite); | ||
if (name) seed.push(callSite); | ||
return seed; | ||
@@ -96,2 +98,2 @@ } | ||
return lines.join("\n"); | ||
} | ||
} |
5133
6
101