diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-07-03 14:57:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-03 14:57:38 -0700 |
commit | ac306cb081c8e6a2ea0b50e51b7f673dc2cf989b (patch) | |
tree | 11b8531309e9b3ffe9fd52b7915894dfa54a69fb /src/js/binaryen.js-post.js | |
parent | 11047d8791eabf77114164b3643bc5f8cd1ee298 (diff) | |
download | binaryen-ac306cb081c8e6a2ea0b50e51b7f673dc2cf989b.tar.gz binaryen-ac306cb081c8e6a2ea0b50e51b7f673dc2cf989b.tar.bz2 binaryen-ac306cb081c8e6a2ea0b50e51b7f673dc2cf989b.zip |
emscripten no longer allows modifying Module['print'] at runtime. Modify the internal out() method instead. see kripken/emscripten#6756 (#1614)
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r-- | src/js/binaryen.js-post.js | 18 |
1 files changed, 9 insertions, 9 deletions
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; }; |