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

Introduce some logical assignment in the src/core/ folder

This commit is contained in:
Jonas Jenwald 2022-07-17 11:24:05 +02:00
parent 317abd6d07
commit d950b91c4e
20 changed files with 62 additions and 103 deletions

View file

@ -41,7 +41,7 @@ class Name {
static get(name) {
// eslint-disable-next-line no-restricted-syntax
return NameCache[name] || (NameCache[name] = new Name(name));
return (NameCache[name] ||= new Name(name));
}
}
@ -58,7 +58,7 @@ class Cmd {
static get(cmd) {
// eslint-disable-next-line no-restricted-syntax
return CmdCache[cmd] || (CmdCache[cmd] = new Cmd(cmd));
return (CmdCache[cmd] ||= new Cmd(cmd));
}
}
@ -282,7 +282,7 @@ class Ref {
static get(num, gen) {
const key = gen === 0 ? `${num}R` : `${num}R${gen}`;
// eslint-disable-next-line no-restricted-syntax
return RefCache[key] || (RefCache[key] = new Ref(num, gen));
return (RefCache[key] ||= new Ref(num, gen));
}
}