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

Unified Diff: src/runtime.js

Issue 2136024: Refactor the samevalue internal method and add tests for this method.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 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
« no previous file with comments | « no previous file | test/mjsunit/samevalue.js » ('j') | test/mjsunit/samevalue.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.js
===================================================================
--- src/runtime.js (revision 4711)
+++ src/runtime.js (working copy)
@@ -559,19 +559,15 @@
// ES5, section 9.12
function SameValue(x, y) {
if (typeof x != typeof y) return false;
- if (IS_NULL_OR_UNDEFINED(x)) return true;
if (IS_NUMBER(x)) {
if (NUMBER_IS_NAN(x) && NUMBER_IS_NAN(y)) return true;
// x is +0 and y is -0 or vice versa.
if (x === 0 && y === 0 && (1 / x) != (1 / y)) {
return false;
}
- return x == y;
+ return x === y;
}
- if (IS_STRING(x)) return %StringEquals(x, y);
- if (IS_BOOLEAN(x)) return y == x;
-
- return %_ObjectEquals(x, y);
+ return x === y
}
« no previous file with comments | « no previous file | test/mjsunit/samevalue.js » ('j') | test/mjsunit/samevalue.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698