From ac306cb081c8e6a2ea0b50e51b7f673dc2cf989b Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 3 Jul 2018 14:57:38 -0700 Subject: emscripten no longer allows modifying Module['print'] at runtime. Modify the internal out() method instead. see kripken/emscripten#6756 (#1614) --- src/js/binaryen.js-post.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/js/binaryen.js-post.js') diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index aca41ca6b..6e4833986 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -1163,19 +1163,19 @@ Module['Module'] = function(module) { return Module['_BinaryenSetStart'](module, start); }; this['emitText'] = function() { - var old = Module['print']; + var old = out; var ret = ''; - Module['print'] = function(x) { ret += x + '\n' }; + out = function(x) { ret += x + '\n' }; Module['_BinaryenModulePrint'](module); - Module['print'] = old; + out = old; return ret; }; this['emitAsmjs'] = function() { - var old = Module['print']; + var old = out; var ret = ''; - Module['print'] = function(x) { ret += x + '\n' }; + out = function(x) { ret += x + '\n' }; Module['_BinaryenModulePrintAsmjs'](module); - Module['print'] = old; + out = old; return ret; }; this['validate'] = function() { @@ -1550,11 +1550,11 @@ Module['emitText'] = function(expr) { if (typeof expr === 'object') { return expr.emitText(); } - var old = Module['print']; + var old = out; var ret = ''; - Module['print'] = function(x) { ret += x + '\n' }; + out = function(x) { ret += x + '\n' }; Module['_BinaryenExpressionPrint'](expr); - Module['print'] = old; + out = old; return ret; }; -- cgit v1.2.3