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