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: #55206
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
  • Loading branch information
Nahee-Park authored and marco-ippolito committed Nov 16, 2024
1 parent 744c723 commit a0b71af
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 @@ -491,7 +491,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 a0b71af

Please sign in to comment.