Bug 71113
| Summary: | [V8] Event.type incorrectly reports that it is writable | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jake Verbaten <raynos2> |
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ap, arv, dominicc |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Jake Verbaten
var e = document.createEvent("UIEvent");
var pd = Object.getOwnPropertyDescriptor(e, "type");
console.log(pd.writable); // type is writable
e.type = "foobar";
console.log(e.type === ""); // Webkit Y U DO THIS.
test : http://jsfiddle.net/WxA3a/1/ in chrome 14.
I presume this is an issue with `e.type` living in C++ land and `e.type = "foobar"` living in ES land.
As a sidenote
delete e.type;
e.type = "click";
breaks e.initEvent()
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
I cannot reproduce this with Safari 5.1 or with a current local build. The value of pd.writable is false, like it should be per <http://www.w3.org/TR/DOM-Level-3-Events/#webidl-events-Event>:
readonly attribute DOMString type;
Erik Arvidsson
Yeah, this is wrong in Chromium/V8.
But, type is specced as a getter on Event.prototype
Jake Verbaten
Given that the value is different in Safari 5.1 and Chrome (14/15).
Is this still an issue with Webkit or an issue with v8/chromium?
Should I go complain to v8 or chromium instead?
Dominic Cooney
*** This bug has been marked as a duplicate of bug 48337 ***