Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 070c377a746fd14fd22c8f7670a417f992aed162..cfebeff82e67872457237de7e7918cf605dc3065 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -4973,7 +4973,7 @@ THREADED_TEST(Equality) { |
CHECK(!v8_str("5")->StrictEquals(v8_num(5))); |
CHECK(v8_num(1)->StrictEquals(v8_num(1))); |
CHECK(!v8_num(1)->StrictEquals(v8_num(2))); |
- CHECK(v8_num(0)->StrictEquals(v8_num(-0))); |
+ CHECK(v8_num(0.0)->StrictEquals(v8_num(-0.0))); |
yusukesuzuki
2013/09/24 12:58:26
Since 0 is int, static_cast<double>(-0) becomes 0.
|
Local<Value> not_a_number = v8_num(i::OS::nan_value()); |
CHECK(!not_a_number->StrictEquals(not_a_number)); |
CHECK(v8::False()->StrictEquals(v8::False())); |
@@ -4983,6 +4983,16 @@ THREADED_TEST(Equality) { |
v8::Persistent<v8::Object> alias(isolate, obj); |
CHECK(v8::Local<v8::Object>::New(isolate, alias)->StrictEquals(obj)); |
alias.Dispose(); |
+ |
+ CHECK(v8_str("a")->SameValue(v8_str("a"))); |
+ CHECK(!v8_str("a")->SameValue(v8_str("b"))); |
+ CHECK(!v8_str("5")->SameValue(v8_num(5))); |
+ CHECK(v8_num(1)->SameValue(v8_num(1))); |
+ CHECK(!v8_num(1)->SameValue(v8_num(2))); |
+ CHECK(!v8_num(0.0)->SameValue(v8_num(-0.0))); |
yusukesuzuki
2013/09/24 12:58:26
`SameValue(0.0, -0.0)` becomes false.
|
+ CHECK(not_a_number->SameValue(not_a_number)); |
yusukesuzuki
2013/09/24 12:58:26
`SameValue(NaN, NaN)` becomes true.
|
+ CHECK(v8::False()->SameValue(v8::False())); |
+ CHECK(!v8::False()->SameValue(v8::Undefined())); |
} |