diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/runtime.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime.js b/src/runtime.js index edcbf637..63610d3b 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -409,7 +409,13 @@ var Runtime = { abort('invalid EM_ASM input |' + source + '|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)'); } } - return Runtime.asmConstCache[code] = eval('(function(' + args.join(',') + '){ ' + source + ' })'); // new Function does not allow upvars in node + try { + var evalled = eval('(function(' + args.join(',') + '){ ' + source + ' })'); // new Function does not allow upvars in node + } catch(e) { + Module.printErr('error in executing inline EM_ASM code: ' + e + ' on: \n\n' + source + '\n\nwith args |' + args + '| (make sure to use the right one out of EM_ASM, EM_ASM_ARGS, etc.)'); + throw e; + } + return Runtime.asmConstCache[code] = evalled; }, warnOnce: function(text) { |