mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Simplify initialization of static
class properties in the worker-thread
Now that we no longer depend on the old Babel version in SystemJS we can remove the `static get ...` work-arounds used to define constants, which leads to slightly more compact code.
This commit is contained in:
parent
d950b91c4e
commit
b0a1af306d
6 changed files with 16 additions and 58 deletions
|
@ -16,7 +16,6 @@
|
|||
import {
|
||||
assert,
|
||||
MAX_IMAGE_SIZE_TO_CACHE,
|
||||
shadow,
|
||||
unreachable,
|
||||
warn,
|
||||
} from "../shared/util.js";
|
||||
|
@ -173,17 +172,11 @@ class RegionalImageCache extends BaseLocalCache {
|
|||
}
|
||||
|
||||
class GlobalImageCache {
|
||||
static get NUM_PAGES_THRESHOLD() {
|
||||
return shadow(this, "NUM_PAGES_THRESHOLD", 2);
|
||||
}
|
||||
static NUM_PAGES_THRESHOLD = 2;
|
||||
|
||||
static get MIN_IMAGES_TO_CACHE() {
|
||||
return shadow(this, "MIN_IMAGES_TO_CACHE", 10);
|
||||
}
|
||||
static MIN_IMAGES_TO_CACHE = 10;
|
||||
|
||||
static get MAX_BYTE_SIZE() {
|
||||
return shadow(this, "MAX_BYTE_SIZE", 5 * MAX_IMAGE_SIZE_TO_CACHE);
|
||||
}
|
||||
static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE;
|
||||
|
||||
constructor() {
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue