* * @param {any} message * @returns {void}
(message)
| 419 | * @returns {void} |
| 420 | */ |
| 421 | postMessage(message) { |
| 422 | if (!isBroadcastChannel(this)) |
| 423 | throw new ERR_INVALID_THIS('BroadcastChannel'); |
| 424 | if (arguments.length === 0) |
| 425 | throw new ERR_MISSING_ARGS('message'); |
| 426 | if (this[kHandle] === undefined) |
| 427 | throw new DOMException('BroadcastChannel is closed.', 'InvalidStateError'); |
| 428 | if (this[kHandle].postMessage(message) === undefined) |
| 429 | throw new DOMException('Message could not be posted.'); |
| 430 | } |
| 431 | |
| 432 | // The ref() method is Node.js specific and not part of the standard |
| 433 | // BroadcastChannel API definition. Typically we shouldn't extend Web |
no test coverage detected