[Bug 14877] Define [[Class]] of interface prototype objects, exception interface objects, and exception interface prototype objects

http://www.w3.org/Bugs/Public/show_bug.cgi?id=14877

--- Comment #12 from Brendan Eich <brendan@mozilla.org> 2011-11-21 20:15:19 UTC ---
(In reply to comment #11)
> (In reply to comment #8)
> > If DOMException is spec changed to be a function then the Interface
> > Object's prototype -- DOMException.prototype -- can then be defined to be
> > an instance of DOMException. This is how all the built-ins work, e.g.
> > 
> >  Function.prototype instance of Function; // true
> >  String.prototype == ""; // true
> >  Error.prototype instanceof Error; // true
> 
> Function.prototype instanceof Function is false in Firefox 11a1, Chrome 17 dev,
> and Opera 12.00, and that appears to me correct per spec:
> 
> http://es5.github.com/#x15.3.5.3

Yes, note how instanceof always skips one up on the [[Prototype]] chain of the
LHS object before testing for whether the current object on that chain is the
same as the value of the .prototype property of the RHS.

Garrett's comment is in error on the first and third lines (correcting for the
stray space on the first).

> (In reply to comment #10)
> > Also, it's important to say the role of [[Class]], since ES6 drafts remove that
> > internal property in favor of generic (class-independent) semantics, or else a
> > more precise and less over-loaded internal nominal tagging scheme. I'm assuming
> > here the issue is Object.prototype.toString.
> 
> Yes, exactly.  That's all I actually care about.  The only way ES5 gives us to
> define Object.prototype.toString behavior is via [[Class]], so that's how
> WebIDL has to define it.

Allen should weigh in here. As noted, [[Class]] is not a supported extension
mechanism for other specs. We should negotiate a more future-proof way to spec.

/be

-- 
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 Monday, 21 November 2011 20:15:26 UTC