@@ -899,14 +899,12 @@ The resolver can throw the following errors:
899
899
> 1. Throw an _Invalid Module Specifier_ error.
900
900
> 7. Let _packageSubpath_ be _"."_ concatenated with the substring of
901
901
> _packageSpecifier_ from the position at the length of _packageName_.
902
- > 8. If _packageSubpath_ ends in _"/"_, then
903
- > 1. Throw an _Invalid Module Specifier_ error.
904
- > 9. Let _selfUrl_ be the result of
902
+ > 8. Let _selfUrl_ be the result of
905
903
> **PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_).
906
- > 10 . If _selfUrl_ is not **undefined**, return _selfUrl_.
907
- > 11 . While _parentURL_ is not the file system root,
904
+ > 9 . If _selfUrl_ is not **undefined**, return _selfUrl_.
905
+ > 10 . While _parentURL_ is not the file system root,
908
906
> 1. Let _packageURL_ be the URL resolution of _"node\_ modules/"_
909
- > concatenated with _packageSpecifier_ , relative to _parentURL_.
907
+ > concatenated with _packageName_ , relative to _parentURL_.
910
908
> 2. Set _parentURL_ to the parent folder URL of _parentURL_.
911
909
> 3. If the folder at _packageURL_ does not exist, then
912
910
> 1. Continue the next loop iteration.
@@ -920,7 +918,7 @@ The resolver can throw the following errors:
920
918
> 1. Return the URL resolution of _main_ in _packageURL_.
921
919
> 7. Otherwise,
922
920
> 1. Return the URL resolution of _packageSubpath_ in _packageURL_.
923
- > 12 . Throw a _Module Not Found_ error.
921
+ > 11 . Throw a _Module Not Found_ error.
924
922
925
923
**PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_)
926
924
@@ -938,6 +936,8 @@ The resolver can throw the following errors:
938
936
939
937
**PACKAGE\_ EXPORTS\_ RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
940
938
939
+ Note: This function is directly invoked by the CommonJS resolution algorithm.
940
+
941
941
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
942
942
> starting with _"."_, throw an _Invalid Package Configuration_ error.
943
943
> 2. If _subpath_ is equal to _"."_, then
@@ -961,6 +961,8 @@ The resolver can throw the following errors:
961
961
962
962
**PACKAGE\_ IMPORTS\_ RESOLVE**(_specifier_, _parentURL_, _conditions_)
963
963
964
+ Note: This function is directly invoked by the CommonJS resolution algorithm.
965
+
964
966
> 1. Assert: _specifier_ begins with _"#"_.
965
967
> 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then
966
968
> 1. Throw an _Invalid Module Specifier_ error.
@@ -977,14 +979,16 @@ The resolver can throw the following errors:
977
979
**PACKAGE\_ IMPORTS\_ EXPORTS\_ RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
978
980
_isImports_, _conditions_)
979
981
980
- > 1. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
982
+ > 1. If _matchKey_ ends in _"/"_, then
983
+ > 1. Throw an _Invalid Module Specifier_ error.
984
+ > 2. If _matchKey_ is a key of _matchObj_ and does not contain _"\* "_, then
981
985
> 1. Let _target_ be the value of _matchObj_\[ _matchKey_].
982
986
> 2. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
983
987
> _target_, **null**, _isImports_, _conditions_).
984
- > 2 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
988
+ > 3 . Let _expansionKeys_ be the list of keys of _matchObj_ containing only a
985
989
> single _"\* "_, sorted by the sorting function **PATTERN\_ KEY\_ COMPARE**
986
990
> which orders in descending order of specificity.
987
- > 3 . For each key _expansionKey_ in _expansionKeys_, do
991
+ > 4 . For each key _expansionKey_ in _expansionKeys_, do
988
992
> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding
989
993
> the first _"\* "_ character.
990
994
> 2. If _matchKey_ starts with but is not equal to _patternBase_, then
@@ -999,7 +1003,7 @@ _isImports_, _conditions_)
999
1003
> _matchKey_ minus the length of _patternTrailer_.
1000
1004
> 3. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
1001
1005
> _target_, _patternMatch_, _isImports_, _conditions_).
1002
- > 4 . Return **null**.
1006
+ > 5 . Return **null**.
1003
1007
1004
1008
**PATTERN\_ KEY\_ COMPARE**(_keyA_, _keyB_)
1005
1009
0 commit comments