-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
new Class().method() has incorrect precedence #273
Comments
Tokens for
Tokens looks fine Parser output
Yeah looks like there'll need to be some work here: |
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. |
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 |
Might be worth making the parser more spec compliant https://tc39.es/ecma262/#sec-left-hand-side-expressions |
New parser! Plus loads of tidy up in various places. Co-authored-by: Jason Williams <[email protected]> Co-authored-by: HalidOdat <[email protected]> Co-authored-by: Iban Eguia <[email protected]> Co-authored-by: Iban Eguia <[email protected]>
new output since 0.7
The precedence looks fixed here |
It looks good, yes! Might be worth adding a test for this? |
Are you adding the test, or should I? |
im doing it now |
The precedence in
new Class().method()
isn't correct. This expression is parsed asnew (Class().method())
, which is incorrect, the correct parse tree would be equivalent to(new Class()).method()
.A real-world example is
new Date().getTime()
.The text was updated successfully, but these errors were encountered: