Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs(lib): add @throws JSDoc for BigInt methods and constructor #61653

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Joseph-Martre
Copy link
Contributor

@Joseph-Martre Joseph-Martre commented May 4, 2025

Adds @throws JSDoc documentation to the BigInt constructor and methods to clarify their potential error behavior.
This helps developers better understand the runtime exceptions these methods may produce, and improves IDE support/documentation.

Related to #43528

Alignment with TypeScript Design Goals:

  • (2) Provide a structuring mechanism for larger pieces of code.
  • (10) Be a cross-platform development tool.

Test Criteria

This PR only introduces documentation changes in .d.ts files.
It does not affect runtime behavior or type system behavior, and therefore does not require test cases.

Note: Technically, BigInt.prototype.toString can throw a TypeError if the value of this is not a BigInt, such as in BigInt.prototype.toString.call(nonBigIntValue, radix). However, this case is not included in the JSDoc. Adding TypeError documentation for such misuse across prototype methods would introduce noise with limited practical benefit. This behavior is already well understood by developers using .call/.apply patterns on object prototype methods.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 4, 2025
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog May 4, 2025
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@Joseph-Martre
Copy link
Contributor Author

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Related to #43528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

2 participants