Updating shims for constrained environments (#944, #993).

This commit is contained in:
Richard Moore 2020-08-27 14:23:23 -04:00
parent 8abdbbbf63
commit 240aac5683
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651
2 changed files with 88 additions and 92 deletions

@ -103,6 +103,8 @@
(function (global){
'use strict';
(function() {
var shims = [];
// Shim String.prototype.normalize
@ -151,12 +153,6 @@ if (!global.btoa) {
global.btoa = base64.btoa;
}
// Shim Promise
// @TODO: Check first?
//if (window.Promise == null) {
// var promise = require('./es6-promise.auto.js');
//}
// Shim ArrayBuffer.isView
if (!ArrayBuffer.isView) {
shims.push("ArrayBuffer.isView");
@ -188,7 +184,6 @@ if (!global.crypto.getRandomValues) {
// Shim FileReader.readAsArrayBuffer
// https://github.com/facebook/react-native/issues/21209
(function() {
try {
var fr = new FileReader();
try {
@ -217,7 +212,6 @@ if (!global.crypto.getRandomValues) {
} catch (error) {
console.log("Missing FileReader; unsupported platform");
}
})();
if (shims.length) {
console.log("Shims Injected:");
@ -226,6 +220,8 @@ if (shims.length) {
}
}
})();

File diff suppressed because one or more lines are too long