1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Move worker-thread only functions from src/shared/util.js and into a new src/core/core_utils.js file

The `src/shared/util.js` file is being bundled into both the `pdf.js` and `pdf.worker.js` files, meaning that its code is by definition duplicated.
Some main-thread only utility functions have already been moved to a separate `src/display/display_utils.js` file, and this patch simply extends that concept to utility functions which are used *only* on the worker-thread.

Note in particular the `getInheritableProperty` function, which expects a `Dict` as input and thus *cannot* possibly ever be used on the main-thread.
This commit is contained in:
Jonas Jenwald 2019-02-23 16:14:31 +01:00
parent a1f7517996
commit db5dc14158
21 changed files with 359 additions and 308 deletions

View file

@ -15,8 +15,7 @@
import {
assert, bytesToString, FONT_IDENTITY_MATRIX, FontType, FormatError, info,
isNum, isSpace, MissingDataException, readUint32, shadow, string32,
unreachable, warn
isNum, isSpace, readUint32, shadow, string32, unreachable, warn
} from '../shared/util';
import {
CFF, CFFCharset, CFFCompiler, CFFHeader, CFFIndex, CFFParser, CFFPrivateDict,
@ -36,6 +35,7 @@ import {
} 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';