]> git.proxmox.com Git - mirror_novnc.git/blobdiff - core/util/polyfill.js
Remove many small, obsolete, old browser hacks
[mirror_novnc.git] / core / util / polyfill.js
index 0e458c8606badc5adfc4ac713dcc5029867866bf..78715a8ae5ceb1f5a4926139f026367c1a0580bd 100644 (file)
@@ -6,37 +6,6 @@
 
 /* Polyfills to provide new APIs in old browsers */
 
-/* Object.assign() (taken from MDN) */
-if (typeof Object.assign != 'function') {
-    // Must be writable: true, enumerable: false, configurable: true
-    Object.defineProperty(Object, "assign", {
-        value: function assign(target, varArgs) { // .length of function is 2
-            'use strict';
-            if (target == null) { // TypeError if undefined or null
-                throw new TypeError('Cannot convert undefined or null to object');
-            }
-
-            const to = Object(target);
-
-            for (let index = 1; index < arguments.length; index++) {
-                const nextSource = arguments[index];
-
-                if (nextSource != null) { // Skip over if undefined or null
-                    for (let nextKey in nextSource) {
-                        // Avoid bugs when hasOwnProperty is shadowed
-                        if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
-                            to[nextKey] = nextSource[nextKey];
-                        }
-                    }
-                }
-            }
-            return to;
-        },
-        writable: true,
-        configurable: true
-    });
-}
-
 /* CustomEvent constructor (taken from MDN) */
 (() => {
     function CustomEvent(event, params) {
@@ -52,10 +21,3 @@ if (typeof Object.assign != 'function') {
         window.CustomEvent = CustomEvent;
     }
 })();
-
-/* Number.isInteger() (taken from MDN) */
-Number.isInteger = Number.isInteger || function isInteger(value) {
-    return typeof value === 'number' &&
-      isFinite(value) &&
-      Math.floor(value) === value;
-};