Introduce more optional chaining in the code-base

Also, use logical OR assignment a bit more.
This commit is contained in:
Jonas Jenwald 2023-08-26 10:52:23 +02:00
parent 598421b11f
commit ec3d2be761
3 changed files with 4 additions and 11 deletions

View file

@ -3153,11 +3153,7 @@ class PDFObjects {
* @returns {Object}
*/
#ensureObj(objId) {
const obj = this.#objs[objId];
if (obj) {
return obj;
}
return (this.#objs[objId] = {
return (this.#objs[objId] ||= {
capability: new PromiseCapability(),
data: null,
});