[whatwg/webidl] Normative: Rename integer types to match ECMAScript typed arrays (#1030)

<!--
Thank you for contributing to the Web IDL Standard! Please describe the change you are making and complete the checklist below if your change is not editorial.
-->

I’ve separated out the integer types rename from <https://github.com/heycam/webidl/pull/856>, as it has greater support and can be done without waiting for parser changes (see also <https://github.com/whatwg/webidl/issues/477>).

---

This renames the integer types to match **ECMAScript** typed arrays in order to resolve the conflict between [the **Infra** byte](infra.spec.whatwg.org/#bytes) and [the **IDL** `byte`](https://webidl.spec.whatwg.org/#idl-byte); refs <https://github.com/whatwg/webidl/issues/843#issuecomment-586203060>:

> (One problem it would resolve is that IDL and Infra conflict on byte. What Infra calls byte IDL currently calls octet.)

Floating‑point types were left for a future **PR** because it’s not possible to simply rename `unrestricted float`/`unrestricted double` to `unrestricted float32`/`unrestricted float64` without the parser being updated first, which is why that depends on something like <https://github.com/whatwg/webidl/pull/857>.


---

I decided to go with `int*` for signed integers since it’s what **ECMAScript** typed arrays use, and because **ECMAScript** provides built‑in support for 32‑bit signed integers using the bitwise **OR** operator, but none for unsigned integers:

```js
let numInt32 = (num | 0); // Converts `num` to a 32-bit signed integer
```

**ECMAScript** `Array`s also restrict the length to a positive 32‑bit signed integer.

---

- **Part of:** <https://github.com/whatwg/webidl/issues/843>

- **Extracted from:** <https://github.com/whatwg/webidl/pull/856>

</ul>

- [ ] At least two implementers are interested (and none opposed):
 * …
 * …
- [ ] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at:
 * …
- [ ] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed:
 * Chrome: …
 * Firefox: …
 * Safari: …

(See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.)
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/webidl/pull/1030


-- Commit Summary --

  * <a href="https://github.com/whatwg/webidl/pull/1030/commits/c3318b75b80e008aad5835bfd3b1bde5fbb970c3">Normative: Rename integer types to match ECMAScript typed arrays</a>

-- File Changes --

    M index.bs (540)

-- Patch Links --

https://github.com/whatwg/webidl/pull/1030.patch

https://github.com/whatwg/webidl/pull/1030.diff


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1030

Received on Wednesday, 6 October 2021 03:24:25 UTC