Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: src/runtime.js

Issue 1298603002: [runtime] Unify and fix the strict equality comparison. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 5683f8422c372cc39241a77711b26d3bef02e166..4de9c2997df1a5debf4341aaef8fdb6d212b2902 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -127,6 +127,7 @@ EQUALS = function EQUALS(y) {
} else if (IS_NULL_OR_UNDEFINED(x)) {
return IS_NULL_OR_UNDEFINED(y) ? 0 : 1;
} else if (IS_SIMD_VALUE(x)) {
+ if (!IS_SIMD_VALUE(y)) return 1; // not equal
return %SimdEquals(x, y);
} else {
// x is an object.
@@ -142,26 +143,6 @@ EQUALS = function EQUALS(y) {
}
}
-// ECMA-262, section 11.9.4, page 56.
-STRICT_EQUALS = function STRICT_EQUALS(x) {
- if (IS_STRING(this)) {
- if (!IS_STRING(x)) return 1; // not equal
- return %StringEquals(this, x);
- }
-
- if (IS_NUMBER(this)) {
- if (!IS_NUMBER(x)) return 1; // not equal
- return %NumberEquals(this, x);
- }
-
- if (IS_SIMD_VALUE(this)) return %SimdEquals(this, x);
-
- // If anything else gets here, we just do simple identity check.
- // Objects (including functions), null, undefined and booleans were
- // checked in the CompareStub, so there should be nothing left.
- return %_ObjectEquals(this, x) ? 0 : 1;
-}
-
// ECMA-262, section 11.8.5, page 53. The 'ncr' parameter is used as
// the result when either (or both) the operands are NaN.
« src/api.cc ('K') | « src/ppc/code-stubs-ppc.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698