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

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

Issue 1230793002: [es6] silence access-check failure for well-known symbol properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove test copy-pasta Created 5 years, 5 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/runtime/runtime-array.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 2bfdeabd42cd606a40e8242d120465dc0414a0ab..28d513793d3ce3251dc169846441d92602dc7b2a 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -21855,3 +21855,48 @@ TEST(CompatibleReceiverCheckOnCachedICHandler) {
"result;\n",
0);
}
+
+
+static bool AccessSymbolsAlwaysBlocked(Local<v8::Object> global,
+ Local<Value> name, v8::AccessType type,
+ Local<Value> data) {
+ if (!name->IsSymbol()) return true;
Toon Verwaest 2015/07/10 13:22:16 Access checks are in the process of being rewritte
+ i::PrintF("Access blocked.\n");
+ return false;
+}
+
+
+THREADED_TEST(Regress507553) {
+ v8::Isolate* isolate = CcTest::isolate();
+ HandleScope scope(isolate);
+
+ // Template for object with security check.
+ Local<ObjectTemplate> spreadable_template = v8::ObjectTemplate::New(isolate);
+ spreadable_template->SetAccessCheckCallbacks(AccessSymbolsAlwaysBlocked,
+ NULL);
+
+ // Context for "foreign" objects used in test.
+ Local<Context> context = v8::Context::New(isolate);
+ context->Enter();
+
+ // Object with explicit security check.
+ Local<Object> protected_object = spreadable_template->NewInstance();
+
+ spreadable_template->Set(v8::Symbol::GetIsConcatSpreadable(isolate),
+ v8::Boolean::New(isolate, true));
+
+ protected_object->Set(v8_str("length"), v8::Integer::New(isolate, 2));
+ protected_object->Set(0U, v8_str("a"));
+ protected_object->Set(1U, v8_str("b"));
+
+ Local<ObjectTemplate> global_template = ObjectTemplate::New(isolate);
+ global_template->Set(v8_str("protected"), protected_object);
+
+ context->Exit();
+
+ LocalContext context2(NULL, global_template);
+
+ Local<Value> result1 = CompileRun("[].concat(protected)");
+ CHECK(result1->IsArray());
+ CHECK(result1.As<Object>()->Get(0)->Equals(protected_object));
+}
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698