From 63766cddcc2eec0552547875aec00a5abcdaafbb Mon Sep 17 00:00:00 2001 From: Seunghyun Hwang Date: Mon, 4 Dec 2023 19:46:54 +0900 Subject: [PATCH] ref Object from globalThis (#611) --- .../src/message-type-extensions/internal-binary-write.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin/src/message-type-extensions/internal-binary-write.ts b/packages/plugin/src/message-type-extensions/internal-binary-write.ts index 17764dbd..4b23e3b0 100644 --- a/packages/plugin/src/message-type-extensions/internal-binary-write.ts +++ b/packages/plugin/src/message-type-extensions/internal-binary-write.ts @@ -610,7 +610,13 @@ export class InternalBinaryWrite implements CustomMethodGenerator { undefined, ts.createVariableDeclarationList([ts.createVariableDeclaration(ts.createIdentifier("k"), undefined, undefined)], ts.NodeFlags.Let), ts.createCall( - ts.createPropertyAccess(ts.createIdentifier("Object"), ts.createIdentifier("keys")), + ts.createPropertyAccess( + ts.createPropertyAccess( + ts.createIdentifier("globalThis"), + ts.createIdentifier("Object") + ), + ts.createIdentifier("keys") + ), undefined, [fieldPropertyAccess] ),