[Webkit-unassigned] [Bug 85057] [V8] Add "stack" property to DOMException

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 27 22:56:15 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=85057





--- Comment #11 from Yang Guo <yangguo at chromium.org>  2012-04-27 22:56:14 PST ---
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > Do you have any idea on the spec compliance?
> > 
> > WebIDL actually specs that DOM exceptions should have Error.prototype in its prototype chain. "stack" is not part of any standard but since we have it all instances that have Error.prototype in its prototype chain I don't think we are violating any spec by adding it ;-)
> > 
> > Look at how we handle TypeError for example:
> > 
> > var te = new TypeError;
> > Object.prototype.toString.call(te)
> > te.hasOwnProperty('stack');  // true
> > te.__proto__.hasOwnProperty('stack');  // true
> > 
> > This seems really fishy to me. JSC seems to do this in a better way. It adds a "stack" property when an object is thrown that has Error.prototype on its prototype chain. So by fixing bug 85078 we will get JSC support for this bug for free.
> 
> JSC adds error info to _any_ object that is thrown, error or not -- we should already have a stack property attached to dom errors, if not could you file a jsc specific bug so i can try and work out what's going wrong?

Initially I actually had an implementation that creates an Error object, copies all properties of the DOMException onto it and throws that Error object.  That way we indeed get the stack property for free, since the constructor of the Error object takes care of that. I'll upload a patch for that.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list