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] - Deny const declarations without initializer inside for loops #1903

Closed
wants to merge 2 commits into from

Conversation

jedel1043
Copy link
Member

@jedel1043 jedel1043 commented Mar 7, 2022

This Pull Request fixes/closes #1897.

It changes the following:

  • Rejects uninitialized const declarations inside the init value of a for loop statement.
  • Adds test for the case.

@jedel1043 jedel1043 added bug Something isn't working parser Issues surrounding the parser labels Mar 7, 2022
@jedel1043 jedel1043 added this to the v0.14.0 milestone Mar 7, 2022
@github-actions
Copy link

github-actions bot commented Mar 7, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 88,342 88,342 0
Passed 43,291 43,293 +2
Ignored 21,413 21,413 0
Failed 23,638 23,636 -2
Panics 0 0 0
Conformance 49.00% 49.01% +0.00%
Fixed tests (2):
test/language/statements/for/head-const-bound-names-in-stmt.js [strict mode] (previously Failed)
test/language/statements/for/head-const-bound-names-in-stmt.js (previously Failed)

@codecov
Copy link

codecov bot commented Mar 7, 2022

Codecov Report

Merging #1903 (680e181) into main (cc755db) will increase coverage by 0.00%.
The diff coverage is 44.44%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1903   +/-   ##
=======================================
  Coverage   46.39%   46.39%           
=======================================
  Files         206      206           
  Lines       16823    16827    +4     
