Ensure that EvaluatorPreprocessor.opMap has a null-prototype (issue 17554)

This accidentally regressed in PR 16956, sorry about that!
This commit is contained in:
Jonas Jenwald 2024-01-21 19:50:06 +01:00
parent fce822cde0
commit d7e41d4cb6
4 changed files with 191 additions and 108 deletions

View File

@ -4780,7 +4780,10 @@ class EvaluatorPreprocessor {
// //
// If variableArgs === true: [0, `numArgs`] expected // If variableArgs === true: [0, `numArgs`] expected
// If variableArgs === false: exactly `numArgs` expected // If variableArgs === false: exactly `numArgs` expected
return shadow(this, "opMap", { return shadow(
this,
"opMap",
Object.assign(Object.create(null), {
// Graphic state // Graphic state
w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }, w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false },
J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false }, J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false },
@ -4897,7 +4900,8 @@ class EvaluatorPreprocessor {
nu: null, nu: null,
nul: null, nul: null,
null: null, null: null,
}); })
);
} }
static MAX_INVALID_PATH_OPS = 10; static MAX_INVALID_PATH_OPS = 10;

View File

@ -300,6 +300,7 @@
!helloworld-bad.pdf !helloworld-bad.pdf
!zerowidthline.pdf !zerowidthline.pdf
!colorspace_cos.pdf !colorspace_cos.pdf
!issue17554.pdf
!issue13242.pdf !issue13242.pdf
!js-colors.pdf !js-colors.pdf
!annotation-line-without-appearance-empty-Rect.pdf !annotation-line-without-appearance-empty-Rect.pdf

71
test/pdfs/issue17554.pdf Normal file
View File

@ -0,0 +1,71 @@
%PDF-1.4
%%EOF
6 0 obj
<<
/Type /Catalog
/Pages 5 0 R
>>
endobj
1 0 obj
<<
/Type /Page
/Parent 5 0 R
/MediaBox [ 0 0 612 792 ]
/Resources 3 0 R
/Contents 2 0 R
>>
endobj
4 0 obj
<<
/Type /Font
/Subtype /Type1
/Name /F1
/BaseFont/Helvetica
>>
endobj
2 0 obj
<<
/Length 53
>>
stream
toString
endstream
endobj
5 0 obj
<<
/Type /Pages
/Kids [ 1 0 R ]
/Count 1
>>
endobj
3 0 obj
<<
/ProcSet[/PDF/Text]
/Font <</F1 4 0 R >>
>>
endobj
xref
0 7
0000000000 65535 f
0000000060 00000 n
0000000228 00000 n
0000000424 00000 n
0000000145 00000 n
0000000333 00000 n
0000000009 00000 n
trailer
<<
/Size 7
/Root 6 0 R
>>
startxref
488
%%EOF

View File

@ -8762,6 +8762,13 @@
} }
} }
}, },
{
"id": "issue17554",
"file": "pdfs/issue17554.pdf",
"md5": "09607e5c6007b28b4e75bf8c38a60de3",
"rounds": 1,
"type": "load"
},
{ {
"id": "freetexts-delete-editor-print", "id": "freetexts-delete-editor-print",
"file": "pdfs/freetexts.pdf", "file": "pdfs/freetexts.pdf",