Bug 143066
| Summary: | Poor runtime error message dealing with undefined in strict mode compared to non-strict mode | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> |
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> |
| Status: | ASSIGNED | ||
| Severity: | Normal | CC: | ggaren, joepeck, rniwa, saam |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Joseph Pecoraro
* SUMMARY
Very poor runtime error message dealing with undefined in strict mode compared to non-strict mode.
* TEST
<script>
"use strict";
function Foo() {
this._key = undefined;
this._key.name = "test";
}
new Foo;
</script>
* NON-STRICT (expected)
[Error] TypeError: undefined is not an object (evaluating 'this._key.name = "test"')
* STRICT (actual)
[Error] TypeError: Attempted to assign to readonly property.
* NOTES
- Because Classes imply strict mode and we've started making heavy use of classes, this will greatly impact us when working on WebInspector.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Timothy Hatcher
This stumped me for a while today.
Saam Barati
I'll take this