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

Fix remaining TypedArray bugs #3186

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Fix remaining TypedArray bugs #3186

merged 1 commit into from
Aug 3, 2023

Conversation

raskad
Copy link
Member

@raskad raskad commented Jul 30, 2023

This Pull Request fixes the remaining TypedArray bugs.

It changes the following:

  • Use the same object for Array.prototype.toString and TypedArray.prototype.toString.
  • Refactor SetTypedArrayFromArrayLike to conform to the spec.
  • Refactor TypedArray.prototype.sort to conform to the spec.
  • Add a U64OrPositiveInfinity enum to remove some unreachable branches in TypedArray.prototype.set.
  • Implement TypedArray.prototype.toLocaleString.

@raskad raskad added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics labels Jul 30, 2023
@raskad raskad added this to the v0.18.0 milestone Jul 30, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 95,260 95,260 0
Passed 74,918 74,970 +52
Ignored 19,230 19,230 0
Failed 1,112 1,060 -52
Panics 0 0 0
Conformance 78.65% 78.70% +0.05%
Fixed tests (52):
test/built-ins/TypedArray/prototype/toString.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toString.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/this-is-not-object.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/this-is-not-object.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/this-is-not-typedarray-instance.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/this-is-not-typedarray-instance.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-result.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-result.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/prop-desc.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/prop-desc.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js (previously Failed)
test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-no-throw.js (previously Failed)
test/built-ins/TypedArray/prototype/sort/sort-tonumber.js [strict mode] (previously Failed)
test/built-ins/TypedArray/prototype/sort/sort-tonumber.js (previously Failed)

@codecov
Copy link

codecov bot commented Jul 30, 2023

Codecov Report

Merging #3186 (2d5bd18) into main (be055a3) will increase coverage by 0.02%.
The diff coverage is 15.74%.

@@            Coverage Diff             @@
##             main    #3186      +/-   ##
==========================================
+ Coverage   50.41%   50.44%   +0.02%     
==========================================
  Files         436      436              
  Lines       42340    42346       +6     
==========================================
+ Hits        21347    21362      +15     
+ Misses      20993    20984       -9     
Files Changed Coverage Δ
...ine/src/object/internal_methods/integer_indexed.rs 0.00% <0.00%> (ø)
boa_engine/src/object/internal_methods/mod.rs 86.36% <ø> (ø)
boa_engine/src/builtins/typed_array/mod.rs 7.55% <4.25%> (+0.24%) ⬆️
boa_engine/src/builtins/array/mod.rs 77.13% <100.00%> (+0.20%) ⬆️
boa_engine/src/context/intrinsics.rs 98.11% <100.00%> (+0.01%) ⬆️

@raskad raskad requested a review from a team July 30, 2023 02:54
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 great! :)

@HalidOdat HalidOdat requested a review from a team July 30, 2023 18:05
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 jedel1043 added this pull request to the merge queue Aug 3, 2023
Merged via the queue into main with commit 8536a6b Aug 3, 2023
@HalidOdat HalidOdat deleted the typed-array-fixes branch August 3, 2023 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants