From 49830a48f683a005abe46af4bade40e547d75072 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Wed, 20 May 2026 05:05:59 +0000 Subject: [PATCH 1/3] [Fuzzer] Make Split's exports a list of strings When the export name contains a comma, such as `foo`, the v8 command does not work: ```colsole v8 ... exports:foo,foo,bar,... --fuzz-split ``` This generates an `exports` as a list of strings within quotes, supporting export names with commas. This still parses the old format of `exports` in case it doesn't contain commas, which I think might be useful for handwritten command lines. --- scripts/fuzz_opt.py | 4 ++-- scripts/fuzz_shell.js | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 4173058abf8..df0480973b0 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -1693,9 +1693,9 @@ def optimize(name): # prepare the list of exports to call. the format is # - # exports:A,B,C + # exports:["A","B","C"] # - exports_to_call = 'exports:' + ','.join(exports) + exports_to_call = 'exports:' + json.dumps(exports) # get the output from the split modules, linking them using JS # TODO run liftoff/turboshaft/etc. diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js index d16c49624b9..06a1030a215 100644 --- a/scripts/fuzz_shell.js +++ b/scripts/fuzz_shell.js @@ -57,7 +57,12 @@ var fuzzSplit = false; for (var i = 0; i < argv.length; i++) { var curr = argv[i]; if (curr.startsWith('exports:')) { - exportsToCall = curr.substr('exports:'.length).split(','); + var payload = curr.substr('exports:'.length); + if (payload.startsWith('[')) { + exportsToCall = JSON.parse(payload); + } else { + exportsToCall = payload ? payload.split(',') : []; + } argv.splice(i, 1); i--; } else if (curr == '--fuzz-split') { From ae55c7215d9d391d129a4a72e33071e7eefb3a60 Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 21 May 2026 00:06:53 +0000 Subject: [PATCH 2/3] Revert "[Fuzzer] Make Split's exports a list of strings" This reverts commit 49830a48f683a005abe46af4bade40e547d75072. --- scripts/fuzz_opt.py | 4 ++-- scripts/fuzz_shell.js | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index df0480973b0..4173058abf8 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -1693,9 +1693,9 @@ def optimize(name): # prepare the list of exports to call. the format is # - # exports:["A","B","C"] + # exports:A,B,C # - exports_to_call = 'exports:' + json.dumps(exports) + exports_to_call = 'exports:' + ','.join(exports) # get the output from the split modules, linking them using JS # TODO run liftoff/turboshaft/etc. diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js index 06a1030a215..d16c49624b9 100644 --- a/scripts/fuzz_shell.js +++ b/scripts/fuzz_shell.js @@ -57,12 +57,7 @@ var fuzzSplit = false; for (var i = 0; i < argv.length; i++) { var curr = argv[i]; if (curr.startsWith('exports:')) { - var payload = curr.substr('exports:'.length); - if (payload.startsWith('[')) { - exportsToCall = JSON.parse(payload); - } else { - exportsToCall = payload ? payload.split(',') : []; - } + exportsToCall = curr.substr('exports:'.length).split(','); argv.splice(i, 1); i--; } else if (curr == '--fuzz-split') { From 240fa620fdb6d31c2d4a60c15aae39e55b58930d Mon Sep 17 00:00:00 2001 From: Heejin Ahn Date: Thu, 21 May 2026 00:28:11 +0000 Subject: [PATCH 3/3] Reapply "[Fuzzer] Make Split's exports a list of strings" This reverts commit ae55c7215d9d391d129a4a72e33071e7eefb3a60. --- scripts/fuzz_opt.py | 4 ++-- scripts/fuzz_shell.js | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/fuzz_opt.py b/scripts/fuzz_opt.py index 4173058abf8..df0480973b0 100755 --- a/scripts/fuzz_opt.py +++ b/scripts/fuzz_opt.py @@ -1693,9 +1693,9 @@ def optimize(name): # prepare the list of exports to call. the format is # - # exports:A,B,C + # exports:["A","B","C"] # - exports_to_call = 'exports:' + ','.join(exports) + exports_to_call = 'exports:' + json.dumps(exports) # get the output from the split modules, linking them using JS # TODO run liftoff/turboshaft/etc. diff --git a/scripts/fuzz_shell.js b/scripts/fuzz_shell.js index d16c49624b9..06a1030a215 100644 --- a/scripts/fuzz_shell.js +++ b/scripts/fuzz_shell.js @@ -57,7 +57,12 @@ var fuzzSplit = false; for (var i = 0; i < argv.length; i++) { var curr = argv[i]; if (curr.startsWith('exports:')) { - exportsToCall = curr.substr('exports:'.length).split(','); + var payload = curr.substr('exports:'.length); + if (payload.startsWith('[')) { + exportsToCall = JSON.parse(payload); + } else { + exportsToCall = payload ? payload.split(',') : []; + } argv.splice(i, 1); i--; } else if (curr == '--fuzz-split') {