Skip to content

Commit

Permalink
ESMify some modules for m-c (bug 1824610)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixteman committed Mar 27, 2023
1 parent 384bd96 commit d0d70c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

"use strict";

var EXPORTED_SYMBOLS = ["PdfJsDefaultPreferences"];

var PdfJsDefaultPreferences = Object.freeze(
export const PdfJsDefaultPreferences = Object.freeze(
PDFJSDev.eval("DEFAULT_PREFERENCES")
);
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function createSandboxExternal(defines) {
transform("utf8", content => {
content = preprocessor2.preprocessPDFJSCode(ctx, content);
return `${licenseHeader}\n${content}`;
})
}).pipe(rename("pdf.sandbox.external.sys.mjs"))
);
}

Expand Down Expand Up @@ -1381,7 +1381,7 @@ gulp.task(
.pipe(gulp.dest(MOZCENTRAL_L10N_DIR)),
gulp.src("LICENSE").pipe(gulp.dest(MOZCENTRAL_EXTENSION_DIR)),
gulp
.src(FIREFOX_CONTENT_DIR + "PdfJsDefaultPreferences.jsm")
.src(FIREFOX_CONTENT_DIR + "PdfJsDefaultPreferences.sys.mjs")
.pipe(transform("utf8", preprocessDefaultPreferences))
.pipe(gulp.dest(MOZCENTRAL_CONTENT_DIR)),
]);
Expand Down
9 changes: 1 addition & 8 deletions src/pdf.sandbox.external.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// In mozilla-central, this file is loaded as non-module script,
// so it mustn't have any dependencies.

class SandboxSupportBase {
export class SandboxSupportBase {
/**
* @param {DOMWindow} - win
*/
Expand Down Expand Up @@ -181,10 +181,3 @@ class SandboxSupportBase {
};
}
}

if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
exports.SandboxSupportBase = SandboxSupportBase;
} else {
/* eslint-disable-next-line no-unused-vars, no-var */
var EXPORTED_SYMBOLS = ["SandboxSupportBase"];
}

0 comments on commit d0d70c3

Please sign in to comment.