Skip to content

Commit 31c1883

Browse files
committed
esm: use wasm version of cjs-module-lexer
The synchronous version has been available since 1.4.0.
1 parent a9b478e commit 31c1883

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/modules/esm/translators.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ function getSource(url) {
7474
let cjsParse;
7575
/**
7676
* Initializes the CommonJS module lexer parser using the JavaScript version.
77-
* TODO(joyeecheung): Use `require('internal/deps/cjs-module-lexer/dist/lexer').initSync()`
78-
* when cjs-module-lexer 1.4.0 is rolled in.
7977
*/
8078
function initCJSParseSync() {
8179
if (cjsParse === undefined) {
82-
cjsParse = require('internal/deps/cjs-module-lexer/lexer').parse;
80+
const { parse, initSync } = require('internal/deps/cjs-module-lexer/dist/lexer');
81+
initSync();
82+
cjsParse = parse;
8383
}
8484
}
8585

0 commit comments

Comments
 (0)