Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index f61400706b35bb7bfadb72aaa8b0b6d4663eade5..a1c2f20331a1185384f4ca243de436140ceb9e39 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -1554,6 +1554,42 @@ THREADED_TEST(ArgumentsObject) { |
} |
+THREADED_TEST(IsMapOrSet) { |
+ LocalContext env; |
+ v8::HandleScope scope(env->GetIsolate()); |
+ v8::Handle<Value> map = CompileRun("new Map()"); |
+ v8::Handle<Value> set = CompileRun("new Set()"); |
+ v8::Handle<Value> weak_map = CompileRun("new WeakMap()"); |
+ v8::Handle<Value> weak_set = CompileRun("new WeakSet()"); |
+ CHECK(map->IsMap()); |
+ CHECK(set->IsSet()); |
+ CHECK(weak_map->IsWeakMap()); |
+ CHECK(weak_set->IsWeakSet()); |
+ |
+ CHECK(!map->IsSet()); |
+ CHECK(!map->IsWeakMap()); |
+ CHECK(!map->IsWeakSet()); |
+ |
+ CHECK(!set->IsMap()); |
+ CHECK(!set->IsWeakMap()); |
+ CHECK(!set->IsWeakSet()); |
+ |
+ CHECK(!weak_map->IsMap()); |
+ CHECK(!weak_map->IsSet()); |
+ CHECK(!weak_map->IsWeakSet()); |
+ |
+ CHECK(!weak_set->IsMap()); |
+ CHECK(!weak_set->IsSet()); |
+ CHECK(!weak_set->IsWeakMap()); |
+ |
+ v8::Handle<Value> object = CompileRun("{a:42}"); |
+ CHECK(!object->IsMap()); |
+ CHECK(!object->IsSet()); |
+ CHECK(!object->IsWeakMap()); |
+ CHECK(!object->IsWeakSet()); |
+} |
+ |
+ |
THREADED_TEST(StringObject) { |
LocalContext env; |
v8::HandleScope scope(env->GetIsolate()); |