Skip to content

Commit

Permalink
worker: throw InvalidStateError in postMessage after close
Browse files Browse the repository at this point in the history
This update addresses expected failures for invalid postMessage
after close in WPT.

PR-URL: nodejs#55206
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
  • Loading branch information
Nahee-Park authored and louwers committed Nov 2, 2024
1 parent 00a0a0e commit 8df7c26
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 1 addition & 1 deletion lib/internal/worker/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class BroadcastChannel extends EventTarget {
if (arguments.length === 0)
throw new ERR_MISSING_ARGS('message');
if (this[kHandle] === undefined)
throw new DOMException('BroadcastChannel is closed.');
throw new DOMException('BroadcastChannel is closed.', 'InvalidStateError');
if (this[kHandle].postMessage(message) === undefined)
throw new DOMException('Message could not be posted.');
}
Expand Down
8 changes: 0 additions & 8 deletions test/wpt/status/webmessaging/broadcastchannel.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
]
}
},
"interface.any.js": {
"fail": {
"expected": [
"postMessage after close should throw",
"postMessage should throw InvalidStateError after close, even with uncloneable data"
]
}
},
"origin.window.js": {
"fail": {
"expected": [
Expand Down

0 comments on commit 8df7c26

Please sign in to comment.