Skip to content

util: keep function name for mapped call sites - #65107

Open
lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-65104-callsite-function-name
Open

util: keep function name for mapped call sites#65107
lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-65104-callsite-function-name

Conversation

@lazerg

@lazerg lazerg commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

When getCallSites({ sourceMap: true }) remaps a frame, reconstructCallSite() uses entry.name ?? ''. The names array is optional in Source Map v3, so a map without a name for that position wipes out the function name V8 already gave us and functionName comes back empty.

Fall back to the generated call site's functionName instead, which is what the source-mapped stack trace formatter in lib/internal/source_map/prepare_stack_trace.js already does.

Fixes: #65104

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Aug 7, 2026
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
@lazerg
lazerg force-pushed the fix/issue-65104-callsite-function-name branch from 9e9d99b to 60488c9 Compare August 7, 2026 15:14
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.31%. Comparing base (e2d7b34) to head (60488c9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65107   +/-   ##
=======================================
  Coverage   90.31%   90.31%           
=======================================
  Files         759      759           
  Lines      248290   248290           
  Branches    46859    46853    -6     
=======================================
  Hits       224241   224241           
+ Misses      15472    15470    -2     
- Partials     8577     8579    +2     
Files with missing lines Coverage Δ
lib/util.js 100.00% <100.00%> (ø)

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lazerg

lazerg commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

The test-macOS failure is in test-stream-pipeline-http2 and test-debugger-exceptions. Both time out, both pass locally, and neither touches the code in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

util.getCallSites() drops functionName when a source map has no name entry

2 participants