Skip to content

Commit c90bd3d

Browse files
committed
globalThis needs to load the host global object
Currently, the globalThis property loads the Chakra GlobalObject from the library but if the host has set a HostObject, we should use that object instead.
1 parent 174fc46 commit c90bd3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Runtime/Library/JavascriptLibrary.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ namespace Js
13791379

13801380
if (globalObject->GetScriptContext()->GetConfig()->IsESGlobalThisEnabled())
13811381
{
1382-
AddMember(globalObject, PropertyIds::globalThis, globalObject, PropertyConfigurable | PropertyWritable);
1382+
AddMember(globalObject, PropertyIds::globalThis, globalObject->ToThis(), PropertyConfigurable | PropertyWritable);
13831383
}
13841384
AddMember(globalObject, PropertyIds::NaN, nan, PropertyNone);
13851385
AddMember(globalObject, PropertyIds::Infinity, positiveInfinite, PropertyNone);

0 commit comments

Comments
 (0)