tame-intl: tolerate missing Intl
MODIFY
src/bundle/tame-intl.js
src/bundle/tame-intl.js
@@ -5,9 +5,13 @@ export default function tameIntl() {
// of side-channels, but we want things to be deterministic across
// runtimes. Best bet is to just disallow calling these functions without
// an explicit locale name.
+
+ // the whitelist may have deleted Intl entirely, so tolerate that
+ if (typeof Intl !== 'undefined') {
Intl.DateTimeFormat = () => { throw Error("disabled"); };
Intl.NumberFormat = () => { throw Error("disabled"); };
Intl.getCanonicalLocales = () => { throw Error("disabled"); };
+ }
Object.prototype.toLocaleString = () => {
throw new Error('toLocaleString suppressed');
};

tame-intl: tolerate missing Intl