From 612b43852bb576232dacb8e2713011da40d04822 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 14 May 2021 16:11:48 +0200 Subject: [PATCH] Remove unused properties from the `Shadings`-implementations in `src/core/pattern.js` Neither the `type` or the `cs` properties are used outside of the "constructors", and we can thus remove them.[1] Note that a lot of this code is very old, and that it actually predates the main/worker-thread split before which the *same* file was used on both the main- *and* worker-threads. --- [1] On the main-thread, a similar `type` property was removed in PR 12591. --- src/core/pattern.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/pattern.js b/src/core/pattern.js index 250c8a7c5..caa035143 100644 --- a/src/core/pattern.js +++ b/src/core/pattern.js @@ -125,7 +125,6 @@ Shadings.RadialAxial = (function RadialAxialClosure() { this.matrix = matrix; this.coordsArr = dict.getArray("Coords"); this.shadingType = dict.get("ShadingType"); - this.type = "Pattern"; const cs = ColorSpace.parse({ cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"), xref, @@ -133,7 +132,6 @@ Shadings.RadialAxial = (function RadialAxialClosure() { pdfFunctionFactory, localColorSpaceCache, }); - this.cs = cs; const bbox = dict.getArray("BBox"); if (Array.isArray(bbox) && bbox.length === 4) { this.bbox = Util.normalizeRect(bbox); @@ -851,7 +849,6 @@ Shadings.Mesh = (function MeshClosure() { const dict = stream.dict; this.matrix = matrix; this.shadingType = dict.get("ShadingType"); - this.type = "Pattern"; const bbox = dict.getArray("BBox"); if (Array.isArray(bbox) && bbox.length === 4) { this.bbox = Util.normalizeRect(bbox); @@ -865,7 +862,6 @@ Shadings.Mesh = (function MeshClosure() { pdfFunctionFactory, localColorSpaceCache, }); - this.cs = cs; this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; @@ -946,9 +942,7 @@ Shadings.Mesh = (function MeshClosure() { })(); Shadings.Dummy = (function DummyClosure() { - function Dummy() { - this.type = "Pattern"; - } + function Dummy() {} Dummy.prototype = { getIR: function Dummy_getIR() {