summaryrefslogtreecommitdiff
path: root/ext/webgpu/src/01_webgpu.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 /ext/webgpu/src/01_webgpu.js
parent2ac575abfb75dc4533306c80240cb1beeb816b9b (diff)
chore: Update dlint (#17031)
Introduces `SafeSetIterator` and `SafeMapIterator` to primordials
Diffstat (limited to 'ext/webgpu/src/01_webgpu.js')
-rw-r--r--ext/webgpu/src/01_webgpu.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/webgpu/src/01_webgpu.js b/ext/webgpu/src/01_webgpu.js
index f4d15e2dd..a5863b6c6 100644
--- a/ext/webgpu/src/01_webgpu.js
+++ b/ext/webgpu/src/01_webgpu.js
@@ -316,7 +316,7 @@
context: "Argument 1",
});
const requiredFeatures = descriptor.requiredFeatures ?? [];
- for (const feature of requiredFeatures) {
+ for (const feature of new SafeArrayIterator(requiredFeatures)) {
if (!SetPrototypeHas(this[_adapter].features[_features], feature)) {
throw new TypeError(
`${prefix}: nonGuaranteedFeatures must be a subset of the adapter features.`,
@@ -1046,7 +1046,7 @@
context: "Argument 1",
});
const device = assertDevice(this, { prefix, context: "this" });
- for (const entry of descriptor.entries) {
+ for (const entry of new SafeArrayIterator(descriptor.entries)) {
let i = 0;
if (entry.buffer) i++;
if (entry.sampler) i++;
@@ -1591,7 +1591,7 @@
device.rid,
commandBufferRids,
);
- for (const commandBuffer of commandBuffers) {
+ for (const commandBuffer of new SafeArrayIterator(commandBuffers)) {
commandBuffer[_rid] = undefined;
}
device.pushError(err);
@@ -1934,7 +1934,7 @@
if (!mappedRanges) {
throw new DOMException(`${prefix}: invalid state.`, "OperationError");
}
- for (const [buffer, _rid, start] of mappedRanges) {
+ for (const [buffer, _rid, start] of new SafeArrayIterator(mappedRanges)) {
// TODO(lucacasonato): is this logic correct?
const end = start + buffer.byteLength;
if (
@@ -2002,7 +2002,7 @@
if (!mappedRanges) {
throw new DOMException(`${prefix}: invalid state.`, "OperationError");
}
- for (const [buffer, mappedRid] of mappedRanges) {
+ for (const [buffer, mappedRid] of new SafeArrayIterator(mappedRanges)) {
const { err } = ops.op_webgpu_buffer_unmap(
bufferRid,
mappedRid,