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
When running this test, we get the following panic:
thread 'main' panicked at 'Failed to parse float after checks: ParseFloatError { kind: Invalid }', boa/src/syntax/lexer/number.rs:384:50
This is the stack trace:
0: rust_begin_unwind
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:495:5
1: core::panicking::panic_fmt
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/panicking.rs:92:14
2: core::option::expect_none_failed
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/option.rs:1268:5
3: <boa::syntax::lexer::number::NumberLiteral as boa::syntax::lexer::Tokenizer<R>>::lex
4: boa::syntax::lexer::Lexer<R>::next
5: boa::syntax::parser::cursor::buffered_lexer::BufferedLexer<R>::fill
6: boa::syntax::parser::cursor::buffered_lexer::BufferedLexer<R>::peek
7: <boa::syntax::parser::expression::assignment::exponentiation::ExponentiationExpression as boa::syntax::parser::TokenParser<R>>::parse
8: <boa::syntax::parser::expression::MultiplicativeExpression as boa::syntax::parser::TokenParser<R>>::parse
9: <boa::syntax::parser::expression::AdditiveExpression as boa::syntax::parser::TokenParser<R>>::parse
10: <boa::syntax::parser::expression::ShiftExpression as boa::syntax::parser::TokenParser<R>>::parse
11: <boa::syntax::parser::expression::RelationalExpression as boa::syntax::parser::TokenParser<R>>::parse
12: <boa::syntax::parser::expression::EqualityExpression as boa::syntax::parser::TokenParser<R>>::parse
13: <boa::syntax::parser::expression::BitwiseANDExpression as boa::syntax::parser::TokenParser<R>>::parse
14: <boa::syntax::parser::expression::BitwiseXORExpression as boa::syntax::parser::TokenParser<R>>::parse
15: <boa::syntax::parser::expression::BitwiseORExpression as boa::syntax::parser::TokenParser<R>>::parse
16: <boa::syntax::parser::expression::ShortCircuitExpression as boa::syntax::parser::TokenParser<R>>::parse
17: <boa::syntax::parser::expression::assignment::conditional::ConditionalExpression as boa::syntax::parser::TokenParser<R>>::parse
18: <boa::syntax::parser::expression::assignment::AssignmentExpression as boa::syntax::parser::TokenParser<R>>::parse
19: <boa::syntax::parser::expression::Expression as boa::syntax::parser::TokenParser<R>>::parse
20: <boa::syntax::parser::statement::Statement as boa::syntax::parser::TokenParser<R>>::parse
21: <boa::syntax::parser::statement::StatementList as boa::syntax::parser::TokenParser<R>>::parse
22: boa::context::Context::eval
23: boa_tester::exec::<impl boa_tester::Test>::run_once
24: boa_tester::exec::<impl boa_tester::Test>::run
25: boa_tester::main
This happens here. In theory, at this point in the code, we have already checked that what we are receiving is a valid float literal, but it seems that some representation of it is passing the checks but still fails to parse.
The minimal code that seems to cause this issue is this one:
4.9406564584124654417656879286822e-324;
This should in theory be parsed as 5e-324, but instead, it panics. This might be because Rust doesn't parse floats the same way as JavaScript does, and we are using f64::from_str.
The text was updated successfully, but these errors were encountered:
When running this test, we get the following panic:
This is the stack trace:
This happens here. In theory, at this point in the code, we have already checked that what we are receiving is a valid float literal, but it seems that some representation of it is passing the checks but still fails to parse.
The minimal code that seems to cause this issue is this one:
This should in theory be parsed as
5e-324
, but instead, it panics. This might be because Rust doesn't parse floats the same way as JavaScript does, and we are usingf64::from_str
.The text was updated successfully, but these errors were encountered: