MCPcopy
hub / github.com/sql-js/sql.js / cwrap

Function cwrap

js/sql-debug.js:524–537  ·  view source on GitHub ↗
(ident, returnType, argTypes)

Source from the content-addressed store, hash-verified

522}
523
524function cwrap (ident, returnType, argTypes) {
525 argTypes = argTypes || [];
526 var cfunc = getCFunc(ident);
527 // When the function takes numbers and returns a number, we can just return
528 // the original function
529 var numericArgs = argTypes.every(function(type){ return type === 'number'});
530 var numericRet = returnType !== 'string';
531 if (numericRet && numericArgs) {
532 return cfunc;
533 }
534 return function() {
535 return ccall(ident, returnType, argTypes, arguments);
536 }
537}
538
539
540Module["cwrap"] = cwrap;

Callers

nothing calls this directly

Calls 2

getCFuncFunction · 0.70
ccallFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…