Skip to content

Commit 5ddabb8

Browse files
committed
Fix AcroFormField Subtype setter to be a true no-op
The setter was storing values, which caused tests to fail because the stored value would appear in the PDF output. Tests expect setting radioGroup.Subtype = "Form" to be silently ignored without affecting the computed value returned by the getter. This changes the setter to be a true no-op (empty function), preventing the "Cannot set property which has only a getter" error while preserving the original behavior where assignments are silently ignored.
1 parent e7835bc commit 5ddabb8

15 files changed

+33
-45
lines changed

dist/jspdf.es.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 3.0.3 Built on 2025-11-10T10:56:39.306Z
5-
* CommitID 92edd044e1
4+
* Version 3.0.3 Built on 2025-11-10T11:58:39.059Z
5+
* CommitID e7835bc9b7
66
*
77
* Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
88
* 2015-2025 yWorks GmbH, http://www.yworks.com
@@ -7048,18 +7048,15 @@ var AcroFormField = function AcroFormField() {
70487048
return this.hasAnnotation ? "/Annot" : null;
70497049
}
70507050
});
7051-
var _Subtype = null;
70527051
Object.defineProperty(this, "Subtype", {
70537052
enumerable: true,
70547053
configurable: false,
70557054
get: function get() {
7056-
if (_Subtype !== null) {
7057-
return _Subtype;
7058-
}
70597055
return this.hasAnnotation ? "/Widget" : null;
70607056
},
70617057
set: function set(value) {
7062-
_Subtype = value;
7058+
// No-op setter to prevent "Cannot set property which has only a getter" errors
7059+
// The value is intentionally not stored
70637060
}
70647061
});
70657062
var _hasAppearanceStream = false;

dist/jspdf.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.es.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.es.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 3.0.3 Built on 2025-11-10T10:56:39.340Z
5-
* CommitID 92edd044e1
4+
* Version 3.0.3 Built on 2025-11-10T11:58:39.102Z
5+
* CommitID e7835bc9b7
66
*
77
* Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
88
* 2015-2025 yWorks GmbH, http://www.yworks.com
@@ -7550,18 +7550,15 @@ let AcroFormField = function () {
75507550
return this.hasAnnotation ? "/Annot" : null;
75517551
}
75527552
});
7553-
let _Subtype = null;
75547553
Object.defineProperty(this, "Subtype", {
75557554
enumerable: true,
75567555
configurable: false,
75577556
get: function () {
7558-
if (_Subtype !== null) {
7559-
return _Subtype;
7560-
}
75617557
return this.hasAnnotation ? "/Widget" : null;
75627558
},
75637559
set: function (value) {
7564-
_Subtype = value;
7560+
// No-op setter to prevent "Cannot set property which has only a getter" errors
7561+
// The value is intentionally not stored
75657562
}
75667563
});
75677564
let _hasAppearanceStream = false;

dist/jspdf.node.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.node.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jspdf.umd.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/** @license
22
*
33
* jsPDF - PDF Document creation from JavaScript
4-
* Version 3.0.3 Built on 2025-11-10T10:56:39.273Z
5-
* CommitID 92edd044e1
4+
* Version 3.0.3 Built on 2025-11-10T11:58:39.026Z
5+
* CommitID e7835bc9b7
66
*
77
* Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
88
* 2015-2025 yWorks GmbH, http://www.yworks.com
@@ -7133,18 +7133,15 @@
71337133
return this.hasAnnotation ? "/Annot" : null;
71347134
}
71357135
});
7136-
var _Subtype = null;
71377136
Object.defineProperty(this, "Subtype", {
71387137
enumerable: true,
71397138
configurable: false,
71407139
get: function get() {
7141-
if (_Subtype !== null) {
7142-
return _Subtype;
7143-
}
71447140
return this.hasAnnotation ? "/Widget" : null;
71457141
},
71467142
set: function set(value) {
7147-
_Subtype = value;
7143+
// No-op setter to prevent "Cannot set property which has only a getter" errors
7144+
// The value is intentionally not stored
71487145
}
71497146
});
71507147
var _hasAppearanceStream = false;

dist/jspdf.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)