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

Unified Diff: test/cctest/test-api.cc

Issue 6287018: Compare JSObjects by identity immediately. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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 | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 9b9f469f60a7a4d434eed5ca7c5003487f0a4fad..3a58929e497d065bbf49dd2f5c0a37749746c342 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -12201,6 +12201,25 @@ TEST(RegExp) {
}
+THREADED_TEST(EQUALS) {
+ v8::HandleScope handleScope;
+ LocalContext localContext;
+
+ v8::Handle<v8::Object> globalProxy = localContext->Global();
+ v8::Handle<Value> global = globalProxy->GetPrototype();
+
+ CHECK_EQ(1, global->StrictEquals(global));
Mads Ager (chromium) 2011/02/01 08:36:34 Please use true and false instead of 1 and 0.
antonm 2011/02/01 12:43:12 Sure and should have done it myself.
+ CHECK_EQ(0, global->StrictEquals(globalProxy));
+ CHECK_EQ(0, globalProxy->StrictEquals(global));
+ CHECK_EQ(1, globalProxy->StrictEquals(globalProxy));
+
+ CHECK_EQ(1, global->Equals(global));
+ CHECK_EQ(0, global->Equals(globalProxy));
+ CHECK_EQ(0, globalProxy->Equals(global));
+ CHECK_EQ(1, globalProxy->Equals(globalProxy));
+}
+
+
static v8::Handle<v8::Value> Getter(v8::Local<v8::String> property,
const v8::AccessorInfo& info ) {
return v8_str("42!");
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698