worker: throw InvalidStateError in postMessage after close

This update addresses expected failures for invalid postMessage
after close in WPT.

PR-URL: https://github.com/nodejs/node/pull/55206
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
This commit is contained in:
devstone 2024-10-03 11:37:34 +09:00 committed by GitHub
parent 5e4da33d97
commit 6b9413e41a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 9 deletions

View File

@ -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.');
}

View File

@ -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": [