diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-12-24 06:04:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-24 13:04:32 +0000 |
commit | 92b2e28c6491f339124ec5851173ac0aaef93908 (patch) | |
tree | 3910827b2772379054c15c4c3f133175138baf36 /ext/web/13_message_port.js | |
parent | 1297c9a8f379d89691522c5cc0c6071c479e95a1 (diff) |
chore: ensure that each op provided to ensureFastOps is only used once (#21689)
When we migrate to op-import-per-extension, we will want to ensure that
ops have one and only one place where they are imported. This tackles
the ops that are imported via `ensureFastOps`, but does not yet tackle
direct `ops` imports.
Landing ahead of https://github.com/denoland/deno_core/pull/393
Diffstat (limited to 'ext/web/13_message_port.js')
-rw-r--r-- | ext/web/13_message_port.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/web/13_message_port.js b/ext/web/13_message_port.js index c1ba3f4c4..9645f5f11 100644 --- a/ext/web/13_message_port.js +++ b/ext/web/13_message_port.js @@ -17,6 +17,7 @@ import { setEventTargetData, setIsTrusted, } from "ext:deno_web/02_event.js"; +import { isDetachedBuffer } from "ext:deno_web/06_streams.js"; import DOMException from "ext:deno_web/01_dom_exception.js"; const { ArrayBufferPrototype, @@ -282,7 +283,7 @@ function serializeJsMessageData(data, transferables) { if (ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, t)) { if ( ArrayBufferPrototypeGetByteLength(t) === 0 && - ops.op_arraybuffer_was_detached(t) + isDetachedBuffer(t) ) { throw new DOMException( `ArrayBuffer at index ${j} is already detached`, |