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

Convert the various image decoder ...Errors to classes extending BaseException (PR 11185 follow-up)

Somehow I missed these in PR 11185, but there's no good reason not to convert them as well.
This commit is contained in:
Jonas Jenwald 2019-10-01 13:10:14 +02:00
parent 8c4f4b5eec
commit 572abdcb4a
3 changed files with 22 additions and 54 deletions

View file

@ -14,21 +14,15 @@
*/
import {
info, log2, readUint16, readUint32, warn
BaseException, info, log2, readUint16, readUint32, warn
} from '../shared/util';
import { ArithmeticDecoder } from './arithmetic_decoder';
let JpxError = (function JpxErrorClosure() {
function JpxError(msg) {
this.message = 'JPX error: ' + msg;
class JpxError extends BaseException {
constructor(msg) {
super(`JPX error: ${msg}`);
}
JpxError.prototype = new Error();
JpxError.prototype.name = 'JpxError';
JpxError.constructor = JpxError;
return JpxError;
})();
}
var JpxImage = (function JpxImageClosure() {
// Table E.1