deps: update to cjs-module-lexer@1.2.2

PR-URL: https://github.com/nodejs/node/pull/39402
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Guy Bedford 2021-07-15 12:36:48 -07:00
parent f1e936ff15
commit fdf625bae8
7 changed files with 14 additions and 9 deletions

View File

@ -1,3 +1,6 @@
1.2.2
- Fix RollupJS reexports bug (https://github.com/guybedford/cjs-module-lexer/pull/59)
1.2.1
- Support Unicode escapes in strings (https://github.com/guybedford/cjs-module-lexer/pull/55)
- Filter export strings to valid surrogate pairs (https://github.com/guybedford/cjs-module-lexer/pull/56)

View File

@ -113,7 +113,7 @@ EXPORT_STAR_LIB: `Object.keys(` IDENTIFIER$1 `).forEach(function (` IDENTIFIER$2
(`if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`)?
)?
) |
`if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) (`&& !` (`Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER$1 `, ` IDENTIFIER$2 `)` | IDENTIFIER$1 `.hasOwnProperty(` IDENTIFIER$2 `)`))? `)`
`if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) (`&& !` (`Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)` | IDENTIFIER `.hasOwnProperty(` IDENTIFIER$2 `)`))? `)`
)
(
EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] =` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -651,8 +651,10 @@ function tryParseObjectDefineOrKeys (keys) {
if (ch !== 33/*!*/) break;
pos += 1;
ch = commentWhitespace();
if (source.startsWith(id, pos)) {
pos += id.length;
if (ch === 79/*O*/ && source.startsWith('bject', pos + 1) && source[pos + 6] === '.') {
if (!tryParseObjectHasOwnProperty(it_id)) break;
}
else if (identifier()) {
ch = commentWhitespace();
if (ch !== 46/*.*/) break;
pos++;
@ -669,7 +671,7 @@ function tryParseObjectDefineOrKeys (keys) {
if (ch !== 41/*)*/) break;
pos += 1;
}
else if (!tryParseObjectHasOwnProperty(it_id)) break;
else break;
ch = commentWhitespace();
}
if (ch !== 41/*)*/) break;

View File

@ -1,6 +1,6 @@
{
"name": "cjs-module-lexer",
"version": "1.2.1",
"version": "1.2.2",
"description": "Lexes CommonJS modules, returning their named exports metadata",
"main": "lexer.js",
"exports": {

View File

@ -1349,7 +1349,7 @@ success!
[`string`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
[`transformSource` hook]: #esm_transformsource_source_context_defaulttransformsource
[`util.TextDecoder`]: util.md#util_class_util_textdecoder
[cjs-module-lexer]: https://github.com/guybedford/cjs-module-lexer/tree/1.2.1
[cjs-module-lexer]: https://github.com/guybedford/cjs-module-lexer/tree/1.2.2
[custom https loader]: #esm_https_loader
[special scheme]: https://url.spec.whatwg.org/#special-scheme
[the official standard format]: https://tc39.github.io/ecma262/#sec-modules