Polyfill Uint8ClampedArray using core-js

https://github.com/zloirock/core-js
This commit is contained in:
Jonas Jenwald 2017-08-14 15:55:54 +02:00
parent e49dfe4ed7
commit be36c60e0f
3 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,7 @@
"babel-loader": "^6.4.0", "babel-loader": "^6.4.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
"core-js": "^2.5.0",
"escodegen": "^1.8.0", "escodegen": "^1.8.0",
"eslint": "^4.2.0", "eslint": "^4.2.0",
"eslint-plugin-mozilla": "^0.4.0", "eslint-plugin-mozilla": "^0.4.0",

View File

@ -53,6 +53,12 @@ PDFJS.compatibilityChecked = true;
// Checking if the typed arrays are supported // Checking if the typed arrays are supported
// Support: iOS<6.0 (subarray), IE<10, Android<4.0 // Support: iOS<6.0 (subarray), IE<10, Android<4.0
(function checkTypedArrayCompatibility() { (function checkTypedArrayCompatibility() {
if (typeof Uint8ClampedArray === 'undefined') {
// Support: IE<11
globalScope.Uint8ClampedArray =
require('core-js/fn/typed/uint8-clamped-array');
}
if (typeof Uint8Array !== 'undefined') { if (typeof Uint8Array !== 'undefined') {
// Support: iOS<6.0 // Support: iOS<6.0
if (typeof Uint8Array.prototype.subarray === 'undefined') { if (typeof Uint8Array.prototype.subarray === 'undefined') {

View File

@ -50,6 +50,7 @@
'pdfjs-web': new URL('web', baseLocation).href, 'pdfjs-web': new URL('web', baseLocation).href,
'pdfjs-test': new URL('test', baseLocation).href, 'pdfjs-test': new URL('test', baseLocation).href,
'pdfjs-lib': new URL('src/pdf', baseLocation).href, 'pdfjs-lib': new URL('src/pdf', baseLocation).href,
'core-js': new URL('node_modules/core-js', baseLocation).href,
}, },
meta: { meta: {
'*': { '*': {