stacktracey 2.1.7 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +1 -1
- package/appveyor.yml +1 -1
- package/package.json +1 -1
- package/stacktracey.d.ts +1 -1
- package/stacktracey.js +1 -0
- package/test.js +24 -9
package/.travis.yml
CHANGED
package/appveyor.yml
CHANGED
package/package.json
CHANGED
package/stacktracey.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ declare class StackTracey {
|
|
|
39
39
|
maxColumnWidths (): StackTracey.MaxColumnWidths
|
|
40
40
|
|
|
41
41
|
static resetCache (): void
|
|
42
|
-
static locationsEqual (a: Location, b: Location): boolean
|
|
42
|
+
static locationsEqual (a: StackTracey.Location, b: StackTracey.Location): boolean
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
declare namespace StackTracey {
|
package/stacktracey.js
CHANGED
|
@@ -130,6 +130,7 @@ class StackTracey {
|
|
|
130
130
|
|
|
131
131
|
if ((planA = line.match (/at (.+) \(eval at .+ \((.+)\), .+\)/)) || // eval calls
|
|
132
132
|
(planA = line.match (/at (.+) \((.+)\)/)) ||
|
|
133
|
+
(planA = line.match (/at (.+) ([^ ]+)/)) ||
|
|
133
134
|
((line.slice (0, 3) !== 'at ') && (planA = line.match (/(.*)@(.*)/)))) {
|
|
134
135
|
|
|
135
136
|
callee = planA[1]
|
package/test.js
CHANGED
|
@@ -232,10 +232,7 @@ describe ('StackTracey', () => {
|
|
|
232
232
|
stack.items[0].syntaxError.should.equal (true)
|
|
233
233
|
stack.items[0].column.should.equal (5)
|
|
234
234
|
|
|
235
|
-
|
|
236
|
-
const spaces2 = nodeVersion > 8 ? (nodeVersion > 11 ? ' ' : ' ') : ' '
|
|
237
|
-
|
|
238
|
-
stack.asTable ().split ('\n')[0].should.equal ('at (syntax error)' + spaces + 'test_files/syntax_error.js:2' + spaces2 + 'foo->bar () ')
|
|
235
|
+
stack.asTable ().split ('\n')[0].should.match(/at \(syntax error\)\s+test_files\/syntax_error.js:2\s+foo->bar \(\)/)
|
|
239
236
|
}
|
|
240
237
|
})
|
|
241
238
|
}
|
|
@@ -334,7 +331,29 @@ describe ('StackTracey', () => {
|
|
|
334
331
|
items[1].fileRelative.should.equal('hohoho/test.js')
|
|
335
332
|
})
|
|
336
333
|
|
|
337
|
-
it
|
|
334
|
+
it ('parses async frames', () => {
|
|
335
|
+
const stack = [
|
|
336
|
+
'Error: test',
|
|
337
|
+
' at async /some/index.js:1:1',
|
|
338
|
+
' at async (/some/index.js:1:1)',
|
|
339
|
+
' at async foo /some/index.js:1:1',
|
|
340
|
+
' at async foo (/some/index.js:1:1)',
|
|
341
|
+
].join ('\n')
|
|
342
|
+
|
|
343
|
+
const items = new StackTracey(stack).items
|
|
344
|
+
|
|
345
|
+
items[0].file.should.equal('/some/index.js')
|
|
346
|
+
items[1].file.should.equal('/some/index.js')
|
|
347
|
+
items[2].file.should.equal('/some/index.js')
|
|
348
|
+
items[3].file.should.equal('/some/index.js')
|
|
349
|
+
|
|
350
|
+
items[0].callee.should.equal('async')
|
|
351
|
+
items[1].callee.should.equal('async')
|
|
352
|
+
items[2].callee.should.equal('async foo')
|
|
353
|
+
items[3].callee.should.equal('async foo')
|
|
354
|
+
})
|
|
355
|
+
|
|
356
|
+
it ('recognizes locations without column', () => {
|
|
338
357
|
const stack = [
|
|
339
358
|
'Error',
|
|
340
359
|
' at ValidateCompatibilityWithBindGroupLayout (../../third_party/dawn/src/dawn_native/ShaderModule.cpp:395)',
|
|
@@ -342,8 +361,6 @@ describe ('StackTracey', () => {
|
|
|
342
361
|
|
|
343
362
|
const items = new StackTracey(stack).items
|
|
344
363
|
|
|
345
|
-
console.log(items)
|
|
346
|
-
|
|
347
364
|
items[0].should.contain({
|
|
348
365
|
callee: 'ValidateCompatibilityWithBindGroupLayout',
|
|
349
366
|
calleeShort: 'ValidateCompatibilityWithBindGroupLayout',
|
|
@@ -354,5 +371,3 @@ describe ('StackTracey', () => {
|
|
|
354
371
|
})
|
|
355
372
|
})
|
|
356
373
|
|
|
357
|
-
|
|
358
|
-
|