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

Function inheritMetadata

lib/internal/ffi-shared-buffer.js:183–195  ·  view source on GitHub ↗
(wrapper, rawFn, nargs)

Source from the content-addressed store, hash-verified

181// The `pointer` descriptor mirrors the raw function's so user code that
182// reassigns `.pointer` keeps working through the wrapper.
183function inheritMetadata(wrapper, rawFn, nargs) {
184 ObjectDefineProperty(wrapper, 'name', {
185 __proto__: null, value: rawFn.name, configurable: true,
186 });
187 ObjectDefineProperty(wrapper, 'length', {
188 __proto__: null, value: nargs, configurable: true,
189 });
190 ObjectDefineProperty(wrapper, 'pointer', {
191 __proto__: null, value: rawFn.pointer,
192 writable: true, configurable: true, enumerable: true,
193 });
194 return wrapper;
195}
196
197// Reentrancy: the ArrayBuffer is per-function, but `InvokeFunctionSB` copies
198// arguments out of it into invocation-local storage before `ffi_call` and

Callers 1

wrapWithSharedBufferFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…