mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Replace a bunch of Array.prototype.forEach()
cases with for...of
loops instead
Using `for...of` is a modern and generally much nicer pattern, since it gets rid of unnecessary callback-functions. (In a couple of spots, a "regular" `for` loop had to be used.)
This commit is contained in:
parent
da0e7ea969
commit
da22146b95
14 changed files with 67 additions and 71 deletions
|
@ -61,9 +61,9 @@ class BaseFontLoader {
|
|||
}
|
||||
|
||||
clear() {
|
||||
this.nativeFontFaces.forEach(nativeFontFace => {
|
||||
for (const nativeFontFace of this.nativeFontFaces) {
|
||||
this._document.fonts.delete(nativeFontFace);
|
||||
});
|
||||
}
|
||||
this.nativeFontFaces.length = 0;
|
||||
|
||||
if (this.styleElement) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue