mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Merge pull request #16408 from vector-im/jryans/regexp-dotall
Add RegExp dotAll feature test
This commit is contained in:
commit
2332cecb59
@ -45,14 +45,20 @@ function checkBrowserFeatures() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// custom checks atop Modernizr because it doesn't have ES2018/ES2019 checks in it for some features we depend on,
|
// Custom checks atop Modernizr because it doesn't have ES2018/ES2019 checks
|
||||||
// Modernizr requires rules to be lowercase with no punctuation:
|
// in it for some features we depend on.
|
||||||
// ES2018: http://www.ecma-international.org/ecma-262/9.0/#sec-promise.prototype.finally
|
// Modernizr requires rules to be lowercase with no punctuation.
|
||||||
|
// ES2018: http://262.ecma-international.org/9.0/#sec-promise.prototype.finally
|
||||||
window.Modernizr.addTest("promiseprototypefinally", () =>
|
window.Modernizr.addTest("promiseprototypefinally", () =>
|
||||||
window.Promise && window.Promise.prototype && typeof window.Promise.prototype.finally === "function");
|
typeof window.Promise?.prototype?.finally === "function");
|
||||||
// ES2019: http://www.ecma-international.org/ecma-262/10.0/#sec-object.fromentries
|
// ES2018: https://262.ecma-international.org/9.0/#sec-get-regexp.prototype.dotAll
|
||||||
|
window.Modernizr.addTest("regexpdotall", () => (
|
||||||
|
window.RegExp?.prototype &&
|
||||||
|
!!Object.getOwnPropertyDescriptor(window.RegExp.prototype, "dotAll")?.get
|
||||||
|
));
|
||||||
|
// ES2019: http://262.ecma-international.org/10.0/#sec-object.fromentries
|
||||||
window.Modernizr.addTest("objectfromentries", () =>
|
window.Modernizr.addTest("objectfromentries", () =>
|
||||||
window.Object && typeof window.Object.fromEntries === "function");
|
typeof window.Object?.fromEntries === "function");
|
||||||
|
|
||||||
const featureList = Object.keys(window.Modernizr);
|
const featureList = Object.keys(window.Modernizr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user