summaryrefslogtreecommitdiff
path: root/src/tools/wasm2js.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/wasm2js.cpp')
-rw-r--r--src/tools/wasm2js.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/tools/wasm2js.cpp b/src/tools/wasm2js.cpp
index d64f0b0ab..24e4037e7 100644
--- a/src/tools/wasm2js.cpp
+++ b/src/tools/wasm2js.cpp
@@ -254,13 +254,8 @@ static void optimizeJS(Ref ast, Wasm2JSBuilder::Flags flags) {
return false;
};
+ // Optimize given that the expression is flowing into a boolean context
auto optimizeBoolean = [&](Ref node) {
- if (isConstantBinary(node, XOR, 1)) {
- // x ^ 1 => !x
- node[0]->setString(UNARY_PREFIX);
- node[1]->setString(L_NOT);
- node[3]->setNull();
- }
// TODO: in some cases it may be possible to turn
//
// if (x | 0)