The initial value of globalThis is the well-known intrinsic object %GlobalThisValue%.
This property has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }.
Well-known Intrinsic Objects| Intrinsic Name | Global Name | ECMAScript Language Association |
|---|---|---|
| %GeneratorPrototype% | The initial value of the `prototype` property of %Generator% | |
| %GlobalThisValue% | globalThis |
The initial value of the `globalThis` property of the global object |
| %Int8Array% | Int8Array |
The `Int8Array` constructor () |
The abstract operation SetRealmGlobalObject with arguments realmRec, globalObj, and thisValue performs the following steps:
- Let
intrinsicsberealmRec.[[Intrinsics]]. - If
globalObjis undefined, then 1. LetglobalObjbe ObjectCreate(intrinsics.[[%ObjectPrototype%]]). - Assert: Type(
globalObj) is Object. - If
thisValueis undefined, letthisValuebeglobalObj. - Set
intrinsics.[[%GlobalThisValue%]] tothisValue. - Set
realmRec.[[GlobalObject]] toglobalObj. - Let
newGlobalEnvbe NewGlobalEnvironment(globalObj,thisValue). - Set
realmRec.[[GlobalEnv]] tonewGlobalEnv. - Return
realmRec.