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
base: main
Are you sure you want to change the base?
Conversation
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
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.
LGTM, some minor comments and one where I'm just not sure what the right amount of editing is.
Automatically ported from CopyWithinParameterConversionGrows test | ||
in V8's mjsunit test typedarray-resizablearraybuffer.js |
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 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. |
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 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.
const TypedArrayCopyWithinHelper = (ta, ...rest) => { | ||
ta.copyWithin(...rest); | ||
}; |
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.
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.
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