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

Unified Diff: src/runtime.js

Issue 947683002: Reimplement Maps and Sets in JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable one more test Created 5 years, 10 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
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 7d82dfa8463fac3305ca98f42dd9a5545444a40c..bc1e47686c8813a705ba812cb8ba283294eb1504 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -613,12 +613,10 @@ function SameValue(x, y) {
// ES6, section 7.2.4
function SameValueZero(x, y) {
- if (typeof x != typeof y) return false;
- if (IS_NUMBER(x)) {
- if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
- }
- return x === y;
+ if (x === y) return true;
+ return IS_NUMBER(x) && NUMBER_IS_NAN(x) && IS_NUMBER(y) && NUMBER_IS_NAN(y);
}
+%SetInlineBuiltinFlag(SameValueZero);
/* ---------------------------------
« src/objects.cc ('K') | « src/objects.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698