add stack trace for syntax errors
This commit is contained in:
parent
a0e983d5c3
commit
d2a746cbe4
@ -31,6 +31,12 @@ export class CodeRunner {
|
||||
const module = await import(`data:text/javascript;charset=utf-8,${encodedText}`);
|
||||
this.evalScope = Object.assign(this.evalScope, module);
|
||||
} catch (error) {
|
||||
Error.captureStackTrace(error, this.run);
|
||||
|
||||
if (!error.stack || error instanceof SyntaxError) {
|
||||
error.stack = `${error.fileName}:${error.lineNumber}:${error.columnNumber}`;
|
||||
}
|
||||
|
||||
this.console.error(error);
|
||||
}
|
||||
}
|
||||
|
0
src/gamelib_adapter.js
Normal file
0
src/gamelib_adapter.js
Normal file
Loading…
x
Reference in New Issue
Block a user