1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Move the isNodeJS-helper into the src/shared/util.js file

With the changes in the previous patch the `isNodeJS`-helper no longer needs to live in its own file, which helps get rid of a closure in the *built* files.
This commit is contained in:
Jonas Jenwald 2023-07-17 16:33:06 +02:00
parent 67303b16f1
commit 3a886e7264
19 changed files with 34 additions and 48 deletions

View file

@ -19,6 +19,7 @@ import {
AnnotationType,
ImageKind,
InvalidPDFException,
isNodeJS,
MissingPDFException,
objectSize,
OPS,
@ -53,7 +54,6 @@ import {
import { AutoPrintRegExp } from "../../web/ui_utils.js";
import { GlobalImageCache } from "../../src/core/image_utils.js";
import { GlobalWorkerOptions } from "../../src/display/worker_options.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { Metadata } from "../../src/display/metadata.js";
describe("api", function () {

View file

@ -13,8 +13,11 @@
* limitations under the License.
*/
import { setVerbosityLevel, VerbosityLevel } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import {
isNodeJS,
setVerbosityLevel,
VerbosityLevel,
} from "../../src/shared/util.js";
// Sets longer timeout, similar to `jasmine-boot.js`.
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;

View file

@ -16,7 +16,7 @@
import { buildGetDocumentParams } from "./test_utils.js";
import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
import { SVGGraphics } from "../../src/display/svg.js";
const XLINK_NS = "http://www.w3.org/1999/xlink";

View file

@ -13,6 +13,7 @@
* limitations under the License.
*/
import { bytesToString, isNodeJS } from "../../src/shared/util.js";
import {
DOMCanvasFactory,
DOMSVGFactory,
@ -21,8 +22,6 @@ import {
isValidFetchUrl,
PDFDateString,
} from "../../src/display/display_utils.js";
import { bytesToString } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
describe("display_utils", function () {
describe("DOMCanvasFactory", function () {

View file

@ -18,7 +18,7 @@ import {
waitOnEventOrTimeout,
WaitOnType,
} from "../../web/event_utils.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
describe("event_utils", function () {
describe("EventBus", function () {

View file

@ -41,7 +41,7 @@
"use strict";
import { GlobalWorkerOptions } from "pdfjs/display/worker_options.js";
import { isNodeJS } from "pdfjs/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
import { TestReporter } from "./testreporter.js";
async function initializePDFJS(callback) {

View file

@ -14,8 +14,7 @@
*/
/* globals __non_webpack_require__ */
import { AbortException } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { AbortException, isNodeJS } from "../../src/shared/util.js";
import { PDFNodeStream } from "../../src/display/node_stream.js";
// Ensure that these tests only run in Node.js environments.

View file

@ -17,7 +17,7 @@ import { FindState, PDFFindController } from "../../web/pdf_find_controller.js";
import { buildGetDocumentParams } from "./test_utils.js";
import { EventBus } from "../../web/event_utils.js";
import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
import { SimpleLinkService } from "../../web/pdf_link_service.js";
const tracemonkeyFileName = "tracemonkey.pdf";

View file

@ -15,7 +15,7 @@
import { NullStream, StringStream } from "../../src/core/stream.js";
import { Page, PDFDocument } from "../../src/core/document.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
import { Ref } from "../../src/core/primitives.js";
const TEST_PDFS_PATH = isNodeJS ? "./test/pdfs/" : "../pdfs/";

View file

@ -19,7 +19,7 @@ import {
} from "../../src/display/text_layer.js";
import { buildGetDocumentParams } from "./test_utils.js";
import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
describe("textLayer", function () {
it("creates textLayer from ReadableStream", async function () {

View file

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { isNodeJS } from "../../src/shared/is_node.js";
import { isNodeJS } from "../../src/shared/util.js";
import { XFAFactory } from "../../src/core/xfa/factory.js";
describe("XFAFactory", function () {