Merge pull request #16875 from Snuffleupagus/more-optional-chaining-4
Introduce more optional chaining in the code-base
This commit is contained in:
commit
e142baecb1
@ -40,9 +40,8 @@ class PDFWorkerStream {
|
||||
}
|
||||
|
||||
cancelAllRequests(reason) {
|
||||
if (this._fullRequestReader) {
|
||||
this._fullRequestReader.cancel(reason);
|
||||
}
|
||||
this._fullRequestReader?.cancel(reason);
|
||||
|
||||
for (const reader of this._rangeRequestReaders.slice(0)) {
|
||||
reader.cancel(reason);
|
||||
}
|
||||
|
@ -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,
|
||||
});
|
||||
|
@ -107,9 +107,7 @@ class Sandbox {
|
||||
}
|
||||
|
||||
dumpMemoryUse() {
|
||||
if (this._module) {
|
||||
this._module.ccall("dumpMemoryUse", null, []);
|
||||
}
|
||||
this._module?.ccall("dumpMemoryUse", null, []);
|
||||
}
|
||||
|
||||
nukeSandbox() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user