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] - Started adding the [[Done]] field to iterators #2125

Closed
wants to merge 4 commits into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Jun 15, 2022

This Pull Request adds the [[Done]] field to iterator records.

@Razican Razican added enhancement New feature or request builtins PRs and Issues related to builtins/intrinsics labels Jun 15, 2022
@Razican Razican added this to the v0.16.0 milestone Jun 15, 2022
@Razican
Copy link
Member Author

Razican commented Jun 15, 2022

I am probably missing stuff on the VM, but I'm somehow not able to make this work :(

@raskad
Copy link
Member

raskad commented Jun 15, 2022

I am probably missing stuff on the VM, but I'm somehow not able to make this work :(

I'm gonna take a look, maybe I spot the error

@raskad
Copy link
Member

raskad commented Jun 16, 2022

I got the vm code to work. Only a few tests are missing. I'm currently looking into those.

One big change is, that the [[NextMethod]] can be a value instead of an object. Imo the spec is just wrong with the field description of [[NextMethod]]. It sounds like it can only be a function: a function object. But in GetIterator it clearly can be a value:

5. Let nextMethod be ? GetV(iterator, "next").
6. Let iteratorRecord be the Iterator Record { [[Iterator]]: iterator, [[NextMethod]]: nextMethod, [[Done]]: false }.

@github-actions
Copy link

github-actions bot commented Jun 16, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 90,499 90,619 +120
Passed 56,837 56,859 +22
Ignored 13,648 13,788 +140
Failed 20,014 19,972 -42
Panics 0 0 0
Conformance 62.80% 62.75% -0.06%
Fixed tests (24):
test/language/statements/for-of/iterator-close-non-object.js [strict mode] (previously Failed)
test/language/statements/for-of/iterator-close-non-object.js (previously Failed)
test/language/statements/for-of/dstr/array-elem-trlg-iter-list-nrml-close-null.js [strict mode] (previously Failed)
test/language/statements/for-of/dstr/array-elem-trlg-iter-list-nrml-close-null.js (previously Failed)
test/language/statements/for-of/dstr/array-elision-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/statements/for-of/dstr/array-elision-iter-nrml-close-null.js (previously Failed)
test/language/statements/for-of/dstr/array-elem-trlg-iter-elision-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/statements/for-of/dstr/array-elem-trlg-iter-elision-iter-nrml-close-null.js (previously Failed)
test/language/statements/for-of/dstr/array-elem-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/statements/for-of/dstr/array-elem-iter-nrml-close-null.js (previously Failed)
test/language/statements/for-of/dstr/array-empty-iter-close-null.js [strict mode] (previously Failed)
test/language/statements/for-of/dstr/array-empty-iter-close-null.js (previously Failed)
test/language/statements/try/S12.14_A12_T2.js [strict mode] (previously Failed)
test/language/statements/try/S12.14_A12_T2.js (previously Failed)
test/language/expressions/assignment/dstr/array-elem-trlg-iter-list-nrml-close-null.js [strict mode] (previously Failed)
test/language/expressions/assignment/dstr/array-elem-trlg-iter-list-nrml-close-null.js (previously Failed)
test/language/expressions/assignment/dstr/array-elision-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/expressions/assignment/dstr/array-elision-iter-nrml-close-null.js (previously Failed)
test/language/expressions/assignment/dstr/array-elem-trlg-iter-elision-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/expressions/assignment/dstr/array-elem-trlg-iter-elision-iter-nrml-close-null.js (previously Failed)
test/language/expressions/assignment/dstr/array-elem-iter-nrml-close-null.js [strict mode] (previously Failed)
test/language/expressions/assignment/dstr/array-elem-iter-nrml-close-null.js (previously Failed)
test/language/expressions/assignment/dstr/array-empty-iter-close-null.js [strict mode] (previously Failed)
test/language/expressions/assignment/dstr/array-empty-iter-close-null.js (previously Failed)
Broken tests (2):
test/language/statements/for/head-const-bound-names-in-stmt.js [strict mode] (previously Passed)
test/language/statements/for/head-const-bound-names-in-stmt.js (previously Passed)

@codecov
Copy link

codecov bot commented Jun 16, 2022

Codecov Report

Merging #2125 (7e043f7) into main (31edb26) will decrease coverage by 0.02%.
The diff coverage is 39.23%.

@@            Coverage Diff             @@
##             main    #2125      +/-   ##
==========================================
- Coverage   43.50%   43.48%   -0.03%     
==========================================
  Files         220      220              
  Lines       19962    19983      +21     
==========================================
+ Hits         8684     8689       +5     
- Misses      11278    11294      +16     
Impacted Files Coverage Δ
boa_engine/src/builtins/array_buffer/mod.rs 9.42% <0.00%> (ø)
boa_engine/src/builtins/typed_array/mod.rs 3.74% <0.00%> (ø)
boa_engine/src/context/mod.rs 32.60% <0.00%> (+0.29%) ⬆️
...gine/src/object/internal_methods/bound_function.rs 0.00% <0.00%> (ø)
boa_engine/src/object/internal_methods/mod.rs 67.96% <ø> (ø)
boa_engine/src/object/internal_methods/proxy.rs 0.00% <0.00%> (ø)
boa_engine/src/object/operations.rs 59.62% <0.00%> (-0.38%) ⬇️
boa_engine/src/vm/call_frame.rs 100.00% <ø> (ø)
boa_engine/src/vm/code_block.rs 45.81% <ø> (ø)
boa_engine/src/vm/opcode.rs 50.00% <ø> (ø)
... and 20 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 31edb26...7e043f7. Read the comment docs.

@Razican
Copy link
Member Author

Razican commented Jun 17, 2022

Thanks @raskad! I will now add the logic to the Promises :)

Also upgraded dependencies, updated the Test262 and fixed a couple of
small spec implementations.
@Razican
Copy link
Member Author

Razican commented Jun 17, 2022

The two test failures are due to changes in Test262. Not related to the PR. I think this is ready for review :)

@Razican Razican marked this pull request as ready for review June 17, 2022 16:52
Copy link
Member

@raskad raskad 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, if we want to include the dependency updates 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.

Looks good!

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jun 19, 2022
This Pull Request adds the `[[Done]]` field to iterator records.

Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
@bors
Copy link

bors bot commented Jun 19, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Started adding the [[Done]] field to iterators [Merged by Bors] - Started adding the [[Done]] field to iterators Jun 19, 2022
@bors bors bot closed this Jun 19, 2022
@bors bors bot deleted the done_iterator branch June 19, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants