Skip to content

Commit

Permalink
module: cjs-module-lexer WebAssembly fallback
Browse files Browse the repository at this point in the history
PR-URL: #43612
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
  • Loading branch information
guybedford authored and targos committed Jul 12, 2022
1 parent 7491469 commit e914185
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/internal/modules/esm/translators.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ async function initCJSParse() {
} else {
const { parse, init } =
require('internal/deps/cjs-module-lexer/dist/lexer');
await init();
cjsParse = parse;
try {
await init();
cjsParse = parse;
} catch {
cjsParse = require('internal/deps/cjs-module-lexer/lexer').parse;
}
}
}

Expand Down

0 comments on commit e914185

Please sign in to comment.