diff options
Diffstat (limited to 'ext/web/02_structured_clone.js')
-rw-r--r-- | ext/web/02_structured_clone.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/web/02_structured_clone.js b/ext/web/02_structured_clone.js index 72778e803..13275e2d8 100644 --- a/ext/web/02_structured_clone.js +++ b/ext/web/02_structured_clone.js @@ -7,10 +7,9 @@ /// <reference path="../web/lib.deno_web.d.ts" /> import { core, primordials } from "ext:core/mod.js"; -import DOMException from "ext:deno_web/01_dom_exception.js"; +import { DOMException } from "ext:deno_web/01_dom_exception.js"; const { ArrayBuffer, - ArrayBufferPrototype, ArrayBufferPrototypeGetByteLength, ArrayBufferPrototypeSlice, ArrayBufferIsView, @@ -38,6 +37,9 @@ const { Float32Array, Float64Array, } = primordials; +const { + isArrayBuffer, +} = core; const objectCloneMemo = new SafeWeakMap(); @@ -61,7 +63,7 @@ function cloneArrayBuffer( function structuredClone(value) { // Performance optimization for buffers, otherwise // `serialize/deserialize` will allocate new buffer. - if (ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, value)) { + if (isArrayBuffer(value)) { const cloned = cloneArrayBuffer( value, 0, |