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 Oct 3, 2024
1 parent 5e4da33 commit 6b9413e
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 6b9413e

Please sign in to comment.