Files
shinyobjectz 917bc94f59 Intl on QuickJS: a composition that formats a number works on Windows and Linux (#169)
QuickJS has no Intl, so toLocaleString or Intl.NumberFormat threw "Intl is not defined" off a Mac. FormatJS's polyfills
(MIT) and the CLDR data they carry (Unicode-3.0) are packed in runtime/jsengine/js/intl.pack (2.2 MB, deflate; js/intl
build.ts, versions pinned), and js/intl/loader.js runs the core the first time anything reads Intl or calls a toLocale*
method, and a locale's data the first time something asks for it, so a script that never formats pays nothing. A small
Collator (letters, then accents, then case) backs localeCompare. quickjs_formats_as_javascriptcore_does: fourteen cases
give JavaScriptCore's answers, and on a Mac it asks JavaScriptCore too. Apple builds are unchanged.
2026-11-19 14:30:17 -08:00

17 lines
1.0 KiB
JavaScript

// Generated into ../intl.pack by build.ts: the Intl QuickJS lacks, FormatJS's polyfills (MIT, LICENSE-FormatJS.md)
// in the order each needs the one before, with English's data and the common time zones. Every other locale's data is
// its own chunk in the pack, run the first time a script asks for that locale (loader.js).
import "@formatjs/intl-getcanonicallocales/polyfill.js";
import "@formatjs/intl-locale/polyfill.js";
import "@formatjs/intl-pluralrules/polyfill.js";
import "@formatjs/intl-pluralrules/locale-data/en.js";
import "@formatjs/intl-numberformat/polyfill.js";
import "@formatjs/intl-numberformat/locale-data/en.js";
import "@formatjs/intl-datetimeformat/polyfill.js";
import "@formatjs/intl-datetimeformat/locale-data/en.js";
import "@formatjs/intl-datetimeformat/add-golden-tz.js";
import "@formatjs/intl-relativetimeformat/polyfill.js";
import "@formatjs/intl-relativetimeformat/locale-data/en.js";
import "@formatjs/intl-listformat/polyfill.js";
import "@formatjs/intl-listformat/locale-data/en.js";