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

Function markAsUntransferable

lib/internal/buffer.js:1078–1086  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

1076// This would better be placed in internal/worker/io.js, but that doesn't work
1077// because Buffer needs this and that would introduce a cyclic dependency.
1078function markAsUntransferable(obj) {
1079 if ((typeof obj !== 'object' && typeof obj !== 'function') || obj === null)
1080 return; // This object is a primitive and therefore already untransferable.
1081 obj[untransferable_object_private_symbol] = true;
1082
1083 if (isArrayBuffer(obj)) {
1084 setDetachKey(obj, kDetachKey);
1085 }
1086}
1087
1088// This simply checks if the object is marked as untransferable and doesn't
1089// check whether we are able to transfer it.

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…