webidl
webidl copied to clipboard
ObservableArray is in DistinguishableType production but is not in distinguishable table
-
https://heycam.github.io/webidl/#prod-DistinguishableType
DistinguishableType :: PrimitiveType Null StringType Null identifier Null sequence < TypeWithExtendedAttributes > Null object Null symbol Null BufferRelatedType Null FrozenArray < TypeWithExtendedAttributes > Null ObservableArray < TypeWithExtendedAttributes > Null RecordType Null
-
https://heycam.github.io/webidl/#dfn-distinguishable
If it's intentionally not distinguishable, I think it shouldn't be in DistinguishableType.
And per https://webidl.spec.whatwg.org/#idl-observable-array
Observable array types must only be used as the type of regular attributes defined on an interface
so it is disallowed to be an inner type of sequence, record, FrozenArray, and Promise.
If we could make ObservableArray not a DistinguishableType
, but maybe a separate type just for regular attributes, we could handle the restriction in grammar level, which could make the parser implementation a bit simpler.
cc @domenic
I suspect people more grammar-comfortable, like @saschanaz or @EdgarChen, are better positioned to make this change than me. Would either of you be up for it? Happy to help review...
Maybe include it in SingleType instead? That will disallow it being in unions and I think it's expected.