Expose Intl.NumberFormat.prototype.formatToParts

RESOLVED FIXED in Firefox 58

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: zbraniecki, Assigned: zbraniecki)

Tracking

({dev-doc-complete})

unspecified
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

Attachments

(1 attachment)

Intl.NumberFormat.prototype.formatToParts reached Stage 4 at today's TC39 meeting. We can expose it now to the public! :)
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attachment #8912816 - Flags: review?(andrebargull)
Andre, can you take a look? The proposal reached Stage 4 so I'd like to expose it soon.

Also, it would help a lot with our tooling if you could pick a `[:abargull]` or similar nick for bugzilla and MR when requesting reviews from you ;)

Comment 3

2 years ago
mozreview-review
Comment on attachment 8912816 [details]
Bug 1403319 - Expose Intl.NumberFormat.prototype.formatToParts.

https://reviewboard.mozilla.org/r/184124/#review189698

We should now be able to run all NumberFormat.formatToParts tests from test262, so these exclusions should be removed <http://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/js/src/tests/jstests.list#363-368>, too.

::: js/src/builtin/Intl.cpp
(Diff revision 1)
> -    // enabled, also add it.
> -    if (cx->compartment()->creationOptions().experimentalNumberFormatFormatToPartsEnabled()) {
> -        RootedValue ftp(cx);
> -        HandlePropertyName name = cx->names().formatToParts;
> -        if (!GlobalObject::getSelfHostedFunction(cx, cx->global(),
> -                                                 cx->names().NumberFormatFormatToParts,

Looks like `NumberFormatFormatToParts` and `formatToParts` can both now also be removed from vm/CommonPropertyNames.h.

::: js/src/tests/Intl/NumberFormat/formatToParts.js:1
(Diff revision 1)
> -// |reftest| skip-if(!this.hasOwnProperty("Intl")||typeof(newGlobal)!=="function"||!newGlobal({experimentalNumberFormatFormatToPartsEnabled:true}).Intl.NumberFormat().formatToParts)
> +// |reftest| skip-if(!this.hasOwnProperty("Intl")||typeof(newGlobal)!=="function")

`typeof(newGlobal)!=="function"` can also be removed now.
Attachment #8912816 - Flags: review?(andrebargull) → review+
(In reply to André Bargull [:anba] from comment #3)
> We should now be able to run all NumberFormat.formatToParts tests from
> test262, so these exclusions should be removed
> <http://searchfox.org/mozilla-central/rev/
> f54c1723befe6bcc7229f005217d5c681128fcad/js/src/tests/jstests.list#363-368>,
> too.

Well, except for this one test which still expects Intl.NumberFormat.prototype.formatToParts.length is 0 instead of 1 <http://searchfox.org/mozilla-central/rev/f54c1723befe6bcc7229f005217d5c681128fcad/js/src/tests/test262/intl402/NumberFormat/prototype/formatToParts/length.js#9>. :-)
Thanks Andre! Submitted a PR to test262 for the length issue https://github.com/tc39/test262/pull/1249

I'll keep it skipped for now and once we merge updated test262 we can reenable it.
Comment hidden (mozreview-request)

Comment 7

2 years ago
Pushed by zbraniecki@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/353baf72f789
Expose Intl.NumberFormat.prototype.formatToParts. r=anba

Comment 8

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/353baf72f789
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.