Skip to content

Commit c8eca7d

Browse files
authored
Replace uses of for..of loops in generated code (#16783)
These uses had unintentionally slipped in. We have meant to avoid for..of loops so far because very old browsers do not support them.
1 parent bce6cf8 commit c8eca7d

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/library_wasmfs_node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ mergeInto(LibraryManager.library, {
6060
if (!e.code) throw e;
6161
return wasmfsNodeConvertNodeCode(e);
6262
}
63-
for (let entry of entries) {
63+
entries.forEach((entry) => {
6464
withStackSave(() => {
6565
let name = allocateUTF8OnStack(entry.name);
6666
let type;
@@ -76,7 +76,7 @@ mergeInto(LibraryManager.library, {
7676
}
7777
__wasmfs_node_record_dirent(vec, name, type);
7878
});
79-
}
79+
});
8080
// implicitly return 0
8181
},
8282

src/library_webgl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,12 +575,12 @@ var LibraryGL = {
575575
return ret;
576576
};
577577
const matrixFuncs = ['uniformMatrix2fv', 'uniformMatrix3fv', 'uniformMatrix4fv'];
578-
for (const f of matrixFuncs) {
578+
matrixFuncs.forEach(f => {
579579
glCtx[f] = function(a1, a2, a3, a4, a5) {
580580
// WebGL2 version has 2 extra optional parameters, ensure we forward them
581581
return glCtx['real_' + f](a1, a2, a3, a4, a5);
582582
}
583-
}
583+
});
584584
},
585585
#endif
586586
// Returns the context handle to the new context.

src/worker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ self.onmessage = (e) => {
224224
// initialized. Only do this once because it is only possible for
225225
// proxying notifications to arrive before thread initialization on
226226
// fresh workers.
227-
for (const queue of pendingNotifiedProxyingQueues) {
227+
pendingNotifiedProxyingQueues.forEach(queue => {
228228
executeNotifiedProxyingQueue(queue);
229-
}
229+
});
230230
pendingNotifiedProxyingQueues = [];
231231
initializedJS = true;
232232
}

0 commit comments

Comments
 (0)