From 67042c059bac0de2aa6fe415e2de325cda59faf4 Mon Sep 17 00:00:00 2001 From: Seunghyun Hwang Date: Tue, 28 Nov 2023 21:22:28 +0900 Subject: [PATCH] ref Object from globalThis --- .../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] ),