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

Add BigInt64Array and BigUint64Array tests #27920

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Mar 7, 2021

@annevk
Copy link
Member

annevk commented Mar 9, 2021

I think we should tests this in a couple other places as well, to ensure implementations end up supporting this correctly (or already support it correctly?):

  • FileAPI/blob/Blob-constructor.any.js
  • encoding/encodeInto.any.js
  • fetch/api/response/response-clone.any.js
  • html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.https.html
  • xhr/send-data-sharedarraybuffer.any.js

@annevk
Copy link
Member

annevk commented Mar 10, 2021

Thanks, I'm not a big fan of making support conditional. Is that needed for some implementations?

encoding/encodeInto.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-clone.any.js Show resolved Hide resolved
@bathos
Copy link

bathos commented Mar 10, 2021

I think the first place I encountered missing support was crypto.getRandomValues. However it’s unclear to me whether it should or shouldn’t work even after these changes now that I’m looking at the spec. Perhaps one of you will find this clearer than I do.

The argument type for getRandomValues is ArrayBufferView, but the operation steps begin with this step:

  1. If array is not of an integer type (i.e., Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array or Uint8ClampedArray), throw a TypeMismatchError and terminate the algorithm.

I haven’t found anything defining what it means for an ArrayBufferView to be “of an integer type.” Web IDL does define “integer type,” but TypedArrays are ES objects whose indexed members model ES Number or BigInt language values. They have associated constraining “element types” (e.g. Int8), but despite the general alignment (e.g. Int8 → Byte), these aren’t really Web IDL integer values, so it doesn’t seem like the Web IDL term would be applicable here?

Stepping back from muddling through a search for a formal answer about how to read this, though: does anybody know what the intention might have been? At the time this was written, I’d guess they specifically wished to forbid Float32Array and Float64Array ... and ... maybe forgot DataView exists? I dunno.

If “of an integer type” really isn’t defined, I’d like to say big ones count (the most integer type of all, perhaps!) — but w/o knowing the rationale for the original constraint, I don’t feel confident making a case for that.

@annevk
Copy link
Member

annevk commented Mar 11, 2021

@bathos that specification seems woefully imprecise. I recommend filing an issue. It does seem like something that ought to work.

@ExE-Boss ExE-Boss force-pushed the resources/idlharness/support-bigint-array branch from b97b333 to 74404bf Compare March 11, 2021 08:57
@ExE-Boss ExE-Boss force-pushed the resources/idlharness/support-bigint-array branch from 74404bf to 6f4b713 Compare March 23, 2021 18:46
@TimothyGu TimothyGu changed the title [idlharness] Support BigInt64Array and BigUint64Array Add BigInt64Array and BigUint64Array tests Jul 1, 2021
@TimothyGu TimothyGu force-pushed the resources/idlharness/support-bigint-array branch from 66fb6fe to 8e7b5ba Compare July 1, 2021 20:06
@TimothyGu
Copy link
Member

Hi @web-platform-tests/wpt-core-team. I'd like to merge this PR, which changes idlharness and thus potentially affects a lot of tests. However, the stability bots are unhappy about some pre-existing flakes:

  • Firefox: /html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html
  • Chrome: /webtransport/idlharness.any.html

Is there a way to merge the PR anyway, despite the required statuses failing?

@foolip
Copy link
Member

foolip commented Jul 1, 2021

@TimothyGu yes if you've looked into the flakiness and it's pre-existing / unrelated then we can admin merge and bypass requires CI checks. I'll do just that.

@foolip foolip merged commit 3ccab5e into web-platform-tests:master Jul 1, 2021
@ExE-Boss ExE-Boss deleted the resources/idlharness/support-bigint-array branch July 2, 2021 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants