File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ import CallHandler from 'matrix-react-sdk/src/CallHandler';
5454let lastLocationHashSet = null ;
5555
5656function checkBrowserFeatures ( featureList ) {
57+ // custom checks atop Modernizr because it doesn't have ES2018/ES2019 checks in it for some features we depend on:
58+ // ran prior to Modernizr so the missing features are logged even if Modernizr is broken
59+ // ES2018: http://www.ecma-international.org/ecma-262/9.0/#sec-promise.prototype.finally
60+ if ( typeof Promise . prototype . finally !== "function" ) {
61+ console . error ( "Browser missing feature: Promise.prototype.finally" ) ;
62+ featureComplete = false ;
63+ }
64+ // ES2019: http://www.ecma-international.org/ecma-262/10.0/#sec-object.fromentries
65+ if ( typeof Object . fromEntries !== "function" ) {
66+ console . error ( "Browser missing feature: Object.fromEntries" ) ;
67+ featureComplete = false ;
68+ }
69+
5770 if ( ! window . Modernizr ) {
5871 console . error ( "Cannot check features - Modernizr global is missing." ) ;
5972 return false ;
@@ -69,11 +82,11 @@ function checkBrowserFeatures(featureList) {
6982 }
7083 if ( window . Modernizr [ featureList [ i ] ] === false ) {
7184 console . error ( "Browser missing feature: '%s'" , featureList [ i ] ) ;
72- // toggle flag rather than return early so we log all missing features
73- // rather than just the first.
85+ // toggle flag rather than return early so we log all missing features rather than just the first.
7486 featureComplete = false ;
7587 }
7688 }
89+
7790 return featureComplete ;
7891}
7992
You can’t perform that action at this time.
0 commit comments