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] - Move redeclaration errors to parser #2027

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Apr 14, 2022

This Pull Request changes the following:

This requires a slight change in our public api. The Parser new requires a full Context instead of just the Interner for parsing new code. This is required, because if multiple scripts are parsed (e.g. every input in the REPL) global variables must be checked for redeclarations.

@raskad raskad added enhancement New feature or request parser Issues surrounding the parser API vm Issues and PRs related to the Boa Virtual Machine. labels Apr 14, 2022
@raskad raskad added this to the v0.15.0 milestone Apr 14, 2022
@github-actions
Copy link

github-actions bot commented Apr 14, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 89,590 89,590 0
Passed 53,264 53,460 +196
Ignored 22,725 22,725 0
Failed 13,601 13,405 -196
Panics 0 0 0
Conformance 59.45% 59.67% +0.22%
Fixed tests (198):
test/annexB/language/statements/try/catch-redeclared-var-statement-captured.js [strict mode] (previously Failed)
test/annexB/language/statements/try/catch-redeclared-var-statement-captured.js (previously Failed)
test/annexB/language/statements/try/catch-redeclared-var-statement.js [strict mode] (previously Failed)
test/annexB/language/statements/try/catch-redeclared-var-statement.js (previously Failed)
test/language/statements/try/early-catch-function.js (previously Failed)
test/language/statements/for-in/head-let-bound-names-in-stmt.js [strict mode] (previously Failed)
test/language/statements/for-in/head-let-bound-names-in-stmt.js (previously Failed)
test/language/statements/for-in/head-const-bound-names-in-stmt.js [strict mode] (previously Failed)
test/language/statements/for-in/head-const-bound-names-in-stmt.js (previously Failed)
test/language/statements/for-of/head-let-bound-names-in-stmt.js [strict mode] (previously Failed)
test/language/statements/for-of/head-let-bound-names-in-stmt.js (previously Failed)
test/language/statements/for-of/head-const-bound-names-in-stmt.js [strict mode] (previously Failed)
test/language/statements/for-of/head-const-bound-names-in-stmt.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-class.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-var.js [strict mode] (previously Failed)
test/language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-const.js [strict mode] (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-const.js [strict mode] (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js (previously Failed)
test/language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-let.js [strict mode] (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-let.js [strict mode] (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-let.js (previously Failed)
test/language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-function.js (previously Failed)
test/language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js (previously Failed)
test/language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-class.js (previously Failed)
Broken tests (2):
test/language/global-code/decl-lex-restricted-global.js [strict mode] (previously Passed)
test/language/global-code/decl-lex-restricted-global.js (previously Passed)

@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #2027 (467710d) into main (a357a18) will increase coverage by 0.24%.
The diff coverage is 45.32%.

@@            Coverage Diff             @@
##             main    #2027      +/-   ##
==========================================
+ Coverage   43.92%   44.16%   +0.24%     
==========================================
  Files         211      212       +1     
  Lines       18693    18812     +119     
==========================================
+ Hits         8211     8309      +98     
- Misses      10482    10503      +21     
Impacted Files Coverage Δ
boa_cli/src/main.rs 5.55% <0.00%> (+0.29%) ⬆️
boa_engine/src/context/mod.rs 33.33% <0.00%> (+0.31%) ⬆️
boa_engine/src/realm.rs 46.15% <ø> (+12.82%) ⬆️
.../statement/declaration/hoistable/class_decl/mod.rs 24.13% <0.00%> (-0.83%) ⬇️
boa_engine/src/syntax/parser/statement/mod.rs 30.37% <ø> (+1.10%) ⬆️
...syntax/parser/statement/iteration/for_statement.rs 38.82% <24.24%> (-3.52%) ⬇️
boa_engine/src/environments/compile.rs 41.66% <25.00%> (+1.84%) ⬆️
boa_engine/src/bytecompiler.rs 30.11% <37.14%> (-0.24%) ⬇️
...ngine/src/syntax/parser/statement/try_stm/catch.rs 45.67% <38.09%> (-4.33%) ⬇️
...a_engine/src/syntax/parser/statement/switch/mod.rs 39.53% <38.46%> (-0.47%) ⬇️
... and 38 more

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 a357a18...467710d. Read the comment docs.

@github-actions
Copy link

Benchmark for e36cad4

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 454.0±1.93ns 448.9±0.69ns -1.12%
Arithmetic operations (Execution) 559.2±1.71ns 561.8±0.67ns +0.46%
Arithmetic operations (Parser) 5.2±0.02µs 5.2±0.01µs 0.00%
Array access (Compiler) 1125.3±3.38ns 1149.8±7.76ns +2.18%
Array access (Execution) 6.8±0.02µs 7.7±0.02µs +13.24%
Array access (Parser) 11.2±0.02µs 11.1±0.02µs -0.89%
Array creation (Compiler) 1581.7±3.66ns 1631.9±13.38ns +3.17%
Array creation (Execution) 2.3±0.00ms 2.5±0.00ms +8.70%
Array creation (Parser) 12.7±0.02µs 12.8±0.03µs +0.79%
Array pop (Compiler) 3.2±0.01µs 3.2±0.01µs 0.00%
Array pop (Execution) 1018.8±3.73µs 985.1±2.46µs -3.31%
Array pop (Parser) 127.8±1.18µs 129.3±0.19µs +1.17%
Boolean Object Access (Compiler) 937.8±2.72ns 934.9±1.46ns -0.31%
Boolean Object Access (Execution) 3.6±0.00µs 3.6±0.01µs 0.00%
Boolean Object Access (Parser) 13.1±0.02µs 13.5±0.03µs +3.05%
Clean js (Compiler) 2.9±0.01µs 3.0±0.01µs +3.45%
Clean js (Execution) 612.4±3.32µs 608.4±3.06µs -0.65%
Clean js (Parser) 27.4±0.05µs 27.8±0.13µs +1.46%
Create Realm 239.7±2.38ns 242.6±0.30ns +1.21%
Dynamic Object Property Access (Compiler) 1427.9±3.31ns 1423.1±3.03ns -0.34%
Dynamic Object Property Access (Execution) 4.7±0.02µs 4.8±0.03µs +2.13%
Dynamic Object Property Access (Parser) 9.9±0.02µs 9.8±0.02µs -1.01%
Fibonacci (Compiler) 2.0±0.00µs 2.0±0.01µs 0.00%
Fibonacci (Execution) 1321.8±6.38µs 1178.0±3.15µs -10.88%
Fibonacci (Parser) 17.2±0.03µs 15.0±0.02µs -12.79%
For loop (Compiler) 1727.5±2.25ns 1718.7±8.98ns -0.51%
For loop (Execution) 15.1±0.04µs 13.5±0.05µs -10.60%
For loop (Parser) 12.9±0.03µs 13.1±0.07µs +1.55%
Mini js (Compiler) 2.8±0.01µs 2.9±0.01µs +3.57%
Mini js (Execution) 579.6±3.89µs 573.2±2.58µs -1.10%
Mini js (Parser) 24.3±0.10µs 27.8±0.10µs +14.40%
Number Object Access (Compiler) 895.8±2.66ns 907.1±4.05ns +1.26%
Number Object Access (Execution) 2.8±0.01µs 2.8±0.00µs 0.00%
Number Object Access (Parser) 10.2±0.03µs 10.5±0.01µs +2.94%
Object Creation (Compiler) 1230.5±2.73ns 1238.8±2.55ns +0.67%
Object Creation (Execution) 4.5±0.01µs 4.5±0.01µs 0.00%
Object Creation (Parser) 8.6±0.01µs 8.5±0.02µs -1.16%
RegExp (Compiler) 1434.0±5.91ns 1432.9±10.62ns -0.08%
RegExp (Execution) 9.7±0.04µs 9.7±0.04µs 0.00%
RegExp (Parser) 9.5±0.01µs 9.4±0.02µs -1.05%
RegExp Creation (Compiler) 1272.6±9.77ns 1222.2±5.12ns -3.96%
RegExp Creation (Execution) 7.3±0.03µs 7.4±0.02µs +1.37%
RegExp Creation (Parser) 7.9±0.04µs 7.8±0.02µs -1.27%
RegExp Literal (Compiler) 1448.3±3.80ns 1464.2±12.89ns +1.10%
RegExp Literal (Execution) 9.8±0.04µs 9.8±0.04µs 0.00%
RegExp Literal (Parser) 7.7±0.01µs 7.6±0.02µs -1.30%
RegExp Literal Creation (Compiler) 1242.7±3.02ns 1250.4±3.12ns +0.62%
RegExp Literal Creation (Execution) 7.3±0.02µs 7.4±0.02µs +1.37%
RegExp Literal Creation (Parser) 6.1±0.01µs 5.9±0.02µs -3.28%
Static Object Property Access (Compiler) 1245.0±4.91ns 1223.5±3.31ns -1.73%
Static Object Property Access (Execution) 4.6±0.02µs 4.6±0.02µs 0.00%
Static Object Property Access (Parser) 9.2±0.02µs 9.2±0.02µs 0.00%
String Object Access (Compiler) 1255.5±4.29ns 1247.3±3.41ns -0.65%
String Object Access (Execution) 5.3±0.02µs 5.2±0.01µs -1.89%
String Object Access (Parser) 12.9±0.02µs 13.2±0.02µs +2.33%
String comparison (Compiler) 1886.5±8.74ns 1832.1±8.96ns -2.88%
String comparison (Execution) 4.1±0.01µs 4.0±0.02µs -2.44%
String comparison (Parser) 10.4±0.01µs 10.1±0.02µs -2.88%
String concatenation (Compiler) 1471.0±4.46ns 1447.5±3.63ns -1.60%
String concatenation (Execution) 3.8±0.02µs 3.8±0.02µs 0.00%
String concatenation (Parser) 7.2±0.02µs 7.0±0.01µs -2.78%
String copy (Compiler) 1152.8±5.17ns 1131.9±6.47ns -1.81%
String copy (Execution) 3.6±0.01µs 3.6±0.01µs 0.00%
String copy (Parser) 5.4±0.02µs 5.2±0.01µs -3.70%
Symbols (Compiler) 808.9±1.71ns 808.5±2.12ns -0.05%
Symbols (Execution) 3.6±0.01µs 3.7±0.01µs +2.78%
Symbols (Parser) 4.1±0.02µs 4.1±0.05µs 0.00%

Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

This looks good from my side! :)

@raskad
Copy link
Member Author

raskad commented Apr 22, 2022

Rebased

@github-actions
Copy link

Benchmark for 1f70b9c

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 644.9±36.71ns 657.5±52.88ns +1.95%
Arithmetic operations (Execution) 796.5±44.95ns 776.9±32.05ns -2.46%
Arithmetic operations (Parser) 6.8±0.33µs 6.6±0.24µs -2.94%
Array access (Compiler) 1587.7±86.78ns 1595.9±89.83ns +0.52%
Array access (Execution) 9.6±0.43µs 9.6±0.44µs 0.00%
Array access (Parser) 14.3±0.58µs 14.2±0.79µs -0.70%
Array creation (Compiler) 2.3±0.12µs 2.2±0.13µs -4.35%
Array creation (Execution) 3.1±0.12ms 3.2±0.12ms +3.23%
Array creation (Parser) 16.8±1.26µs 16.5±0.55µs -1.79%
Array pop (Compiler) 4.7±0.33µs 4.7±0.25µs 0.00%
Array pop (Execution) 1391.3±77.24µs 1450.6±60.18µs +4.26%
Array pop (Parser) 168.8±9.38µs 173.8±7.42µs +2.96%
Boolean Object Access (Compiler) 1171.4±67.41ns 1171.1±69.30ns -0.03%
Boolean Object Access (Execution) 5.1±0.23µs 5.1±0.17µs 0.00%
Boolean Object Access (Parser) 17.4±0.64µs 17.8±0.98µs +2.30%
Clean js (Compiler) 4.1±0.20µs 4.3±0.36µs +4.88%
Clean js (Execution) 862.5±39.08µs 850.2±25.20µs -1.43%
Clean js (Parser) 35.6±2.20µs 36.2±2.19µs +1.69%
Create Realm 343.4±14.11ns 353.5±24.21ns +2.94%
Dynamic Object Property Access (Compiler) 2.0±0.08µs 1979.1±104.65ns -1.05%
Dynamic Object Property Access (Execution) 6.8±0.39µs 6.6±0.40µs -2.94%
Dynamic Object Property Access (Parser) 12.7±0.43µs 12.9±0.86µs +1.57%
Fibonacci (Compiler) 2.8±0.15µs 2.8±0.20µs 0.00%
Fibonacci (Execution) 1671.0±65.69µs 1682.1±72.00µs +0.66%
Fibonacci (Parser) 20.1±1.38µs 19.7±0.82µs -1.99%
For loop (Compiler) 2.4±0.20µs 2.4±0.14µs 0.00%
For loop (Execution) 19.2±1.22µs 19.4±0.93µs +1.04%
For loop (Parser) 17.0±0.76µs 17.0±0.91µs 0.00%
Mini js (Compiler) 4.1±0.12µs 4.0±0.22µs -2.44%
Mini js (Execution) 810.7±23.19µs 813.1±30.47µs +0.30%
Mini js (Parser) 30.8±0.97µs 31.2±0.92µs +1.30%
Number Object Access (Compiler) 1144.0±59.60ns 1150.9±63.17ns +0.60%
Number Object Access (Execution) 4.1±0.30µs 4.0±0.24µs -2.44%
Number Object Access (Parser) 13.4±0.73µs 13.5±0.82µs +0.75%
Object Creation (Compiler) 1745.9±112.79ns 1732.1±89.56ns -0.79%
Object Creation (Execution) 6.3±0.31µs 6.3±0.22µs 0.00%
Object Creation (Parser) 10.9±0.41µs 11.2±0.48µs +2.75%
RegExp (Compiler) 2.1±0.10µs 2.1±0.16µs 0.00%
RegExp (Execution) 13.3±0.52µs 13.9±1.25µs +4.51%
RegExp (Parser) 12.1±0.55µs 12.2±0.69µs +0.83%
RegExp Creation (Compiler) 1761.0±78.70ns 1745.0±86.72ns -0.91%
RegExp Creation (Execution) 10.7±1.63µs 10.1±0.67µs -5.61%
RegExp Creation (Parser) 10.0±0.45µs 10.1±0.42µs +1.00%
RegExp Literal (Compiler) 2.1±0.12µs 2.1±0.16µs 0.00%
RegExp Literal (Execution) 13.4±0.67µs 13.8±1.11µs +2.99%
RegExp Literal (Parser) 9.8±0.60µs 9.9±0.58µs +1.02%
RegExp Literal Creation (Compiler) 1753.0±91.09ns 1711.1±90.10ns -2.39%
RegExp Literal Creation (Execution) 10.2±0.39µs 10.1±0.52µs -0.98%
RegExp Literal Creation (Parser) 7.9±0.48µs 7.9±0.52µs 0.00%
Static Object Property Access (Compiler) 1731.3±105.65ns 1746.5±92.25ns +0.88%
Static Object Property Access (Execution) 6.5±0.29µs 6.6±0.54µs +1.54%
Static Object Property Access (Parser) 11.8±0.67µs 11.8±0.50µs 0.00%
String Object Access (Compiler) 1643.2±85.28ns 1646.3±89.32ns +0.19%
String Object Access (Execution) 7.3±0.34µs 7.5±0.57µs +2.74%
String Object Access (Parser) 17.0±0.80µs 17.4±1.43µs +2.35%
String comparison (Compiler) 2.6±0.11µs 2.6±0.18µs 0.00%
String comparison (Execution) 5.7±0.34µs 5.7±0.23µs 0.00%
String comparison (Parser) 13.5±1.23µs 13.0±0.60µs -3.70%
String concatenation (Compiler) 2.0±0.10µs 2.0±0.12µs 0.00%
String concatenation (Execution) 5.4±0.23µs 5.4±0.29µs 0.00%
String concatenation (Parser) 9.2±1.93µs 9.1±0.39µs -1.09%
String copy (Compiler) 1645.6±177.86ns 1615.4±56.77ns -1.84%
String copy (Execution) 5.1±0.28µs 5.1±0.29µs 0.00%
String copy (Parser) 6.7±0.38µs 6.6±0.32µs -1.49%
Symbols (Compiler) 1157.8±45.20ns 1185.7±71.37ns +2.41%
Symbols (Execution) 5.3±0.29µs 5.3±0.28µs 0.00%
Symbols (Parser) 5.2±0.31µs 5.1±0.23µs -1.92%

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

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

I'm happy to merge it as-is, looks very good and this is a great improvement now! Check my comments to see if it makes sense to take action on them :)

@github-actions
Copy link

Benchmark for 3b2af86

Click to view benchmark
Test Base PR %
Arithmetic operations (Compiler) 509.5±0.88ns 530.8±2.84ns +4.18%
Arithmetic operations (Execution) 446.4±1.14ns 452.8±3.77ns +1.43%
Arithmetic operations (Parser) 6.1±0.02µs 6.2±0.02µs +1.64%
Array access (Compiler) 1345.4±5.14ns 1333.2±5.30ns -0.91%
Array access (Execution) 8.5±0.03µs 8.2±0.03µs -3.53%
Array access (Parser) 13.9±0.04µs 13.8±0.06µs -0.72%
Array creation (Compiler) 1984.9±7.31ns 1963.7±5.81ns -1.07%
Array creation (Execution) 2.4±0.01ms 2.5±0.00ms +4.17%
Array creation (Parser) 15.6±0.04µs 15.8±0.08µs +1.28%
Array pop (Compiler) 3.7±0.01µs 3.6±0.02µs -2.70%
Array pop (Execution) 1066.4±7.01µs 1086.9±16.62µs +1.92%
Array pop (Parser) 157.5±0.26µs 159.3±0.30µs +1.14%
Boolean Object Access (Compiler) 1109.9±2.98ns 1142.6±6.42ns +2.95%
Boolean Object Access (Execution) 4.5±0.03µs 4.5±0.01µs 0.00%
Boolean Object Access (Parser) 16.0±0.02µs 15.8±0.08µs -1.25%
Clean js (Compiler) 3.7±0.01µs 3.7±0.02µs 0.00%
Clean js (Execution) 703.0±4.67µs 692.0±2.60µs -1.56%
Clean js (Parser) 33.7±0.18µs 33.6±0.12µs -0.30%
Create Realm 272.2±2.60ns 282.2±0.98ns +3.67%
Dynamic Object Property Access (Compiler) 1801.0±8.50ns 1761.3±10.77ns -2.20%
Dynamic Object Property Access (Execution) 5.7±0.06µs 5.5±0.02µs -3.51%
Dynamic Object Property Access (Parser) 12.2±0.06µs 12.0±0.05µs -1.64%
Fibonacci (Compiler) 2.5±0.00µs 2.5±0.01µs 0.00%
Fibonacci (Execution) 1410.1±1.29µs 1399.5±9.50µs -0.75%
Fibonacci (Parser) 18.6±0.05µs 18.5±0.04µs -0.54%
For loop (Compiler) 2.1±0.00µs 2.1±0.01µs 0.00%
For loop (Execution) 15.3±0.07µs 15.4±0.07µs +0.65%
For loop (Parser) 15.9±0.04µs 16.0±0.06µs +0.63%
Mini js (Compiler) 3.6±0.01µs 3.6±0.01µs 0.00%
Mini js (Execution) 665.8±6.64µs 656.9±3.21µs -1.34%
Mini js (Parser) 29.7±0.12µs 29.8±0.10µs +0.34%
Number Object Access (Compiler) 1034.1±1.56ns 1059.4±5.38ns +2.45%
Number Object Access (Execution) 3.5±0.11µs 3.5±0.01µs 0.00%
Number Object Access (Parser) 12.6±0.09µs 12.4±0.10µs -1.59%
Object Creation (Compiler) 1481.1±6.81ns 1474.4±5.42ns -0.45%
Object Creation (Execution) 5.2±0.02µs 5.2±0.01µs 0.00%
Object Creation (Parser) 10.7±0.09µs 10.5±0.04µs -1.87%
RegExp (Compiler) 1752.7±4.45ns 1744.5±6.51ns -0.47%
RegExp (Execution) 11.6±0.06µs 11.6±0.09µs 0.00%
RegExp (Parser) 11.8±0.06µs 11.5±0.06µs -2.54%
RegExp Creation (Compiler) 1484.5±3.98ns 1459.8±5.31ns -1.66%
RegExp Creation (Execution) 8.8±0.04µs 8.6±0.02µs -2.27%
RegExp Creation (Parser) 9.8±0.05µs 9.5±0.05µs -3.06%
RegExp Literal (Compiler) 1736.3±4.10ns 1724.0±4.55ns -0.71%
RegExp Literal (Execution) 11.8±0.08µs 11.6±0.07µs -1.69%
RegExp Literal (Parser) 9.5±0.06µs 9.4±0.03µs -1.05%
RegExp Literal Creation (Compiler) 1531.0±3.76ns 1520.7±23.86ns -0.67%
RegExp Literal Creation (Execution) 8.8±0.04µs 8.6±0.03µs -2.27%
RegExp Literal Creation (Parser) 7.5±0.03µs 7.4±0.04µs -1.33%
Static Object Property Access (Compiler) 1484.3±3.34ns 1497.8±5.75ns +0.91%
Static Object Property Access (Execution) 5.4±0.07µs 5.3±0.03µs -1.85%
Static Object Property Access (Parser) 11.4±0.05µs 11.2±0.04µs -1.75%
String Object Access (Compiler) 1519.6±6.15ns 1518.4±10.56ns -0.08%
String Object Access (Execution) 6.2±0.07µs 6.3±0.01µs +1.61%
String Object Access (Parser) 15.8±0.02µs 15.7±0.08µs -0.63%
String comparison (Compiler) 2.2±0.01µs 2.2±0.01µs 0.00%
String comparison (Execution) 4.7±0.02µs 4.9±0.02µs +4.26%
String comparison (Parser) 12.7±0.17µs 12.3±0.05µs -3.15%
String concatenation (Compiler) 1759.3±4.74ns 1670.4±2.79ns -5.05%
String concatenation (Execution) 4.5±0.01µs 4.6±0.03µs +2.22%
String concatenation (Parser) 8.6±0.02µs 8.5±0.06µs -1.16%
String copy (Compiler) 1341.4±5.90ns 1339.4±5.31ns -0.15%
String copy (Execution) 4.3±0.07µs 4.3±0.01µs 0.00%
String copy (Parser) 6.4±0.02µs 6.3±0.02µs -1.56%
Symbols (Compiler) 941.1±3.48ns 959.9±3.32ns +2.00%
Symbols (Execution) 4.4±0.01µs 4.3±0.02µs -2.27%
Symbols (Parser) 5.0±0.01µs 4.9±0.03µs -2.00%

@raskad
Copy link
Member Author

raskad commented Apr 27, 2022

bors r+

bors bot pushed a commit that referenced this pull request Apr 27, 2022
This Pull Request changes the following:

- Implement redeclaration errors in the parser
- Remove redeclaration errors from the compiler (this is a big step towards #1907)
- Fix some failing tests on the way

This requires a slight change in our public api. The Parser new requires a full `Context` instead of just the `Interner` for parsing new code. This is required, because if multiple scripts are parsed (e.g. every input in the REPL) global variables must be checked for redeclarations.
@bors
Copy link

bors bot commented Apr 27, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Move redeclaration errors to parser [Merged by Bors] - Move redeclaration errors to parser Apr 27, 2022
@bors bors bot closed this Apr 27, 2022
@bors bors bot deleted the fix-redeclarations branch April 27, 2022 16:28
Razican pushed a commit that referenced this pull request Jun 8, 2022
This Pull Request changes the following:

- Implement redeclaration errors in the parser
- Remove redeclaration errors from the compiler (this is a big step towards #1907)
- Fix some failing tests on the way

This requires a slight change in our public api. The Parser new requires a full `Context` instead of just the `Interner` for parsing new code. This is required, because if multiple scripts are parsed (e.g. every input in the REPL) global variables must be checked for redeclarations.
@raskad raskad mentioned this pull request Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request parser Issues surrounding the parser vm Issues and PRs related to the Boa Virtual Machine.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants