-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compartment-mapper): top-level "this" is "module.exports" (#2620)
For CJS compat, the top-level `this` must be equal to `module.exports` (which must be equal to `exports`). This implementation changes the CJS parsers to call the wrapper `functor` using the context of `module.exports`. Fixed an unrelated "dynamic require" test so it does not use the CJS compat fixtures.
- Loading branch information
Showing
10 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/compartment-mapper/test/fixtures-cjs-compat/node_modules/app/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...partment-mapper/test/fixtures-cjs-compat/node_modules/exports-shenanigans/exports-this.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...ages/compartment-mapper/test/fixtures-dynamic/node_modules/static-app/README.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/compartment-mapper/test/fixtures-dynamic/node_modules/static-app/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
packages/compartment-mapper/test/fixtures-dynamic/node_modules/static-app/package.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+6 Bytes
(100%)
packages/compartment-mapper/test/snapshots/error-handling.test.js.snap
Binary file not shown.