-
-
Notifications
You must be signed in to change notification settings - Fork 402
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 Array.of #1127
Implement Array.of #1127
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1127 +/- ##
==========================================
+ Coverage 58.53% 58.59% +0.06%
==========================================
Files 176 176
Lines 12547 12559 +12
==========================================
+ Hits 7344 7359 +15
+ Misses 5203 5200 -3
Continue to review full report at Codecov.
|
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! :)
Check my comments to see how we might improve the implementation.
boa/src/builtins/array/mod.rs
Outdated
}; | ||
|
||
// add properties and set length | ||
array.set_field("length", 0, context)?; |
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.
array.set_field("length", 0, context)?; | |
array.set_field("length", args.len(), context)?; |
The length
shouldn't be zero, should be the count of arguments, (Array.of
spec step 8)
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.
The length is set by Array::add_to_array_object
, setting it to 0 was unnecessary and has been removed
boa/src/builtins/array/mod.rs
Outdated
array.set_field("length", 0, context)?; | ||
Array::add_to_array_object(&array, args, context)?; |
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.
We should also swap the order since one can throw before the other. This could change the behaviour so it's best to keep it the same as the spec.
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.
Code looks good, just needs a small change to deal with a recent API change.
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.
Hello! This looks perfect, but it requires a re-base in order to fix the build errors and to make it mergeable.
It seems the |
Test262 conformance changes:
Fixed tests:
Broken tests:
|
It seems there are some new broken tests, but it could be due to a missing re-base. Could we check that? |
Latest numbers, fixed 20 but broke 2: Test262 conformance changes:
Fixed tests:
Broken tests:
|
I think |
Halid has been tight on time, as long as another maintainer gives their go ahead I think we can merge. |
This Pull Request checks off part of #36.
It changes the following: