unexpected
Advanced tools
Comparing version 10.10.3 to 10.10.4
@@ -25,3 +25,3 @@ var utils = require('./utils'); | ||
this.parent = parent || null; | ||
this.name = 'UnexpectedError'; | ||
this.name = 'Error'; | ||
} | ||
@@ -204,2 +204,12 @@ | ||
function findStackStart(lines) { | ||
for (var i = lines.length - 1; 0 <= i; i -= 1) { | ||
if (lines[i] === '') { | ||
return i + 1; | ||
} | ||
} | ||
return -1; | ||
} | ||
UnexpectedError.prototype.serializeMessage = function (outputFormat) { | ||
@@ -216,3 +226,3 @@ if (!this._hasSerializedErrorMessage) { | ||
format: htmlFormat ? 'text' : outputFormat | ||
}).toString(); | ||
}).toString() + '\n'; | ||
@@ -223,4 +233,7 @@ if (!this.useFullStackTrace) { | ||
var lines = this.stack.split(/\n/); | ||
var stackStart = findStackStart(lines); | ||
lines.forEach(function (line, i) { | ||
if (i !== 0 && (/node_modules\/unexpected(?:-[^\/]+)?\//).test(line)) { | ||
if (stackStart <= i && (/node_modules\/unexpected(?:-[^\/]+)?\//).test(line)) { | ||
removedFrames = true; | ||
@@ -240,3 +253,2 @@ } else { | ||
} | ||
} | ||
@@ -243,0 +255,0 @@ |
{ | ||
"name": "unexpected", | ||
"version": "10.10.3", | ||
"version": "10.10.4", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
748466
18724