// Capture the output of this into a variable, if you want (function(FUNCTION_TABLE_OFFSET, parentModule) { var Module = {}; var args = []; Module.arguments = []; Module.print = parentModule.print; Module.printErr = parentModule.printErr; Module.cleanups = []; #if ASM_JS var H_BASE = 0; // Each module has its own stack var STACKTOP = parentModule['_malloc'](TOTAL_STACK); assert(STACKTOP % 8 == 0); var STACK_MAX = STACKTOP + TOTAL_STACK; Module.cleanups.push(function() { parentModule['_free'](STACKTOP); // XXX ensure exported parentModule['_free'](H_BASE); }); #endif {{BODY}} // {{MODULE_ADDITIONS}} return Module; });