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 ObjectsIntrinsic 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
intrinsics
berealmRec
.[[Intrinsics]]. - If
globalObj
is undefined, then 1. LetglobalObj
be ObjectCreate(intrinsics
.[[%ObjectPrototype%]]). - Assert: Type(
globalObj
) is Object. - If
thisValue
is undefined, letthisValue
beglobalObj
. - Set
intrinsics
.[[%GlobalThisValue%]] tothisValue
. - Set
realmRec
.[[GlobalObject]] toglobalObj
. - Let
newGlobalEnv
be NewGlobalEnvironment(globalObj
,thisValue
). - Set
realmRec
.[[GlobalEnv]] tonewGlobalEnv
. - Return
realmRec
.