From 52d06bf87a66b168bb23981e3fce67eefe698f17 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 22 Oct 2025 16:43:55 -0700 Subject: [PATCH] [emscripten] Avoid copying binaryen.js for each test. NFC Turns out you can import a `.js` just fine under node. It doesn't need to be called `.mjs`, despite the comment. --- scripts/test/binaryenjs.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/test/binaryenjs.py b/scripts/test/binaryenjs.py index 21600de26c2..392e9df59dc 100644 --- a/scripts/test/binaryenjs.py +++ b/scripts/test/binaryenjs.py @@ -13,7 +13,6 @@ # limitations under the License. import os -import shutil import subprocess from . import shared @@ -37,15 +36,10 @@ def make_js_test_header(binaryen_js): def make_js_test(input_js_file, binaryen_js): - # Copy the binaryen.js file to binaryen.mjs for now since file - # extensions matter under node. - # TODO(sbc): Should binaryen build as a `.mjs` file itself? - shutil.copyfile(binaryen_js, 'binaryen.mjs') - basename = os.path.basename(input_js_file) outname = os.path.splitext(basename)[0] + '.mjs' with open(outname, 'w') as f: - f.write(make_js_test_header('./binaryen.mjs')) + f.write(make_js_test_header(binaryen_js)) test_src = open(input_js_file).read() f.write(test_src) return outname