@@ -861,14 +861,12 @@ The resolver can throw the following errors:
861861> 1. Throw an _Invalid Module Specifier_ error.
862862> 7. Let _packageSubpath_ be _"."_ concatenated with the substring of
863863> _packageSpecifier_ from the position at the length of _packageName_.
864- > 8. If _packageSubpath_ ends in _"/"_, then
865- > 1. Throw an _Invalid Module Specifier_ error.
866- > 9. Let _selfUrl_ be the result of
864+ > 8. Let _selfUrl_ be the result of
867865> **PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_).
868- > 10 . If _selfUrl_ is not **undefined**, return _selfUrl_.
869- > 11 . While _parentURL_ is not the file system root,
866+ > 9 . If _selfUrl_ is not **undefined**, return _selfUrl_.
867+ > 10 . While _parentURL_ is not the file system root,
870868> 1. Let _packageURL_ be the URL resolution of _"node\_ modules/"_
871- > concatenated with _packageSpecifier_ , relative to _parentURL_.
869+ > concatenated with _packageName_ , relative to _parentURL_.
872870> 2. Set _parentURL_ to the parent folder URL of _parentURL_.
873871> 3. If the folder at _packageURL_ does not exist, then
874872> 1. Continue the next loop iteration.
@@ -882,7 +880,7 @@ The resolver can throw the following errors:
882880> 1. Return the URL resolution of _main_ in _packageURL_.
883881> 7. Otherwise,
884882> 1. Return the URL resolution of _packageSubpath_ in _packageURL_.
885- > 12 . Throw a _Module Not Found_ error.
883+ > 11 . Throw a _Module Not Found_ error.
886884
887885**PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_)
888886
@@ -900,6 +898,8 @@ The resolver can throw the following errors:
900898
901899**PACKAGE\_ EXPORTS\_ RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
902900
901+ Note: This function is directly invoked by the CommonJS resolution algorithm.
902+
903903> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
904904> starting with _"."_, throw an _Invalid Package Configuration_ error.
905905> 2. If _subpath_ is equal to _"."_, then
@@ -923,6 +923,8 @@ The resolver can throw the following errors:
923923
924924**PACKAGE\_ IMPORTS\_ RESOLVE**(_specifier_, _parentURL_, _conditions_)
925925
926+ Note: This function is directly invoked by the CommonJS resolution algorithm.
927+
926928> 1. Assert: _specifier_ begins with _"#"_.
927929> 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then
928930> 1. Throw an _Invalid Module Specifier_ error.
@@ -939,14 +941,16 @@ The resolver can throw the following errors:
939941**PACKAGE\_ IMPORTS\_ EXPORTS\_ RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
940942_isImports_, _conditions_)
941943
942- > 1. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
944+ > 1. If _matchKey_ ends in _"/"_, then
945+ > 1. Throw an _Invalid Module Specifier_ error.
946+ > 2. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
943947> 1. Let _target_ be the value of _matchObj_\[ _matchKey_].
944948> 2. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
945949> _target_, **null**, _isImports_, _conditions_).
946- > 2 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
950+ > 3 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
947951> single _"\* "_, sorted by the sorting function **PATTERN\_ KEY\_ COMPARE**
948952> which orders in descending order of specificity.
949- > 3 . For each key _expansionKey_ in _expansionKeys_, do
953+ > 4 . For each key _expansionKey_ in _expansionKeys_, do
950954> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding
951955> the first _"\* "_ character.
952956> 2. If _matchKey_ starts with but is not equal to _patternBase_, then
@@ -961,7 +965,7 @@ _isImports_, _conditions_)
961965> _matchKey_ minus the length of _patternTrailer_.
962966> 3. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
963967> _target_, _patternMatch_, _isImports_, _conditions_).
964- > 4 . Return **null**.
968+ > 5 . Return **null**.
965969
966970**PATTERN\_ KEY\_ COMPARE**(_keyA_, _keyB_)
967971
0 commit comments