From bf22f114a6e049744866ebaba48faec2cb86549b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 7 Feb 2022 13:54:32 +0100 Subject: refactor: update runtime code for primordial check for iterators (#13510) --- ext/webgpu/01_webgpu.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/webgpu/01_webgpu.js') diff --git a/ext/webgpu/01_webgpu.js b/ext/webgpu/01_webgpu.js index 3531dd797..be880d81d 100644 --- a/ext/webgpu/01_webgpu.js +++ b/ext/webgpu/01_webgpu.js @@ -32,6 +32,7 @@ PromisePrototypeThen, PromiseReject, PromiseResolve, + SafeArrayIterator, Set, SetPrototypeEntries, SetPrototypeForEach, @@ -543,7 +544,9 @@ } [SymbolFor("Deno.privateCustomInspect")](inspect) { - return `${this.constructor.name} ${inspect([...this.values()])}`; + return `${this.constructor.name} ${ + inspect([...new SafeArrayIterator(this.values())]) + }`; } } @@ -1923,7 +1926,7 @@ const { err } = core.opSync("op_webgpu_buffer_unmap", { bufferRid, mappedRid, - }, ...(write ? [new Uint8Array(buffer)] : [])); + }, ...new SafeArrayIterator(write ? [new Uint8Array(buffer)] : [])); device.pushError(err); if (err) return; } -- cgit v1.2.3