diff options
Diffstat (limited to 'src/js/_codegen/builtin-parser.ts')
-rw-r--r-- | src/js/_codegen/builtin-parser.ts | 6 |
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; } |