=======================================
+ Hits         7805     7807    +2     
- Misses       9018     9020    +2     
Impacted Files Coverage Δ
...src/syntax/parser/statement/declaration/lexical.rs 36.36% <33.33%> (+0.64%) ⬆️
...syntax/parser/statement/iteration/for_statement.rs 49.16% <50.00%> (+0.04%) ⬆️
boa_engine/src/object/jsobject.rs 49.68% <0.00%> (-0.63%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc755db...680e181. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Mar 7, 2022

Benchmark for f20b190

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 717.5±55.50ns 708.8±36.92ns -1.21%
Arithmetic operations (Execution) 2.6±0.17µs 2.6±0.13µs 0.00%
Arithmetic operations (Parser) 6.8±0.26µs 6.8±0.40µs 0.00%
Array access (Compiler) 1815.0±107.30ns 1822.5±133.76ns +0.41%
Array access (Execution) 13.2±0.77µs 13.0±0.57µs -1.52%
Array access (Parser) 15.5±1.09µs 14.7±0.60µs -5.16%
Array creation (Compiler) 2.5±0.13µs 2.5±0.14µs 0.00%
Array creation (Execution) 4.0±0.18ms 4.1±0.25ms +2.50%
Array creation (Parser) 16.8±0.85µs 16.2±0.90µs -3.57%
Array pop (Compiler) 5.0±0.30µs 5.0±0.24µs 0.00%
Array pop (Execution) 1725.3±60.28µs 1748.4±72.81µs +1.34%
Array pop (Parser) 179.3±9.35µs 175.5±11.19µs -2.12%
Boolean Object Access (Compiler) 1492.0±120.10ns 1502.0±120.13ns +0.67%
Boolean Object Access (Execution) 7.8±0.37µs 7.9±0.58µs +1.28%
Boolean Object Access (Parser) 18.1±0.73µs 18.0±0.74µs -0.55%
Clean js (Compiler) 4.8±0.35µs 4.7±0.27µs -2.08%
Clean js (Execution) 1440.3±98.69µs 1398.9±56.17µs -2.87%
Clean js (Parser) 36.2±2.30µs 36.5±2.93µs +0.83%
Create Realm 351.7±16.01ns 350.6±21.02ns -0.31%
Dynamic Object Property Access (Compiler) 2.2±0.06µs 2.3±0.15µs +4.55%
Dynamic Object Property Access (Execution) 9.1±0.54µs 9.4±0.64µs +3.30%
Dynamic Object Property Access (Parser) 13.4±0.85µs 13.0±0.89µs -2.99%
Fibonacci (Compiler) 3.2±0.13µs 3.2±0.33µs 0.00%
Fibonacci (Execution) 2.4±0.11ms 2.4±0.11ms 0.00%
Fibonacci (Parser) 20.3±1.19µs 20.0±0.98µs -1.48%
For loop (Compiler) 2.7±0.13µs 2.7±0.14µs 0.00%
For loop (Execution) 56.3±2.61µs 56.2±2.00µs -0.18%
For loop (Parser) 17.3±0.73µs 16.9±1.82µs -2.31%
Mini js (Compiler) 4.5±0.21µs 4.6±0.56µs +2.22%
Mini js (Execution) 1290.6±76.92µs 1279.4±48.49µs -0.87%
Mini js (Parser) 32.1±1.68µs 31.8±1.42µs -0.93%
Number Object Access (Compiler) 1412.6±46.78ns 1386.4±84.30ns -1.85%
Number Object Access (Execution) 6.2±0.66µs 6.4±1.48µs +3.23%
Number Object Access (Parser) 14.3±0.76µs 14.0±0.78µs -2.10%
Object Creation (Compiler) 1957.2±87.93ns 1973.1±120.32ns +0.81%
Object Creation (Execution) 8.3±0.32µs 8.4±0.42µs +1.20%
Object Creation (Parser) 11.8±0.69µs 11.7±0.89µs -0.85%
RegExp (Compiler) 2.3±0.22µs 2.3±0.16µs 0.00%
RegExp (Execution) 16.8±1.05µs 16.7±0.64µs -0.60%
RegExp (Parser) 12.9±0.78µs 12.5±0.71µs -3.10%
RegExp Creation (Compiler) 1993.1±140.99ns 2.0±0.17µs +0.35%
RegExp Creation (Execution) 12.2±0.65µs 12.7±0.67µs +4.10%
RegExp Creation (Parser) 10.8±0.61µs 10.5±0.61µs -2.78%
RegExp Literal (Compiler) 2.3±0.09µs 2.3±0.15µs 0.00%
RegExp Literal (Execution) 16.4±0.73µs 16.7±0.79µs +1.83%
RegExp Literal (Parser) 10.3±0.45µs 10.2±0.61µs -0.97%
RegExp Literal Creation (Compiler) 1973.1±99.26ns 2.0±0.16µs +1.36%
RegExp Literal Creation (Execution) 12.2±0.62µs 12.6±1.41µs +3.28%
RegExp Literal Creation (Parser) 8.2±1.02µs 7.8±0.77µs -4.88%
Static Object Property Access (Compiler) 2.0±0.22µs 2.0±0.14µs 0.00%
Static Object Property Access (Execution) 8.8±0.59µs 8.8±0.37µs 0.00%
Static Object Property Access (Parser) 12.7±0.61µs 12.5±0.76µs -1.57%
String Object Access (Compiler) 1952.5±87.12ns 1949.3±96.76ns -0.16%
String Object Access (Execution) 10.1±0.69µs 10.1±0.45µs 0.00%
String Object Access (Parser) 18.0±0.95µs 18.3±1.31µs +1.67%
String comparison (Compiler) 2.9±0.13µs 2.9±0.21µs 0.00%
String comparison (Execution) 7.8±0.50µs 7.8±0.32µs 0.00%
String comparison (Parser) 14.0±1.04µs 13.6±0.58µs -2.86%
String concatenation (Compiler) 2.3±0.09µs 2.3±0.20µs 0.00%
String concatenation (Execution) 7.2±0.29µs 7.2±0.29µs 0.00%
String concatenation (Parser) 9.6±0.37µs 10.1±6.76µs +5.21%
String copy (Compiler) 1844.2±145.53ns 1807.9±82.30ns -1.97%
String copy (Execution) 6.5±0.44µs 6.6±0.34µs +1.54%
String copy (Parser) 7.2±0.43µs 6.9±0.27µs -4.17%
Symbols (Compiler) 1336.9±66.65ns 1318.5±75.37ns -1.38%
Symbols (Execution) 6.2±0.28µs 6.3±0.26µs +1.61%
Symbols (Parser) 5.6±0.42µs 5.4±0.26µs -3.57%

@HalidOdat
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Mar 7, 2022
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->

This Pull Request fixes/closes #1897.

It changes the following:

- Rejects uninitialized const declarations inside the init value of a for loop statement.
- Adds test for the case.
@bors
Copy link

bors bot commented Mar 7, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Deny const declarations without initializer inside for loops [Merged by Bors] - Deny const declarations without initializer inside for loops Mar 7, 2022
@bors bors bot closed this Mar 7, 2022
@bors bors bot deleted the fix/issue-1897 branch March 7, 2022 16:26
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.

Const declarations without initialisers can cause a panic
3 participants