Revision: 24658
Author: [email protected]
Date: Thu Oct 16 11:24:45 2014 UTC
Log: Object.is should use SameValue
BUG=v8:3576
LOG=
[email protected], [email protected], [email protected]
Review URL: https://codereview.chromium.org/626323002
Patch from Diego Pino <[email protected]>.
https://code.google.com/p/v8/source/detail?r=24658
Modified:
/branches/bleeding_edge/src/v8natives.js
/branches/bleeding_edge/test/mjsunit/object-is.js
=======================================
--- /branches/bleeding_edge/src/v8natives.js Wed Oct 15 14:01:20 2014 UTC
+++ /branches/bleeding_edge/src/v8natives.js Thu Oct 16 11:24:45 2014 UTC
@@ -1363,13 +1363,9 @@
}
-// Harmony egal.
+// ECMA-262, Edition 6, section 19.1.2.10
function ObjectIs(obj1, obj2) {
- if (obj1 === obj2) {
- return (obj1 !== 0) || (1 / obj1 === 1 / obj2);
- } else {
- return (obj1 !== obj1) && (obj2 !== obj2);
- }
+ return SameValue(obj1, obj2);
}
=======================================
--- /branches/bleeding_edge/test/mjsunit/object-is.js Thu Mar 8 16:38:44
2012 UTC
+++ /branches/bleeding_edge/test/mjsunit/object-is.js Thu Oct 16 11:24:45
2014 UTC
@@ -32,8 +32,8 @@
assertSame(expected, Object.is(x, y));
}
-var test_set = [ {}, [], 1/0, -1/0, "s", 0, 0/-1, null, undefined ];
-print(test_set);
+var test_set = [ {}, [], Infinity, -Infinity, "s", "ア", 0, 0/-1, null,
+ undefined, true, false, Symbol("foo"), NaN ];
for (var i = 0; i < test_set.length; i++) {
for (var j = 0; j < test_set.length; j++) {
if (i == j) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.