Skip to content

Commit

Permalink
Merge pull request #27766 from element-hq/dbkr/comment_intl_check
Browse files Browse the repository at this point in the history
Add comment on why we're adding a custom check
  • Loading branch information
dbkr authored Jul 17, 2024
2 parents dd68593 + a32aca4 commit 419f37b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ function checkBrowserFeatures(): boolean {
() => window.RegExp?.prototype && "unicodeSets" in window.RegExp.prototype,
);
// ES2024: https://402.ecma-international.org/9.0/#sec-intl.segmenter
// The built-in modernizer 'intl' check only checks for the presence of the Intl object, not the Segmenter,
// and older Firefox has the former but not the latter, so we add our own.
window.Modernizr.addTest("intlsegmenter", () => typeof window.Intl?.Segmenter === "function");

const featureList = Object.keys(window.Modernizr) as Array<keyof ModernizrStatic>;
Expand Down

0 comments on commit 419f37b

Please sign in to comment.