diff options
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r-- | src/js/binaryen.js-post.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 96562e6e0..8cddc61c7 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -2376,7 +2376,10 @@ Module['getExpressionInfo'] = function(expr) { return { 'id': id, 'type': type, - 'names': getAllNested(expr, Module['_BinaryenSwitchGetNumNames'], Module['_BinaryenSwitchGetName']).map(UTF8ToString), + 'names': getAllNested(expr, Module['_BinaryenSwitchGetNumNames'], Module['_BinaryenSwitchGetName']).map(function (p) { + // Do not pass the index as the second parameter to UTF8ToString as that will cut off the string. + return UTF8ToString(p); + }), 'defaultName': UTF8ToString(Module['_BinaryenSwitchGetDefaultName'](expr)), 'condition': Module['_BinaryenSwitchGetCondition'](expr), 'value': Module['_BinaryenSwitchGetValue'](expr) |