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
new Class().method() has incorrect precedence #273
The precedence in new Class().method() isn't correct. This expression is parsed as new (Class().method()), which is incorrect, the correct parse tree would be equivalent to (new Class()).method().
Activity
jasonwilliams commentedon Mar 9, 2020
Tokens for
new Date().getTime()Tokens looks fine
Parser output
Yeah looks like there'll need to be some work here:
https://github.com/jasonwilliams/boa/blob/master/boa/src/syntax/parser/mod.rs#L232-L240
jasonwilliams commentedon Mar 9, 2020
Upon deeper inspection the issue is around here: https://github.com/jasonwilliams/boa/blob/master/boa/src/syntax/parser/mod.rs#L688-L721
Normally it just carries on, which is why it continues parsing until the method.
There needs to be some signal to stop after the first call.
jasonwilliams commentedon Mar 9, 2020
if we stopped after here https://github.com/jasonwilliams/boa/blob/master/boa/src/syntax/parser/mod.rs#L719 it would break other things such as function chaining
jasonwilliams commentedon Mar 9, 2020
Might be worth making the parser more spec compliant https://tc39.es/ecma262/#sec-left-hand-side-expressions
jasonwilliams commentedon Mar 10, 2020
jasonwilliams#274jasonwilliams#225
Parser fixes #225 #240 #273 (#281)
jasonwilliams commentedon Apr 13, 2020
new output since 0.7
The precedence looks fixed here
@HalidOdat @Razican ?
Razican commentedon Apr 13, 2020
It looks good, yes! Might be worth adding a test for this?
HalidOdat commentedon Apr 13, 2020
Are you adding the test, or should I?
jasonwilliams commentedon Apr 13, 2020
im doing it now
adding test for #273
adding test for #273 (#313)