Bug 189316 - The error message for reassignment to const variables should say “variable” not “property"
Summary: The error message for reassignment to const variables should say “variable” n...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-05 13:35 PDT by Thomas Denney
Modified: 2018-09-07 14:03 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Denney 2018-09-05 13:35:45 PDT
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.