Skip to content
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

formatRangeToParts produces an empty source when FormatApproximately is used #104

Closed
trflynn89 opened this issue Jul 27, 2022 · 2 comments
Closed

Comments

@trflynn89
Copy link
Contributor

If Intl.NumberFormat.prototype.formatRangeToParts is provided approximately equivalent values, PartitionNumberRangePattern will return early by way of FormatApproximately. However, FormatApproximately does not set the [[Source]] internal slot for the approximatelySign or any of the partitions in the result vector. FormatNumericRangeToParts then blindly adds a source property to the object it returns.

In our implementation over at SerenityOS's LibJS, this currently results in an empty string:

> new Intl.NumberFormat().formatRangeToParts(1, 1)
[
    { "type": "approximatelySign", "value": "~", "source": "" },
    { "type": "integer", "value": "1", "source": "" }
]

Should [[Source]] be set (maybe to "shared") in FormatApproximately?

@sffc
Copy link
Collaborator

sffc commented Jul 27, 2022

Yes it should. Duplicate of #63

@sffc sffc closed this as completed Jul 27, 2022
@trflynn89
Copy link
Contributor Author

Oops! Looked through the open issues and missed that one, thanks!

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

No branches or pull requests

2 participants