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
{{ message }}
Repository navigation
[parser UpdateExpression] panics when the prefix/postfix increment/decrement target is a number #779
thread 'main' panicked at 'TypeError: invalid assignment to 245', /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/context.rs:438:18
stack backtrace:
0: rust_begin_unwind
at /rustc/d006f5734f49625c34d6fc33bf6b9967243abca8/library/std/src/panicking.rs:483
1: std::panicking::begin_panic_fmt
at /rustc/d006f5734f49625c34d6fc33bf6b9967243abca8/library/std/src/panicking.rs:437
2: boa::context::Context::set_value
at /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/context.rs:438
3: boa::exec::operator::<impl boa::exec::Executable for boa::syntax::ast::node::operator::UnaryOp>::run
at /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/exec/operator/mod.rs:206
4: <boa::syntax::ast::node::Node as boa::exec::Executable>::run
at /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/exec/mod.rs:108
5: boa::exec::statement_list::<impl boa::exec::Executable for boa::syntax::ast::node::statement_list::StatementList>::run
at /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/exec/statement_list.rs:17
6: boa::context::Context::eval
at /home/capitol/.cargo/registry/src/github.com-1ecc6299db9ec823/Boa-0.10.0/src/context.rs:494
7: boa_reproduce::main
at ./src/main.rs:3
8: core::ops::function::FnOnce::call_once
at /home/capitol/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
Can the title be changed to something like [parser UpdateExpression] panics when the prefix/postfix increment/decrement target is a number.
The relevant code bits start in the boa/src/syntax/parser/expression/update.rs.
Regarding prefix increment:
I'm checking the code, and I came to the boa/src/syntax/parser/expression/update.rs line 61 and 70. First of all the target is set to be LeftHandSideExpression instead of the UnaryExpression.
changed the title [-]panic on assignment to number[/-][+][parser UpdateExpression] panics when the prefix/postfix increment/decrement target is a number[/+]on Oct 12, 2020
I'm checking the code, and I came to the boa/src/syntax/parser/expression/update.rs line 61 and 70. First of all the target is set to be LeftHandSideExpression instead of the UnaryExpression.
This is solved.
Activity
croraf commentedon Oct 7, 2020
Thanks for submitting. Simple assignment like
3 = 4do throw correctly. Boa fails in the case of using "number" in Update expressions: https://tc39.es/ecma262/#sec-update-expressionsThis should be detected during static analysis.
croraf commentedon Oct 10, 2020
Can the title be changed to something like
[parser UpdateExpression] panics when the prefix/postfix increment/decrement target is a number.The relevant code bits start in the
boa/src/syntax/parser/expression/update.rs.Regarding
prefix increment:I'm checking the code, and I came to the boa/src/syntax/parser/expression/update.rs line 61 and 70. First of all the target is set to be
LeftHandSideExpressioninstead of theUnaryExpression.[-]panic on assignment to number[/-][+][parser UpdateExpression] panics when the prefix/postfix increment/decrement target is a number[/+]croraf commentedon Oct 13, 2020
But another problem is:
boa/boa/src/syntax/parser/expression/left_hand_side/mod.rs
Lines 66 to 72 in 907030b
which doesnt account properly the LHS expressions as per the spec https://tc39.es/ecma262/#prod-LeftHandSideExpression
Razican commentedon Jan 9, 2021
This no longer panics, it returns a
TypeError, so I'm closing this as the original issue has been fixed.