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

Implement spread for objects #1364

Merged

Conversation

FrancisMurillo
Copy link
Contributor

This Pull Request fixes/closes #214.

It changes the following:

  • Add spread operator for object initializer

@Razican Razican added this to the v0.13.0 milestone Jun 26, 2021
@Razican Razican added the enhancement New feature or request label Jun 26, 2021
@Razican
Copy link
Member

Razican commented Jun 27, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,897 78,897 0
Passed 26,974 26,990 +16
Ignored 15,616 15,616 0
Failed 36,307 36,291 -16
Panics 0 0 0
Conformance 34.19% 34.21% +0.02%
Fixed tests:
test/language/expressions/new/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/new/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/new/spread-obj-override-immutable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-override-immutable.js (previously Failed)
test/language/expressions/array/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/array/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/array/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/array/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/call/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/call/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/call/spread-obj-override-immutable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-override-immutable.js (previously Failed)

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 with how it looks :) Maybe I would add the link, but in any case, we will probably need to refactor it at some point to call the proper abstract operations, once we implement them.

boa/src/syntax/ast/node/object/mod.rs Show resolved Hide resolved
@FrancisMurillo FrancisMurillo force-pushed the feature/object-spread-operator branch from 87b7131 to 3edcc91 Compare August 27, 2021 14:14
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.

One suggestion otherwise looks good to me!

boa/src/syntax/ast/node/object/mod.rs Outdated Show resolved Hide resolved
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.

Very nice work!
These are the latest test results:

Test262 conformance changes:

Test result master count PR count difference
Total 80,685 80,685 0
Passed 32,670 32,754 +84
Ignored 15,818 15,818 0
Failed 32,197 32,113 -84
Panics 0 0 0
Conformance 40.49% 40.59% +0.10%
Fixed tests (84):
test/language/expressions/array/spread-obj-spread-order.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-spread-order.js (previously Failed)
test/language/expressions/array/spread-obj-getter-init.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-getter-init.js (previously Failed)
test/language/expressions/array/spread-obj-override-immutable.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-override-immutable.js (previously Failed)
test/language/expressions/array/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/array/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/array/spread-obj-mult-spread.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-mult-spread.js (previously Failed)
test/language/expressions/array/spread-obj-mult-spread-getter.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-mult-spread-getter.js (previously Failed)
test/language/expressions/array/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/array/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/array/spread-obj-overrides-prev-properties.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-overrides-prev-properties.js (previously Failed)
test/language/expressions/array/spread-mult-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/array/spread-mult-obj-ident.js (previously Failed)
test/language/expressions/array/spread-obj-getter-descriptor.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-getter-descriptor.js (previously Failed)
test/language/expressions/array/spread-obj-with-overrides.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-with-overrides.js (previously Failed)
test/language/expressions/array/spread-obj-manipulate-outter-obj-in-getter.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-manipulate-outter-obj-in-getter.js (previously Failed)
test/language/expressions/array/spread-sngl-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/array/spread-sngl-obj-ident.js (previously Failed)
test/language/expressions/array/spread-obj-symbol-property.js [strict mode] (previously Failed)
test/language/expressions/array/spread-obj-symbol-property.js (previously Failed)
test/language/expressions/call/spread-obj-spread-order.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-spread-order.js (previously Failed)
test/language/expressions/call/spread-obj-getter-init.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-getter-init.js (previously Failed)
test/language/expressions/call/spread-obj-override-immutable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-override-immutable.js (previously Failed)
test/language/expressions/call/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/call/spread-obj-mult-spread.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-mult-spread.js (previously Failed)
test/language/expressions/call/spread-obj-mult-spread-getter.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-mult-spread-getter.js (previously Failed)
test/language/expressions/call/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/call/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/call/spread-obj-overrides-prev-properties.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-overrides-prev-properties.js (previously Failed)
test/language/expressions/call/spread-mult-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/call/spread-mult-obj-ident.js (previously Failed)
test/language/expressions/call/spread-obj-getter-descriptor.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-getter-descriptor.js (previously Failed)
test/language/expressions/call/spread-obj-with-overrides.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-with-overrides.js (previously Failed)
test/language/expressions/call/spread-obj-manipulate-outter-obj-in-getter.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-manipulate-outter-obj-in-getter.js (previously Failed)
test/language/expressions/call/spread-sngl-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/call/spread-sngl-obj-ident.js (previously Failed)
test/language/expressions/call/spread-obj-symbol-property.js [strict mode] (previously Failed)
test/language/expressions/call/spread-obj-symbol-property.js (previously Failed)
test/language/expressions/new/spread-obj-spread-order.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-spread-order.js (previously Failed)
test/language/expressions/new/spread-obj-getter-init.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-getter-init.js (previously Failed)
test/language/expressions/new/spread-obj-override-immutable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-override-immutable.js (previously Failed)
test/language/expressions/new/spread-err-sngl-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-err-sngl-err-obj-unresolvable.js (previously Failed)
test/language/expressions/new/spread-obj-mult-spread.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-mult-spread.js (previously Failed)
test/language/expressions/new/spread-obj-mult-spread-getter.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-mult-spread-getter.js (previously Failed)
test/language/expressions/new/spread-err-mult-err-obj-unresolvable.js [strict mode] (previously Failed)
test/language/expressions/new/spread-err-mult-err-obj-unresolvable.js (previously Failed)
test/language/expressions/new/spread-obj-overrides-prev-properties.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-overrides-prev-properties.js (previously Failed)
test/language/expressions/new/spread-mult-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/new/spread-mult-obj-ident.js (previously Failed)
test/language/expressions/new/spread-obj-getter-descriptor.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-getter-descriptor.js (previously Failed)
test/language/expressions/new/spread-obj-with-overrides.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-with-overrides.js (previously Failed)
test/language/expressions/new/spread-obj-manipulate-outter-obj-in-getter.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-manipulate-outter-obj-in-getter.js (previously Failed)
test/language/expressions/new/spread-sngl-obj-ident.js [strict mode] (previously Failed)
test/language/expressions/new/spread-sngl-obj-ident.js (previously Failed)
test/language/expressions/new/spread-obj-symbol-property.js [strict mode] (previously Failed)
test/language/expressions/new/spread-obj-symbol-property.js (previously Failed)

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.

The implementation looks good! Just a cleanup of a test to use the new API and this should be ready.

boa/src/exec/tests.rs Outdated Show resolved Hide resolved
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.

Good work!

@jedel1043 jedel1043 merged commit 22d0c37 into boa-dev:master Aug 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Spread operator for Objects
4 participants