-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
About
Take this code as an example:
const f = () => {
throw new Error();
};
f();Actual behavior
With quickjs-emscripten, the stack trace only shows line numbers:
at f (example.js:3)
at <eval> (example.js:6)
Desired behavior
In developer tool's console, it shows column numbers, too:
Uncaught Error
at f (<anonymous>:2:7)
at <anonymous>:5:1
How to reproduce
Here's repro.ts:
import { errors, getQuickJS } from "npm:quickjs-emscripten";
const QuickJS = await getQuickJS();
const vm = QuickJS.newContext();
const code = `
const f = () => {
throw new Error();
};
f();
`;
const evalResult = vm.evalCode(code, 'example.js');
try {
const result = vm.unwrapResult(evalResult);
throw new Error('unreachable!');
} catch (e: unknown) {
if (e instanceof errors.QuickJSUnwrapError && e.cause && typeof e.cause === 'object' && 'stack' in e.cause) {
console.log(e.cause.stack);
}
}The result is as follows. It only contains line numbers:
$ deno run repro.ts
at f (example.js:3)
at <eval> (example.js:6)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels