@@ -840,14 +840,12 @@ The resolver can throw the following errors:
840
840
> 1. Throw an _Invalid Module Specifier_ error.
841
841
> 7. Let _packageSubpath_ be _"."_ concatenated with the substring of
842
842
> _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
846
844
> **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,
849
847
> 1. Let _packageURL_ be the URL resolution of _"node\_ modules/"_
850
- > concatenated with _packageSpecifier_ , relative to _parentURL_.
848
+ > concatenated with _packageName_ , relative to _parentURL_.
851
849
> 2. Set _parentURL_ to the parent folder URL of _parentURL_.
852
850
> 3. If the folder at _packageURL_ does not exist, then
853
851
> 1. Continue the next loop iteration.
@@ -861,7 +859,7 @@ The resolver can throw the following errors:
861
859
> 1. Return the URL resolution of _main_ in _packageURL_.
862
860
> 7. Otherwise,
863
861
> 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.
865
863
866
864
**PACKAGE\_ SELF\_ RESOLVE**(_packageName_, _packageSubpath_, _parentURL_)
867
865
@@ -879,6 +877,8 @@ The resolver can throw the following errors:
879
877
880
878
**PACKAGE\_ EXPORTS\_ RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_)
881
879
880
+ Note: This function is directly invoked by the CommonJS resolution algorithm.
881
+
882
882
> 1. If _exports_ is an Object with both a key starting with _"."_ and a key not
883
883
> starting with _"."_, throw an _Invalid Package Configuration_ error.
884
884
> 2. If _subpath_ is equal to _"."_, then
@@ -902,6 +902,8 @@ The resolver can throw the following errors:
902
902
903
903
**PACKAGE\_ IMPORTS\_ RESOLVE**(_specifier_, _parentURL_, _conditions_)
904
904
905
+ Note: This function is directly invoked by the CommonJS resolution algorithm.
906
+
905
907
> 1. Assert: _specifier_ begins with _"#"_.
906
908
> 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then
907
909
> 1. Throw an _Invalid Module Specifier_ error.
@@ -918,14 +920,16 @@ The resolver can throw the following errors:
918
920
**PACKAGE\_ IMPORTS\_ EXPORTS\_ RESOLVE**(_matchKey_, _matchObj_, _packageURL_,
919
921
_isImports_, _conditions_)
920
922
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
922
926
> 1. Let _target_ be the value of _matchObj_\[ _matchKey_].
923
927
> 2. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
924
928
> _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
926
930
> single _"\* "_, sorted by the sorting function **PATTERN\_ KEY\_ COMPARE**
927
931
> 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
929
933
> 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding
930
934
> the first _"\* "_ character.
931
935
> 2. If _matchKey_ starts with but is not equal to _patternBase_, then
@@ -940,7 +944,7 @@ _isImports_, _conditions_)
940
944
> _matchKey_ minus the length of _patternTrailer_.
941
945
> 3. Return the result of **PACKAGE\_ TARGET\_ RESOLVE**(_packageURL_,
942
946
> _target_, _patternMatch_, _isImports_, _conditions_).
943
- > 4 . Return **null**.
947
+ > 5 . Return **null**.
944
948
945
949
**PATTERN\_ KEY\_ COMPARE**(_keyA_, _keyB_)
946
950
0 commit comments