diff options
author | Alon Zakai <azakai@google.com> | 2022-08-17 13:49:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-17 13:49:44 -0700 |
commit | b70fe755aa4c90727edfd91dc0a9a51febf0239d (patch) | |
tree | f36c3225e85ba9601472dde3a75c9a35c7da6ad3 | |
parent | 0c0c51257476f319028671cf2322a49683ba1961 (diff) | |
download | binaryen-b70fe755aa4c90727edfd91dc0a9a51febf0239d.tar.gz binaryen-b70fe755aa4c90727edfd91dc0a9a51febf0239d.tar.bz2 binaryen-b70fe755aa4c90727edfd91dc0a9a51febf0239d.zip |
Fix require() in wasm2js test suite for newer Node.js (#4913)
Without this fix, newer node errors on:
"node-esm-loader.mjs 'resolve'" did not call the next hook in its chain and did not explicitly signal a short circuit. If this is intentional, include `shortCircuit: true` in the hook's return.
This adds that shortCircuit property.
-rw-r--r-- | scripts/test/node-esm-loader.mjs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/test/node-esm-loader.mjs b/scripts/test/node-esm-loader.mjs index 8a3b67d1c..ad58c0618 100644 --- a/scripts/test/node-esm-loader.mjs +++ b/scripts/test/node-esm-loader.mjs @@ -25,6 +25,8 @@ const specialTestSuiteModules = { export async function resolve(specifier, context, defaultResolve) { const specialModule = specialTestSuiteModules[specifier]; if (specialModule) { + // This is needed for newer node versions. + specialModule.shortCircuit = true; return specialModule; } return defaultResolve(specifier, context, defaultResolve); |