aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2013-07-08 11:23:41 -0700
committerDan Gohman <sunfish@google.com>2013-07-08 11:25:12 -0700
commit30d6e3ce7d7b28998264b913b793a921d6d78e41 (patch)
treeb2ee00e3c57d9b9ea31aedd7343ae0887d0a81ae
parentb090967580b4b1d03134b4dd11d849fd50f23951 (diff)
Add '!==' as a comparison operator.
-rw-r--r--tools/js-optimizer.js2
-rw-r--r--tools/test-js-optimizer-asm-pre-output.js1
-rw-r--r--tools/test-js-optimizer-asm-pre.js1
3 files changed, 3 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index f69278b0..e7a745e1 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -405,7 +405,7 @@ function removeUnneededLabelSettings(ast) {
// Various expression simplifications. Pre run before closure (where we still have metadata), Post run after.
var USEFUL_BINARY_OPS = set('<<', '>>', '|', '&', '^');
-var COMPARE_OPS = set('<', '<=', '>', '>=', '==', '===', '!=');
+var COMPARE_OPS = set('<', '<=', '>', '>=', '==', '===', '!=', '!==');
function simplifyExpressionsPre(ast) {
// Simplify common expressions used to perform integer conversion operations
diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js
index d66c28a4..b7afab26 100644
--- a/tools/test-js-optimizer-asm-pre-output.js
+++ b/tools/test-js-optimizer-asm-pre-output.js
@@ -130,6 +130,7 @@ function compare_result_simplification() {
HEAP32[$4] = HEAP32[$5] == HEAP32[$6];
HEAP32[$4] = HEAP32[$5] === HEAP32[$6];
HEAP32[$4] = HEAP32[$5] != HEAP32[$6];
+ HEAP32[$4] = HEAP32[$5] !== HEAP32[$6];
var x = HEAP32[$5] != HEAP32[$6] | 0;
}
function tempDoublePtr($45, $14, $28, $42) {
diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js
index 5c09043e..b762a60e 100644
--- a/tools/test-js-optimizer-asm-pre.js
+++ b/tools/test-js-optimizer-asm-pre.js
@@ -137,6 +137,7 @@ function compare_result_simplification() {
HEAP32[$4] = (HEAP32[$5] == HEAP32[$6]) & 1;
HEAP32[$4] = (HEAP32[$5] === HEAP32[$6]) & 1;
HEAP32[$4] = (HEAP32[$5] != HEAP32[$6]) & 1;
+ HEAP32[$4] = (HEAP32[$5] !== HEAP32[$6]) & 1;
// Convert the &1 to |0 here, since we don't get an implicit coersion.
var x = (HEAP32[$5] != HEAP32[$6]) & 1;
}