MCPcopy
hub / github.com/pixijs/pixijs / makeDynCaller

Function makeDynCaller

transcoders/basis/basis_transcoder.js:691–700  ·  view source on GitHub ↗
(dynCall)

Source from the content-addressed store, hash-verified

689 } function embind__requireFunction(signature, rawFunction)
690 {
691 signature = readLatin1String(signature); function makeDynCaller(dynCall)
692 {
693 const args = [];
694
695 for (let i = 1; i < signature.length; ++i) { args.push(`a${i}`); } const name = `dynCall_${signature}_${rawFunction}`; let body = `return function ${name}(${args.join(', ')}) {\n`;
696
697 body += ` return dynCall(rawFunction${args.length ? ', ' : ''}${args.join(', ')});\n`; body += '};\n';
698
699 return new Function('dynCall', 'rawFunction', body)(dynCall, rawFunction);
700 } const dc = Module[`dynCall_${signature}`]; const fp = makeDynCaller(dc);
701
702 if (typeof fp !== 'function') { throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`); }
703

Callers 1

embind__requireFunctionFunction · 0.70

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected