1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Ensure that AnnotationBorderStyle.setWidth is able to handle the input being a Name, to correctly deal with corrupt PDF documents (issue 10385)

This commit is contained in:
Jonas Jenwald 2018-12-31 12:21:28 +01:00
parent 15b3806937
commit 76a9580aeb
2 changed files with 13 additions and 0 deletions

View file

@ -236,6 +236,14 @@ describe('annotation', function() {
expect(borderStyle.width).toEqual(1);
});
it('should set/get a valid width, when the input is a `Name` (issue 10385)',
function() {
const borderStyle = new AnnotationBorderStyle();
borderStyle.setWidth(Name.get('0'));
expect(borderStyle.width).toEqual(0);
});
it('should set and get a valid style', function() {
const borderStyle = new AnnotationBorderStyle();
borderStyle.setStyle(Name.get('D'));