Skip to content

Commit 612b438

Browse files
committed
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.
1 parent e394da5 commit 612b438

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/core/pattern.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,13 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
125125
this.matrix = matrix;
126126
this.coordsArr = dict.getArray("Coords");
127127
this.shadingType = dict.get("ShadingType");
128-
this.type = "Pattern";
129128
const cs = ColorSpace.parse({
130129
cs: dict.getRaw("ColorSpace") || dict.getRaw("CS"),
131130
xref,
132131
resources,
133132
pdfFunctionFactory,
134133
localColorSpaceCache,
135134
});
136-
this.cs = cs;
137135
const bbox = dict.getArray("BBox");
138136
if (Array.isArray(bbox) && bbox.length === 4) {
139137
this.bbox = Util.normalizeRect(bbox);
@@ -851,7 +849,6 @@ Shadings.Mesh = (function MeshClosure() {
851849
const dict = stream.dict;
852850
this.matrix = matrix;
853851
this.shadingType = dict.get("ShadingType");
854-
this.type = "Pattern";
855852
const bbox = dict.getArray("BBox");
856853
if (Array.isArray(bbox) && bbox.length === 4) {
857854
this.bbox = Util.normalizeRect(bbox);
@@ -865,7 +862,6 @@ Shadings.Mesh = (function MeshClosure() {
865862
pdfFunctionFactory,
866863
localColorSpaceCache,
867864
});
868-
this.cs = cs;
869865
this.background = dict.has("Background")
870866
? cs.getRgb(dict.get("Background"), 0)
871867
: null;
@@ -946,9 +942,7 @@ Shadings.Mesh = (function MeshClosure() {
946942
})();
947943

948944
Shadings.Dummy = (function DummyClosure() {
949-
function Dummy() {
950-
this.type = "Pattern";
951-
}
945+
function Dummy() {}
952946

953947
Dummy.prototype = {
954948
getIR: function Dummy_getIR() {

0 commit comments

Comments
 (0)