Skip to content

Line numbers are incorrect #406

@Attacler

Description

@Attacler

I have an issue with the returned linenumbers.
When i use:

let parse_code = Module::declare(
    ctx.clone(),
    "userFunction",
    r#"export default async function() {
return "abc" + a
}"#
)
.catch (& ctx);


let(module, _) = parse_code.unwrap().eval().catch(& ctx).unwrap();

while ctx.execute_pending_job() { }

if parse_code.is_err() {
    if let Err(err) = parse_code {
        let err_str = err.to_string();
        println!("{:}", err_str);
    }
}

It will give me an error with the following:
Exception { message: Some("a is not defined"), stack: Some(" at default (userFunction:1:1)\n") }
However i would expect that the line:col is not 1:1 but 2:18
How can i fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:2-confirmedBug is confirmedkind:bugAn unexpected problem or behaviourtopic:upstreamRelated to the upstream C engine

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions