removed all unecessary polifys

This commit is contained in:
vitorsemeano 2019-02-27 00:10:31 +00:00
parent 9ad29733bf
commit 32d9a1549d
5 changed files with 0 additions and 126 deletions

View File

@ -1,25 +0,0 @@
if (!Array.prototype.filter) {
Array.prototype.filter = function (fun /*, thisp*/) {
"use strict";
if (this == null)
throw new TypeError();
var t = Object(this);
var len = t.length >>> 0;
if (typeof fun != "function")
throw new TypeError();
var res = [];
var thisp = arguments[1];
for (var i = 0; i < len; i++) {
if (i in t) {
var val = t[i]; // in case fun mutates this
if (fun.call(thisp, val, i, t))
res.push(val);
}
}
return res;
};
}

View File

@ -1,27 +0,0 @@
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () { },
fBound = function () {
return fToBind.apply(this instanceof fNOP
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
if (this.prototype) {
// Function.prototype doesn't have a prototype property
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}

View File

@ -1,23 +0,0 @@
if (typeof Object.assign != 'function') {
(function () {
Object.assign = function (target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== undefined && source !== null) {
for (var nextKey in source) {
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}

View File

@ -1,31 +0,0 @@
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function () {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame']
|| window[vendors[x] + 'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function (callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function () { callback(currTime + timeToCall); },
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function (id) {
clearTimeout(id);
};
}());

View File

@ -491,22 +491,6 @@ var AppInfo = {};
promises.push(require(["fetch"]));
}
if ("function" != typeof Object.assign) {
promises.push(require(["objectassign"]));
}
if (!Array.prototype.filter) {
promises.push(require(["arraypolyfills"]));
}
if (!Function.prototype.bind) {
promises.push(require(["functionbind"]));
}
if (!window.requestAnimationFrame) {
promises.push(require(["raf"]));
}
Promise.all(promises).then(function () {
createConnectionManager().then(function () {
console.log("initAfterDependencies promises resolved");
@ -867,10 +851,6 @@ var AppInfo = {};
define("dashboardcss", ["css!css/dashboard"], returnFirstDependency);
define("slideshow", [componentsPath + "/slideshow/slideshow"], returnFirstDependency);
define("fetch", [bowerPath + "/fetch/fetch"], returnFirstDependency);
define("raf", [componentsPath + "/polyfills/raf"], returnFirstDependency);
define("functionbind", [componentsPath + "/polyfills/bind"], returnFirstDependency);
define("arraypolyfills", [componentsPath + "/polyfills/array"], returnFirstDependency);
define("objectassign", [componentsPath + "/polyfills/objectassign"], returnFirstDependency);
define("clearButtonStyle", ["css!" + componentsPath + "/clearbutton"], returnFirstDependency);
define("userdataButtons", [componentsPath + "/userdatabuttons/userdatabuttons"], returnFirstDependency);
define("emby-playstatebutton", [componentsPath + "/userdatabuttons/emby-playstatebutton"], returnFirstDependency);