@@ -1137,7 +1137,7 @@ The resolver can throw the following errors:
1137
1137
1138
1138
** PACKAGE \_SELF \_RESOLVE ** (_packageName_, _packageSubpath_, _parentURL_)
1139
1139
1140
- > 1. Let _packageURL_ be the result of ** READ \_PACKAGE \_SCOPE ** (_parentURL_).
1140
+ > 1. Let _packageURL_ be the result of ** LOOKUP \_PACKAGE \_SCOPE ** (_parentURL_).
1141
1141
> 2. If _packageURL_ is ** null ** , then
1142
1142
> 1. Return ** undefined ** .
1143
1143
> 3. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_packageURL_).
@@ -1178,7 +1178,7 @@ The resolver can throw the following errors:
1178
1178
> 1. Assert: _specifier_ begins with _" #" _.
1179
1179
> 2. If _specifier_ is exactly equal to _" #" _ or starts with _" #/" _, then
1180
1180
> 1. Throw an _Invalid Module Specifier_ error.
1181
- > 3. Let _packageURL_ be the result of ** READ \_PACKAGE \_SCOPE ** (_parentURL_).
1181
+ > 3. Let _packageURL_ be the result of ** LOOKUP \_PACKAGE \_SCOPE ** (_parentURL_).
1182
1182
> 4. If _packageURL_ is not ** null ** , then
1183
1183
> 1. Let _pjson_ be the result of ** READ \_PACKAGE \_JSON ** (_packageURL_).
1184
1184
> 2. If _pjson .imports_ is a non- null Object , then
@@ -1291,29 +1291,31 @@ _internal_, _conditions_)
1291
1291
**ESM\_FILE\_FORMAT**(_url_)
1292
1292
1293
1293
> 1. Assert: _url_ corresponds to an existing file.
1294
- > 2. Let _pjson_ be the result of **READ\_PACKAGE\_SCOPE**(_url_).
1295
- > 3. If _url_ ends in _".mjs"_, then
1294
+ > 2. If _url_ ends in _".mjs"_, then
1296
1295
> 1. Return _"module"_.
1297
- > 4 . If _url_ ends in _".cjs"_, then
1296
+ > 3 . If _url_ ends in _".cjs"_, then
1298
1297
> 1. Return _"commonjs"_.
1299
- > 5 . If _url_ ends in _".json"_, then
1298
+ > 4 . If _url_ ends in _".json"_, then
1300
1299
> 1. Return _"json"_.
1301
- > 6. If _pjson?.type_ exists and is _"module"_, then
1300
+ > 5. Let _packageURL_ be the result of **LOOKUP\_PACKAGE\_SCOPE**(_url_).
1301
+ > 6. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_packageURL_).
1302
+ > 7. If _pjson?.type_ exists and is _"module"_, then
1302
1303
> 1. If _url_ ends in _".js"_, then
1303
1304
> 1. Return _"module"_.
1304
1305
> 2. Throw an _Unsupported File Extension_ error.
1305
- > 7 . Otherwise,
1306
+ > 8 . Otherwise,
1306
1307
> 1. Throw an _Unsupported File Extension_ error.
1307
1308
1308
- **READ \_PACKAGE\_SCOPE**(_url_)
1309
+ **LOOKUP \_PACKAGE\_SCOPE**(_url_)
1309
1310
1310
1311
> 1. Let _scopeURL_ be _url_.
1311
1312
> 2. While _scopeURL_ is not the file system root,
1312
1313
> 1. Set _scopeURL_ to the parent URL of _scopeURL_.
1313
1314
> 2. If _scopeURL_ ends in a _"node\_modules"_ path segment, return **null**.
1314
- > 3. Let _pjson_ be the result of **READ\_PACKAGE\_JSON**(_scopeURL_).
1315
- > 4. If _pjson_ is not **null**, then
1316
- > 1. Return _pjson_.
1315
+ > 3. Let _pjsonURL_ be the resolution of _"package.json"_ within
1316
+ > _packageURL_.
1317
+ > 4. if the file at _pjsonURL_ exists, then
1318
+ > 1. Return _scopeURL_.
1317
1319
> 3. Return **null**.
1318
1320
1319
1321
**READ\_PACKAGE\_JSON**(_packageURL_)
0 commit comments