Skip to content

Commit d56079a

Browse files
committed
deps: update to [email protected]
PR-URL: #38002 Backport-PR-URL: #37992 Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent f70aee0 commit d56079a

File tree

7 files changed

+226
-80
lines changed

7 files changed

+226
-80
lines changed

deps/cjs-module-lexer/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
1.1.1
2+
- Better support for Babel reexport getter function forms (https://github.com./guybedford/cjs-module-lexer/issues/50)
3+
- Support Babel interopRequireWildcard reexports patterns (https://github.com./guybedford/cjs-module-lexer/issues/52)
4+
5+
1.1.0
6+
- Support for Babel reexport conflict filter (https://github.com./guybedford/cjs-module-lexer/issues/36, @nicolo-ribaudo)
7+
- Support trailing commas in getter patterns (https://github.com./guybedford/cjs-module-lexer/issues/31)
8+
- Support for RollupJS reexports property checks (https://github.com./guybedford/cjs-module-lexer/issues/38)
9+
110
1.0.0
211
- Unsafe getter tracking (https://github.com./guybedford/cjs-module-lexer/pull/29)
312

deps/cjs-module-lexer/README.md

+24-11
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ EXPORTS_DOT_ASSIGN: EXPORTS_IDENTIFIER `.` IDENTIFIER `=`
8080
8181
EXPORTS_LITERAL_COMPUTED_ASSIGN: EXPORTS_IDENTIFIER `[` IDENTIFIER_STRING `]` `=`
8282
83-
EXPORTS_LITERAL_PROP: (IDENTIFIER `:` IDENTIFIER)?) | (IDENTIFIER_STRING `:` IDENTIFIER)
83+
EXPORTS_LITERAL_PROP: (IDENTIFIER (`:` IDENTIFIER)?) | (IDENTIFIER_STRING `:` IDENTIFIER)
8484
8585
EXPORTS_SPREAD: `...` (IDENTIFIER | REQUIRE)
8686
@@ -92,31 +92,34 @@ EXPORTS_DEFINE_VALUE: EXPORTS_DEFINE `, {`
9292
(`enumerable: true,`)?
9393
(
9494
`value:` |
95-
`get` (`: function` IDENTIFIER? )? `()` {` return IDENTIFIER (`.` IDENTIFIER | `[` IDENTIFIER_STRING `]`)? `;`? `}`
95+
`get` (`: function` IDENTIFIER? )? `() {` return IDENTIFIER (`.` IDENTIFIER | `[` IDENTIFIER_STRING `]`)? `;`? `}` `,`?
9696
)
9797
`})`
9898
9999
EXPORTS_LITERAL: MODULE_EXPORTS `=` `{` (EXPORTS_LITERAL_PROP | EXPORTS_SPREAD) `,`)+ `}`
100100
101101
REQUIRE: `require` `(` STRING_LITERAL `)`
102102
103-
EXPORTS_ASSIGN: (`var` | `const` | `let`) IDENTIFIER `=` REQUIRE
103+
EXPORTS_ASSIGN: (`var` | `const` | `let`) IDENTIFIER `=` (`_interopRequireWildcard (`)? REQUIRE
104104
105105
MODULE_EXPORTS_ASSIGN: MODULE_EXPORTS `=` REQUIRE
106106
107107
EXPORT_STAR: (`__export` | `__exportStar`) `(` REQUIRE
108108
109109
EXPORT_STAR_LIB: `Object.keys(` IDENTIFIER$1 `).forEach(function (` IDENTIFIER$2 `) {`
110110
(
111-
`if (` IDENTIFIER$2 `===` ( `'default'` | `"default"` ) `||` IDENTIFIER$2 `===` ( '__esModule' | `"__esModule"` ) `) return` `;`? |
112-
`if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) `)`
111+
(
112+
`if (` IDENTIFIER$2 `===` ( `'default'` | `"default"` ) `||` IDENTIFIER$2 `===` ( '__esModule' | `"__esModule"` ) `) return` `;`?
113+
(
114+
(`if (Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER `, ` IDENTIFIER$2 `)) return` `;`?)?
115+
(`if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`)?
116+
)?
117+
) |
118+
`if (` IDENTIFIER$2 `!==` ( `'default'` | `"default"` ) (`&& !` (`Object` `.prototype`? `.hasOwnProperty.call(` IDENTIFIER$1 `, ` IDENTIFIER$2 `)` | IDENTIFIER$1 `.hasOwnProperty(` IDENTIFIER$2 `)`))? `)`
113119
)
114-
(
115-
`if (` IDENTIFIER$2 `in` EXPORTS_IDENTIFIER `&&` EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] ===` IDENTIFIER$1 `[` IDENTIFIER$2 `]) return` `;`?
116-
)?
117120
(
118121
EXPORTS_IDENTIFIER `[` IDENTIFIER$2 `] =` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? |
119-
`Object.defineProperty(` EXPORTS_IDENTIFIER `, ` IDENTIFIER$2 `, { enumerable: true, get: function () { return ` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? } })` `;`?
122+
`Object.defineProperty(` EXPORTS_IDENTIFIER `, ` IDENTIFIER$2 `, { enumerable: true, get` (`: function` IDENTIFIER? )? `() { return ` IDENTIFIER$1 `[` IDENTIFIER$2 `]` `;`? `}` `,`? `})` `;`?
120123
)
121124
`})`
122125
```
@@ -126,7 +129,7 @@ Spacing between tokens is taken to be any ECMA-262 whitespace, ECMA-262 block co
126129
* The returned export names are taken to be the combination of:
127130
1. All `IDENTIFIER` and `IDENTIFIER_STRING` slots for `EXPORTS_MEMBER` and `EXPORTS_LITERAL` matches.
128131
2. The first `IDENTIFIER_STRING` slot for all `EXPORTS_DEFINE_VALUE` matches where that same string is not an `EXPORTS_DEFINE` match that is not also an `EXPORTS_DEFINE_VALUE` match.
129-
* The reexport specifiers are taken to be the the combination of:
132+
* The reexport specifiers are taken to be the combination of:
130133
1. The `REQUIRE` matches of the last matched of either `MODULE_EXPORTS_ASSIGN` or `EXPORTS_LITERAL`.
131134
2. All _top-level_ `EXPORT_STAR` `REQUIRE` matches and `EXPORTS_ASSIGN` matches whose `IDENTIFIER` also matches the first `IDENTIFIER` in `EXPORT_STAR_LIB`.
132135

@@ -194,13 +197,23 @@ Object.defineProperty(exports, 'd', { value: 'd' });
194197
Object.defineProperty(exports, '__esModule', { value: true });
195198
```
196199

200+
Value properties are also detected specifically:
201+
202+
```js
203+
Object.defineProperty(exports, 'a', {
204+
value: 'no problem'
205+
});
206+
```
207+
197208
To avoid matching getters that have side effects, any getter for an export name that does not support the forms above will
198209
opt-out of the getter matching:
199210

200211
```js
201212
// DETECTS: NO EXPORTS
202213
Object.defineProperty(exports, 'a', {
203-
value: 'no problem'
214+
get () {
215+
return 'nope';
216+
}
204217
});
205218

206219
if (false) {

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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

+2-2
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)