Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ea23939

Browse filesBrowse files
guybedfordMylesBorins
authored andcommitted
module: cjs-module-lexer@0.4.1 big endian fix
PR-URL: #35634 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
1 parent 7a98961 commit ea23939
Copy full SHA for ea23939

File tree

Expand file treeCollapse file tree

5 files changed

+10
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+10
-16
lines changed
Open diff view settings
Collapse file

‎deps/cjs-module-lexer/dist/lexer.js‎

Copy file name to clipboardExpand all lines: deps/cjs-module-lexer/dist/lexer.js
+1-1Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Collapse file

‎deps/cjs-module-lexer/dist/lexer.mjs‎

Copy file name to clipboardExpand all lines: deps/cjs-module-lexer/dist/lexer.mjs
+2-2Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.
Collapse file

‎deps/cjs-module-lexer/package.json‎

Copy file name to clipboardExpand all lines: deps/cjs-module-lexer/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cjs-module-lexer",
3-
"version": "0.4.0",
3+
"version": "0.4.2",
44
"description": "Lexes CommonJS modules, returning their named exports metadata",
55
"main": "lexer.js",
66
"exports": {
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1294,9 +1294,9 @@ success!
12941294
[`string`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
12951295
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
12961296
[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
1297-
[`util.TextDecoder`]: util.html#util_class_util_textdecoder
1298-
[cjs-module-lexer]: https://github.com/guybedford/cjs-module-lexer/tree/0.4.0
12991297
[dynamic instantiate hook]: #esm_code_dynamicinstantiate_code_hook
1298+
[`util.TextDecoder`]: util.md#util_class_util_textdecoder
1299+
[cjs-module-lexer]: https://github.com/guybedford/cjs-module-lexer/tree/0.4.2
13001300
[special scheme]: https://url.spec.whatwg.org/#special-scheme
13011301
[the official standard format]: https://tc39.github.io/ecma262/#sec-modules
13021302
[transpiler loader example]: #esm_transpiler_loader
Collapse file

‎lib/internal/modules/esm/translators.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/translators.js
+4-10Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,14 @@ const asyncESM = require('internal/process/esm_loader');
5959

6060
let cjsParse;
6161
async function initCJSParse() {
62-
if (typeof WebAssembly !== 'undefined') {
62+
if (typeof WebAssembly === 'undefined') {
63+
cjsParse = require('internal/deps/cjs-module-lexer/lexer');
64+
} else {
6365
const { parse, init } =
6466
require('internal/deps/cjs-module-lexer/dist/lexer');
6567
await init();
66-
let exports;
67-
try {
68-
({ exports } = parse('exports.a=1'));
69-
if (exports.length === 1) {
70-
cjsParse = parse;
71-
return;
72-
}
73-
} catch {}
68+
cjsParse = parse;
7469
}
75-
cjsParse = require('internal/deps/cjs-module-lexer/lexer');
7670
}
7771

7872
const translators = new SafeMap();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.