- From: Shiino Yuki <notifications@github.com>
- Date: Tue, 18 Oct 2022 01:05:01 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/issues/1221@github.com>
https://webidl.spec.whatwg.org/commit-snapshots/02e834239089b82f8383cd35a234257076a712af/#interface-prototype-object
> Let unscopableObject be OrdinaryObjectCreate\(null\)\.
>
> For each exposed member member of interface that is declared with the \[Unscopable\] extended attribute:
>
> Let id be member’s identifier\.
>
> Perform \! CreateDataProperty\(unscopableObject, id, true\)\.
>
> Let desc be the PropertyDescriptor\{\[\[Value\]\]: unscopableObject, \[\[Writable\]\]: false, \[\[Enumerable\]\]: false, \[\[Configurable\]\]: true\}\.
>
> Perform \! DefinePropertyOrThrow\(interfaceProtoObj, @@unscopables, desc\)\.
The spec creates an unscopables object with the interface members with \[Unscopable\], which ends up hiding the inherited interface's unscopables object. This looks a spec issue to me.
Example)
```
interface Base {
[Unscopable] void foo();
};
interface Derived : Base {
[Unscopable] void bar();
};
```
will result in:
```
Base.prototype[Symbol.unscopables]
// => {foo: true}
Derived.prototype[Symbol.unscopables]
// => {bar: true} // No entry of {foo: true}.
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1221
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/issues/1221@github.com>
Received on Tuesday, 18 October 2022 08:05:13 UTC