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

Issue with "Intl.NumberFormat() constructor": (narrowSymbol not supported on Safari) #9319

Closed
cgarrovillo opened this issue Mar 1, 2021 · 7 comments
Assignees
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript

Comments

@cgarrovillo
Copy link

MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat

What information was incorrect, unhelpful, or incomplete?

The incompatibility table does not warn that narrowSymbol is not a valid option for Intl.NumberFormat

Specific section or headline?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#browser_compatibility

What did you expect to see?

A warning for narrowSymbol incompatibility

Did you test this? If so, how?

Visited the website

MDN Content page report details
@sideshowbarker
Copy link
Collaborator

Do you have a test case that demonstrates the problem?

narrowSymbol can’t be used directly as a key/parameter-name in the options object you give to the Intl.NumberFormat() constructor, right? Instead narrowSymbol is a possible value for the currencyDisplay option — like this:

new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', currencyDisplay: 'narrowSymbol' }).format(3500)

The relevant Test262 test at https://test262.report/browse/intl402/NumberFormat/currencyDisplay-unit.js shows OK for JavaScriptCore for that test.

@cgarrovillo
Copy link
Author

I can drum up something end of day today. Not sure why test262 is reporting it that way.

@Ryuno-Ki
Copy link

Ryuno-Ki commented Mar 2, 2021

Preliminary assigned this issue to you, then, @cgarrovillo

@cgarrovillo
Copy link
Author

cgarrovillo commented Mar 3, 2021

image

https://github.com/cgarrovillo/MDN-Intl.NumberFormat/tree/main

I just realized I didnt format the unit_amount in the screenshot. But you can see the error regardless.

@sideshowbarker sideshowbarker transferred this issue from mdn/content Mar 3, 2021
@sideshowbarker
Copy link
Collaborator

OK, I’ve transferred this to the BCD repo, since that’s where we need to make a change.

@cgarrovillo Thanks yeah, using he https://github.com/cgarrovillo/MDN-Intl.NumberFormat/tree/main document, I’ve also reproduced this and confirmed in my environment that Safari 14 reports an error.

Interestingly, though, Safari Technology Preview (Release 119 (Safari 14.1, WebKit 16611.1.10.1)) doesn’t report an error. https://trac.webkit.org/changeset/266031/webkit shows that narrowSymbol support was added 2020-08-22. And Safari 14 was released less than a month later, 2020-09-16 — so the Safari 14 release branch was cut before this change went into the trunk.

So we should document this in BCD by marking the Safari support with partial_implementation and a note.

@cgarrovillo Do you want to take a shot at writing up patch/PR for that? (If not, I can do it.)

I guess one of us should also raise an issue at https://github.com/tc39/test262/issues

@cgarrovillo
Copy link
Author

I could raise this issue over at test262.

@queengooborg queengooborg added the data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Mar 6, 2021
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Mar 7, 2021
Code examination https://trac.webkit.org/changeset/266031/webkit
indicates that support for compactDisplay, currencySign, notation,
signDisplay, unit, unitDisplay, currencyDisplay: 'narrowSymbol', and
style: 'unit'" wasn’t added until 2020-08-22 — and didn’t make it into
Safari 14 (confirmed by testing), which was released 2020-09-16.

Fixes mdn#9319
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Mar 7, 2021
Code examination of https://trac.webkit.org/changeset/266031/webkit
indicates that support for compactDisplay, currencySign, notation,
signDisplay, unit, unitDisplay, currencyDisplay: 'narrowSymbol', and
style: 'unit'" wasn’t added until 2020-08-22 — and didn’t make it into
Safari 14 (confirmed by testing), which was released 2020-09-16.

Fixes mdn#9319
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Mar 7, 2021
Code examination of https://trac.webkit.org/changeset/266031/webkit
indicates that support for compactDisplay, currencySign, notation,
signDisplay, unit, unitDisplay, currencyDisplay: 'narrowSymbol', and
style: 'unit' wasn’t added until 2020-08-22 — and didn’t make it into
Safari 14 (confirmed by testing), which was released 2020-09-16.

Fixes mdn#9319
@sideshowbarker
Copy link
Collaborator

OK, I’ve opened #9371 with an update for this.

sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Mar 19, 2021
Code examination of https://trac.webkit.org/changeset/266031/webkit
indicates that support for currencyDisplay: 'narrowSymbol' wasn’t
added to WebKit until 2020-08-22 — and didn’t make it into Safari 14
(confirmed by testing), which was released 2020-09-16.

Fixes mdn#9319
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Mar 19, 2021
Code examination of https://trac.webkit.org/changeset/266031/webkit
indicates that support for currencyDisplay: 'narrowSymbol' wasn’t
added to WebKit until 2020-08-22 — and didn’t make it into Safari 14
(confirmed by testing), which was released 2020-09-16.

Fixes mdn#9319
@Elchi3 Elchi3 closed this as completed in 36ca80c Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

No branches or pull requests

4 participants