summaryrefslogtreecommitdiff
path: root/runtime/js/12_io.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2022-12-20 11:37:50 +0900
committerGitHub <noreply@github.com>2022-12-20 03:37:50 +0100
commit948f85216a15e4ef489af21bb532a9b201b0364c (patch)
tree35c2bbfa021cf9a4190ab803ed091c5547bfe9f4 /runtime/js/12_io.js
parent2ac575abfb75dc4533306c80240cb1beeb816b9b (diff)
chore: Update dlint (#17031)
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
Diffstat (limited to 'runtime/js/12_io.js')
-rw-r--r--runtime/js/12_io.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/js/12_io.js b/runtime/js/12_io.js
index db83343bf..c8fc002fc 100644
--- a/runtime/js/12_io.js
+++ b/runtime/js/12_io.js
@@ -12,6 +12,7 @@
Uint8Array,
ArrayPrototypePush,
MathMin,
+ SafeArrayIterator,
TypedArrayPrototypeSubarray,
TypedArrayPrototypeSet,
} = window.__bootstrap.primordials;
@@ -156,14 +157,14 @@
function concatBuffers(buffers) {
let totalLen = 0;
- for (const buf of buffers) {
+ for (const buf of new SafeArrayIterator(buffers)) {
totalLen += buf.byteLength;
}
const contents = new Uint8Array(totalLen);
let n = 0;
- for (const buf of buffers) {
+ for (const buf of new SafeArrayIterator(buffers)) {
TypedArrayPrototypeSet(contents, buf, n);
n += buf.byteLength;
}