diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/preamble.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/preamble.js b/src/preamble.js index 71b123e7..0bfeda1b 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -270,11 +270,9 @@ Module["ccall"] = ccall; // Returns the C function with a specified identifier (for C++, you need to do manual name mangling) function getCFunc(ident) { try { - var func = eval('_' + ident); + var func = globalScope['Module']['_' + ident]; // closure exported function + if (!func) func = eval('_' + ident); // explicit lookup } catch(e) { - try { - func = globalScope['Module']['_' + ident]; // closure exported function - } catch(e) {} } assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)'); return func; |