Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: make getCallSites sourceMap option truly optional #57388

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Mar 9, 2025

When calling the util.getCallSites(...) API, if the options argument is omitted, then the options.sourceMap option is defaulted to false. However, if any empty options is passed, it would throw an error if sourceMap was not explicitly given. This relaxes that so that sourceMap can be left unspecified.

For instance, before this commit, getCallSites({}) would throw an error.

Also, add more test coverage of this.

When calling the `util.getCallSites(...)` API, if the `options`
argument is omitted, then the `options.sourceMap` option is defaulted
to false. However, if any empty `options` is passed, it would throw
an error is `sourceMap` was not explicitly given. This relaxes that
so that `sourceMap` can be left unspecified.

For instance, before this commit, `getCallSites({})` would throw an
error.

Also, add more test coverage of this.
@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 Mar 9, 2025
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.23%. Comparing base (9df0ff7) to head (0712421).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #57388   +/-   ##
=======================================
  Coverage   90.23%   90.23%           
=======================================
  Files         630      630           
  Lines      185200   185204    +4     
  Branches    36233    36238    +5     
=======================================
+ Hits       167108   167127   +19     
+ Misses      11056    11054    -2     
+ Partials     7036     7023   -13     
Files with missing lines Coverage Δ
lib/util.js 97.73% <100.00%> (+0.01%) ⬆️

... and 21 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.

@nodejs-github-bot
Copy link
Collaborator

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.

6 participants