- From: <bugzilla@jessica.w3.org>
- Date: Fri, 25 Nov 2011 20:28:44 +0000
- To: public-script-coord@w3.org
http://www.w3.org/Bugs/Public/show_bug.cgi?id=14877
--- Comment #18 from Garrett <dhtmlkitchen@gmail.com> 2011-11-25 20:28:44 UTC ---
(In reply to comment #17)
> (In reply to comment #15)
> > No, the Function prototype object is itself a Function object. (sic)
>
> Ah, I see. We were using different definitions. By "is a Function object" I
> meant "is instanceof Function"/"has Function.prototype in its prototype chain",
> while you meant "has [[Class]] 'Function'". You're quite correct, I
> misunderstood. Your point is that
>
> {}.toString.call(Object.prototype) === "[object Object]"
> {}.toString.call(Function.prototype) === "[object Function]"
> {}.toString.call(Boolean.prototype) === "[object Boolean]"
>
> so for consistency we also want
>
> {}.toString.call(NodeList.prototype) === "[object NodeList]"
>
> and so on -- not NodeListPrototype or Object or whatever.
>
> That's a really good point, and now that you point it out, I agree. For
> consistency with ES, we should define the [[Class]] of an interface prototype
> object to be the identifier of the interface, and the [[Class]] of an exception
> interface prototype object to be the identifier of the exception. The
> [[Class]] of interface objects and exception interface objects should remain
> "Function", as now. (I was confused in comment 9 when I talked about the
> [[Class]] of exception interface objects not being defined -- it clearly is.)
(In reply to comment #17)
> (In reply to comment #15)
> > No, the Function prototype object is itself a Function object. (sic)
[...]
> That's a really good point, and now that you point it out, I agree. For
> consistency with ES, we should define the [[Class]] of an interface prototype
> object to be the identifier of the interface, and the [[Class]] of an exception
> interface prototype object to be the identifier of the exception. The
> [[Class]] of interface objects and exception interface objects should remain
> "Function", as now. (I was confused in comment 9 when I talked about the
> [[Class]] of exception interface objects not being defined -- it clearly is.)
Doing so would be consistent.
However in contrast, Brendan advises against other specs using [[Class]] and
that [[Class]] would be going away: "Note that [[Class]] is going away in
ES.next." I provided a link to that in comment 1. Here it is again:
http://lists.w3.org/Archives/Public/public-script-coord/2011OctDec/0110.html
So if [[Class]] is going away, then Brendan or Allen should figure out what
other specs like WebIDL can use to specify the behavior. Taking a step back,
this bug could be renamed to describe the desired behavior instead of the
desired implementation details ([[Class]] is an implementation detail). E.g.
instead of
"Define [[Class]] of interface prototype objects, exception interface objects,
and exception interface prototype objects"
- change it to define the publicly observable behavior:-
"Define toString of interface prototype objects, exception interface objects,
and exception interface prototype objects."
So as to not rely on specification mechanisms but rather to work with a defined
contract. Or maybe mark the bug as INVALID and start over with a new or refined
bug.
--
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Friday, 25 November 2011 20:28:51 UTC