| Summary: | Updating a non-writable property of a coerced primitive object does not throw a TypeError exception in a strict mode | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Daejun Park <daejunpark> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | ggaren, oliver |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac (Intel) | ||
| OS: | OS X 10.9 | ||
|
Description
Daejun Park
2014-11-18 18:50:23 PST
I'm sorry for the noise. It turns out that I've missed how Web Inspector works. The above example works correctly when I wrapped the code with a function, ensuring the strict mode, as follows:
function f() {
"use strict";
Object.defineProperty(Number.prototype, "x", { "value" : 0, "writable" : false, "enumerable" : true, "configurable" : true });
1["x"] = 10; // TypeError
}
f();
I close this issue.
Thanks,
Daejun
|