Replace NotImplementedException with unreachable

This commit is contained in:
Tim van der Meij 2018-06-23 21:20:53 +02:00
parent e8b5088370
commit 2907827d31
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762
2 changed files with 7 additions and 20 deletions

View File

@ -15,7 +15,7 @@
import {
createPromiseCapability, createValidAbsoluteUrl, MissingDataException,
NotImplementedException, shadow, unreachable, Util, warn
shadow, unreachable, Util, warn
} from '../shared/util';
import { ChunkedStreamManager } from './chunked_stream';
import { PDFDocument } from './document';
@ -49,7 +49,7 @@ var BasePdfManager = (function BasePdfManagerClosure() {
},
onLoadedStream: function BasePdfManager_onLoadedStream() {
throw new NotImplementedException();
unreachable('Abstract method `onLoadedStream` called');
},
ensureDoc: function BasePdfManager_ensureDoc(prop, args) {
@ -73,19 +73,19 @@ var BasePdfManager = (function BasePdfManagerClosure() {
},
ensure: function BasePdfManager_ensure(obj, prop, args) {
return new NotImplementedException();
unreachable('Abstract method `ensure` called');
},
requestRange: function BasePdfManager_requestRange(begin, end) {
return new NotImplementedException();
unreachable('Abstract method `requestRange` called');
},
requestLoadedStream: function BasePdfManager_requestLoadedStream() {
return new NotImplementedException();
unreachable('Abstract method `requestLoadedStream` called');
},
sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) {
return new NotImplementedException();
unreachable('Abstract method `sendProgressiveData` called');
},
updatePassword: function BasePdfManager_updatePassword(password) {
@ -93,7 +93,7 @@ var BasePdfManager = (function BasePdfManagerClosure() {
},
terminate: function BasePdfManager_terminate() {
return new NotImplementedException();
unreachable('Abstract method `terminate` called');
},
};

View File

@ -443,18 +443,6 @@ var UnexpectedResponseException =
return UnexpectedResponseException;
})();
var NotImplementedException = (function NotImplementedExceptionClosure() {
function NotImplementedException(msg) {
this.message = msg;
}
NotImplementedException.prototype = new Error();
NotImplementedException.prototype.name = 'NotImplementedException';
NotImplementedException.constructor = NotImplementedException;
return NotImplementedException;
})();
var MissingDataException = (function MissingDataExceptionClosure() {
function MissingDataException(begin, end) {
this.begin = begin;
@ -1037,7 +1025,6 @@ export {
MissingDataException,
MissingPDFException,
NativeImageDecoding,
NotImplementedException,
PasswordException,
PasswordResponses,
StreamType,