@@ -840,14 +840,12 @@ The resolver can throw the following errors:
840840> 1. Throw an _Invalid Module Specifier_ error.
841841> 7. Let _packageSubpath_ be _"."_ concatenated with the substring of
842842> _packageSpecifier_ from the position at the length of _packageName_.
843- > 8. If _packageSubpath_ ends in _"/"_, then
844- > 1. Throw an _Invalid Module Specifier_ error.
845- > 9. Let _selfUrl_ be the result of
843+ > 8. Let _selfUrl_ be the result of
846844> **PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_).
847- > 10 . If _selfUrl_ is not **undefined**, return _selfUrl_.
848- > 11 . While _parentURL_ is not the file system root,
845+ > 9 . If _selfUrl_ is not **undefined**, return _selfUrl_.
846+ > 10 . While _parentURL_ is not the file system root,
849847> 1. Let _packageURL_ be the URL resolution of _"node\_ modules/"_
850- > concatenated with _packageSpecifier_ , relative to _parentURL_.
848+ > concatenated with _packageName_ , relative to _parentURL_.
851849> 2. Set _parentURL_ to the parent folder URL of _parentURL_.
852850> 3. If the folder at _packageURL_ does not exist, then
853851> 1. Continue the next loop iteration.
@@ -861,7 +859,7 @@ The resolver can throw the following errors:
861859> 1. Return the URL resolution of _main_ in _packageURL_.
862860> 7. Otherwise,
863861> 1. Return the URL resolution of _packageSubpath_ in _packageURL_.
864- > 12 . Throw a _Module Not Found_ error.
862+ > 11 . Throw a _Module Not Found_ error.
865863
866864**PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_)
867865
@@ -879,6 +877,8 @@ The resolver can throw the following errors:
879877
880878**PACKAGE\_ EXPORTS\_ RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
881879
880+ Note: This function is directly invoked by the CommonJS resolution algorithm.
881+
882882> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
883883> starting with _"."_, throw an _Invalid Package Configuration_ error.
884884> 2. If _subpath_ is equal to _"."_, then
@@ -902,6 +902,8 @@ The resolver can throw the following errors:
902902
903903**PACKAGE\_ IMPORTS\_ RESOLVE**(_specifier_, _parentURL_, _conditions_)
904904
905+ Note: This function is directly invoked by the CommonJS resolution algorithm.
906+
905907> 1. Assert: _specifier_ begins with _"#"_.
906908> 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then
907909> 1. Throw an _Invalid Module Specifier_ error.
@@ -918,14 +920,16 @@ The resolver can throw the following errors:
918920**PACKAGE\_ IMPORTS\_ EXPORTS\_ RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
919921_isImports_, _conditions_)
920922
921- > 1. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
923+ > 1. If _matchKey_ ends in _"/"_, then
924+ > 1. Throw an _Invalid Module Specifier_ error.
925+ > 2. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
922926> 1. Let _target_ be the value of _matchObj_\[ _matchKey_].
923927> 2. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
924928> _target_, **null**, _isImports_, _conditions_).
925- > 2 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
929+ > 3 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
926930> single _"\* "_, sorted by the sorting function **PATTERN\_ KEY\_ COMPARE**
927931> which orders in descending order of specificity.
928- > 3 . For each key _expansionKey_ in _expansionKeys_, do
932+ > 4 . For each key _expansionKey_ in _expansionKeys_, do
929933> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding
930934> the first _"\* "_ character.
931935> 2. If _matchKey_ starts with but is not equal to _patternBase_, then
@@ -940,7 +944,7 @@ _isImports_, _conditions_)
940944> _matchKey_ minus the length of _patternTrailer_.
941945> 3. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
942946> _target_, _patternMatch_, _isImports_, _conditions_).
943- > 4 . Return **null**.
947+ > 5 . Return **null**.
944948
945949**PATTERN\_ KEY\_ COMPARE**(_keyA_, _keyB_)
946950
0 commit comments