Skip to content

lib: make getCallSites sourceMap option truly optional #57388

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

Closed
wants to merge 1 commit into 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.

@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.21%. Comparing base (3329efe) to head (a314316).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #57388   +/-   ##
=======================================
  Coverage   90.20%   90.21%           
=======================================
  Files         629      629           
  Lines      184948   184952    +4     
  Branches    36204    36215   +11     
=======================================
+ Hits       166837   166859   +22     
+ Misses      11057    11036   -21     
- Partials     7054     7057    +3     
Files with missing lines Coverage Δ
lib/util.js 97.73% <100.00%> (+0.01%) ⬆️

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

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

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.
@jasnell jasnell force-pushed the jasnell/getcallsites-sourcemap branch from f38af26 to a314316 Compare March 13, 2025 18:20
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

jasnell added a commit that referenced this pull request Mar 14, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
@jasnell
Copy link
Member Author

jasnell commented Mar 14, 2025

Landed in c0788f0

@jasnell jasnell closed this Mar 14, 2025
aduh95 pushed a commit that referenced this pull request Mar 18, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 1, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 1, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Apr 8, 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 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.

PR-URL: nodejs#57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 14, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 14, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
aduh95 pushed a commit that referenced this pull request Apr 14, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
aduh95 pushed a commit that referenced this pull request Apr 14, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
aduh95 pushed a commit that referenced this pull request Apr 15, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
RafaelGSS pushed a commit that referenced this pull request Apr 16, 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 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.

PR-URL: #57388
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
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.

8 participants