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/DataView/prototype/byteLength/resizable-array-buffer-auto.js and built-ins/DataView/prototype/byteOffset/resizable-array-buffer-auto.js? #3279

Closed
patrick-soquet opened this issue Oct 22, 2021 · 3 comments

Comments

@patrick-soquet
Copy link

I am implementing resizable ArrayBuffer in XS. Thank you much for the tests. I have a question about these two tests...

The byte length of a data view can be 0:

var ab = new ArrayBuffer(1);
var dv = new DataView(ab, 1);
print(dv.byteOffset, dv.byteLength); // 1 0

So the last part of both tests seems wrong:

var expectedError;
try {
	ab.resize(1);
	expectedError = TypeError;
} catch (_) {
	expectedError = Test262Error;
}

Or am I misunderstanding something?

@jugglinmike
Copy link
Contributor

Thanks for the report! I think you're correct, so I've submitted gh-3280 according to that interpretation.

(In case you're curious: the proposal recently changed its behavior for the corresponding condition with TypedArray accessor methods. Of course, that's unrelated to the accessors for DataView, but coincidentally, it looks like a few changes are in order there, too.)

/cc @marjakh (who has recently been working on V8's implementation of the proposal)

@marjakh
Copy link
Contributor

marjakh commented Oct 24, 2021

Thanks for the heads up. I haven't yet looked into the DataView tests or implemented those parts in V8, so I hadn't noticed potential errors in those tests yet :)

@jugglinmike
Copy link
Contributor

Resolved via gh-3280. Thanks again!

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

No branches or pull requests

3 participants