aboutsummaryrefslogtreecommitdiff
path: root/src/js/_codegen/builtin-parser.ts
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-09-28 03:53:24 -0700
committerGravatar GitHub <noreply@github.com> 2023-09-28 03:53:24 -0700
commit387f1260c9dc0cea667b44ec0152fff0cd4def25 (patch)
tree24dde83cf812481b6d1c8de316a30ece7b745a54 /src/js/_codegen/builtin-parser.ts
parente60b3607c12c91959ec795228cc299703d5b09d0 (diff)
downloadbun-387f1260c9dc0cea667b44ec0152fff0cd4def25.tar.gz
bun-387f1260c9dc0cea667b44ec0152fff0cd4def25.tar.zst
bun-387f1260c9dc0cea667b44ec0152fff0cd4def25.zip
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
Diffstat (limited to 'src/js/_codegen/builtin-parser.ts')
-rw-r--r--src/js/_codegen/builtin-parser.ts6
1 files changed, 4 insertions, 2 deletions
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;
}