mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Upgrade core-js
to version 3.2.1
This only required changing the import paths. The `es` folder contains all polyfills we need now. If we want to import everything, we need to explicitly require the `index` file.
This commit is contained in:
parent
3da680cdfc
commit
c71a291317
3 changed files with 30 additions and 22 deletions
|
@ -119,7 +119,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.startsWith) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/starts-with');
|
||||
require('core-js/es/string/starts-with');
|
||||
})();
|
||||
|
||||
// Provides support for String.prototype.endsWith in legacy browsers.
|
||||
|
@ -128,7 +128,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.endsWith) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/ends-with');
|
||||
require('core-js/es/string/ends-with');
|
||||
})();
|
||||
|
||||
// Provides support for String.prototype.includes in legacy browsers.
|
||||
|
@ -137,7 +137,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.includes) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/includes');
|
||||
require('core-js/es/string/includes');
|
||||
})();
|
||||
|
||||
// Provides support for Array.prototype.includes in legacy browsers.
|
||||
|
@ -146,7 +146,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Array.prototype.includes) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/array/includes');
|
||||
require('core-js/es/array/includes');
|
||||
})();
|
||||
|
||||
// Provides support for Array.from in legacy browsers.
|
||||
|
@ -155,7 +155,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Array.from) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/array/from');
|
||||
require('core-js/es/array/from');
|
||||
})();
|
||||
|
||||
// Provides support for Object.assign in legacy browsers.
|
||||
|
@ -164,7 +164,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Object.assign) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/object/assign');
|
||||
require('core-js/es/object/assign');
|
||||
})();
|
||||
|
||||
// Provides support for Math.log2 in legacy browsers.
|
||||
|
@ -173,7 +173,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Math.log2) {
|
||||
return;
|
||||
}
|
||||
Math.log2 = require('core-js/fn/math/log2');
|
||||
Math.log2 = require('core-js/es/math/log2');
|
||||
})();
|
||||
|
||||
// Provides support for Number.isNaN in legacy browsers.
|
||||
|
@ -182,7 +182,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Number.isNaN) {
|
||||
return;
|
||||
}
|
||||
Number.isNaN = require('core-js/fn/number/is-nan');
|
||||
Number.isNaN = require('core-js/es/number/is-nan');
|
||||
})();
|
||||
|
||||
// Provides support for Number.isInteger in legacy browsers.
|
||||
|
@ -191,7 +191,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Number.isInteger) {
|
||||
return;
|
||||
}
|
||||
Number.isInteger = require('core-js/fn/number/is-integer');
|
||||
Number.isInteger = require('core-js/es/number/is-integer');
|
||||
})();
|
||||
|
||||
// Support: IE, Safari<11, Chrome<63
|
||||
|
@ -205,7 +205,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
globalScope.Promise.prototype.finally)) {
|
||||
return;
|
||||
}
|
||||
globalScope.Promise = require('core-js/fn/promise');
|
||||
globalScope.Promise = require('core-js/es/promise/index');
|
||||
})();
|
||||
|
||||
// Support: IE<11, Safari<8, Chrome<36
|
||||
|
@ -213,7 +213,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (globalScope.WeakMap) {
|
||||
return;
|
||||
}
|
||||
globalScope.WeakMap = require('core-js/fn/weak-map');
|
||||
globalScope.WeakMap = require('core-js/es/weak-map/index');
|
||||
})();
|
||||
|
||||
// Support: IE11
|
||||
|
@ -221,7 +221,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (globalScope.WeakSet) {
|
||||
return;
|
||||
}
|
||||
globalScope.WeakSet = require('core-js/fn/weak-set');
|
||||
globalScope.WeakSet = require('core-js/es/weak-set/index');
|
||||
})();
|
||||
|
||||
// Provides support for String.codePointAt in legacy browsers.
|
||||
|
@ -230,7 +230,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.codePointAt) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/code-point-at');
|
||||
require('core-js/es/string/code-point-at');
|
||||
})();
|
||||
|
||||
// Provides support for String.fromCodePoint in legacy browsers.
|
||||
|
@ -239,7 +239,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.fromCodePoint) {
|
||||
return;
|
||||
}
|
||||
String.fromCodePoint = require('core-js/fn/string/from-code-point');
|
||||
String.fromCodePoint = require('core-js/es/string/from-code-point');
|
||||
})();
|
||||
|
||||
// Support: IE
|
||||
|
@ -247,7 +247,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (globalScope.Symbol) {
|
||||
return;
|
||||
}
|
||||
require('core-js/es6/symbol');
|
||||
require('core-js/es/symbol/index');
|
||||
})();
|
||||
|
||||
// Provides support for String.prototype.padStart in legacy browsers.
|
||||
|
@ -256,7 +256,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.padStart) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/pad-start');
|
||||
require('core-js/es/string/pad-start');
|
||||
})();
|
||||
|
||||
// Provides support for String.prototype.padEnd in legacy browsers.
|
||||
|
@ -265,7 +265,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (String.prototype.padEnd) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/string/pad-end');
|
||||
require('core-js/es/string/pad-end');
|
||||
})();
|
||||
|
||||
// Provides support for Object.values in legacy browsers.
|
||||
|
@ -274,7 +274,7 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
|||
if (Object.values) {
|
||||
return;
|
||||
}
|
||||
Object.values = require('core-js/fn/object/values');
|
||||
Object.values = require('core-js/es/object/values');
|
||||
})();
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue