Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line numbers are incorrect #406

Open
Attacler opened this issue Dec 13, 2024 · 0 comments
Open

Line numbers are incorrect #406

Attacler opened this issue Dec 13, 2024 · 0 comments

Comments

@Attacler
Copy link

Attacler commented Dec 13, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant