Re: [whatwg/webidl] draft: Interaction with the Stage 2 Record & Tuple proposal for ECMAScript (PR #1184)

I notice the [record\<K, V\> conversion](https://webidl.spec.whatwg.org/#es-record) isn’t changed here yet. That’s probably just because it’s a work in progress, but it would be funny if we couldn’t use em for that, so I figured it may be worth pointing out just in case it was overlooked.

```js
let headers = new Headers(#{ "content-type": "record/record; record=record" });
```

As with dictionary member types, the `V` type of `record<K,V>` might not be compatible with the primitive-members-only nature of ES Record/Tuple. In practice I’m pretty sure most usages are a natural match, though. From the first few pages of matches for `record<K,V>` usage in specs, most of them had `V` in the string/number/tuple-of-the-same zone:

```
(sequence<sequence<ByteString>> or record<ByteString, ByteString>)
record<DOMString, sequence<DOMString>>
record<DOMString, double>
record<USVString, double>
record<USVString, (USVString or undefined)>
record<USVString, (USVString or sequence<USVString>)>
record<DOMString, GPUSize64> // GPUSize64 = unsigned long long
```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1184#issuecomment-1250019279

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1184/c1250019279@github.com>

Received on Saturday, 17 September 2022 07:21:03 UTC