[RN] Support the for...of statement in lib-jitsi-meet

This commit is contained in:
Lyubo Marinov 2017-03-01 21:30:21 -06:00
parent 246cb39003
commit bd51613e62
2 changed files with 14 additions and 0 deletions

View File

@ -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",

View File

@ -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: