Closed
Description
Let's say I have a file test.js
function foo() {
var path = "foo";
if (true)
throw "fail1";
return path;
}
foo();
Now I call JS_EvalThis on this piece of code and get a backtrace
at /Users/abbapoh/Developer/qbs/qbs/tests/auto/language/testdata/test.js:1:1
at <eval> (/Users/abbapoh/Developer/qbs/qbs/tests/auto/language/testdata/test.js:7:1
When changing the line to new throw Error("fail1");
, I get test.js:4:19, as expected.
In order to catch strings as errors, we added a wrapper to turn them into Errors like this https://github.com/qbs/quickjs-ng/blob/qbs/quickjs.c#L17483-L17489
This used to be working with the old engine. From what I debugged, find_line_num can't guess the line anymore.
Am I doing this wrong?
Metadata
Metadata
Assignees
Labels
No labels