Caching URelativeDateTimeFormatter avoids creating new ones for every call to Intl.RelativeTimeFormatObject.prototype.format().
Adds caching for URelativeDateTimeFormatter to Intl.RelativeTimeFormat. I've also changed |intl_FormatRelativeTime()| to pass the Intl.RelativeTimeFormat's type from JS->C++, because that avoids a slow-ish C++->JS call when calling |GetInternalsObject()|. And I've changed some lines so they don't exceed the 99 chars per line limit.
Attachment #8947924 - Flags: review?(gandalf)
Comment on attachment 8947924 [details] [diff] [review] bug1435325.patch lgtm!
Attachment #8947924 - Flags: review?(gandalf) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/af6cc52c9b8b Cache URelativeDateTimeFormatter in Intl.RelativeTimeFormat. r=gandalf
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
status-firefox60: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.