Skip to content
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

[Merged by Bors] - Add early errors for 'eval' or 'arguments' in parameters #2515

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Jan 4, 2023

This Pull Request changes the following:

  • Add early errors for functions to make sure that 'eval' or 'arguments' cannot be used as binding identifiers in function parameters. When the function body contains a strict directive, this also has to be accounted for.
  • Fix early errors for function identifiers to make sure they cannot be 'eval' or 'arguments' when a function body contains a strict directive.

@raskad raskad added bug Something isn't working parser Issues surrounding the parser labels Jan 4, 2023
@raskad raskad added this to the v0.17.0 milestone Jan 4, 2023
@github-actions
Copy link

github-actions bot commented Jan 4, 2023

Test262 conformance changes

Test result main count PR count difference
Total 94,188 94,188 0
Passed 70,164 70,172 +8
Ignored 18,605 18,605 0
Failed 5,419 5,411 -8
Panics 0 0 0
Conformance 74.49% 74.50% +0.01%
Fixed tests (8):
test/language/statements/function/param-arguments-strict-body.js (previously Failed)
test/language/statements/function/name-eval-strict-body.js (previously Failed)
test/language/statements/function/name-arguments-strict-body.js (previously Failed)
test/language/statements/function/param-eval-strict-body.js (previously Failed)
test/language/statements/function/13.1-22-s.js (previously Failed)
test/language/expressions/function/name-eval-strict-body.js (previously Failed)
test/language/expressions/function/name-arguments-strict-body.js (previously Failed)
test/language/expressions/function/param-eval-strict-body.js (previously Failed)

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #2515 (53e7366) into main (1b04c9e) will increase coverage by 0.84%.
The diff coverage is 41.12%.

@@            Coverage Diff             @@
##             main    #2515      +/-   ##
==========================================
+ Coverage   50.68%   51.52%   +0.84%     
==========================================
  Files         358      353       -5     
  Lines       36265    35731     -534     
==========================================
+ Hits        18380    18411      +31     
+ Misses      17885    17320     -565     
Impacted Files Coverage Δ
...pression/primary/async_generator_expression/mod.rs 59.21% <27.27%> (-6.47%) ⬇️
...ser/expression/primary/generator_expression/mod.rs 54.83% <27.27%> (-7.43%) ⬇️
...xpression/primary/async_function_expression/mod.rs 59.67% <33.33%> (-8.85%) ⬇️
.../src/parser/statement/declaration/hoistable/mod.rs 71.42% <52.94%> (+1.19%) ⬆️
...rser/expression/primary/function_expression/mod.rs 61.81% <56.25%> (+0.59%) ⬆️
boa_ast/src/operations.rs 78.06% <100.00%> (+0.41%) ⬆️
boa_parser/src/parser/expression/primary/mod.rs 54.81% <100.00%> (ø)
boa_engine/src/vm/opcode/binary_ops/mod.rs 77.14% <0.00%> (-5.72%) ⬇️
boa_ast/src/visitor.rs 10.58% <0.00%> (-0.59%) ⬇️
boa_cli/src/helper.rs 0.00% <0.00%> (ø)
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work!

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good!

@HalidOdat
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jan 7, 2023
This Pull Request changes the following:

- Add early errors for functions to make sure that 'eval' or 'arguments' cannot be used as binding identifiers in function parameters. When the function body contains a strict directive, this also has to be accounted for.
- Fix early errors for function identifiers to make sure they cannot be 'eval' or 'arguments' when a function body contains a strict directive.
@bors
Copy link

bors bot commented Jan 7, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Add early errors for 'eval' or 'arguments' in parameters [Merged by Bors] - Add early errors for 'eval' or 'arguments' in parameters Jan 7, 2023
@bors bors bot closed this Jan 7, 2023
@bors bors bot deleted the function-parameters-eval-arguments branch January 7, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants