From ab678e7b90bb02857f2a6b79c3eb9c47011e529a Mon Sep 17 00:00:00 2001 From: CountBleck Date: Sat, 25 Feb 2023 18:18:45 -0800 Subject: [PATCH] Generate wrapper binding functions for non-identifier imports This change should ensure performance.now() and document.foo() does not break. --- src/bindings/js.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/js.ts b/src/bindings/js.ts index 520878b992..3c488ff30e 100644 --- a/src/bindings/js.ts +++ b/src/bindings/js.ts @@ -285,7 +285,7 @@ export class JSBuilder extends ExportsWalker { sb.push(escapeString(name, CharCode.DoubleQuote)); sb.push("\""); } - if (isPlainFunction(signature, Mode.Import) && !code) { + if (isPlainFunction(signature, Mode.Import) && !code && isIdentifier(name)) { sb.push(": (\n"); indent(sb, this.indentLevel + 1); sb.push("// ");