Running minified code, I'm seeing incorrect column number on the generated stack trace, leading to source maps being incorrect traced. Example:
// min.js
if (typeof print === 'undefined') globalThis.print = console.log;
function r(){return e()}function e(){return new Error("bad")}print(r().stack)
In quickjs:
$ ./build/qjs min.js
at e (min.js:2:49)
at r (min.js:2:21)
at <eval> (min.js:2:49)
Compared to Node.js:
$ node min.js
Error: bad
at e (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:45)
at r (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:21)
at Object.<anonymous> (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:68)
# other lines omitted for brevity
Notes:
- QuickJS and V8 seem to differ in where the start of the error is - V8 starts at
new, QuickJS starts at Error. This might be OK, but I figured I'd note the difference.
- Bigger issue is that the 3rd line of the stack is totally off. It matches the first line of the stack in QuickJS, but should be pointing to column 68 which is where the
r() function is invoked.
Not clear to me, but maybe this is related to #232?
Running minified code, I'm seeing incorrect column number on the generated stack trace, leading to source maps being incorrect traced. Example:
In quickjs:
$ ./build/qjs min.js at e (min.js:2:49) at r (min.js:2:21) at <eval> (min.js:2:49)Compared to Node.js:
$ node min.js Error: bad at e (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:45) at r (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:21) at Object.<anonymous> (/Users/nrajlich/Code/quickjs-ng/quickjs/min.js:2:68) # other lines omitted for brevityNotes:
new, QuickJS starts atError. This might be OK, but I figured I'd note the difference.r()function is invoked.Not clear to me, but maybe this is related to #232?