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

RAB: Integrate staging tests for .copyWithin method #4072

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ioannad
Copy link
Contributor

@ioannad ioannad commented May 3, 2024

of Array.prototype and TypedArray.prototype

This is part of PR #3888 to make reviewing easier. Includes changes to use the helper ./harness/resizableArrayBufferUtils.js

of Array.prototype and TypedArray.prototype

This is part of PR tc39#3888 to make reviewing easier.
Includes changes to use the helper ./harness/resizableArrayBufferUtils.js
@ioannad ioannad requested a review from a team as a code owner May 3, 2024 16:07
Copy link
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

LGTM, some minor comments and one where I'm just not sure what the right amount of editing is.

Comment on lines +7 to +8
Automatically ported from CopyWithinParameterConversionGrows test
in V8's mjsunit test typedarray-resizablearraybuffer.js
Copy link
Contributor

Choose a reason for hiding this comment

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

This test has been hand-edited now, so we should replace this description with something more meaningful.


ArrayCopyWithinHelper(fixedLength, 0, 1);
ArrayCopyWithinHelper(fixedLengthWithOffset, 0, 1);
// We'll check below that these were no-op.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment seems to be incorrect. But it's also incorrect in the original V8 test that this was adapted from: https://github.com/v8/v8/blob/fe53d403bfc7e62e1895b6057ff68e029b995020/test/mjsunit/typedarray-resizablearraybuffer.js#L1880-L1884

We could just remove the comment, or add an assertion to check that these are actually no-ops. If we decide to add an assertion, there are a few other cases below where assertions would also need to be added.

Comment on lines +13 to +15
const TypedArrayCopyWithinHelper = (ta, ...rest) => {
ta.copyWithin(...rest);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

If we were writing these tests from scratch, I'd suggest getting rid of this function — unlike the ArrayCopyWithinHelper above it doesn't really make the test easier to read or write. But I suspect that's probably on the wrong side of the 'too picky' line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants