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 the .every method #4074

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:27
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.

Did the original PR have any tests for every() on resizable buffers that don't shrink or grow? Most of the other PRs have had these tests.

Comment on lines +24 to +33
let values;
let rab;
let resizeAfter;
let resizeTo;
for (let ctor of ctors) {
rab = CreateRabForTest(ctor);
const fixedLength = new ctor(rab, 0, 4);
values = [];
resizeAfter = 2;
resizeTo = 5 * ctor.BYTES_PER_ELEMENT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably better to scope these values inside the loops, to prevent accidental contamination. It doesn't look like they need to be shared between the loops.

Suggested change
let values;
let rab;
let resizeAfter;
let resizeTo;
for (let ctor of ctors) {
rab = CreateRabForTest(ctor);
const fixedLength = new ctor(rab, 0, 4);
values = [];
resizeAfter = 2;
resizeTo = 5 * ctor.BYTES_PER_ELEMENT;
for (let ctor of ctors) {
const rab = CreateRabForTest(ctor);
const fixedLength = new ctor(rab, 0, 4);
const values = [];
const resizeAfter = 2;
const resizeTo = 3 * ctor.BYTES_PER_ELEMENT;

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