| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e8d4a31 commit 2c4f894
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -861,14 +861,12 @@ The resolver can throw the following errors: | |||
| 861 | 861 | > 1. Throw an _Invalid Module Specifier_ error. | |
| 862 | 862 | > 7. Let _packageSubpath_ be _"."_ concatenated with the substring of | |
| 863 | 863 | > _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 | ||
| 867 | 865 | > **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, | ||
| 870 | 868 | > 1. Let _packageURL_ be the URL resolution of _"node\_modules/"_ | |
| 871 | - > concatenated with _packageSpecifier_, relative to _parentURL_. | ||
| 869 | + > concatenated with _packageName_, relative to _parentURL_. | ||
| 872 | 870 | > 2. Set _parentURL_ to the parent folder URL of _parentURL_. | |
| 873 | 871 | > 3. If the folder at _packageURL_ does not exist, then | |
| 874 | 872 | > 1. Continue the next loop iteration. | |
@@ -882,7 +880,7 @@ The resolver can throw the following errors: | |||
| 882 | 880 | > 1. Return the URL resolution of _main_ in _packageURL_. | |
| 883 | 881 | > 7. Otherwise, | |
| 884 | 882 | > 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. | ||
| 886 | 884 | ||
| 887 | 885 | **PACKAGE\_SELF\_RESOLVE**(_packageName_, _packageSubpath_, _parentURL_) | |
| 888 | 886 | ||
@@ -900,6 +898,8 @@ The resolver can throw the following errors: | |||
| 900 | 898 | ||
| 901 | 899 | **PACKAGE\_EXPORTS\_RESOLVE**(_packageURL_, _subpath_, _exports_, _conditions_) | |
| 902 | 900 | ||
| 901 | + Note: This function is directly invoked by the CommonJS resolution algorithm. | ||
| 902 | + | ||
| 903 | 903 | > 1. If _exports_ is an Object with both a key starting with _"."_ and a key not | |
| 904 | 904 | > starting with _"."_, throw an _Invalid Package Configuration_ error. | |
| 905 | 905 | > 2. If _subpath_ is equal to _"."_, then | |
@@ -923,6 +923,8 @@ The resolver can throw the following errors: | |||
| 923 | 923 | ||
| 924 | 924 | **PACKAGE\_IMPORTS\_RESOLVE**(_specifier_, _parentURL_, _conditions_) | |
| 925 | 925 | ||
| 926 | + Note: This function is directly invoked by the CommonJS resolution algorithm. | ||
| 927 | + | ||
| 926 | 928 | > 1. Assert: _specifier_ begins with _"#"_. | |
| 927 | 929 | > 2. If _specifier_ is exactly equal to _"#"_ or starts with _"#/"_, then | |
| 928 | 930 | > 1. Throw an _Invalid Module Specifier_ error. | |
@@ -939,14 +941,16 @@ The resolver can throw the following errors: | |||
| 939 | 941 | **PACKAGE\_IMPORTS\_EXPORTS\_RESOLVE**(_matchKey_, _matchObj_, _packageURL_, | |
| 940 | 942 | _isImports_, _conditions_) | |
| 941 | 943 | ||
| 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 | ||
| 943 | 947 | > 1. Let _target_ be the value of _matchObj_\[_matchKey_]. | |
| 944 | 948 | > 2. Return the result of **PACKAGE\_TARGET\_RESOLVE**(_packageURL_, | |
| 945 | 949 | > _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 | ||
| 947 | 951 | > single _"\*"_, sorted by the sorting function **PATTERN\_KEY\_COMPARE** | |
| 948 | 952 | > 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 | ||
| 950 | 954 | > 1. Let _patternBase_ be the substring of _expansionKey_ up to but excluding | |
| 951 | 955 | > the first _"\*"_ character. | |
| 952 | 956 | > 2. If _matchKey_ starts with but is not equal to _patternBase_, then | |
@@ -961,7 +965,7 @@ _isImports_, _conditions_) | |||
| 961 | 965 | > _matchKey_ minus the length of _patternTrailer_. | |
| 962 | 966 | > 3. Return the result of **PACKAGE\_TARGET\_RESOLVE**(_packageURL_, | |
| 963 | 967 | > _target_, _patternMatch_, _isImports_, _conditions_). | |
| 964 | - > 4. Return **null**. | ||
| 968 | + > 5. Return **null**. | ||
| 965 | 969 | ||
| 966 | 970 | **PATTERN\_KEY\_COMPARE**(_keyA_, _keyB_) | |
| 967 | 971 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -342,7 +342,7 @@ require(X) from module at path Y | |||
| 342 | 342 | b. STOP | |
| 343 | 343 | 2. If X begins with '/' | |
| 344 | 344 | a. set Y to the file system root | |
| 345 | - 3. If X begins with './' or '/' or '../' | ||
| 345 | + 3. If X is equal to '.', or X begins with './', '/' or '../' | ||
| 346 | 346 | a. LOAD_AS_FILE(Y + X) | |
| 347 | 347 | b. LOAD_AS_DIRECTORY(Y + X) | |
| 348 | 348 | c. THROW "not found" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments