-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Per https://github.com/tc39/proposal-global, the global value `global` should be configurable, writable, and non-enumerable. `node` has always provided it as configurable, writable, and enumerable. The plan is to make it non-enumerable, and barring strong evidence that node can not ship `global` as non-enumerable, this will be how it lands as stage 4 (in the spec).
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
require('../common'); | ||
|
||
const assert = require('assert'); | ||
|
||
const { | ||
value, | ||
configurable, | ||
enumerable, | ||
writable | ||
} = Object.getOwnPropertyDescriptor(global, 'global'); | ||
|
||
const actualGlobal = Function('return this')(); | ||
assert.strictEqual(value, actualGlobal, 'global should be global object'); | ||
|
||
assert.strictEqual(configurable, true, 'global should be configurable'); | ||
assert.strictEqual(enumerable, false, 'global should be non-enumerable'); | ||
assert.strictEqual(writable, true, 'global should be writable'); |