Skip to content

Commit

Permalink
Fix typo in ScopeHoisting.md (#9794)
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadapc authored Jun 14, 2024
1 parent 7728c2e commit 5b72a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Scopehoisting.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Core (so symbol propagation and `getSymbolResolution`) rely on the following con

- `dependency.symbols` is a map of import names (= which binding was imported) to the local name (= the identifier that the imported binding got replaced by, e.g. `$id$import$bar`). The whole namespace can be imported by using `*` as the import name. A dependency with a `* -> *` mapping corresponds to `export * from`.

All CommonJS assets have a `* -> $id$exports` symbol, which serves as a fallback when importing a symbol that is not explicitly listed. This is also what prevents symbol propagation from throwing a `some-commonjs.js does not export foo` error, as this can't be done reliably for CommonJS assets (e.g. assets can be added from outside the asset).
All CommonJS assets have a `* -> $id$exports` symbol, which serves as a fallback when importing a symbol that is not explicitly listed. This is also what prevents symbol propagation from throwing a `some-commonjs.js does not export foo` error, as this can't be done reliably for CommonJS assets (e.g. symbols can be added from outside the asset by writing to the module object).

`module.exports = ...;` or some other non-statically analyzable syntax like accessing `module` freely causes the asset to have a `*`.

Expand Down

0 comments on commit 5b72a26

Please sign in to comment.