summaryrefslogtreecommitdiff
path: root/ext/web/13_message_port.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/web/13_message_port.js')
-rw-r--r--ext/web/13_message_port.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/web/13_message_port.js b/ext/web/13_message_port.js
index f50d14d1a..6227bf92b 100644
--- a/ext/web/13_message_port.js
+++ b/ext/web/13_message_port.js
@@ -19,6 +19,7 @@ import DOMException from "ext:deno_web/01_dom_exception.js";
const primordials = globalThis.__bootstrap.primordials;
const {
ArrayBufferPrototype,
+ ArrayBufferPrototypeGetByteLength,
ArrayPrototypeFilter,
ArrayPrototypeIncludes,
ArrayPrototypePush,
@@ -249,7 +250,10 @@ function serializeJsMessageData(data, transferables) {
for (let i = 0, j = 0; i < transferables.length; i++) {
const ab = transferables[i];
if (ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, ab)) {
- if (ab.byteLength === 0 && ops.op_arraybuffer_was_detached(ab)) {
+ if (
+ ArrayBufferPrototypeGetByteLength(ab) === 0 &&
+ ops.op_arraybuffer_was_detached(ab)
+ ) {
throw new DOMException(
`ArrayBuffer at index ${j} is already detached`,
"DataCloneError",