From 387f1260c9dc0cea667b44ec0152fff0cd4def25 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Thu, 28 Sep 2023 03:53:24 -0700 Subject: Get Next.js Pages Router to work (#6095) * hell * make it so bun-debug-src * teag * wild * yippee * fas * fix async hooks assertions * yap * yeah that's wild * aa * a * increase time allowed * so trivial --- src/js/_codegen/builtin-parser.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/js/_codegen/builtin-parser.ts') diff --git a/src/js/_codegen/builtin-parser.ts b/src/js/_codegen/builtin-parser.ts index ffd5671c1..4e35f13dd 100644 --- a/src/js/_codegen/builtin-parser.ts +++ b/src/js/_codegen/builtin-parser.ts @@ -79,12 +79,14 @@ export function sliceSourceCode( i = 1; } else if (endOnComma && contents.startsWith(",")) { if (bracketCount <= 1) { - result += ","; contents = contents.slice(1); - // if the next non-whitespace character is ), also consume + // if the next non-whitespace character is ), we will treat it like a ) let match = contents.match(/^\s*\)/); if (match) { contents = contents.slice(match[0].length); + result += ")"; + } else { + result += ","; } break; } -- cgit v1.2.3