Skip to content

Commit 226836c

Browse files
Nahee-Parkmarco-ippolito
authored andcommitted
worker: throw InvalidStateError in postMessage after close
This update addresses expected failures for invalid postMessage after close in WPT. PR-URL: #55206 Reviewed-By: Mattias Buelens <[email protected]> Reviewed-By: Matthew Aitken <[email protected]>
1 parent 2f7828d commit 226836c

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

lib/internal/worker/io.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ class BroadcastChannel extends EventTarget {
491491
if (arguments.length === 0)
492492
throw new ERR_MISSING_ARGS('message');
493493
if (this[kHandle] === undefined)
494-
throw new DOMException('BroadcastChannel is closed.');
494+
throw new DOMException('BroadcastChannel is closed.', 'InvalidStateError');
495495
if (this[kHandle].postMessage(message) === undefined)
496496
throw new DOMException('Message could not be posted.');
497497
}

test/wpt/status/webmessaging/broadcastchannel.json

-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@
1010
]
1111
}
1212
},
13-
"interface.any.js": {
14-
"fail": {
15-
"expected": [
16-
"postMessage after close should throw",
17-
"postMessage should throw InvalidStateError after close, even with uncloneable data"
18-
]
19-
}
20-
},
2113
"origin.window.js": {
2214
"fail": {
2315
"expected": [

0 commit comments

Comments
 (0)