1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Ignore double negative in Lexer_getNumber (issue 6218)

Basic mathematics would suggest that a double negative should always become positive, but it appears that Adobe Reader simply ignores that case. Hence I think that it makes sense for us to do the same.

Fixes 6218.
This commit is contained in:
Jonas Jenwald 2015-07-16 12:11:49 +02:00
parent cf6d40f348
commit c718d1ab10
2 changed files with 12 additions and 0 deletions

View file

@ -27,6 +27,13 @@ describe('parser', function() {
}
});
it('should ignore double negative before number', function() {
var input = new StringStream('--205.88');
var lexer = new Lexer(input);
var result = lexer.getNumber();
expect(result).toEqual(-205.88);
});
it('should handle glued numbers and operators', function() {
var input = new StringStream('123ET');