From 1b5d500bdb10f88c1fd697faddc8dfc83ec2b33d Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 30 Jun 2020 17:36:28 +0300 Subject: [PATCH] [all] add missed resources --- apps/common/main/lib/util/fix-ie-compat.js | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apps/common/main/lib/util/fix-ie-compat.js diff --git a/apps/common/main/lib/util/fix-ie-compat.js b/apps/common/main/lib/util/fix-ie-compat.js new file mode 100644 index 000000000..e56227d2f --- /dev/null +++ b/apps/common/main/lib/util/fix-ie-compat.js @@ -0,0 +1,34 @@ + +if ( !window.fetch ) { + var element = document.createElement('script'); + element['src'] = '../../../vendor/fetch/fetch.umd.js'; + document.getElementsByTagName('head')[0].appendChild(element); + + if ( !window.Promise ) { + element = document.createElement('script'); + element['src'] = '../../../vendor/es6-promise/es6-promise.auto.min.js'; + document.getElementsByTagName('head')[0].appendChild(element); + } + + if (typeof Object.assign != 'function') { + Object.assign = function(target) { + 'use strict'; + if (target == null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + target = Object(target); + for (var index = 1; index < arguments.length; index++) { + var source = arguments[index]; + if (source != null) { + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + } + return target; + }; + } +}