Closed
Bug 1289340
Opened 8 years ago
Closed 8 years ago
Expose Intl.DateTimeFormat.prototype.formatToParts
Categories
(Core :: JavaScript: Internationalization API, enhancement)
Core
JavaScript: Internationalization API
Tracking
()
VERIFIED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | verified |
People
(Reporter: sebo, Assigned: zbraniecki)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
No description provided.
Reporter | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → gandalf
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
V8 added DateTimeFormat.prototype.formatToParts - https://bugs.chromium.org/p/v8/issues/detail?id=5244 and seems like the API is pretty much verified and frozen, with three implementations (Intl.js, Gecko and Chrome) passing test262 tests suite for it.
We should be ready to expose it to content.
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8790744 [details]
Bug 1289340 - Expose Intl.DateTimeFormat.prototype.formatToParts.
https://reviewboard.mozilla.org/r/78426/#review77040
The XXX bug you mention claims I'm module owner (which I am not), but IRC word is the staging for this is right, so I think we're good.
::: js/src/builtin/Intl.cpp:1819
(Diff revision 2)
> - RootedValue ftp(cx);
> + RootedValue ftp(cx);
> - HandlePropertyName name = cx->names().formatToParts;
> + HandlePropertyName name = cx->names().formatToParts;
> - if (!GlobalObject::getSelfHostedFunction(cx, cx->global(),
> + if (!GlobalObject::getSelfHostedFunction(cx, cx->global(),
> - cx->names().DateTimeFormatFormatToParts,
> + cx->names().DateTimeFormatFormatToParts,
> - name,
> + name,
> - 0, &ftp))
> + 0, &ftp))
It'd be better adding this to the JSFunctionSpec for DateTimeFormat instead of preserving this needed-for-conditionality code. But this gets the job done for now, and I can go back and fix it to be the idiomatic way at some later time.
Attachment #8790744 -
Flags: review?(jwalden+bmo) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 6•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/3f47a92541c8e445757683d0e3e21e6df5d1a0d2
Bug 1289340 - Expose Intl.DateTimeFormat.prototype.formatToParts. r=waldo
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Reporter | ||
Comment 8•8 years ago
|
||
Works for me as expected.
Updated the compatibility info:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts#Browser_compatibility
And the release notes:
https://developer.mozilla.org/en-US/Firefox/Releases/51?document_saved=true#JavaScript
Zibi, can you please verify that the docs are correct?
Sebastian
Assignee | ||
Comment 9•8 years ago
|
||
:sebo - sorry for late response. In the Specifications box the comments indicate that it's "Not yet part of the draft specification. ".
At this point it is merged into the ECMA 402 spec.
Also, V8/Chrome has it exposed behind --harmony flag - https://bugs.chromium.org/p/v8/issues/detail?id=5244
And since we're at it - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/getCanonicalLocales is already exposed in Chrome as well :)
Flags: needinfo?(gandalf)
Assignee | ||
Updated•8 years ago
|
Flags: needinfo?(sebastianzartner)
Reporter | ||
Comment 10•8 years ago
|
||
Added the compatibility information and removed the outdated spec. comment. Zibi, can you please verify them again?
Sebastian
Flags: needinfo?(sebastianzartner) → needinfo?(gandalf)
Reporter | ||
Comment 12•8 years ago
|
||
Perfect! Thanks for the prompt feedback!
Sebastian
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•