Skip to content

Conversation

@jessealama
Copy link
Collaborator

Here we make ToIntlMathematicalValue act essentially like parseFloat, which allows it to handle an initial numeric string optionally followed by text like [kg] or [meter-per-second]. It's not specific to the format we have in mind for marking numeric strings with a unit.

@jessealama jessealama linked an issue Nov 12, 2025 that may be closed by this pull request
@jessealama jessealama requested a review from eemeli November 12, 2025 18:27
@github-actions
Copy link

github-actions bot commented Nov 12, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://tc39.github.io/proposal-amount/pr-preview/pr-73/

Built to branch gh-pages at 2025-11-13 10:04 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

intl.emu Outdated
1. Perform ? RequireInternalSlot(_O_, [[Decimal128Data]]).
1. Perform ? RequireInternalSlot(_O_, [[Value]]).
1. Let _amountUnit_ be _O_.[[Unit]].
1. Let _optionsUnit_ be _options_.[[unit]].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is reading an internal slot?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated things so that we no longer refer to an internal slot and, if necessary, create a fresh copy of options rather than potentially modifying it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adapting ToIntlMathematicalValue to not read internal slots

3 participants