@@ -700,15 +700,17 @@ _isMain_ is **true** when resolving the Node.js application entry point.
700
700
> 1. Throw an _Invalid Specifier_ error.
701
701
> 1. Set _packageName_ to the substring of _packageSpecifier_
702
702
> until the second _"/"_ separator or the end of the string.
703
- > 1. Let _packageSubpath_ be the substring of _packageSpecifier_ from the
704
- > position at the length of _packageName_ plus one, if any.
705
- > 1. Assert: _packageName_ is a valid package name or scoped package name.
706
- > 1. Assert: _packageSubpath_ is either empty, or a path without a leading
707
- > separator.
703
+ > 1. If _packageName_ starts with _"."_ or contains _"\\ "_ or _"%"_, then
704
+ > 1. Throw an _Invalid Specifier_ error.
705
+ > 1. Let _packageSubpath_ be _undefined_.
706
+ > 1. If the length of _packageSpecifier_ is greater than the length of
707
+ > _packageName_, then
708
+ > 1. Set _packageSubpath_ to _"."_ concatenated with the substring of
709
+ > _packageSpecifier_ from the position at the length of _packageName_.
708
710
> 1. If _packageSubpath_ contains any _"."_ or _".."_ segments or percent
709
711
> encoded strings for _"/"_ or _"\\ "_ then,
710
712
> 1. Throw an _Invalid Specifier_ error.
711
- > 1. If _packageSubpath_ is empty and _packageName_ is a Node.js builtin
713
+ > 1. If _packageSubpath_ is _undefined_ and _packageName_ is a Node.js builtin
712
714
> module, then
713
715
> 1. Return the string _"node:"_ concatenated with _packageSpecifier_.
714
716
> 1. While _parentURL_ is not the file system root,
@@ -719,16 +721,16 @@ _isMain_ is **true** when resolving the Node.js application entry point.
719
721
> 1. Set _parentURL_ to the parent URL path of _parentURL_.
720
722
> 1. Continue the next loop iteration.
721
723
> 1. Let _pjson_ be the result of **READ_PACKAGE_JSON**(_packageURL_).
722
- > 1. If _packageSubpath_ is empty , then
724
+ > 1. If _packageSubpath_ is _undefined__ , then
723
725
> 1. Return the result of **PACKAGE_MAIN_RESOLVE**(_packageURL_,
724
726
> _pjson_).
725
727
> 1. Otherwise,
726
728
> 1. If _pjson_ is not **null** and _pjson_ has an _"exports"_ key, then
727
729
> 1. Let _exports_ be _pjson.exports_.
728
730
> 1. If _exports_ is not **null** or **undefined**, then
729
731
> 1. Return **PACKAGE_EXPORTS_RESOLVE**(_packageURL_,
730
- > _packagePath_ , _pjson.exports_).
731
- > 1. Return the URL resolution of _packagePath_ in _packageURL_.
732
+ > _packageSubpath_ , _pjson.exports_).
733
+ > 1. Return the URL resolution of _packageSubpath_ in _packageURL_.
732
734
> 1. Throw a _Module Not Found_ error.
733
735
734
736
**PACKAGE_MAIN_RESOLVE**(_packageURL_, _pjson_)
0 commit comments