@@ -1129,7 +1129,7 @@ The resolver can throw the following errors:
1129
1129
1130
1130
** PACKAGE \_SELF \_RESOLVE ** (_packageName_, _packageSubpath_, _parentURL_)
1131
1131
1132
- > 1. Let _packageURL_ be the result of ** READ \_PACKAGE \_SCOPE ** (_parentURL_).
1132
+ > 1. Let _packageURL_ be the result of ** LOOKUP \_PACKAGE \_SCOPE ** (_parentURL_).
1133
1133
> 2. If _packageURL_ is ** null ** , then
1134
1134
> 1. Return ** undefined ** .
1135
1135
> 3. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_packageURL_).
@@ -1173,7 +1173,7 @@ The resolver can throw the following errors:
1173
1173
> 1. Assert: _specifier_ begins with _" #" _.
1174
1174
> 2. If _specifier_ is exactly equal to _" #" _ or starts with _" #/" _, then
1175
1175
> 1. Throw an _Invalid Module Specifier_ error.
1176
- > 3. Let _packageURL_ be the result of ** READ \_PACKAGE \_SCOPE ** (_parentURL_).
1176
+ > 3. Let _packageURL_ be the result of ** LOOKUP \_PACKAGE \_SCOPE ** (_parentURL_).
1177
1177
> 4. If _packageURL_ is not ** null ** , then
1178
1178
> 1. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_packageURL_).
1179
1179
> 2. If _pjson .imports_ is a non- null Object , then
@@ -1304,29 +1304,31 @@ _internal_, _conditions_)
1304
1304
** ESM \_FILE \_FORMAT ** (_url_)
1305
1305
1306
1306
> 1. Assert: _url_ corresponds to an existing file.
1307
- > 2. Let _pjson_ be the result of ** READ \_PACKAGE \_SCOPE ** (_url_).
1308
- > 3. If _url_ ends in _" .mjs" _, then
1307
+ > 2. If _url_ ends in _" .mjs" _, then
1309
1308
> 1. Return _" module" _.
1310
- > 4 . If _url_ ends in _" .cjs" _, then
1309
+ > 3 . If _url_ ends in _" .cjs" _, then
1311
1310
> 1. Return _" commonjs" _.
1312
- > 5 . If _url_ ends in _" .json" _, then
1311
+ > 4 . If _url_ ends in _" .json" _, then
1313
1312
> 1. Return _" json" _.
1314
- > 6. If _pjson? .type_ exists and is _" module" _, then
1313
+ > 5. Let _packageURL_ be the result of ** LOOKUP \_PACKAGE \_SCOPE ** (_url_).
1314
+ > 6. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_packageURL_).
1315
+ > 7. If _pjson? .type_ exists and is _" module" _, then
1315
1316
> 1. If _url_ ends in _" .js" _, then
1316
1317
> 1. Return _" module" _.
1317
1318
> 2. Throw an _Unsupported File Extension_ error.
1318
- > 7 . Otherwise,
1319
+ > 8 . Otherwise,
1319
1320
> 1. Throw an _Unsupported File Extension_ error.
1320
1321
1321
- ** READ \_PACKAGE \_SCOPE ** (_url_)
1322
+ ** LOOKUP \_PACKAGE \_SCOPE ** (_url_)
1322
1323
1323
1324
> 1. Let _scopeURL_ be _url_.
1324
1325
> 2. While _scopeURL_ is not the file system root,
1325
1326
> 1. Set _scopeURL_ to the parent URL of _scopeURL_.
1326
1327
> 2. If _scopeURL_ ends in a _" node\_ modules" _ path segment, return ** null ** .
1327
- > 3. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_scopeURL_).
1328
- > 4. If _pjson_ is not ** null ** , then
1329
- > 1. Return _pjson_.
1328
+ > 3. Let _pjsonURL_ be the resolution of _" package.json" _ within
1329
+ > _packageURL_.
1330
+ > 4. if the file at _pjsonURL_ exists, then
1331
+ > 1. Return _scopeURL_.
1330
1332
> 3. Return ** null ** .
1331
1333
1332
1334
** READ \_PACKAGE \_JSON ** (_packageURL_)
0 commit comments