fix(testrunner): support throwing non-errors

This commit is contained in:
Andrey Lushnikov 2020-02-20 17:06:05 -08:00
parent 05a1e1c641
commit 53a7e342e9
1 changed files with 2 additions and 0 deletions

View File

@ -27,6 +27,8 @@ class SourceMapSupport {
} }
async rewriteStackTraceWithSourceMaps(error) { async rewriteStackTraceWithSourceMaps(error) {
if (!error.stack || typeof error.stack !== 'string')
return;
const stackFrames = error.stack.split('\n'); const stackFrames = error.stack.split('\n');
for (let i = 0; i < stackFrames.length; ++i) { for (let i = 0; i < stackFrames.length; ++i) {
const stackFrame = stackFrames[i]; const stackFrame = stackFrames[i];