Bug 27611
| Summary: | document.__proto__ Behavior | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | arv, eric, ggaren, keishi |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | OS X 10.5 | ||
Joseph Pecoraro
Please read the comments on this bug report:
https://bugs.webkit.org/show_bug.cgi?id=27169
Note that I'm only concerned with the instanceof. The typeof doesn't seem to be a major issue. Which behavior of instanceof do you think is correct?
Summary:
WebKit and Chrome:
> document.__proto__ instanceof window.Node
true
> document.__proto__.__proto__.__proto__ === Node.prototype
true
>typeof document.__proto__
"object"
Firefox:
> document.__proto__ instanceof window.Node
false
> document.__proto__.__proto__.__proto__ === Node.prototype
true
>typeof document.__proto__
"object"
Opera:
> document.__proto__ instanceof window.Node
false
> document.__proto__.__proto__.__proto__ === Node.prototype
ERROR
> typeof document.__proto__
"undefined"
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Keishi Hattori
Opera doesn7t support __proto__
Eric Seidel (no email)
Adding two ECMA experts who would know this off the top of their heads.
Erik Arvidsson
This is once again underspecified behavior.
> document.__proto__ instanceof window.Node
true
This is correct because the [[Prototype]] of document should be a Node
> document.__proto__.__proto__.__proto__ === Node.prototype
true
This is less clear. DOM defines everything in interfaces. But given that we treat an interface as a prototype in other places it seems as correct as we can get it
document instanceof HTMLDocument
document.__proto__instanceof Document
document.__proto__.__proto__ instanceof Node
I think this is (or should be) covered by WebIDL.
To me it seems WebKit is doing as good as it can.
Eric Seidel (no email)
Any comments as to why the resolution?