mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Use more optional chaining in the code-base (PR 15398 follow-up)
*Fixes a few cases that I missed in PR 15398.*
This commit is contained in:
parent
2146d93609
commit
9f637966f8
3 changed files with 15 additions and 20 deletions
|
@ -163,12 +163,11 @@ class BaseFullReader {
|
|||
return this.read();
|
||||
}
|
||||
this._loaded += chunk.length;
|
||||
if (this.onProgress) {
|
||||
this.onProgress({
|
||||
loaded: this._loaded,
|
||||
total: this._contentLength,
|
||||
});
|
||||
}
|
||||
this.onProgress?.({
|
||||
loaded: this._loaded,
|
||||
total: this._contentLength,
|
||||
});
|
||||
|
||||
// Ensure that `read()` method returns ArrayBuffer.
|
||||
const buffer = new Uint8Array(chunk).buffer;
|
||||
return { value: buffer, done: false };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue