[Webkit-unassigned] [Bug 27169] typing "document.__proto__" in inspector throws exception

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 22 23:48:48 PDT 2009


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


Joseph Pecoraro <joepeck02 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joepeck02 at gmail.com




--- Comment #1 from Joseph Pecoraro <joepeck02 at gmail.com>  2009-07-22 23:48:47 PDT ---
After some digging it appears this is a rather weird edge case that can be
reduced to this:

> typeof document.__proto__
object

> document.__proto__ instanceof window.Node
true

> document.__proto__.nodeName
undefined

> document.__proto__.nodeType
undefined


So when the formatter actually gets down to formating as a node, jumps into
utilities.js's nodeTitleInfo(), does a switch on obj.nodeType (undefined) which
hits the default case and tries obj.nodeName and throws the error.

The Javascript workaround that I feel is the most responsible would be to treat
"document.__proto__" as the type it returns via "typeof", which is "object",
instead of "node".  To be more general, if something is an "instanceof Node"
then to really be sure its a node it should have a "nodeType" property. 
Otherwise its lieing!

Maybe the solution is to change something in the Document C++ implementation so
document.__proto__ instanceof "Node" returns false instead of true.

-- 
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