stacktracey
Advanced tools
Comparing version 1.2.90 to 1.2.91
{ | ||
"name": "stacktracey", | ||
"version": "1.2.90", | ||
"version": "1.2.91", | ||
"description": "Parses call stacks. Reads sources. Clean & filtered output. Sourcemaps. Node & browsers.", | ||
@@ -5,0 +5,0 @@ "main": "stacktracey", |
@@ -11,3 +11,4 @@ "use strict"; | ||
asTable = require ('as-table'), | ||
pathRoot = isBrowser ? window.location.href : (process.cwd () + '/') | ||
nixSlashes = x => x.replace (/\\/g, '/'), | ||
pathRoot = isBrowser ? window.location.href : (nixSlashes (process.cwd ()) + '/') | ||
@@ -60,3 +61,3 @@ /* ------------------------------------------------------------------------ */ | ||
input.unshift ({ | ||
file: fileLine[1], | ||
file: nixSlashes (fileLine[1]), | ||
line: fileLine[2], | ||
@@ -143,3 +144,3 @@ column: (rawLines[2] || '').indexOf ('^') + 1, | ||
native: native || false, | ||
file: fileLineColumn[0] || '', | ||
file: nixSlashes (fileLineColumn[0] || ''), | ||
line: parseInt (fileLineColumn[1] || '', 10) || undefined, | ||
@@ -232,6 +233,2 @@ column: parseInt (fileLineColumn[2] || '', 10) || undefined } }) | ||
} | ||
get asArray () { | ||
} | ||
} | ||
@@ -238,0 +235,0 @@ |
20
test.js
@@ -242,2 +242,22 @@ "use strict"; | ||
}) | ||
it ('works on Windows', () => { | ||
const dir = process.cwd () | ||
const windowsStack = | ||
[ | ||
'Error', | ||
' at Context.it (' + dir + '\\test.js:31:22)', | ||
' at callFn (' + dir + '\\node_modules\\mocha\\lib\\runnable.js:354:21)', | ||
' at runCallback (timers.js:800:20)' | ||
].join ('\n') | ||
const stack = new StackTracey (windowsStack) | ||
const lines = stack.pretty.split ('\n') | ||
lines[0].should.equal ('at it test.js:31 stack.should.be.an.instanceof (Array)') | ||
lines[1].indexOf ('at callFn mocha/lib/runnable.js:354').should.equal (0) | ||
}) | ||
}) | ||
@@ -244,0 +264,0 @@ |
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
207705
5909