MCPcopy Index your code
hub / github.com/nodejs/node / postMessage

Method postMessage

lib/internal/worker/io.js:421–430  ·  view source on GitHub ↗

* * @param {any} message * @returns {void}

(message)

Source from the content-addressed store, hash-verified

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

Callers 15

makeAsyncRequestMethod · 0.45
makeSyncRequestMethod · 0.45
customizedModuleWorkerFunction · 0.45
handleMessageFunction · 0.45
constructorMethod · 0.45
pullMethod · 0.45
cancelMethod · 0.45
constructorMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Calls 1

isBroadcastChannelFunction · 0.85

Tested by

no test coverage detected