diff --git a/package.json b/package.json index 2bf61ba1b..37c09fece 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "async": "0.9.0", "autosize": "^1.18.13", "bootstrap": "3.1.1", + "es6-iterator": "2.0.0", "i18next": "7.0.0", "i18next-browser-languagedetector": "1.0.1", "i18next-xhr-backend": "1.3.0", diff --git a/react/features/base/lib-jitsi-meet/native/polyfills-browser.js b/react/features/base/lib-jitsi-meet/native/polyfills-browser.js index 903b82928..a2a80d567 100644 --- a/react/features/base/lib-jitsi-meet/native/polyfills-browser.js +++ b/react/features/base/lib-jitsi-meet/native/polyfills-browser.js @@ -1,3 +1,4 @@ +import Iterator from 'es6-iterator'; import BackgroundTimer from 'react-native-background-timer'; import 'url-polyfill'; // Polyfill for URL constructor @@ -98,6 +99,18 @@ function _visitNode(node, callback) { global.addEventListener = () => {}; } + // Array.prototype[@@iterator] + // + // Required by: + // - for...of statement use(s) in lib-jitsi-meet + const arrayPrototype = Array.prototype; + + if (typeof arrayPrototype['@@iterator'] === 'undefined') { + arrayPrototype['@@iterator'] = function() { + return new Iterator(this); + }; + } + // document // // Required by: