Re: [heycam/webidl] Inconsistent enumerability on keys/values/entries and friends (#738)

> I wonder if browsers actually follow the spec here :-/.

It's a bit exciting to test given lack of use for maplike/setlike in the wild...  Gecko implements nothing that's setlike, for example, and I think the only default-exposed maplike is `RTCStatsReport`.  For `FontFaceSet` Gecko fakes setlike via regular interface members, which are of course enumerable.

Within that constraint, this testcase:
```
<pre>
<script>
    let objs = [URLSearchParams, RTCStatsReport, FontFaceSet];
    let props = ["keys", "values", "entries"];
    for (let obj of objs) {
      for (let prop of props) {
        document.writeln(obj.name, ".", prop, ": ",
                         Object.getOwnPropertyDescriptor(obj.prototype, prop).enumerable);
      }
    }
</script>
```
shows that Gecko does in fact make the iterable case enumerable and the maplike case non-enumerable like the spec says.  In Safari the behavior is like Gecko (including having FontFaceSet stuff enumerable, but maybe it doesn't use setlike there either?).  

Chrome has `FontFaceSet` as `[NoInterfaceObject]`.  If I use `document.fonts.constructor` instead of `FontFaceSet`, the testcase shows that Chrome makes all these methods enumerable, looks like, so it's not following the current spec.

I don't have strong opinions about the desired behavior here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/738#issuecomment-505235523

Received on Tuesday, 25 June 2019 00:59:40 UTC