mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Convert the various image decoder ...Error
s 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:
parent
8c4f4b5eec
commit
572abdcb4a
3 changed files with 22 additions and 54 deletions
|
@ -13,21 +13,17 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { log2, readInt8, readUint16, readUint32, shadow } from '../shared/util';
|
||||
import {
|
||||
BaseException, log2, readInt8, readUint16, readUint32, shadow
|
||||
} from '../shared/util';
|
||||
import { ArithmeticDecoder } from './arithmetic_decoder';
|
||||
import { CCITTFaxDecoder } from './ccitt';
|
||||
|
||||
let Jbig2Error = (function Jbig2ErrorClosure() {
|
||||
function Jbig2Error(msg) {
|
||||
this.message = 'JBIG2 error: ' + msg;
|
||||
class Jbig2Error extends BaseException {
|
||||
constructor(msg) {
|
||||
super(`JBIG2 error: ${msg}`);
|
||||
}
|
||||
|
||||
Jbig2Error.prototype = new Error();
|
||||
Jbig2Error.prototype.name = 'Jbig2Error';
|
||||
Jbig2Error.constructor = Jbig2Error;
|
||||
|
||||
return Jbig2Error;
|
||||
})();
|
||||
}
|
||||
|
||||
var Jbig2Image = (function Jbig2ImageClosure() {
|
||||
// Utility data structures
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue