You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
But based on the implementation it seems to still be requiring NumberFormat to be an instance:
function formatToParts(value = undefined) {
let internal = this !== null && typeof this === 'object' && getInternalProperties(this);
if (!internal || !internal['[[initializedNumberFormat]]'])
throw new TypeError('`this` value for formatToParts() is not an initialized Intl.NumberFormat object.');
let x = Number(value);
return FormatNumberToParts(this, x);
}
I haven't dug into the issue yet, but I can attest to the fact that all users visiting my sites on Mobile Safari 12.1 and 12.1.2 are failing to have formatToParts correctly polyfilled.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm putting some pieces together so please forgive me if I'm just misreading things. I have the following polyfill code:
In iOS Safari 11 and 12 (where this is clearly being polyfilled) I get the following error:
"TypeError:
this
value for formatToParts() is not an initialized Intl.NumberFormat object."It looks as if here: tc39/ecma402#122 the prototype for
NumberFormat
was changed from being an instance ofNumberFormat
to being a plain object. And that is documented here: https://tc39.es/proposal-unified-intl-numberformat/section11/numberformat_proposed_out.html#sec-properties-of-intl-numberformat-prototype-object.But based on the implementation it seems to still be requiring
NumberFormat
to be an instance:And this is the spec being referenced for the
Intl.NumberFormat.prototype
from your documentation: http://www.ecma-international.org/ecma-402/1.0/#sec-11.3.Or am I just doing something wrong here?
The text was updated successfully, but these errors were encountered: