-
-
Notifications
You must be signed in to change notification settings - Fork 406
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 unscopables for Array.prototype #1963
[Merged by Bors] - Implement unscopables for Array.prototype #1963
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1963 +/- ##
==========================================
+ Coverage 45.87% 45.94% +0.06%
==========================================
Files 206 206
Lines 17102 17135 +33
==========================================
+ Hits 7846 7872 +26
- Misses 9256 9263 +7
Continue to review full report at Codecov.
|
VM implementation
Fixed tests (2):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution! Just a little mistake on the result object. Everything else looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just some documentation is needed :)
We should document the unscopables_intrinsic
spec steps, like we do in other Array
methods
@NorbertGarfield I think with the documentation of the steps they mentioned adding the spec documentation:
So, the idea would be to write the code like this: // 1. Let unscopableList be [OrdinaryObjectCreate](https://tc39.es/ecma262/#sec-ordinaryobjectcreate)(null).
let result_obj = JsObject::empty();
// 2. Perform ! [CreateDataPropertyOrThrow](https://tc39.es/ecma262/#sec-createdatapropertyorthrow)(unscopableList, "at", true).
result_obj
.create_data_property_or_throw("at", true, context)
.expect("CreateDataPropertyOrThrow for 'at' must not fail");
// ... and so on Also, I would call the variable |
@Razican done. I omitted direct links for the sake of consistency (it seems to me that those are only used in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks perfect for me now :) thank you!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
bors r+ |
This Pull Request fixes/closes #1916. It implements `Array.prototype [ @@unscopables ]` as described in [ECMAScript](https://tc39.es/ecma262/#sec-array.prototype-@@unscopables)
Pull request successfully merged into main. Build succeeded: |
This Pull Request fixes/closes #1916. It implements `Array.prototype [ @@unscopables ]` as described in [ECMAScript](https://tc39.es/ecma262/#sec-array.prototype-@@unscopables)
This Pull Request fixes/closes #1916.
It implements
Array.prototype [ @@unscopables ]
as described in ECMAScript