[whatwg/webidl] Should a read–write maplike/setlike interface be allowed having static operations with same name as set methods, e.g. clear, delete ... (Issue #1280)

Spec now have, 

https://webidl.spec.whatwg.org/#idl-maplike:
> Maplike interfaces must not have any [interface members](https://webidl.spec.whatwg.org/#dfn-interface-member) named "entries", "forEach", "get", "has", "keys", "size", or "values", or have any [inherited interfaces](https://webidl.spec.whatwg.org/#dfn-inherited-interfaces) that have [members](https://webidl.spec.whatwg.org/#dfn-member) with these names.

https://webidl.spec.whatwg.org/#idl-setlike:
> Setlike interfaces must not have any [interface members](https://webidl.spec.whatwg.org/#dfn-interface-member) named "entries", "forEach", "has", "keys", "size", or "values", or have any [inherited interfaces](https://webidl.spec.whatwg.org/#dfn-inherited-interfaces) that have [members](https://webidl.spec.whatwg.org/#dfn-member) with these names.

https://webidl.spec.whatwg.org/#idl-iterable:
> Interfaces with iterable declarations must not have any [interface members](https://webidl.spec.whatwg.org/#dfn-interface-member) named "entries", "forEach", "keys", or "values", or have any [inherited interfaces](https://webidl.spec.whatwg.org/#dfn-inherited-interfaces) that have [members](https://webidl.spec.whatwg.org/#dfn-member) with these names.

https://webidl.spec.whatwg.org/#idl-async-iterable:
> [Interfaces](https://webidl.spec.whatwg.org/#dfn-interface) with an [asynchronously iterable declaration](https://webidl.spec.whatwg.org/#dfn-async-iterable-declaration) must not have any [interface members](https://webidl.spec.whatwg.org/#dfn-interface-member) named "entries", "keys", or "values", or have any [inherited interfaces](https://webidl.spec.whatwg.org/#dfn-inherited-interfaces) that have [interface members](https://webidl.spec.whatwg.org/#dfn-interface-member) with these names.

All of them forbid static operations with the same name on those methods

But for read-write maplike/setlike, they are allowed to having operations with same same name as set method, e.g. `delete`, `clear` ... to override the default implementation. And after https://github.com/whatwg/webidl/pull/1098, static and regular operations allows having same name, which means now static operations with `delete`, `clear` name is also allowed.

Should a read–write maplike/setlike interface be allowed having static operations with same name as set methods, e.g. clear, delete ...?

I feel that if we forbid static operation with the same name as get methods, we should also forbid that for set method.
Or vice versa for consistence.

Any thought?

--
cc @petervanderbeken

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

Message ID: <whatwg/webidl/issues/1280@github.com>

Received on Thursday, 16 March 2023 11:50:40 UTC