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

Unified Diff: src/runtime.js

Issue 771863002: Add Array.prototype.includes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase on master Created 6 years 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
« no previous file with comments | « src/harmony-array-includes.js ('k') | test/mjsunit/harmony/array-includes.js » ('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 c9cf825038a95ab642808b5ea027553e3b514b35..4bc377c5f063aa60924358ac7bbfb9ca45ba8d23 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -601,6 +601,15 @@ function SameValue(x, y) {
return 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;
+}
+
/* ---------------------------------
- - - U t i l i t i e s - - -
« no previous file with comments | « src/harmony-array-includes.js ('k') | test/mjsunit/harmony/array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698