mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Convert globalScope
and isNodeJS
to proper modules
Slightly unrelated to the rest of the patch, but this also removes an out-of-place `globals` definition from the `web/viewer.js` file.
This commit is contained in:
parent
c2bd3a0bfb
commit
2817121bc1
20 changed files with 34 additions and 27 deletions
|
@ -81,11 +81,11 @@ function initializePDFJS(callback) {
|
|||
].map(function (moduleName) {
|
||||
return SystemJS.import(moduleName);
|
||||
})).then(function(modules) {
|
||||
var displayApi = modules[0];
|
||||
const GlobalWorkerOptions = modules[1].GlobalWorkerOptions;
|
||||
var PDFNetworkStream = modules[2].PDFNetworkStream;
|
||||
var PDFFetchStream = modules[3].PDFFetchStream;
|
||||
const isNodeJS = modules[4];
|
||||
const displayApi = modules[0];
|
||||
const { GlobalWorkerOptions, } = modules[1];
|
||||
const { PDFNetworkStream, } = modules[2];
|
||||
const { PDFFetchStream, } = modules[3];
|
||||
const { isNodeJS, } = modules[4];
|
||||
|
||||
if (isNodeJS()) {
|
||||
throw new Error('The `gulp unittest` command cannot be used in ' +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue