Bug 207310 - Throw a type error upon attempts to redefine undefined and friends on the JSGlobalObject
Summary: Throw a type error upon attempts to redefine undefined and friends on the JSG...
Status: RESOLVED DUPLICATE of bug 203456
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-05 16:44 PST by Robin Morisset
Modified: 2020-02-05 16:45 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2020-02-05 16:44:12 PST
According to http://www.ecma-international.org/ecma-262/6.0/index.html#sec-undefined, JSGlobalObject got properties such as "undefined" which are non-writable and non-configurable.
So the following code should throw a type error:
```
Object.defineProperty(this, "undefined", {
    configurable: true,
    get: function() {
        return false;
    }
});
```
And it does in Chrome, but currently does not in Safari.
Comment 1 Robin Morisset 2020-02-05 16:44:29 PST
<rdar://problem/56658015>
Comment 2 Robin Morisset 2020-02-05 16:45:56 PST
Oops, I did not realize that this was already in the bugzilla.

*** This bug has been marked as a duplicate of bug 203456 ***