From 7caf769a666387304ee24e738a20b10325ff7e65 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 2 Mar 2019 11:45:14 +0100 Subject: [PATCH] Move the `deprecated` helper function to the `src/display/display_utils.js` file Given that the function is (purposely) independent of the verbosity level and that its message is worded to only apply on the main-thread, there's no reason to duplicate this across the built `pdf.js`/`pdf.worker.js` files. --- src/display/api.js | 13 ++++++------- src/display/display_utils.js | 6 ++++++ src/shared/util.js | 6 ------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index dfe7fec7b..19ea589fd 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -16,15 +16,14 @@ /* eslint no-var: error */ import { - assert, createPromiseCapability, deprecated, getVerbosityLevel, info, - InvalidPDFException, isArrayBuffer, isSameOrigin, MissingPDFException, - NativeImageDecoding, PasswordException, setVerbosityLevel, shadow, - stringToBytes, UnexpectedResponseException, UnknownErrorException, - unreachable, URL, warn + assert, createPromiseCapability, getVerbosityLevel, info, InvalidPDFException, + isArrayBuffer, isSameOrigin, MissingPDFException, NativeImageDecoding, + PasswordException, setVerbosityLevel, shadow, stringToBytes, + UnexpectedResponseException, UnknownErrorException, unreachable, URL, warn } from '../shared/util'; import { - DOMCanvasFactory, DOMCMapReaderFactory, DummyStatTimer, loadScript, - PageViewport, RenderingCancelledException, StatTimer + deprecated, DOMCanvasFactory, DOMCMapReaderFactory, DummyStatTimer, + loadScript, PageViewport, RenderingCancelledException, StatTimer } from './display_utils'; import { FontFaceObject, FontLoader } from './font_loader'; import { apiCompatibilityParams } from './api_compatibility'; diff --git a/src/display/display_utils.js b/src/display/display_utils.js index faaeedd9d..c0418a473 100644 --- a/src/display/display_utils.js +++ b/src/display/display_utils.js @@ -477,6 +477,11 @@ function loadScript(src) { }); } +// Deprecated API function -- display regardless of the `verbosity` setting. +function deprecated(details) { + console.log('Deprecated API usage: ' + details); +} + export { PageViewport, RenderingCancelledException, @@ -492,4 +497,5 @@ export { isFetchSupported, isValidFetchUrl, loadScript, + deprecated, }; diff --git a/src/shared/util.js b/src/shared/util.js index 4d03b26e8..8a9902b82 100644 --- a/src/shared/util.js +++ b/src/shared/util.js @@ -307,11 +307,6 @@ function warn(msg) { } } -// Deprecated API function -- display regardless of the `verbosity` setting. -function deprecated(details) { - console.log('Deprecated API usage: ' + details); -} - function unreachable(msg) { throw new Error(msg); } @@ -929,7 +924,6 @@ export { bytesToString, createPromiseCapability, createObjectURL, - deprecated, getVerbosityLevel, info, isArrayBuffer,