summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/compiler/strict-equal-number.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/compiler/strict-equal-number.js')
-rw-r--r--deps/v8/test/mjsunit/compiler/strict-equal-number.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/compiler/strict-equal-number.js b/deps/v8/test/mjsunit/compiler/strict-equal-number.js
new file mode 100644
index 0000000000..18cd52aa01
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/strict-equal-number.js
@@ -0,0 +1,16 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+// Make sure that we don't incorrectly truncate Oddball
+// to Number for strict equality comparisons.
+(function() {
+ function foo(x, y) { return x === y; }
+
+ assertTrue(foo(0.1, 0.1));
+ assertTrue(foo(undefined, undefined));
+ %OptimizeFunctionOnNextCall(foo);
+ assertTrue(foo(undefined, undefined));
+})();