You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like scientific notation numbers starting with a float compile to either undefined (positive float base) and when used in Number() triggers a panic.
Number() is able to parse String inputs correctly, but raw scientific notation numbers with a float base trigger a panic. This may be a parsing issue as the errors look like this:
$ cargo run # Parsing `Number(1.0e1)`
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `target/debug/boa`
thread 'main' panicked at 'parsing failed: Expected([Punctuator(Comma), Punctuator(CloseParen)], Token { data: Identifier("e1"), pos: Position { column_number: 9, line_number: 5 } }, "function call arguments")', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
I ran into this while trying to fix some panics in the lexer. It looks like the lexer is trying to lex the number as two separate ones. The above panic will no longer occur, but the parser throws an error.
It looks like scientific notation numbers starting with a float compile to either
undefined
(positive float base) and when used in Number() triggers a panic.For example:
This behavior works in Node.js as expected:
Number()
is able to parse String inputs correctly, but raw scientific notation numbers with a float base trigger a panic. This may be a parsing issue as the errors look like this:refs #182 implementing #34
The text was updated successfully, but these errors were encountered: