Merge pull request #11465 from Snuffleupagus/import-file-extension

Ensure that all `import` and `require` statements, in the entire code-base, have a `.js` file extension
This commit is contained in:
Tim van der Meij 2020-01-06 23:24:43 +01:00 committed by GitHub
commit 93aa613db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
125 changed files with 453 additions and 443 deletions

View File

@ -27,13 +27,13 @@ import {
stringToPDFString,
Util,
warn,
} from "../shared/util";
import { Catalog, FileSpec, ObjectLoader } from "./obj";
import { Dict, isDict, isName, isRef, isStream } from "./primitives";
import { ColorSpace } from "./colorspace";
import { getInheritableProperty } from "./core_utils";
import { OperatorList } from "./operator_list";
import { Stream } from "./stream";
} from "../shared/util.js";
import { Catalog, FileSpec, ObjectLoader } from "./obj.js";
import { Dict, isDict, isName, isRef, isStream } from "./primitives.js";
import { ColorSpace } from "./colorspace.js";
import { getInheritableProperty } from "./core_utils.js";
import { OperatorList } from "./operator_list.js";
import { Stream } from "./stream.js";
class AnnotationFactory {
/**

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { warn } from "../shared/util";
import { warn } from "../shared/util.js";
// Character types for symbols from 0000 to 00FF.
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt

View File

@ -25,7 +25,7 @@
* or -1 when EOF is reached.
*/
import { info } from "../shared/util";
import { info } from "../shared/util.js";
let CCITTFaxDecoder = (function CCITTFaxDecoder() {
const ccittEOL = -2;

View File

@ -13,9 +13,9 @@
* limitations under the License.
*/
import { Dict, isDict } from "./primitives";
import { CCITTFaxDecoder } from "./ccitt";
import { DecodeStream } from "./stream";
import { Dict, isDict } from "./primitives.js";
import { CCITTFaxDecoder } from "./ccitt.js";
import { DecodeStream } from "./stream.js";
var CCITTFaxStream = (function CCITTFaxStreamClosure() {
function CCITTFaxStream(str, maybeLength, params) {

View File

@ -20,13 +20,13 @@ import {
stringToBytes,
Util,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
ExpertCharset,
ExpertSubsetCharset,
ISOAdobeCharset,
} from "./charsets";
import { ExpertEncoding, StandardEncoding } from "./encodings";
} from "./charsets.js";
import { ExpertEncoding, StandardEncoding } from "./encodings.js";
// Maximum subroutine call depth of type 2 chartrings. Matches OTS.
var MAX_SUBR_NESTING = 10;

View File

@ -19,8 +19,8 @@ import {
arraysToBytes,
createPromiseCapability,
isEmptyObj,
} from "../shared/util";
import { MissingDataException } from "./core_utils";
} from "../shared/util.js";
import { MissingDataException } from "./core_utils.js";
class ChunkedStream {
constructor(length, chunkSize, manager) {

View File

@ -19,11 +19,11 @@ import {
isString,
unreachable,
warn,
} from "../shared/util";
import { isCmd, isEOF, isName, isStream } from "./primitives";
import { Lexer } from "./parser";
import { MissingDataException } from "./core_utils";
import { Stream } from "./stream";
} from "../shared/util.js";
import { isCmd, isEOF, isName, isStream } from "./primitives.js";
import { Lexer } from "./parser.js";
import { MissingDataException } from "./core_utils.js";
import { Stream } from "./stream.js";
var BUILT_IN_CMAPS = [
// << Start unicode maps.

View File

@ -21,8 +21,8 @@ import {
shadow,
unreachable,
warn,
} from "../shared/util";
import { isDict, isName, isStream } from "./primitives";
} from "../shared/util.js";
import { isDict, isName, isStream } from "./primitives.js";
/**
* Resizes an RGB image with 3 components.

View File

@ -14,7 +14,7 @@
*/
/* eslint no-var: error */
import { assert, BaseException, warn } from "../shared/util";
import { assert, BaseException, warn } from "../shared/util.js";
function getLookupTableFactory(initializer) {
let lookup;

View File

@ -22,9 +22,9 @@ import {
unreachable,
utf8StringToString,
warn,
} from "../shared/util";
import { isDict, isName, Name } from "./primitives";
import { DecryptStream } from "./stream";
} from "../shared/util.js";
import { isDict, isName, Name } from "./primitives.js";
import { DecryptStream } from "./stream.js";
var ARCFourCipher = (function ARCFourCipherClosure() {
function ARCFourCipher(key) {

View File

@ -31,22 +31,22 @@ import {
stringToPDFString,
Util,
warn,
} from "../shared/util";
import { Catalog, ObjectLoader, XRef } from "./obj";
import { Dict, isDict, isName, isStream, Ref } from "./primitives";
} from "../shared/util.js";
import { Catalog, ObjectLoader, XRef } from "./obj.js";
import { Dict, isDict, isName, isStream, Ref } from "./primitives.js";
import {
getInheritableProperty,
MissingDataException,
XRefEntryException,
XRefParseException,
} from "./core_utils";
import { NullStream, Stream, StreamsSequenceStream } from "./stream";
import { AnnotationFactory } from "./annotation";
import { calculateMD5 } from "./crypto";
import { Linearization } from "./parser";
import { OperatorList } from "./operator_list";
import { PartialEvaluator } from "./evaluator";
import { PDFFunctionFactory } from "./function";
} from "./core_utils.js";
import { NullStream, Stream, StreamsSequenceStream } from "./stream.js";
import { AnnotationFactory } from "./annotation.js";
import { calculateMD5 } from "./crypto.js";
import { Linearization } from "./parser.js";
import { OperatorList } from "./operator_list.js";
import { PartialEvaluator } from "./evaluator.js";
import { PDFFunctionFactory } from "./function.js";
const DEFAULT_USER_UNIT = 1.0;
const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];

View File

@ -32,8 +32,8 @@ import {
UNSUPPORTED_FEATURES,
Util,
warn,
} from "../shared/util";
import { CMapFactory, IdentityCMap } from "./cmap";
} from "../shared/util.js";
import { CMapFactory, IdentityCMap } from "./cmap.js";
import {
Cmd,
Dict,
@ -44,7 +44,7 @@ import {
isStream,
Name,
Ref,
} from "./primitives";
} from "./primitives.js";
import {
ErrorFont,
Font,
@ -52,7 +52,7 @@ import {
getFontType,
IdentityToUnicodeMap,
ToUnicodeMap,
} from "./fonts";
} from "./fonts.js";
import {
getEncoding,
MacRomanEncoding,
@ -60,31 +60,31 @@ import {
SymbolSetEncoding,
WinAnsiEncoding,
ZapfDingbatsEncoding,
} from "./encodings";
} from "./encodings.js";
import {
getNormalizedUnicodes,
getUnicodeForGlyph,
reverseIfRtl,
} from "./unicode";
} from "./unicode.js";
import {
getSerifFonts,
getStdFontMap,
getSymbolsFonts,
} from "./standard_fonts";
import { getTilingPatternIR, Pattern } from "./pattern";
import { Lexer, Parser } from "./parser";
import { bidi } from "./bidi";
import { ColorSpace } from "./colorspace";
import { DecodeStream } from "./stream";
import { getGlyphsUnicode } from "./glyphlist";
import { getLookupTableFactory } from "./core_utils";
import { getMetrics } from "./metrics";
import { isPDFFunction } from "./function";
import { JpegStream } from "./jpeg_stream";
import { MurmurHash3_64 } from "./murmurhash3";
import { NativeImageDecoder } from "./image_utils";
import { OperatorList } from "./operator_list";
import { PDFImage } from "./image";
} from "./standard_fonts.js";
import { getTilingPatternIR, Pattern } from "./pattern.js";
import { Lexer, Parser } from "./parser.js";
import { bidi } from "./bidi.js";
import { ColorSpace } from "./colorspace.js";
import { DecodeStream } from "./stream.js";
import { getGlyphsUnicode } from "./glyphlist.js";
import { getLookupTableFactory } from "./core_utils.js";
import { getMetrics } from "./metrics.js";
import { isPDFFunction } from "./function.js";
import { JpegStream } from "./jpeg_stream.js";
import { MurmurHash3_64 } from "./murmurhash3.js";
import { NativeImageDecoder } from "./image_utils.js";
import { OperatorList } from "./operator_list.js";
import { PDFImage } from "./image.js";
var PartialEvaluator = (function PartialEvaluatorClosure() {
const DefaultPartialEvaluatorOptions = {

View File

@ -19,11 +19,11 @@ import {
FormatError,
unreachable,
warn,
} from "../shared/util";
import { CFFParser } from "./cff_parser";
import { getGlyphsUnicode } from "./glyphlist";
import { StandardEncoding } from "./encodings";
import { Stream } from "./stream";
} from "../shared/util.js";
import { CFFParser } from "./cff_parser.js";
import { getGlyphsUnicode } from "./glyphlist.js";
import { StandardEncoding } from "./encodings.js";
import { Stream } from "./stream.js";
var FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) {

View File

@ -27,7 +27,7 @@ import {
string32,
unreachable,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
CFF,
CFFCharset,
@ -39,32 +39,32 @@ import {
CFFStandardStrings,
CFFStrings,
CFFTopDict,
} from "./cff_parser";
import { getDingbatsGlyphsUnicode, getGlyphsUnicode } from "./glyphlist";
} from "./cff_parser.js";
import { getDingbatsGlyphsUnicode, getGlyphsUnicode } from "./glyphlist.js";
import {
getEncoding,
MacRomanEncoding,
StandardEncoding,
SymbolSetEncoding,
ZapfDingbatsEncoding,
} from "./encodings";
} from "./encodings.js";
import {
getGlyphMapForStandardFonts,
getNonStdFontMap,
getStdFontMap,
getSupplementalGlyphMapForArialBlack,
getSupplementalGlyphMapForCalibri,
} from "./standard_fonts";
} from "./standard_fonts.js";
import {
getUnicodeForGlyph,
getUnicodeRangeFor,
mapSpecialUnicodeValues,
} from "./unicode";
import { FontRendererFactory } from "./font_renderer";
import { IdentityCMap } from "./cmap";
import { MissingDataException } from "./core_utils";
import { Stream } from "./stream";
import { Type1Parser } from "./type1_parser";
} from "./unicode.js";
import { FontRendererFactory } from "./font_renderer.js";
import { IdentityCMap } from "./cmap.js";
import { MissingDataException } from "./core_utils.js";
import { Stream } from "./stream.js";
import { Type1Parser } from "./type1_parser.js";
// Unicode Private Use Areas:
const PRIVATE_USE_AREAS = [

View File

@ -20,9 +20,9 @@ import {
isEvalSupported,
shadow,
unreachable,
} from "../shared/util";
import { isDict, isStream } from "./primitives";
import { PostScriptLexer, PostScriptParser } from "./ps_parser";
} from "../shared/util.js";
import { isDict, isStream } from "./primitives.js";
import { PostScriptLexer, PostScriptParser } from "./ps_parser.js";
let IsEvalSupportedCached = {
get value() {

View File

@ -14,7 +14,7 @@
*/
/* no-babel-preset */
var getLookupTableFactory = require("./core_utils").getLookupTableFactory;
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
var getGlyphsUnicode = getLookupTableFactory(function(t) {
t["A"] = 0x0041;

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { assert, FormatError, ImageKind, info, warn } from "../shared/util";
import { isName, isStream, Name } from "./primitives";
import { ColorSpace } from "./colorspace";
import { DecodeStream } from "./stream";
import { JpegStream } from "./jpeg_stream";
import { JpxImage } from "./jpx";
import { assert, FormatError, ImageKind, info, warn } from "../shared/util.js";
import { isName, isStream, Name } from "./primitives.js";
import { ColorSpace } from "./colorspace.js";
import { DecodeStream } from "./stream.js";
import { JpegStream } from "./jpeg_stream.js";
import { JpxImage } from "./jpx.js";
var PDFImage = (function PDFImageClosure() {
/**

View File

@ -14,9 +14,9 @@
*/
/* eslint no-var: error */
import { ColorSpace } from "./colorspace";
import { JpegStream } from "./jpeg_stream";
import { Stream } from "./stream";
import { ColorSpace } from "./colorspace.js";
import { JpegStream } from "./jpeg_stream.js";
import { Stream } from "./stream.js";
class NativeImageDecoder {
constructor({

View File

@ -20,9 +20,9 @@ import {
readUint16,
readUint32,
shadow,
} from "../shared/util";
import { ArithmeticDecoder } from "./arithmetic_decoder";
import { CCITTFaxDecoder } from "./ccitt";
} from "../shared/util.js";
import { ArithmeticDecoder } from "./arithmetic_decoder.js";
import { CCITTFaxDecoder } from "./ccitt.js";
class Jbig2Error extends BaseException {
constructor(msg) {

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
import { isDict, isStream } from "./primitives";
import { DecodeStream } from "./stream";
import { Jbig2Image } from "./jbig2";
import { shadow } from "../shared/util";
import { isDict, isStream } from "./primitives.js";
import { DecodeStream } from "./stream.js";
import { Jbig2Image } from "./jbig2.js";
import { shadow } from "../shared/util.js";
/**
* For JBIG2's we use a library to decode these images and

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
import { createObjectURL, shadow } from "../shared/util";
import { DecodeStream } from "./stream";
import { isDict } from "./primitives";
import { JpegImage } from "./jpg";
import { createObjectURL, shadow } from "../shared/util.js";
import { DecodeStream } from "./stream.js";
import { isDict } from "./primitives.js";
import { JpegImage } from "./jpg.js";
/**
* Depending on the type of JPEG a JpegStream is handled in different ways. For

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { assert, BaseException, warn } from "../shared/util";
import { assert, BaseException, warn } from "../shared/util.js";
class JpegError extends BaseException {
constructor(msg) {

View File

@ -20,8 +20,8 @@ import {
readUint16,
readUint32,
warn,
} from "../shared/util";
import { ArithmeticDecoder } from "./arithmetic_decoder";
} from "../shared/util.js";
import { ArithmeticDecoder } from "./arithmetic_decoder.js";
class JpxError extends BaseException {
constructor(msg) {

View File

@ -13,9 +13,9 @@
* limitations under the License.
*/
import { DecodeStream } from "./stream";
import { JpxImage } from "./jpx";
import { shadow } from "../shared/util";
import { DecodeStream } from "./stream.js";
import { JpxImage } from "./jpx.js";
import { shadow } from "../shared/util.js";
/**
* For JPEG 2000's we use a library to decode these images and

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { getLookupTableFactory } from "./core_utils";
import { getLookupTableFactory } from "./core_utils.js";
// The Metrics object contains glyph widths (in glyph space units).
// As per PDF spec, for most fonts (Type 3 being an exception) a glyph

View File

@ -18,7 +18,7 @@
*/
/* eslint no-var: error */
import { isArrayBuffer, isString } from "../shared/util";
import { isArrayBuffer, isString } from "../shared/util.js";
const SEED = 0xc3d2e1f0;
// Workaround for missing math precision in JS.

View File

@ -30,7 +30,7 @@ import {
stringToUTF8String,
unreachable,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
clearPrimitiveCaches,
Cmd,
@ -44,16 +44,16 @@ import {
Ref,
RefSet,
RefSetCache,
} from "./primitives";
import { Lexer, Parser } from "./parser";
} from "./primitives.js";
import { Lexer, Parser } from "./parser.js";
import {
MissingDataException,
toRomanNumerals,
XRefEntryException,
XRefParseException,
} from "./core_utils";
import { CipherTransformFactory } from "./crypto";
import { ColorSpace } from "./colorspace";
} from "./core_utils.js";
import { CipherTransformFactory } from "./crypto.js";
import { ColorSpace } from "./colorspace.js";
function fetchDestination(dest) {
return isDict(dest) ? dest.get("D") : dest;

View File

@ -14,7 +14,7 @@
*/
/* eslint-disable no-unsanitized/method */
import { assert, ImageKind, OPS } from "../shared/util";
import { assert, ImageKind, OPS } from "../shared/util.js";
var QueueOptimizer = (function QueueOptimizerClosure() {
function addState(parentState, pattern, checkFn, iterateFn, processFn) {

View File

@ -22,7 +22,7 @@ import {
NullStream,
PredictorStream,
RunLengthStream,
} from "./stream";
} from "./stream.js";
import {
assert,
bytesToString,
@ -32,7 +32,7 @@ import {
isSpace,
StreamType,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
Cmd,
Dict,
@ -43,12 +43,12 @@ import {
isName,
Name,
Ref,
} from "./primitives";
import { CCITTFaxStream } from "./ccitt_stream";
import { Jbig2Stream } from "./jbig2_stream";
import { JpegStream } from "./jpeg_stream";
import { JpxStream } from "./jpx_stream";
import { MissingDataException } from "./core_utils";
} from "./primitives.js";
import { CCITTFaxStream } from "./ccitt_stream.js";
import { Jbig2Stream } from "./jbig2_stream.js";
import { JpegStream } from "./jpeg_stream.js";
import { JpxStream } from "./jpx_stream.js";
import { MissingDataException } from "./core_utils.js";
const MAX_LENGTH_TO_CACHE = 1000;
const MAX_ADLER32_LENGTH = 5552;

View File

@ -21,10 +21,10 @@ import {
UNSUPPORTED_FEATURES,
Util,
warn,
} from "../shared/util";
import { ColorSpace } from "./colorspace";
import { isStream } from "./primitives";
import { MissingDataException } from "./core_utils";
} from "../shared/util.js";
import { ColorSpace } from "./colorspace.js";
import { isStream } from "./primitives.js";
import { MissingDataException } from "./core_utils.js";
var ShadingType = {
FUNCTION_BASED: 1,

View File

@ -18,11 +18,11 @@ import {
shadow,
unreachable,
warn,
} from "../shared/util";
import { ChunkedStreamManager } from "./chunked_stream";
import { MissingDataException } from "./core_utils";
import { PDFDocument } from "./document";
import { Stream } from "./stream";
} from "../shared/util.js";
import { ChunkedStreamManager } from "./chunked_stream.js";
import { MissingDataException } from "./core_utils.js";
import { PDFDocument } from "./document.js";
import { Stream } from "./stream.js";
class BasePdfManager {
constructor() {

View File

@ -14,7 +14,7 @@
*/
/* uses XRef */
import { assert } from "../shared/util";
import { assert } from "../shared/util.js";
var EOF = {};

View File

@ -14,8 +14,8 @@
*/
/* eslint no-var: error */
import { FormatError, isSpace, shadow } from "../shared/util";
import { EOF } from "./primitives";
import { FormatError, isSpace, shadow } from "../shared/util.js";
import { EOF } from "./primitives.js";
class PostScriptParser {
constructor(lexer) {

View File

@ -14,7 +14,7 @@
*/
/* eslint no-var: error */
import { getLookupTableFactory } from "./core_utils";
import { getLookupTableFactory } from "./core_utils.js";
/**
* Hold a map of decoded fonts and of the standard fourteen Type1

View File

@ -24,8 +24,8 @@ import {
isSpace,
stringToBytes,
unreachable,
} from "../shared/util";
import { isDict } from "./primitives";
} from "../shared/util.js";
import { isDict } from "./primitives.js";
var Stream = (function StreamClosure() {
function Stream(arrayBuffer, start, length, dict) {

View File

@ -13,9 +13,9 @@
* limitations under the License.
*/
import { isSpace, warn } from "../shared/util";
import { getEncoding } from "./encodings";
import { Stream } from "./stream";
import { isSpace, warn } from "../shared/util.js";
import { getEncoding } from "./encodings.js";
import { Stream } from "./stream.js";
// Hinting is currently disabled due to unknown problems on windows
// in tracemonkey and various other pdfs with type1 fonts.

View File

@ -14,7 +14,7 @@
*/
/* no-babel-preset */
var getLookupTableFactory = require("./core_utils").getLookupTableFactory;
var getLookupTableFactory = require("./core_utils.js").getLookupTableFactory;
// Some characters, e.g. copyrightserif, are mapped to the private use area
// and might not be displayed using standard fonts. Mapping/hacking well-known

View File

@ -29,13 +29,13 @@ import {
UNSUPPORTED_FEATURES,
VerbosityLevel,
warn,
} from "../shared/util";
import { clearPrimitiveCaches, Ref } from "./primitives";
import { LocalPdfManager, NetworkPdfManager } from "./pdf_manager";
import { isNodeJS } from "../shared/is_node";
import { MessageHandler } from "../shared/message_handler";
import { PDFWorkerStream } from "./worker_stream";
import { XRefParseException } from "./core_utils";
} from "../shared/util.js";
import { clearPrimitiveCaches, Ref } from "./primitives.js";
import { LocalPdfManager, NetworkPdfManager } from "./pdf_manager.js";
import { isNodeJS } from "../shared/is_node.js";
import { MessageHandler } from "../shared/message_handler.js";
import { PDFWorkerStream } from "./worker_stream.js";
import { XRefParseException } from "./core_utils.js";
var WorkerTask = (function WorkerTaskClosure() {
function WorkerTask(name) {

View File

@ -14,7 +14,7 @@
*/
/* eslint no-var: error */
import { assert } from "../shared/util";
import { assert } from "../shared/util.js";
/** @implements {IPDFStream} */
class PDFWorkerStream {

View File

@ -20,7 +20,7 @@ import {
getFilenameFromUrl,
LinkTarget,
PDFDateString,
} from "./display_utils";
} from "./display_utils.js";
import {
AnnotationBorderStyleType,
AnnotationType,
@ -28,7 +28,7 @@ import {
unreachable,
Util,
warn,
} from "../shared/util";
} from "../shared/util.js";
/**
* @typedef {Object} AnnotationElementParameters

View File

@ -37,7 +37,7 @@ import {
UnknownErrorException,
unreachable,
warn,
} from "../shared/util";
} from "../shared/util.js";
import {
deprecated,
DOMCanvasFactory,
@ -47,16 +47,16 @@ import {
releaseImageResources,
RenderingCancelledException,
StatTimer,
} from "./display_utils";
import { FontFaceObject, FontLoader } from "./font_loader";
import { apiCompatibilityParams } from "./api_compatibility";
import { CanvasGraphics } from "./canvas";
import { GlobalWorkerOptions } from "./worker_options";
import { isNodeJS } from "../shared/is_node";
import { MessageHandler } from "../shared/message_handler";
import { Metadata } from "./metadata";
import { PDFDataTransportStream } from "./transport_stream";
import { WebGLContext } from "./webgl";
} from "./display_utils.js";
import { FontFaceObject, FontLoader } from "./font_loader.js";
import { apiCompatibilityParams } from "./api_compatibility.js";
import { CanvasGraphics } from "./canvas.js";
import { GlobalWorkerOptions } from "./worker_options.js";
import { isNodeJS } from "../shared/is_node.js";
import { MessageHandler } from "../shared/message_handler.js";
import { Metadata } from "./metadata.js";
import { PDFDataTransportStream } from "./transport_stream.js";
import { WebGLContext } from "./webgl.js";
const DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536
const RENDERING_CANCELLED_TIMEOUT = 100; // ms
@ -1635,7 +1635,7 @@ const PDFWorker = (function PDFWorkerClosure() {
if (typeof SystemJS !== "object") {
throw new Error("SystemJS must be used to load fake worker.");
}
const worker = await SystemJS.import("pdfjs/core/worker");
const worker = await SystemJS.import("pdfjs/core/worker.js");
return worker.WorkerMessageHandler;
}
if (

View File

@ -15,7 +15,7 @@
let compatibilityParams = Object.create(null);
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
const { isNodeJS } = require("../shared/is_node");
const { isNodeJS } = require("../shared/is_node.js");
const userAgent =
(typeof navigator !== "undefined" && navigator.userAgent) || "";

View File

@ -26,8 +26,8 @@ import {
unreachable,
Util,
warn,
} from "../shared/util";
import { getShadingPatternFromIR, TilingPattern } from "./pattern_helper";
} from "../shared/util.js";
import { getShadingPatternFromIR, TilingPattern } from "./pattern_helper.js";
// <canvas> contexts store most of the state we need natively.
// However, PDF needs a bit more state, which we store here.

View File

@ -23,7 +23,7 @@ import {
stringToBytes,
Util,
warn,
} from "../shared/util";
} from "../shared/util.js";
const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
const SVG_NS = "http://www.w3.org/2000/svg";

View File

@ -18,13 +18,13 @@ import {
AbortException,
assert,
createPromiseCapability,
} from "../shared/util";
} from "../shared/util.js";
import {
createResponseStatusError,
extractFilenameFromHeader,
validateRangeRequestCapabilities,
validateResponseStatus,
} from "./network_utils";
} from "./network_utils.js";
function createFetchOptions(headers, withCredentials, abortController) {
return {

View File

@ -22,7 +22,7 @@ import {
unreachable,
UNSUPPORTED_FEATURES,
warn,
} from "../shared/util";
} from "../shared/util.js";
class BaseFontLoader {
constructor({ docId, onUnsupportedFeature }) {

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { assert } from "../shared/util";
import { SimpleXMLParser } from "./xml_parser";
import { assert } from "../shared/util.js";
import { SimpleXMLParser } from "./xml_parser.js";
class Metadata {
constructor(data) {

View File

@ -14,12 +14,16 @@
*/
/* eslint no-var: error */
import { assert, createPromiseCapability, stringToBytes } from "../shared/util";
import {
assert,
createPromiseCapability,
stringToBytes,
} from "../shared/util.js";
import {
createResponseStatusError,
extractFilenameFromHeader,
validateRangeRequestCapabilities,
} from "./network_utils";
} from "./network_utils.js";
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("FIREFOX || MOZCENTRAL")) {
throw new Error(

View File

@ -17,8 +17,8 @@ import {
assert,
MissingPDFException,
UnexpectedResponseException,
} from "../shared/util";
import { getFilenameFromContentDispositionHeader } from "./content_disposition";
} from "../shared/util.js";
import { getFilenameFromContentDispositionHeader } from "./content_disposition.js";
function validateRangeRequestCapabilities({
getResponseHeader,

View File

@ -24,11 +24,11 @@ import {
assert,
createPromiseCapability,
MissingPDFException,
} from "../shared/util";
} from "../shared/util.js";
import {
extractFilenameFromHeader,
validateRangeRequestCapabilities,
} from "./network_utils";
} from "./network_utils.js";
const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//;

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { FormatError, info, Util } from "../shared/util";
import { FormatError, info, Util } from "../shared/util.js";
var ShadingIRs = {};

View File

@ -25,9 +25,9 @@ import {
TextRenderingMode,
Util,
warn,
} from "../shared/util";
import { DOMSVGFactory } from "./display_utils";
import { isNodeJS } from "../shared/is_node";
} from "../shared/util.js";
import { DOMSVGFactory } from "./display_utils.js";
import { isNodeJS } from "../shared/is_node.js";
let SVGGraphics = function() {
throw new Error("Not implemented: SVGGraphics");

View File

@ -13,7 +13,11 @@
* limitations under the License.
*/
import { AbortException, createPromiseCapability, Util } from "../shared/util";
import {
AbortException,
createPromiseCapability,
Util,
} from "../shared/util.js";
/**
* Text layer render parameters.

View File

@ -14,7 +14,7 @@
*/
/* eslint no-var: error */
import { assert, createPromiseCapability } from "../shared/util";
import { assert, createPromiseCapability } from "../shared/util.js";
/** @implements {IPDFStream} */
class PDFDataTransportStream {

View File

@ -14,7 +14,7 @@
*/
/* eslint-disable no-multi-str */
import { shadow } from "../shared/util";
import { shadow } from "../shared/util.js";
class WebGLContext {
constructor({ enable = false }) {

View File

@ -12,12 +12,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-unused-vars */
import { getVerbosityLevel, setVerbosityLevel } from "./shared/util";
import { Jbig2mage } from "./core/jbig2";
import { JpegImage } from "./core/jpg";
import { JpxImage } from "./core/jpx";
import { getVerbosityLevel, setVerbosityLevel } from "./shared/util.js";
import { Jbig2mage } from "./core/jbig2.js";
import { JpegImage } from "./core/jpg.js";
import { JpxImage } from "./core/jpx.js";
// To ensure that the standalone PDF.js image decoders have the same
// browser/environment compatibility as the regular PDF.js library,
@ -33,7 +32,9 @@ import { JpxImage } from "./core/jpx";
// - Promise
// - URL
// eslint-disable-next-line no-unused-vars
const pdfjsVersion = PDFJSDev.eval("BUNDLE_VERSION");
// eslint-disable-next-line no-unused-vars
const pdfjsBuild = PDFJSDev.eval("BUNDLE_BUILD");
export { Jbig2mage, JpegImage, JpxImage, getVerbosityLevel, setVerbosityLevel };

View File

@ -27,7 +27,7 @@ if (
}
globalThis._pdfjsCompatibilityChecked = true;
const { isNodeJS } = require("./is_node");
const { isNodeJS } = require("./is_node.js");
const hasDOM = typeof window === "object" && typeof document === "object";
const userAgent =
@ -148,7 +148,7 @@ if (
if (String.prototype.startsWith) {
return;
}
require("core-js/es/string/starts-with");
require("core-js/es/string/starts-with.js");
})();
// Provides support for String.prototype.endsWith in legacy browsers.
@ -157,7 +157,7 @@ if (
if (String.prototype.endsWith) {
return;
}
require("core-js/es/string/ends-with");
require("core-js/es/string/ends-with.js");
})();
// Provides support for String.prototype.includes in legacy browsers.
@ -166,7 +166,7 @@ if (
if (String.prototype.includes) {
return;
}
require("core-js/es/string/includes");
require("core-js/es/string/includes.js");
})();
// Provides support for Array.prototype.includes in legacy browsers.
@ -175,7 +175,7 @@ if (
if (Array.prototype.includes) {
return;
}
require("core-js/es/array/includes");
require("core-js/es/array/includes.js");
})();
// Provides support for Array.from in legacy browsers.
@ -184,7 +184,7 @@ if (
if (Array.from) {
return;
}
require("core-js/es/array/from");
require("core-js/es/array/from.js");
})();
// Provides support for Object.assign in legacy browsers.
@ -193,7 +193,7 @@ if (
if (Object.assign) {
return;
}
require("core-js/es/object/assign");
require("core-js/es/object/assign.js");
})();
// Provides support for Math.log2 in legacy browsers.
@ -202,7 +202,7 @@ if (
if (Math.log2) {
return;
}
Math.log2 = require("core-js/es/math/log2");
Math.log2 = require("core-js/es/math/log2.js");
})();
// Provides support for Number.isNaN in legacy browsers.
@ -211,7 +211,7 @@ if (
if (Number.isNaN) {
return;
}
Number.isNaN = require("core-js/es/number/is-nan");
Number.isNaN = require("core-js/es/number/is-nan.js");
})();
// Provides support for Number.isInteger in legacy browsers.
@ -220,7 +220,7 @@ if (
if (Number.isInteger) {
return;
}
Number.isInteger = require("core-js/es/number/is-integer");
Number.isInteger = require("core-js/es/number/is-integer.js");
})();
// Support: IE, Safari<11, Chrome<63
@ -237,7 +237,7 @@ if (
) {
return;
}
globalThis.Promise = require("core-js/es/promise/index");
globalThis.Promise = require("core-js/es/promise/index.js");
})();
// Support: IE
@ -252,7 +252,7 @@ if (
// builds.
return;
}
globalThis.URL = require("core-js/web/url");
globalThis.URL = require("core-js/web/url.js");
})();
// Support: IE, Node.js
@ -281,7 +281,7 @@ if (
if (isReadableStreamSupported) {
return;
}
globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill").ReadableStream;
globalThis.ReadableStream = require("web-streams-polyfill/dist/ponyfill.js").ReadableStream;
})();
// Support: IE<11, Safari<8, Chrome<36
@ -289,7 +289,7 @@ if (
if (globalThis.WeakMap) {
return;
}
globalThis.WeakMap = require("core-js/es/weak-map/index");
globalThis.WeakMap = require("core-js/es/weak-map/index.js");
})();
// Support: IE11
@ -297,7 +297,7 @@ if (
if (globalThis.WeakSet) {
return;
}
globalThis.WeakSet = require("core-js/es/weak-set/index");
globalThis.WeakSet = require("core-js/es/weak-set/index.js");
})();
// Provides support for String.codePointAt in legacy browsers.
@ -306,7 +306,7 @@ if (
if (String.prototype.codePointAt) {
return;
}
require("core-js/es/string/code-point-at");
require("core-js/es/string/code-point-at.js");
})();
// Provides support for String.fromCodePoint in legacy browsers.
@ -315,7 +315,7 @@ if (
if (String.fromCodePoint) {
return;
}
String.fromCodePoint = require("core-js/es/string/from-code-point");
String.fromCodePoint = require("core-js/es/string/from-code-point.js");
})();
// Support: IE
@ -323,7 +323,7 @@ if (
if (globalThis.Symbol) {
return;
}
require("core-js/es/symbol/index");
require("core-js/es/symbol/index.js");
})();
// Provides support for String.prototype.padStart in legacy browsers.
@ -332,7 +332,7 @@ if (
if (String.prototype.padStart) {
return;
}
require("core-js/es/string/pad-start");
require("core-js/es/string/pad-start.js");
})();
// Provides support for String.prototype.padEnd in legacy browsers.
@ -341,7 +341,7 @@ if (
if (String.prototype.padEnd) {
return;
}
require("core-js/es/string/pad-end");
require("core-js/es/string/pad-end.js");
})();
// Provides support for Object.values in legacy browsers.
@ -350,6 +350,6 @@ if (
if (Object.values) {
return;
}
Object.values = require("core-js/es/object/values");
Object.values = require("core-js/es/object/values.js");
})();
}

