Replace Util.extendObj
by Object.assign
This commit is contained in:
parent
0e0fa489dd
commit
af8e88d00b
@ -13,9 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
ImageKind, OPS, Util
|
||||
} from '../shared/util';
|
||||
import { ImageKind, OPS } from '../shared/util';
|
||||
|
||||
var QueueOptimizer = (function QueueOptimizerClosure() {
|
||||
function addState(parentState, pattern, checkFn, iterateFn, processFn) {
|
||||
@ -612,7 +610,7 @@ var OperatorList = (function OperatorListClosure() {
|
||||
},
|
||||
|
||||
addOpList(opList) {
|
||||
Util.extendObj(this.dependencies, opList.dependencies);
|
||||
Object.assign(this.dependencies, opList.dependencies);
|
||||
for (var i = 0, ii = opList.length; i < ii; i++) {
|
||||
this.addOp(opList.fnArray[i], opList.argsArray[i]);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import {
|
||||
assert, createPromiseCapability, getVerbosityLevel, info, InvalidPDFException,
|
||||
isArrayBuffer, isSameOrigin, MissingPDFException, NativeImageDecoding,
|
||||
PasswordException, setVerbosityLevel, shadow, stringToBytes,
|
||||
UnexpectedResponseException, UnknownErrorException, unreachable, Util, warn
|
||||
UnexpectedResponseException, UnknownErrorException, unreachable, warn
|
||||
} from '../shared/util';
|
||||
import {
|
||||
DOMCanvasFactory, DOMCMapReaderFactory, DummyStatTimer, loadScript,
|
||||
@ -1074,7 +1074,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
|
||||
resolve(textContent);
|
||||
return;
|
||||
}
|
||||
Util.extendObj(textContent.styles, value.styles);
|
||||
Object.assign(textContent.styles, value.styles);
|
||||
textContent.items.push(...value.items);
|
||||
pump();
|
||||
}, reject);
|
||||
|
@ -578,10 +578,9 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
||||
return;
|
||||
}
|
||||
|
||||
Util.extendObj(styleCache, value.styles);
|
||||
Object.assign(styleCache, value.styles);
|
||||
this._processItems(value.items, styleCache);
|
||||
pump();
|
||||
|
||||
}, capability.reject);
|
||||
};
|
||||
|
||||
|
@ -109,6 +109,15 @@ const hasDOM = typeof window === 'object' && typeof document === 'object';
|
||||
require('core-js/fn/array/includes');
|
||||
})();
|
||||
|
||||
// Provides support for Object.assign in legacy browsers.
|
||||
// Support: IE
|
||||
(function checkObjectAssign() {
|
||||
if (Object.assign) {
|
||||
return;
|
||||
}
|
||||
require('core-js/fn/object/assign');
|
||||
})();
|
||||
|
||||
// Provides support for Math.log2 in legacy browsers.
|
||||
// Support: IE, Chrome<38
|
||||
(function checkMathLog2() {
|
||||
|
@ -886,12 +886,6 @@ var Util = (function UtilClosure() {
|
||||
return (lowerCase ? romanStr.toLowerCase() : romanStr);
|
||||
};
|
||||
|
||||
Util.extendObj = function extendObj(obj1, obj2) {
|
||||
for (var key in obj2) {
|
||||
obj1[key] = obj2[key];
|
||||
}
|
||||
};
|
||||
|
||||
Util.inherit = function Util_inherit(sub, base, prototype) {
|
||||
sub.prototype = Object.create(base.prototype);
|
||||
sub.prototype.constructor = sub;
|
||||
|
Loading…
Reference in New Issue
Block a user