add benchmark#4
Merged
Merged
Conversation
Member
Author
|
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
Member
Author
CodSpeed Performance ReportCongrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Boshen
added a commit
that referenced
this pull request
Jul 2, 2026
) The "return the last array entry's error" branch in `package_target_resolve` was dead code: `i` comes from `enumerate()`, so `i == targets.len()` could never be true. Errors from array entries were always swallowed like `undefined`, so an invalid target in the last fallback entry surfaced as a generic `PackagePathNotExported` instead of the specific error — despite the comment right below claiming "Return or throw the last fallback resolution null return or error". This fixes the off-by-one (`i + 1 == targets.len()`) so the last entry's error now propagates, matching the documented intent and Node's `lastException` behavior for arrays. One deliberate exemption: `ResolveError::NotFound` still falls through. It only arises from re-resolving a bare `imports` target (e.g. `\"#a\": [{\"import\": [\"#b/import.js\"]}]`) through the module system, and enhanced-resolve treats an unresolvable candidate there as a soft failure, not a hard error — the ported "Direct and conditional mapping #4" test pins that behavior. Node would actually throw immediately on any non-`ERR_INVALID_PACKAGE_TARGET` error inside the array loop, which is stricter than enhanced-resolve; the exemption keeps us compatible with the latter. Adds two imports-field tests: an invalid target in the **last** array entry now errors (previously `Ok(None)`), and an invalid target in a **non-last** entry still falls through to the next entry. Split out of #1263.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.