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

Function markTransferMode

lib/internal/worker/js_transferable.js:91–98  ·  view source on GitHub ↗

* Mark an object as being transferable or customized cloneable in * `.postMessage()`. * This should only applied to host objects like Web API interfaces, Node.js' * built-in objects. * Objects marked as cloneable and transferable should implement the method * `@@kClone` and `@@kTransfer` respec

(obj, cloneable = false, transferable = false)

Source from the content-addressed store, hash-verified

89 * `@@kTransfer` is implemented.
90 */
91function markTransferMode(obj, cloneable = false, transferable = false) {
92 if ((typeof obj !== 'object' && typeof obj !== 'function') || obj === null)
93 return; // This object is a primitive and therefore already untransferable.
94 let mode = kDisallowCloneAndTransfer;
95 if (cloneable) mode |= kCloneable;
96 if (transferable) mode |= kTransferable;
97 obj[transfer_mode_private_symbol] = mode;
98}
99
100
101webidl.converters.StructuredSerializeOptions = webidl

Callers 15

constructorMethod · 0.85
transferableAbortSignalFunction · 0.85
ClonedHistogramFunction · 0.85
constructorMethod · 0.85
constructorMethod · 0.85
constructorMethod · 0.85
constructorMethod · 0.85
constructorMethod · 0.85
TransferableBlobFunction · 0.85
constructorMethod · 0.85
constructorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…