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

Account for the use of ToIndex in Atomic operations #870

Merged
merged 2 commits into from
Mar 2, 2017
Merged

Account for the use of ToIndex in Atomic operations #870

merged 2 commits into from
Mar 2, 2017

Conversation

lars-t-hansen
Copy link
Contributor

These test changes pertain to the spec change in tc39/ecma262#807.

(view) => undefined, // 0
(view) => Number.NaN, // 0
(view) => 3.5,
(view) => '3.5',
Copy link
Member

Choose a reason for hiding this comment

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

if the length is 3 or more this will fail.

0.5 and '0.5' should avoid this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean, if the length is 3 or less this will fail? I'll change this to 0.5 which has the same effect for me, but may still fail if the length is zero. I'll add a comment stipulating the minimum expected length.

(view) => Number.NaN, // 0
(view) => 3.5,
(view) => '3.5',
(view) => ({ password: "qumquat" }),
(view) => view.length - 1,
(view) => ({ valueOf: () => 0 }),
(view) => ({ toString: () => '0', valueOf: false }) // non-callable valueOf triggers invocation of toString
Copy link
Member

Choose a reason for hiding this comment

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

you can include false to improve coverage for the ToIndex operation here.

-0.9 should work as a good index as well, weird, but it works.

@@ -44,6 +39,11 @@ function testWithAtomicsInBoundsIndices(f) {
var good_indices = [
(view) => 0/-1, // -0
(view) => '-0',
(view) => undefined, // 0
(view) => Number.NaN, // 0
Copy link
Member

Choose a reason for hiding this comment

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

the regular global NaN should do the trick as well, but it's not necessary to do change this.

@leobalter leobalter added this to Review in Q1 Bocoup & Google Mar 2, 2017
@@ -33,16 +33,20 @@ function testWithAtomicsOutOfBoundsIndices(f) {
* Calls the provided function for each good index that should not throw when
* passed to an Atomics method on a SAB-backed view.
*
* The view must have length greater than zero.
Copy link
Member

Choose a reason for hiding this comment

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

+1

@leobalter leobalter merged commit abc4dfa into tc39:master Mar 2, 2017
@leobalter leobalter moved this from Needs Review to Done in Q1 Bocoup & Google Mar 2, 2017
@gnarf gnarf moved this from Done this week to Really Done in Q1 Bocoup & Google Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants