Skip to content

Commit 0930be6

Browse files
chjjrichardlau
authored andcommittedMar 25, 2024
doc: fix some errors in esm resolution algorithms
PR-URL: #50898 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 6375540 commit 0930be6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎doc/api/esm.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,9 @@ The resolver can throw the following errors:
933933
> 2. If _resolved_ is not **null** or **undefined**, return _resolved_.
934934
> 3. Otherwise, if _exports_ is an Object and all keys of _exports_ start with
935935
> _"."_, then
936-
> 1. Let _matchKey_ be the string _"./"_ concatenated with _subpath_.
936+
> 1. Assert: _subpath_ begins with _"./"_.
937937
> 2. Let _resolved_ be the result of **PACKAGE\_IMPORTS\_EXPORTS\_RESOLVE**(
938-
> _matchKey_, _exports_, _packageURL_, **false**, _conditions_).
938+
> _subpath_, _exports_, _packageURL_, **false**, _conditions_).
939939
> 3. If _resolved_ is not **null** or **undefined**, return _resolved_.
940940
> 4. Throw a _Package Path Not Exported_ error.
941941
@@ -1015,7 +1015,7 @@ _isImports_, _conditions_)
10151015
> Package Target_ error.
10161016
> 3. Let _resolvedTarget_ be the URL resolution of the concatenation of
10171017
> _packageURL_ and _target_.
1018-
> 4. Assert: _resolvedTarget_ is contained in _packageURL_.
1018+
> 4. Assert: _packageURL_ is contained in _resolvedTarget_.
10191019
> 5. If _patternMatch_ is **null**, then
10201020
> 1. Return _resolvedTarget_.
10211021
> 6. If _patternMatch_ split on _"/"_ or _"\\"_ contains any _""_, _"."_,
@@ -1024,7 +1024,7 @@ _isImports_, _conditions_)
10241024
> 7. Return the URL resolution of _resolvedTarget_ with every instance of
10251025
> _"\*"_ replaced with _patternMatch_.
10261026
> 2. Otherwise, if _target_ is a non-null Object, then
1027-
> 1. If _exports_ contains any index property keys, as defined in ECMA-262
1027+
> 1. If _target_ contains any index property keys, as defined in ECMA-262
10281028
> [6.1.7 Array Index][], throw an _Invalid Package Configuration_ error.
10291029
> 2. For each property _p_ of _target_, in object insertion order as,
10301030
> 1. If _p_ equals _"default"_ or _conditions_ contains an entry for _p_,

0 commit comments

Comments
 (0)
Please sign in to comment.