diff --git a/test/test_other.py b/test/test_other.py index 4dabc8ecb3524..79098a8b03068 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -407,7 +407,8 @@ def test_export_es6_allows_export_in_post_js(self): @parameterized({ '': ([],), # load a worker before startup to check ES6 modules there as well - 'pthreads': (['-pthread', '-sPTHREAD_POOL_SIZE=1'],), + # pass -O2 to ensure the worker JS file is minified with Acorn + 'pthreads': (['-O2', '-pthread', '-sPTHREAD_POOL_SIZE=1'],), }) def test_export_es6(self, args, package_json): self.run_process([EMCC, test_file('hello_world.c'), '-sEXPORT_ES6', diff --git a/tools/acorn-optimizer.mjs b/tools/acorn-optimizer.mjs index c62e29f066665..f877761d636eb 100755 --- a/tools/acorn-optimizer.mjs +++ b/tools/acorn-optimizer.mjs @@ -2029,6 +2029,7 @@ try { preserveParens: closureFriendly, onComment: closureFriendly ? sourceComments : undefined, sourceType: exportES6 ? 'module' : 'script', + allowAwaitOutsideFunction: true, }); } catch (err) { err.message += (() => {