Adapting `ToIntlMathematicalValue` to not read internal slots
Nobody has claimed this yet.
- #73 by @jessealama — closed without merging
- Dominant language
- HTML
- Stars
- 58
- Forks
- 12
- Avg merge
- 2h 35m
- Merged PRs (30d)
- 2
Description
As it stands, the Amount proposal reads internal slots in calls to ToIntlMathematicalValue, which happens when we use Intl.NumberFormat to format an Amount. We thus end up consulting internal slots of an argument of a function, which is problematic for membrance transparency.
How shall we do this? I see two paths forward:
- Ensure that
ToIntlMathematicalValueends up working with a String version of the underlying Amount - Checking for
.fractionDigitsand.unitproperties (not internal slots)
(1) would work by changing step 1 ofToIntlMathematicalValue so that the call to ToNumber receive a ~string~ hint rather than a ~number~ hint. This aligns nicely with the work going on in proposal-intl-keep-trailing-zeros.
Option 2 also seems fine. It feels like it aligns well with how Intl.NF(.p.format) works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ToIntlMathematicalValue algorithm and the Amount proposal's Intl.NumberFormat integration described in the issue. Compare the string-hint and property-access approaches, including the proposal-intl-keep-trailing-zeros work; done means the chosen behavior is specified without consulting Amount internal slots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- internationalization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100