Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index f61400706b35bb7bfadb72aaa8b0b6d4663eade5..a13a6e5f2913f050bfdde02aba0aa3bc6dfb133a 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -2924,6 +2924,29 @@ THREADED_TEST(GlobalSymbols) { |
} |
+static void CheckWellKnownSymbol(v8::Local<v8::Symbol>(*getter)(v8::Isolate*), |
+ const char* name) { |
+ LocalContext env; |
+ v8::Isolate* isolate = env->GetIsolate(); |
+ v8::HandleScope scope(isolate); |
+ |
+ v8::Local<v8::Symbol> symbol = getter(isolate); |
+ std::string script = std::string("var sym = ") + name; |
+ CompileRun(script.c_str()); |
+ v8::Local<Value> value = env->Global()->Get(v8_str("sym")); |
+ |
+ CHECK(!value.IsEmpty()); |
+ CHECK(!symbol.IsEmpty()); |
+ CHECK(value->SameValue(symbol)); |
+} |
+ |
+ |
+THREADED_TEST(WellKnownSymbols) { |
+ CheckWellKnownSymbol(v8::Symbol::GetIterator, "Symbol.iterator"); |
+ CheckWellKnownSymbol(v8::Symbol::GetUnscopables, "Symbol.unscopables"); |
+} |
+ |
+ |
THREADED_TEST(GlobalPrivates) { |
LocalContext env; |
v8::Isolate* isolate = env->GetIsolate(); |