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

Replaced occurence of throw new Error with unreachable where applicable

This commit is contained in:
Naveen Jain 2017-12-13 19:21:45 +05:30
parent b327633ad6
commit 1135674647
12 changed files with 41 additions and 32 deletions

View file

@ -14,7 +14,8 @@
*/
import {
CMapCompressionType, FormatError, isString, MissingDataException, Util, warn
CMapCompressionType, FormatError, isString, MissingDataException,
unreachable, Util, warn
} from '../shared/util';
import { isCmd, isEOF, isName, isStream } from './primitives';
import { Lexer } from './parser';
@ -353,19 +354,19 @@ var IdentityCMap = (function IdentityCMapClosure() {
addCodespaceRange: CMap.prototype.addCodespaceRange,
mapCidRange(low, high, dstLow) {
throw new Error('should not call mapCidRange');
unreachable('should not call mapCidRange');
},
mapBfRange(low, high, dstLow) {
throw new Error('should not call mapBfRange');
unreachable('should not call mapBfRange');
},
mapBfRangeToArray(low, high, array) {
throw new Error('should not call mapBfRangeToArray');
unreachable('should not call mapBfRangeToArray');
},
mapOne(src, dst) {
throw new Error('should not call mapCidOne');
unreachable('should not call mapCidOne');
},
lookup(code) {
@ -402,7 +403,7 @@ var IdentityCMap = (function IdentityCMapClosure() {
},
get isIdentityCMap() {
throw new Error('should not access .isIdentityCMap');
unreachable('should not access .isIdentityCMap');
},
};