Bug 189316
Summary: | The error message for reassignment to const variables should say “variable” not “property" | ||
---|---|---|---|
Product: | WebKit | Reporter: | Thomas Denney <tdenney> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | fpizlo, ysuzuki |
Priority: | P2 | ||
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Thomas Denney
In the following JS:
"use strict";
class Example {
get thing() { return 0; }
}
const example = new Example();
example.thing = 1; // TypeError: Attempted to assign to readonly property.
example = new Example(); // TypeError: Attempted to assign to readonly property.
The same error message appears for both assignments, however the latter should read “TypeError: Attempted to assign to readonly variable.” rather than property.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |