tc39 / tc39/proposal-amount

`BigInt(new Amount(bigint))` roundtrip.

Open
#45 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
58
Forks
12
Avg merge
2h 35m
Merged PRs (30d)
2

Description

BigInt(value) currently calls value[Symbol.toPrimitive]("number").

If that remains it means an amount created from a bigint could lose data if it was passed to BigInt.

Ideas:

  • This is OK
  • Throw if BigInt() is passed an amount
  • Get a bigint similar to Amount.prototype.toBigInt()

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked ECMAScript BigInt constructor specification and examine how it handles an Amount created from a bigint. Compare the three proposed outcomes—allowing the conversion, throwing, or exposing a bigint conversion—with the existing Amount.prototype.toBigInt() behavior. Done means choosing and documenting one consistent conversion rule.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.