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] - Handle __proto__ fields in object literals #2423

Closed
wants to merge 2 commits into from

Conversation

raskad
Copy link
Member

@raskad raskad commented Nov 8, 2022

This Pull Request changes the following:

  • Handle __proto__ fields in object literals

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

github-actions bot commented Nov 8, 2022

Test262 conformance changes

Test result main count PR count difference
Total 93,815 93,815 0
Passed 69,528 69,540 +12
Ignored 18,422 18,422 0
Failed 5,865 5,853 -12
Panics 0 0 0
Conformance 74.11% 74.12% +0.01%
Fixed tests (12):
test/language/expressions/object/__proto__-value-null.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-value-null.js (previously Failed)
test/language/expressions/object/__proto__-poisoned-object-prototype.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-poisoned-object-prototype.js (previously Failed)
test/language/expressions/object/__proto__-value-non-object.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-value-non-object.js (previously Failed)
test/language/expressions/object/__proto__-duplicate.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-duplicate.js (previously Failed)
test/language/expressions/object/__proto__-value-obj.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-value-obj.js (previously Failed)
test/language/expressions/object/__proto__-duplicate-computed.js [strict mode] (previously Failed)
test/language/expressions/object/__proto__-duplicate-computed.js (previously Failed)

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! :)

boa_interner/src/sym.rs Outdated Show resolved Hide resolved
Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

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

Just have the question about the comma, everything else looks good

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.

Just a small nitpick. Mostly about documentation of the poco de. We should probably add more references to the spec in general in opcodes.

I'm happy to merge it as is too, though, great work :)

let object = object.as_object().expect("object is not an object");
object
.__set_prototype_of__(prototype, context)
.expect("cannot fail per spec");
Copy link
Member

Choose a reason for hiding this comment

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

Here it says that this cannot fail per the spec, but then I'm missing some link to the spec, or the spec text that says so, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I will open is issue for this as it is currently a problem with all opcodes.

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #2423 (4c5e93a) into main (2ffae5b) will increase coverage by 0.17%.
The diff coverage is 43.10%.

@@            Coverage Diff             @@
##             main    #2423      +/-   ##
==========================================
+ Coverage   38.69%   38.86%   +0.17%     
==========================================
  Files         314      316       +2     
  Lines       23887    24131     +244     
==========================================
+ Hits         9242     9378     +136     
- Misses      14645    14753     +108     
Impacted Files Coverage Δ
boa_engine/src/bytecompiler/function.rs 45.33% <ø> (ø)
boa_engine/src/vm/code_block.rs 33.42% <ø> (ø)
boa_engine/src/vm/opcode/mod.rs 66.66% <ø> (ø)
boa_interner/src/sym.rs 25.00% <ø> (ø)
boa_parser/src/parser/mod.rs 36.84% <0.00%> (-1.00%) ⬇️
boa_engine/src/bytecompiler/mod.rs 29.39% <20.00%> (+0.17%) ⬆️
boa_parser/src/parser/cursor/mod.rs 38.38% <25.00%> (-0.57%) ⬇️
...arser/expression/primary/object_initializer/mod.rs 41.06% <39.13%> (-0.28%) ⬇️
boa_engine/src/context/mod.rs 34.78% <50.00%> (+2.31%) ⬆️
boa_engine/src/vm/opcode/set/prototype.rs 75.00% <75.00%> (ø)
... and 22 more

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

@raskad
Copy link
Member Author

raskad commented Nov 9, 2022

bors r+

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

- Handle `__proto__` fields in object literals
@bors
Copy link

bors bot commented Nov 9, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Handle __proto__ fields in object literals [Merged by Bors] - Handle __proto__ fields in object literals Nov 9, 2022
@bors bors bot closed this Nov 9, 2022
@bors bors bot deleted the object-literal-proto-handling branch November 9, 2022 20:03
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.

6 participants