Merge pull request #27674 from robintown/emoji-false-positives
Add a Modernizr check for v mode regexes
This commit is contained in:
commit
4ffc77dfef
1 changed files with 7 additions and 2 deletions
|
@ -56,8 +56,8 @@ function checkBrowserFeatures(): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom checks atop Modernizr because it doesn't have ES2018/ES2019 checks
|
// Custom checks atop Modernizr because it doesn't have checks in it for
|
||||||
// in it for some features we depend on.
|
// some features we depend on.
|
||||||
// Modernizr requires rules to be lowercase with no punctuation.
|
// Modernizr requires rules to be lowercase with no punctuation.
|
||||||
// ES2018: http://262.ecma-international.org/9.0/#sec-promise.prototype.finally
|
// ES2018: http://262.ecma-international.org/9.0/#sec-promise.prototype.finally
|
||||||
window.Modernizr.addTest("promiseprototypefinally", () => typeof window.Promise?.prototype?.finally === "function");
|
window.Modernizr.addTest("promiseprototypefinally", () => typeof window.Promise?.prototype?.finally === "function");
|
||||||
|
@ -70,6 +70,11 @@ function checkBrowserFeatures(): boolean {
|
||||||
);
|
);
|
||||||
// ES2019: http://262.ecma-international.org/10.0/#sec-object.fromentries
|
// ES2019: http://262.ecma-international.org/10.0/#sec-object.fromentries
|
||||||
window.Modernizr.addTest("objectfromentries", () => typeof window.Object?.fromEntries === "function");
|
window.Modernizr.addTest("objectfromentries", () => typeof window.Object?.fromEntries === "function");
|
||||||
|
// ES2024: https://tc39.es/ecma262/2024/#sec-get-regexp.prototype.unicodesets
|
||||||
|
window.Modernizr.addTest(
|
||||||
|
"regexpunicodesets",
|
||||||
|
() => window.RegExp?.prototype && "unicodeSets" in window.RegExp.prototype,
|
||||||
|
);
|
||||||
|
|
||||||
const featureList = Object.keys(window.Modernizr) as Array<keyof ModernizrStatic>;
|
const featureList = Object.keys(window.Modernizr) as Array<keyof ModernizrStatic>;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue