Re-factor ColorSpace.parse to take a parameter object, rather than a bunch of (randomly) ordered parameters

Given the number of existing parameters, this will avoid needlessly unwieldy call-sites especially with upcoming changes in later patches.
This commit is contained in:
Jonas Jenwald 2020-06-17 18:17:43 +02:00
parent ac4a5c3ace
commit e22bc483a5
5 changed files with 124 additions and 52 deletions

View file

@ -1136,12 +1136,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
parseColorSpace({ cs, resources, localColorSpaceCache }) {
return new Promise(resolve => {
const parsedColorSpace = ColorSpace.parse(
const parsedColorSpace = ColorSpace.parse({
cs,
this.xref,
xref: this.xref,
resources,
this.pdfFunctionFactory
);
pdfFunctionFactory: this.pdfFunctionFactory,
});
const csName = cs instanceof Name ? cs.name : null;
if (csName) {