@@ -1107,6 +1107,8 @@ The resolver can throw the following errors:
1107
1107
> 1. Throw an _Invalid Module Specifier_ error.
1108
1108
> 1. Let _packageSubpath_ be _" ." _ concatenated with the substring of
1109
1109
> _packageSpecifier_ from the position at the length of _packageName_.
1110
+ > 1. If _packageSubpath_ ends in _" /" _, then
1111
+ > 1. Throw an _Invalid Module Specifier_ error.
1110
1112
> 1. Let _selfUrl_ be the result of
1111
1113
> ** PACKAGE_SELF_RESOLVE ** (_packageName_, _packageSubpath_, _parentURL_).
1112
1114
> 1. If _selfUrl_ is not ** undefined ** , return _selfUrl_.
@@ -1118,18 +1120,15 @@ The resolver can throw the following errors:
1118
1120
> concatenated with _packageSpecifier_, relative to _parentURL_.
1119
1121
> 1. Set _parentURL_ to the parent folder URL of _parentURL_.
1120
1122
> 1. If the folder at _packageURL_ does not exist, then
1121
- > 1. Set _parentURL_ to the parent URL path of _parentURL_.
1122
1123
> 1. Continue the next loop iteration.
1123
1124
> 1. Let _pjson_ be the result of ** READ_PACKAGE_JSON ** (_packageURL_).
1124
1125
> 1. If _pjson_ is not ** null ** and _pjson_ ._exports_ is not ** null ** or
1125
1126
> ** undefined ** , then
1126
- > 1. Let _exports_ be _pjson .exports_ .
1127
1127
> 1. Return the result of ** PACKAGE_EXPORTS_RESOLVE ** (_packageURL_,
1128
1128
> _packageSubpath_, _pjson .exports_ , _defaultConditions_).
1129
1129
> 1. Otherwise, if _packageSubpath_ is equal to _" ." _, then
1130
- > 1. Return the result of applying the legacy ** LOAD_AS_DIRECTORY **
1131
- > CommonJS resolver to _packageURL_, throwing a _Module Not Found_
1132
- > error for no resolution.
1130
+ > 1. If _pjson .main_ is a string, then
1131
+ > 1. Return the URL resolution of _main_ in _packageURL_.
1133
1132
> 1. Otherwise,
1134
1133
> 1. Return the URL resolution of _packageSubpath_ in _packageURL_.
1135
1134
> 1. Throw a _Module Not Found_ error.
@@ -1150,8 +1149,6 @@ The resolver can throw the following errors:
1150
1149
1151
1150
** PACKAGE_EXPORTS_RESOLVE ** (_packageURL_, _subpath_, _exports_, _conditions_)
1152
1151
1153
- > 1. If _subpath_ ends in _" /" _, then
1154
- > 1. Throw an _Invalid Module Specifier_ error.
1155
1152
> 1. If _exports_ is an Object with both a key starting with _" ." _ and a key not
1156
1153
> starting with _" ." _, throw an _Invalid Package Configuration_ error.
1157
1154
> 1. If _subpath_ is equal to _" ." _, then
@@ -1177,8 +1174,7 @@ The resolver can throw the following errors:
1177
1174
** PACKAGE_IMPORTS_RESOLVE ** (_specifier_, _parentURL_, _conditions_)
1178
1175
1179
1176
> 1. Assert: _specifier_ begins with _" #" _.
1180
- > 1. If _specifier_ is exactly equal to _" #" _, starts with _" #/" _, or ends in
1181
- > _" /" _, then
1177
+ > 1. If _specifier_ is exactly equal to _" #" _ or starts with _" #/" _, then
1182
1178
> 1. Throw an _Invalid Module Specifier_ error.
1183
1179
> 1. Let _packageURL_ be the result of ** READ_PACKAGE_SCOPE ** (_parentURL_).
1184
1180
> 1. If _packageURL_ is not ** null ** , then
@@ -1192,7 +1188,6 @@ The resolver can throw the following errors:
1192
1188
** PACKAGE_IMPORTS_EXPORTS_RESOLVE ** (_matchKey_, _matchObj_, _packageURL_,
1193
1189
_isImports_, _conditions_)
1194
1190
1195
- > 1. Assert: _matchKey_ does not end in _" /" _.
1196
1191
> 1. If _matchKey_ is a key of _matchObj_ and does not contain _" *" _, then
1197
1192
> 1. Let _target_ be the value of _matchObj_\[_matchKey_\].
1198
1193
> 1. Return the result of ** PACKAGE_TARGET_RESOLVE ** (_packageURL_, _target_,
0 commit comments