mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Replace the isInt
helper function with the native Number.isInteger
function
*Follow-up to PR 8643.*
This commit is contained in:
parent
066fea9c8b
commit
11408da340
12 changed files with 65 additions and 72 deletions
|
@ -15,11 +15,11 @@
|
|||
/* globals requirejs, __non_webpack_require__ */
|
||||
|
||||
import {
|
||||
assert, createPromiseCapability, deprecated, getVerbosityLevel,
|
||||
info, InvalidPDFException, isArrayBuffer, isInt, isSameOrigin,
|
||||
loadJpegStream, MessageHandler, MissingPDFException, NativeImageDecoding,
|
||||
PageViewport, PasswordException, StatTimer, stringToBytes,
|
||||
UnexpectedResponseException, UnknownErrorException, Util, warn
|
||||
assert, createPromiseCapability, deprecated, getVerbosityLevel, info,
|
||||
InvalidPDFException, isArrayBuffer, isSameOrigin, loadJpegStream,
|
||||
MessageHandler, MissingPDFException, NativeImageDecoding, PageViewport,
|
||||
PasswordException, StatTimer, stringToBytes, UnexpectedResponseException,
|
||||
UnknownErrorException, Util, warn
|
||||
} from '../shared/util';
|
||||
import {
|
||||
DOMCanvasFactory, DOMCMapReaderFactory, getDefaultSetting,
|
||||
|
@ -1986,7 +1986,8 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||
},
|
||||
|
||||
getPage: function WorkerTransport_getPage(pageNumber, capability) {
|
||||
if (!isInt(pageNumber) || pageNumber <= 0 || pageNumber > this.numPages) {
|
||||
if (!Number.isInteger(pageNumber) ||
|
||||
pageNumber <= 0 || pageNumber > this.numPages) {
|
||||
return Promise.reject(new Error('Invalid page request'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue