Comments (3)
The point here is that if two types are distinguishable, then given any object you have to be able to tell which of the two types it is.
This means that if there is an object which can claim to be of both types, they need to not be distinguishable. Therefore interpretation A is the correct one and we should adjust phrasing as needed to make that clear.
To determine if A and B are distinguishable, you have to look at all interfaces in the web platform
Yes, you do. That's necessary to achieve the "given any object" goal. I agree that this is rather annoying, but I don't see how the goal can be achieved otherwise.
And, is this actually implementable, or implemented by existing binding layers?
What Gecko's binding layer implements is the following:
Each interface has a set of interfaces associated with it. This set contains the interface itself, all interfaces inheriting from it (transitively, not directly), and all interfaces that have it as a "consequential interface" or inherit from an interface that has it as a consequential interface. So in your example above, the set associated with Baz
just contains Baz
itself. The set associated with Foo
contains Foo
and Baz
. The set associated with Bar
contains Bar
and Baz
. Two interfaces are distinguishable if their associated sets are disjoint (have no common members). I believe this is a correct implementation of your interpretation A.
from webidl.
Would it make sense to replace "It is not possible for a single platform object to implement both interfaces" with "No platform object implements both interfaces"? The non-local nature of the check is annoying, but at least this makes it clear.
from webidl.
I think once we have proper mixins this might be a lot easier to spec, especially if we don't allow mixins to be used as types. Because at that point, the only way for two interfaces to not be distinguishable will be if one of them inherits from the other, I believe.
from webidl.
Related Issues (20)
- Simple exceptions βapart from...β list is incomplete HOT 1
- Give SharedArrayBuffer a dedicated type (downstream) HOT 2
- Defining AbstractModuleSource intrinsic inheritance HOT 13
- Language-independent definition of interfaces should mention how to create instances HOT 5
- Meta: npm warnings HOT 1
- Definition name uniqueness requirement omits mixins
- Suggestion: forbid ECMA-262/402-defined global names for some named constructs HOT 2
- Nullable ObservableArray attributes are not supported HOT 1
- Make ObservableArray "subclassable" HOT 3
- Definition of {} is slightly ambiguous HOT 2
- Named properties object [[GetOwnProperty]] conflicts with class string HOT 1
- Add `toggle()` and `replace()` methods to `setlike` HOT 1
- Allowing throwing an exception with a specific message HOT 5
- Offer [[ArrayBufferDetachKey]] abstraction?
- Truncation in "convert a Web IDL arguments list to an ECMAScript arguments list" seems (potentially) incorrect
- Dictionary with required members as optional argument HOT 4
- "byte length of a buffer source type" needs updating for resizable and detached buffers HOT 9
- Intent to use BigInt/numeric union in WebNN HOT 6
- CreateMethodProperty removed from Ecma262 HOT 1
- Disallow FrozenArray<> in argument lists, and maybe dictionaries and return types HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webidl.