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

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

Issue 483173002: Expose well-known Symbols to C++ API. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 6 years, 4 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
« src/api.cc ('K') | « src/heap/heap.h ('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 f61400706b35bb7bfadb72aaa8b0b6d4663eade5..b503332369e29ed6d0785c1c458efb888be9e21d 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -2914,6 +2914,10 @@ THREADED_TEST(GlobalSymbols) {
CHECK(glob_api2->SameValue(glob_api));
CHECK(!glob_api->SameValue(glob));
+ v8::Local<String> iterator_name = v8_str("Symbol.iterator");
+ v8::Local<v8::Symbol> iterator =
+ v8::Symbol::ForInternal(isolate, iterator_name);
+
v8::Local<v8::Symbol> sym = v8::Symbol::New(isolate, name);
CHECK(!sym->SameValue(glob));
@@ -2921,6 +2925,11 @@ THREADED_TEST(GlobalSymbols) {
v8::Local<Value> sym2 = env->Global()->Get(v8_str("sym2"));
CHECK(sym2->SameValue(glob));
CHECK(!sym2->SameValue(glob_api));
+
+ CompileRun("var sym3 = Symbol.iterator");
+ v8::Local<Value> sym3 = env->Global()->Get(v8_str("sym3"));
+ CHECK(!sym3.IsEmpty());
+ CHECK(sym3->SameValue(iterator));
}
« src/api.cc ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698