View File

@ -21,7 +21,7 @@ import {
MissingPDFException,
UnexpectedResponseException,
UnknownErrorException,
} from "./util";
} from "./util.js";
const CallbackKind = {
UNKNOWN: 0,

View File

@ -27,6 +27,6 @@ self.importScripts = (function(importScripts) {
importScripts("../node_modules/systemjs/dist/system.js");
importScripts("../systemjs.config.js");
SystemJS.import("pdfjs/core/worker").then(function() {
SystemJS.import("pdfjs/core/worker.js").then(function() {
// Worker is loaded at this point.
});

View File

@ -42,10 +42,10 @@
function initializePDFJS(callback) {
Promise.all([
SystemJS.import("pdfjs/core/fonts"),
SystemJS.import("pdfjs/core/stream"),
SystemJS.import("pdfjs/core/primitives"),
SystemJS.import("pdfjs/core/cmap"),
SystemJS.import("pdfjs/core/fonts.js"),
SystemJS.import("pdfjs/core/stream.js"),
SystemJS.import("pdfjs/core/primitives.js"),
SystemJS.import("pdfjs/core/cmap.js"),
]).then(function(modules) {
var fonts = modules[0],
stream = modules[1],

View File

@ -19,7 +19,7 @@ import {
AnnotationFactory,
getQuadPoints,
MarkupAnnotation,
} from "../../src/core/annotation";
} from "../../src/core/annotation.js";
import {
AnnotationBorderStyleType,
AnnotationFieldFlag,
@ -27,11 +27,11 @@ import {
AnnotationType,
stringToBytes,
stringToUTF8String,
} from "../../src/shared/util";
import { createIdFactory, XRefMock } from "./test_utils";
import { Dict, Name, Ref } from "../../src/core/primitives";
import { Lexer, Parser } from "../../src/core/parser";
import { StringStream } from "../../src/core/stream";
} from "../../src/shared/util.js";
import { createIdFactory, XRefMock } from "./test_utils.js";
import { Dict, Name, Ref } from "../../src/core/primitives.js";
import { Lexer, Parser } from "../../src/core/parser.js";
import { StringStream } from "../../src/core/stream.js";
describe("annotation", function() {
class PDFManagerMock {

View File

@ -19,7 +19,7 @@ import {
NodeCanvasFactory,
NodeFileReaderFactory,
TEST_PDFS_PATH,
} from "./test_utils";
} from "./test_utils.js";
import {
createPromiseCapability,
FontType,
@ -31,23 +31,23 @@ import {
PasswordResponses,
PermissionFlag,
StreamType,
} from "../../src/shared/util";
} from "../../src/shared/util.js";
import {
DOMCanvasFactory,
RenderingCancelledException,
StatTimer,
} from "../../src/display/display_utils";
} from "../../src/display/display_utils.js";
import {
getDocument,
PDFDataRangeTransport,
PDFDocumentProxy,
PDFPageProxy,
PDFWorker,
} from "../../src/display/api";
import { AutoPrintRegExp } from "../../web/ui_utils";
import { GlobalWorkerOptions } from "../../src/display/worker_options";
import { isNodeJS } from "../../src/shared/is_node";
import { Metadata } from "../../src/display/metadata";
} from "../../src/display/api.js";
import { AutoPrintRegExp } from "../../web/ui_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() {
let basicApiFileName = "basicapi.pdf";

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { bidi } from "../../src/core/bidi";
import { bidi } from "../../src/core/bidi.js";
describe("bidi", function() {
it("should mark text as RTL if more than 30% of text is RTL", function() {

View File

@ -19,9 +19,9 @@ import {
CFFFDSelect,
CFFParser,
CFFStrings,
} from "../../src/core/cff_parser";
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts";
import { Stream } from "../../src/core/stream";
} from "../../src/core/cff_parser.js";
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts.js";
import { Stream } from "../../src/core/stream.js";
describe("CFFParser", function() {
function createWithNullProto(obj) {

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
import { setVerbosityLevel, VerbosityLevel } from "../../src/shared/util";
import { isNodeJS } from "../../src/shared/is_node";
import { PDFNodeStream } from "../../src/display/node_stream";
import { setPDFNetworkStreamFactory } from "../../src/display/api";
import { setVerbosityLevel, VerbosityLevel } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { PDFNodeStream } from "../../src/display/node_stream.js";
import { setPDFNetworkStreamFactory } from "../../src/display/api.js";
// Ensure that this script only runs in Node.js environments.
if (!isNodeJS) {

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { CMap, CMapFactory, IdentityCMap } from "../../src/core/cmap";
import { DOMCMapReaderFactory } from "../../src/display/display_utils";
import { isNodeJS } from "../../src/shared/is_node";
import { Name } from "../../src/core/primitives";
import { NodeCMapReaderFactory } from "./test_utils";
import { StringStream } from "../../src/core/stream";
import { CMap, CMapFactory, IdentityCMap } from "../../src/core/cmap.js";
import { DOMCMapReaderFactory } from "../../src/display/display_utils.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { Name } from "../../src/core/primitives.js";
import { NodeCMapReaderFactory } from "./test_utils.js";
import { StringStream } from "../../src/core/stream.js";
var cMapUrl = {
dom: "../../external/bcmaps/",

View File

@ -13,11 +13,11 @@
* limitations under the License.
*/
import { Dict, Name, Ref } from "../../src/core/primitives";
import { Stream, StringStream } from "../../src/core/stream";
import { ColorSpace } from "../../src/core/colorspace";
import { PDFFunctionFactory } from "../../src/core/function";
import { XRefMock } from "./test_utils";
import { Dict, Name, Ref } from "../../src/core/primitives.js";
import { Stream, StringStream } from "../../src/core/stream.js";
import { ColorSpace } from "../../src/core/colorspace.js";
import { PDFFunctionFactory } from "../../src/core/function.js";
import { XRefMock } from "./test_utils.js";
describe("colorspace", function() {
describe("ColorSpace", function() {

View File

@ -13,12 +13,12 @@
* limitations under the License.
*/
import { Dict, Ref } from "../../src/core/primitives";
import { Dict, Ref } from "../../src/core/primitives.js";
import {
getInheritableProperty,
toRomanNumerals,
} from "../../src/core/core_utils";
import { XRefMock } from "./test_utils";
} from "../../src/core/core_utils.js";
import { XRefMock } from "./test_utils.js";
describe("core_utils", function() {
describe("getInheritableProperty", function() {

View File

@ -24,13 +24,13 @@ import {
CipherTransformFactory,
PDF17,
PDF20,
} from "../../src/core/crypto";
import { Dict, Name } from "../../src/core/primitives";
} from "../../src/core/crypto.js";
import { Dict, Name } from "../../src/core/primitives.js";
import {
PasswordException,
PasswordResponses,
stringToBytes,
} from "../../src/shared/util";
} from "../../src/shared/util.js";
describe("crypto", function() {
function hex2binary(s) {

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
import { buildGetDocumentParams, NodeCanvasFactory } from "./test_utils";
import { DOMCanvasFactory } from "../../src/display/display_utils";
import { getDocument } from "../../src/display/api";
import { isNodeJS } from "../../src/shared/is_node";
import { buildGetDocumentParams, NodeCanvasFactory } from "./test_utils.js";
import { DOMCanvasFactory } from "../../src/display/display_utils.js";
import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node.js";
function getTopLeftPixel(canvasContext) {
let imgData = canvasContext.getImageData(0, 0, 1, 1);

View File

@ -14,12 +14,12 @@
*/
/* globals __non_webpack_require__ */
import { setStubs, unsetStubs } from "../../examples/node/domstubs";
import { buildGetDocumentParams } from "./test_utils";
import { getDocument } from "../../src/display/api";
import { isNodeJS } from "../../src/shared/is_node";
import { NativeImageDecoding } from "../../src/shared/util";
import { SVGGraphics } from "../../src/display/svg";
import { setStubs, unsetStubs } from "../../examples/node/domstubs.js";
import { buildGetDocumentParams } from "./test_utils.js";
import { getDocument } from "../../src/display/api.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { NativeImageDecoding } from "../../src/shared/util.js";
import { SVGGraphics } from "../../src/display/svg.js";
const XLINK_NS = "http://www.w3.org/1999/xlink";

View File

@ -20,8 +20,8 @@ import {
getFilenameFromUrl,
isValidFetchUrl,
PDFDateString,
} from "../../src/display/display_utils";
import { isNodeJS } from "../../src/shared/is_node";
} from "../../src/display/display_utils.js";
import { isNodeJS } from "../../src/shared/is_node.js";
describe("display_utils", function() {
describe("DOMCanvasFactory", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { createIdFactory } from "./test_utils";
import { createIdFactory } from "./test_utils.js";
describe("document", function() {
describe("Page", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { getEncoding } from "../../src/core/encodings";
import { getEncoding } from "../../src/core/encodings.js";
describe("encodings", function() {
describe("getEncoding", function() {

View File

@ -13,13 +13,13 @@
* limitations under the License.
*/
import { createIdFactory, XRefMock } from "./test_utils";
import { Dict, Name } from "../../src/core/primitives";
import { FormatError, OPS } from "../../src/shared/util";
import { Stream, StringStream } from "../../src/core/stream";
import { OperatorList } from "../../src/core/operator_list";
import { PartialEvaluator } from "../../src/core/evaluator";
import { WorkerTask } from "../../src/core/worker";
import { createIdFactory, XRefMock } from "./test_utils.js";
import { Dict, Name } from "../../src/core/primitives.js";
import { FormatError, OPS } from "../../src/shared/util.js";
import { Stream, StringStream } from "../../src/core/stream.js";
import { OperatorList } from "../../src/core/operator_list.js";
import { PartialEvaluator } from "../../src/core/evaluator.js";
import { WorkerTask } from "../../src/core/worker.js";
describe("evaluator", function() {
function HandlerMock() {

View File

@ -14,8 +14,8 @@
*/
/* eslint no-var: error */
import { AbortException } from "../../src/shared/util";
import { PDFFetchStream } from "../../src/display/fetch_stream";
import { AbortException } from "../../src/shared/util.js";
import { PDFFetchStream } from "../../src/display/fetch_stream.js";
describe("fetch_stream", function() {
const pdfUrl = new URL("../pdfs/tracemonkey.pdf", window.location).href;

View File

@ -16,9 +16,9 @@
import {
PostScriptCompiler,
PostScriptEvaluator,
} from "../../src/core/function";
import { PostScriptLexer, PostScriptParser } from "../../src/core/ps_parser";
import { StringStream } from "../../src/core/stream";
} from "../../src/core/function.js";
import { PostScriptLexer, PostScriptParser } from "../../src/core/ps_parser.js";
import { StringStream } from "../../src/core/stream.js";
describe("function", function() {
beforeEach(function() {

View File

@ -43,42 +43,42 @@
function initializePDFJS(callback) {
Promise.all(
[
"pdfjs/display/api",
"pdfjs/display/worker_options",
"pdfjs/display/network",
"pdfjs/display/fetch_stream",
"pdfjs/shared/is_node",
"pdfjs-test/unit/annotation_spec",
"pdfjs-test/unit/api_spec",
"pdfjs-test/unit/bidi_spec",
"pdfjs-test/unit/cff_parser_spec",
"pdfjs-test/unit/cmap_spec",
"pdfjs-test/unit/colorspace_spec",
"pdfjs-test/unit/core_utils_spec",
"pdfjs-test/unit/crypto_spec",
"pdfjs-test/unit/custom_spec",
"pdfjs-test/unit/display_svg_spec",
"pdfjs-test/unit/display_utils_spec",
"pdfjs-test/unit/document_spec",
"pdfjs-test/unit/encodings_spec",
"pdfjs-test/unit/evaluator_spec",
"pdfjs-test/unit/function_spec",
"pdfjs-test/unit/fetch_stream_spec",
"pdfjs-test/unit/message_handler_spec",
"pdfjs-test/unit/metadata_spec",
"pdfjs-test/unit/murmurhash3_spec",
"pdfjs-test/unit/network_spec",
"pdfjs-test/unit/network_utils_spec",
"pdfjs-test/unit/parser_spec",
"pdfjs-test/unit/pdf_find_controller_spec",
"pdfjs-test/unit/pdf_find_utils_spec",
"pdfjs-test/unit/pdf_history_spec",
"pdfjs-test/unit/primitives_spec",
"pdfjs-test/unit/stream_spec",
"pdfjs-test/unit/type1_parser_spec",
"pdfjs-test/unit/ui_utils_spec",
"pdfjs-test/unit/unicode_spec",
"pdfjs-test/unit/util_spec",
"pdfjs/display/api.js",
"pdfjs/display/worker_options.js",
"pdfjs/display/network.js",
"pdfjs/display/fetch_stream.js",
"pdfjs/shared/is_node.js",
"pdfjs-test/unit/annotation_spec.js",
"pdfjs-test/unit/api_spec.js",
"pdfjs-test/unit/bidi_spec.js",
"pdfjs-test/unit/cff_parser_spec.js",
"pdfjs-test/unit/cmap_spec.js",
"pdfjs-test/unit/colorspace_spec.js",
"pdfjs-test/unit/core_utils_spec.js",
"pdfjs-test/unit/crypto_spec.js",
"pdfjs-test/unit/custom_spec.js",
"pdfjs-test/unit/display_svg_spec.js",
"pdfjs-test/unit/display_utils_spec.js",
"pdfjs-test/unit/document_spec.js",
"pdfjs-test/unit/encodings_spec.js",
"pdfjs-test/unit/evaluator_spec.js",
"pdfjs-test/unit/function_spec.js",
"pdfjs-test/unit/fetch_stream_spec.js",
"pdfjs-test/unit/message_handler_spec.js",
"pdfjs-test/unit/metadata_spec.js",
"pdfjs-test/unit/murmurhash3_spec.js",
"pdfjs-test/unit/network_spec.js",
"pdfjs-test/unit/network_utils_spec.js",
"pdfjs-test/unit/parser_spec.js",
"pdfjs-test/unit/pdf_find_controller_spec.js",
"pdfjs-test/unit/pdf_find_utils_spec.js",
"pdfjs-test/unit/pdf_history_spec.js",
"pdfjs-test/unit/primitives_spec.js",
"pdfjs-test/unit/stream_spec.js",
"pdfjs-test/unit/type1_parser_spec.js",
"pdfjs-test/unit/ui_utils_spec.js",
"pdfjs-test/unit/unicode_spec.js",
"pdfjs-test/unit/util_spec.js",
].map(function(moduleName) {
return SystemJS.import(moduleName);
})

View File

@ -17,9 +17,9 @@ import {
AbortException,
createPromiseCapability,
UnknownErrorException,
} from "../../src/shared/util";
import { LoopbackPort } from "../../src/display/api";
import { MessageHandler } from "../../src/shared/message_handler";
} from "../../src/shared/util.js";
import { LoopbackPort } from "../../src/display/api.js";
import { MessageHandler } from "../../src/shared/message_handler.js";
describe("message_handler", function() {
// Sleep function to wait for sometime, similar to setTimeout but faster.

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { isEmptyObj } from "../../src/shared/util";
import { Metadata } from "../../src/display/metadata";
import { isEmptyObj } from "../../src/shared/util.js";
import { Metadata } from "../../src/display/metadata.js";
describe("metadata", function() {
it("should handle valid metadata", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { MurmurHash3_64 } from "../../src/core/murmurhash3";
import { MurmurHash3_64 } from "../../src/core/murmurhash3.js";
describe("MurmurHash3_64", function() {
it("instantiates without seed", function() {

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { AbortException } from "../../src/shared/util";
import { PDFNetworkStream } from "../../src/display/network";
import { AbortException } from "../../src/shared/util.js";
import { PDFNetworkStream } from "../../src/display/network.js";
describe("network", function() {
var pdf1 = new URL("../pdfs/tracemonkey.pdf", window.location).href;

View File

@ -18,11 +18,11 @@ import {
extractFilenameFromHeader,
validateRangeRequestCapabilities,
validateResponseStatus,
} from "../../src/display/network_utils";
} from "../../src/display/network_utils.js";
import {
MissingPDFException,
UnexpectedResponseException,
} from "../../src/shared/util";
} from "../../src/shared/util.js";
describe("network_utils", function() {
describe("validateRangeRequestCapabilities", function() {

View File

@ -14,9 +14,9 @@
*/
/* globals __non_webpack_require__ */
import { AbortException, assert } from "../../src/shared/util";
import { isNodeJS } from "../../src/shared/is_node";
import { PDFNodeStream } from "../../src/display/node_stream";
import { AbortException, assert } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { PDFNodeStream } from "../../src/display/node_stream.js";
// Make sure that we only running this script is Node.js environments.
assert(isNodeJS);

View File

@ -14,10 +14,10 @@
*/
/* eslint no-var: error */
import { Lexer, Linearization, Parser } from "../../src/core/parser";
import { FormatError } from "../../src/shared/util";
import { Name } from "../../src/core/primitives";
import { StringStream } from "../../src/core/stream";
import { Lexer, Linearization, Parser } from "../../src/core/parser.js";
import { FormatError } from "../../src/shared/util.js";
import { Name } from "../../src/core/primitives.js";
import { StringStream } from "../../src/core/stream.js";
describe("parser", function() {
describe("Parser", function() {

View File

@ -13,11 +13,11 @@
* limitations under the License.
*/
import { buildGetDocumentParams } from "./test_utils";
import { EventBus } from "../../web/ui_utils";
import { getDocument } from "../../src/display/api";
import { PDFFindController } from "../../web/pdf_find_controller";
import { SimpleLinkService } from "../../web/pdf_link_service";
import { buildGetDocumentParams } from "./test_utils.js";
import { EventBus } from "../../web/ui_utils.js";
import { getDocument } from "../../src/display/api.js";
import { PDFFindController } from "../../web/pdf_find_controller.js";
import { SimpleLinkService } from "../../web/pdf_link_service.js";
class MockLinkService extends SimpleLinkService {
constructor() {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { CharacterType, getCharacterType } from "../../web/pdf_find_utils";
import { CharacterType, getCharacterType } from "../../web/pdf_find_utils.js";
describe("pdf_find_utils", function() {
describe("getCharacterType", function() {

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
import { isDestArraysEqual, isDestHashesEqual } from "../../web/pdf_history";
import { isDestArraysEqual, isDestHashesEqual } from "../../web/pdf_history.js";
describe("pdf_history", function() {
describe("isDestHashesEqual", function() {

View File

@ -24,8 +24,8 @@ import {
Name,
Ref,
RefSet,
} from "../../src/core/primitives";
import { XRefMock } from "./test_utils";
} from "../../src/core/primitives.js";
import { XRefMock } from "./test_utils.js";
describe("primitives", function() {
describe("Name", function() {

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
import { PredictorStream, Stream } from "../../src/core/stream";
import { Dict } from "../../src/core/primitives";
import { PredictorStream, Stream } from "../../src/core/stream.js";
import { Dict } from "../../src/core/primitives.js";
describe("stream", function() {
beforeEach(function() {

View File

@ -13,10 +13,10 @@
* limitations under the License.
*/
import { assert, CMapCompressionType } from "../../src/shared/util";
import { isNodeJS } from "../../src/shared/is_node";
import { isRef } from "../../src/core/primitives";
import { Page } from "../../src/core/document";
import { assert, CMapCompressionType } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
import { isRef } from "../../src/core/primitives.js";
import { Page } from "../../src/core/document.js";
class DOMFileReaderFactory {
static async fetch(params) {

View File

@ -13,9 +13,9 @@
* limitations under the License.
*/
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts";
import { StringStream } from "../../src/core/stream";
import { Type1Parser } from "../../src/core/type1_parser";
import { SEAC_ANALYSIS_ENABLED } from "../../src/core/fonts.js";
import { StringStream } from "../../src/core/stream.js";
import { Type1Parser } from "../../src/core/type1_parser.js";
describe("Type1Parser", function() {
it("splits tokens", function() {

View File

@ -25,9 +25,9 @@ import {
moveToEndOfArray,
waitOnEventOrTimeout,
WaitOnType,
} from "../../web/ui_utils";
import { createObjectURL } from "../../src/shared/util";
import { isNodeJS } from "../../src/shared/is_node";
} from "../../web/ui_utils.js";
import { createObjectURL } from "../../src/shared/util.js";
import { isNodeJS } from "../../src/shared/is_node.js";
describe("ui_utils", function() {
describe("binary search", function() {

View File

@ -16,14 +16,14 @@
import {
getDingbatsGlyphsUnicode,
getGlyphsUnicode,
} from "../../src/core/glyphlist";
} from "../../src/core/glyphlist.js";
import {
getNormalizedUnicodes,
getUnicodeForGlyph,
getUnicodeRangeFor,
mapSpecialUnicodeValues,
reverseIfRtl,
} from "../../src/core/unicode";
} from "../../src/core/unicode.js";
describe("unicode", function() {
describe("mapSpecialUnicodeValues", function() {

View File

@ -29,7 +29,7 @@ import {
string32,
stringToBytes,
stringToPDFString,
} from "../../src/shared/util";
} from "../../src/shared/util.js";
describe("util", function() {
describe("bytesToString", function() {

View File

@ -14,8 +14,8 @@
*/
import { AnnotationLayer } from "pdfjs-lib";
import { NullL10n } from "./ui_utils";
import { SimpleLinkService } from "./pdf_link_service";
import { NullL10n } from "./ui_utils.js";
import { SimpleLinkService } from "./pdf_link_service.js";
/**
* @typedef {Object} AnnotationLayerBuilderOptions

View File

@ -34,8 +34,8 @@ import {
ScrollMode,
SpreadMode,
TextLayerMode,
} from "./ui_utils";
import { AppOptions, OptionKind } from "./app_options";
} from "./ui_utils.js";
import { AppOptions, OptionKind } from "./app_options.js";
import {
build,
createObjectURL,
@ -53,25 +53,25 @@ import {
UNSUPPORTED_FEATURES,
version,
} from "pdfjs-lib";
import { CursorTool, PDFCursorTools } from "./pdf_cursor_tools";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue";
import { PDFSidebar, SidebarView } from "./pdf_sidebar";
import { OverlayManager } from "./overlay_manager";
import { PasswordPrompt } from "./password_prompt";
import { PDFAttachmentViewer } from "./pdf_attachment_viewer";
import { PDFDocumentProperties } from "./pdf_document_properties";
import { PDFFindBar } from "./pdf_find_bar";
import { PDFFindController } from "./pdf_find_controller";
import { PDFHistory } from "./pdf_history";
import { PDFLinkService } from "./pdf_link_service";
import { PDFOutlineViewer } from "./pdf_outline_viewer";
import { PDFPresentationMode } from "./pdf_presentation_mode";
import { PDFSidebarResizer } from "./pdf_sidebar_resizer";
import { PDFThumbnailViewer } from "./pdf_thumbnail_viewer";
import { PDFViewer } from "./pdf_viewer";
import { SecondaryToolbar } from "./secondary_toolbar";
import { Toolbar } from "./toolbar";
import { ViewHistory } from "./view_history";
import { CursorTool, PDFCursorTools } from "./pdf_cursor_tools.js";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue.js";
import { PDFSidebar, SidebarView } from "./pdf_sidebar.js";
import { OverlayManager } from "./overlay_manager.js";
import { PasswordPrompt } from "./password_prompt.js";
import { PDFAttachmentViewer } from "./pdf_attachment_viewer.js";
import { PDFDocumentProperties } from "./pdf_document_properties.js";
import { PDFFindBar } from "./pdf_find_bar.js";
import { PDFFindController } from "./pdf_find_controller.js";
import { PDFHistory } from "./pdf_history.js";
import { PDFLinkService } from "./pdf_link_service.js";
import { PDFOutlineViewer } from "./pdf_outline_viewer.js";
import { PDFPresentationMode } from "./pdf_presentation_mode.js";
import { PDFSidebarResizer } from "./pdf_sidebar_resizer.js";
import { PDFThumbnailViewer } from "./pdf_thumbnail_viewer.js";
import { PDFViewer } from "./pdf_viewer.js";
import { SecondaryToolbar } from "./secondary_toolbar.js";
import { Toolbar } from "./toolbar.js";
import { ViewHistory } from "./view_history.js";
const DEFAULT_SCALE_DELTA = 1.1;
const DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000; // ms
@ -1769,7 +1769,7 @@ async function loadFakeWorker() {
if (typeof SystemJS !== "object") {
throw new Error("SystemJS must be used to load fake worker.");
}
window.pdfjsWorker = await SystemJS.import("pdfjs/core/worker");
window.pdfjsWorker = await SystemJS.import("pdfjs/core/worker.js");
return undefined;
}
return loadScript(PDFWorker.getWorkerSrc());

View File

@ -14,7 +14,7 @@
*/
import { apiCompatibilityParams } from "pdfjs-lib";
import { viewerCompatibilityParams } from "./viewer_compatibility";
import { viewerCompatibilityParams } from "./viewer_compatibility.js";
const OptionKind = {
VIEWER: 0x02,

View File

@ -36,13 +36,13 @@ import {
UNKNOWN_SCALE,
VERTICAL_PADDING,
watchScroll,
} from "./ui_utils";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue";
import { AnnotationLayerBuilder } from "./annotation_layer_builder";
} from "./ui_utils.js";
import { PDFRenderingQueue, RenderingStates } from "./pdf_rendering_queue.js";
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
import { createPromiseCapability } from "pdfjs-lib";
import { PDFPageView } from "./pdf_page_view";
import { SimpleLinkService } from "./pdf_link_service";
import { TextLayerBuilder } from "./text_layer_builder";
import { PDFPageView } from "./pdf_page_view.js";
import { SimpleLinkService } from "./pdf_link_service.js";
import { TextLayerBuilder } from "./text_layer_builder.js";
const DEFAULT_CACHE_SIZE = 10;

View File

@ -14,11 +14,11 @@
*/
/* globals chrome */
import { DefaultExternalServices, PDFViewerApplication } from "./app";
import { AppOptions } from "./app_options";
import { BasePreferences } from "./preferences";
import { DownloadManager } from "./download_manager";
import { GenericL10n } from "./genericl10n";
import { DefaultExternalServices, PDFViewerApplication } from "./app.js";
import { AppOptions } from "./app_options.js";
import { BasePreferences } from "./preferences.js";
import { DownloadManager } from "./download_manager.js";
import { GenericL10n } from "./genericl10n.js";
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("CHROME")) {
throw new Error(

Some files were not shown because too many files have changed in this diff Show More