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

built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js and built-ins/TypedArray/prototype/byteOffset/BigInt/resizable-array-buffer-auto.js are wrong #3206

Closed
marjakh opened this issue Sep 21, 2021 · 2 comments · Fixed by #3211

Comments

@marjakh
Copy link
Contributor

marjakh commented Sep 21, 2021

built-ins/TypedArray/prototype/byteOffset/BigInt/resizable-array-buffer-auto.js:

Line 39:

ab.resize(BPE);
expected = 0;

This should be the "at the boundary" case where the TA is not out of bounds.

built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js:

Line 37:

var expected = BPE;
  try {
    ab.resize(BPE);
    expected = 0;
  } catch (_) {}

  assert.sameValue(array.byteOffset, expected, "following shrink (on boundary)");

Ditto.

@marjakh
Copy link
Contributor Author

marjakh commented Sep 21, 2021

The normative spec change for the "at the boundary" TAs should've been handled by this:

#3163

But looks like the byteOffset tests aren't updated correctly; the expected value should be BPE, not 0.

cc @jugglinmike @rwaldron

@marjakh marjakh changed the title built-ins/TypedArray/prototype/byteOffset/BigInt/resizable-array-buffer-auto.js is wrong built-ins/TypedArray/prototype/byteOffset/resizable-array-buffer-auto.js and built-ins/TypedArray/prototype/byteOffset/BigInt/resizable-array-buffer-auto.js are wrong Sep 21, 2021
@jugglinmike
Copy link
Contributor

Thanks for reporting this! gh-3211 ought to fix things.

Scrutinizing gh-3163 further, it looks like I neglected a couple other BigInt tests (the ones for the byteLength and length accessor properties). The tests still happen to be technically correct, but their assertions incorrectly label the "on boundary" condition as "out of bounds," and they lack any verification of a true "out of bounds" condition. I've opened gh-3212 to correct that.

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 a pull request may close this issue.

2 participants