Skip to content

Commit 84795e3

Browse files
authored
[emscripten] Avoid copying binaryen.js for each test. NFC (#7987)
Turns out you can import a `.js` just fine under node. It doesn't need to be called `.mjs`, despite the comment.
1 parent 1c4a085 commit 84795e3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

scripts/test/binaryenjs.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import os
16-
import shutil
1716
import subprocess
1817

1918
from . import shared
@@ -37,15 +36,10 @@ def make_js_test_header(binaryen_js):
3736

3837

3938
def make_js_test(input_js_file, binaryen_js):
40-
# Copy the binaryen.js file to binaryen.mjs for now since file
41-
# extensions matter under node.
42-
# TODO(sbc): Should binaryen build as a `.mjs` file itself?
43-
shutil.copyfile(binaryen_js, 'binaryen.mjs')
44-
4539
basename = os.path.basename(input_js_file)
4640
outname = os.path.splitext(basename)[0] + '.mjs'
4741
with open(outname, 'w') as f:
48-
f.write(make_js_test_header('./binaryen.mjs'))
42+
f.write(make_js_test_header(binaryen_js))
4943
test_src = open(input_js_file).read()
5044
f.write(test_src)
5145
return outname

0 commit comments

Comments
 (0)