[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 #13 from Garrett <dhtmlkitchen@gmail.com> 2011-11-22 03:20:50 UTC ---
(In reply to comment #12)
> (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.
> 
Right, thanks.
Though what I was getting at was that "The Function prototype object is itself
a Function object". 


> Garrett's comment is in error on the first and third lines (correcting for the
> stray space on the first).
> 
The third line is a suggestion of what might happen if the suggested change is
made. As you've pointed out with Function.prototype, that too would not make
sense.  The idea suggested was what if DOMException.prototype is a DOMException
object. My mistake was using the instanceof operator here.

-- 
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 Tuesday, 22 November 2011 03:21:01 UTC