tc39 / tc39/proposal-amount

Document and decide on arithmetic toPrimitive footguns

Open
#71 1 comment 2 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

We should better document the consequences of toPrimitive and consider how it impacts call sites such as

new Amount(5) + 5
new Amount(5) * 5
new Amount(5)++

We may want to reconsider whether any of these are too surprising.

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 by reviewing the issue's discussion of toPrimitive and the listed call sites: addition, multiplication, and post-increment. Done means documenting their consequences and reaching a decision about whether any behavior is too surprising.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
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.