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] - Implement Generator Function Constructor #2174

Closed
wants to merge 1 commit into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Jul 11, 2022

This Pull Request changes the following:

  • Modify CreateDynamicFunction to work with generator functions.
  • Add the name anonymus to functions created via CreateDynamicFunction to comply with the spec.
  • Fix a bug in the Yield parser where the parser would expect a token when no token is a legal case.
  • Change the Yield::new function to require less turbofishes.

@raskad raskad added enhancement New feature or request parser Issues surrounding the parser execution Issues or PRs related to code execution labels Jul 11, 2022
@raskad raskad added this to the v0.16.0 milestone Jul 11, 2022
@github-actions
Copy link

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 90,847 90,847 0
Passed 59,784 59,814 +30
Ignored 14,012 14,012 0
Failed 17,051 17,021 -30
Panics 0 0 0
Conformance 65.81% 65.84% +0.03%
Fixed tests (30):
test/built-ins/Function/instance-name.js [strict mode] (previously Failed)
test/built-ins/Function/instance-name.js (previously Failed)
test/built-ins/GeneratorFunction/instance-construct-throws.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/instance-construct-throws.js (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js (previously Failed)
test/built-ins/GeneratorFunction/proto-from-ctor-realm-prototype.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/proto-from-ctor-realm-prototype.js (previously Failed)
test/built-ins/GeneratorFunction/instance-prototype.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/instance-prototype.js (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js (previously Failed)
test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js (previously Failed)
test/built-ins/GeneratorFunction/instance-name.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/instance-name.js (previously Failed)
test/built-ins/GeneratorFunction/instance-length.js [strict mode] (previously Failed)
test/built-ins/GeneratorFunction/instance-length.js (previously Failed)
test/built-ins/Proxy/construct/trap-is-undefined-proto-from-cross-realm-newtarget.js [strict mode] (previously Failed)
test/built-ins/Proxy/construct/trap-is-undefined-proto-from-cross-realm-newtarget.js (previously Failed)
test/language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js [strict mode] (previously Failed)
test/language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js (previously Failed)
test/language/expressions/import.meta/syntax/goal-generator-params-or-body.js [strict mode] (previously Failed)
test/language/expressions/import.meta/syntax/goal-generator-params-or-body.js (previously Failed)
test/language/expressions/instanceof/S15.3.5.3_A3_T2.js [strict mode] (previously Failed)
test/language/expressions/instanceof/S15.3.5.3_A3_T2.js (previously Failed)

@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #2174 (d4e4f8b) into main (44d3291) will decrease coverage by 0.00%.
The diff coverage is 22.85%.

@@            Coverage Diff             @@
##             main    #2174      +/-   ##
==========================================
- Coverage   41.90%   41.90%   -0.01%     
==========================================
  Files         231      231              
  Lines       21502    21501       -1     
==========================================
- Hits         9011     9010       -1     
  Misses      12491    12491              
Impacted Files Coverage Δ
boa_engine/src/builtins/async_function/mod.rs 78.94% <ø> (ø)
boa_engine/src/builtins/function/mod.rs 25.66% <0.00%> (-0.28%) ⬇️
boa_engine/src/builtins/generator_function/mod.rs 80.95% <0.00%> (+10.11%) ⬆️
boa_interner/src/sym.rs 0.00% <ø> (ø)
...e/src/syntax/parser/expression/assignment/yield.rs 21.15% <50.00%> (-1.07%) ⬇️
boa_engine/src/vm/mod.rs 47.96% <50.00%> (-0.19%) ⬇️
boa_engine/src/vm/code_block.rs 37.57% <66.66%> (+0.07%) ⬆️
boa_engine/src/syntax/ast/node/yield/mod.rs 18.18% <100.00%> (ø)
...ngine/src/syntax/parser/statement/try_stm/catch.rs 45.67% <0.00%> (-2.47%) ⬇️
... and 3 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 44d3291...d4e4f8b. Read the comment docs.

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.

Looking good, just a couple of questions, for clarifications mostly :) thanks!

boa_engine/src/builtins/function/mod.rs Show resolved Hide resolved
boa_engine/src/syntax/ast/node/yield/mod.rs Show resolved Hide resolved
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.

Looks good to me!

@raskad
Copy link
Member Author

raskad commented Jul 15, 2022

bors r+

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

- Modify `CreateDynamicFunction` to work with generator functions.
- Add the name `anonymus` to functions created via `CreateDynamicFunction` to comply with the spec. 
- Fix a bug in the `Yield` parser where the parser would expect a token when no token is a legal case.
- Change the `Yield::new` function to require less turbofishes.
@bors
Copy link

bors bot commented Jul 15, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Implement Generator Function Constructor [Merged by Bors] - Implement Generator Function Constructor Jul 15, 2022
@bors bors bot closed this Jul 15, 2022
@bors bors bot deleted the implement-generator-constructor branch July 15, 2022 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request execution Issues or PRs related to code execution parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants