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

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

Issue 1034523002: Test for access checks on super assignments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + typo Created 5 years, 9 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 | « no previous file | 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 0714e404b4fc6386ab0535f952717993c0de87f8..5edbda777cb49473185e3bcdedf28338be0be0eb 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -8733,6 +8733,32 @@ TEST(SuperAccessControl) {
}
+TEST(Regress470113) {
+ i::FLAG_harmony_classes = true;
+ i::FLAG_harmony_object_literals = true;
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope handle_scope(isolate);
+ v8::Handle<v8::ObjectTemplate> obj_template =
+ v8::ObjectTemplate::New(isolate);
+ obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL);
+ LocalContext env;
+ env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance());
+
+ {
+ v8::TryCatch try_catch;
+ CompileRun(
+ "'use strict';\n"
+ "class C extends Object {\n"
+ " m() { super.powned = 'Powned!'; }\n"
+ "}\n"
+ "let c = new C();\n"
+ "c.m.call(prohibited)");
+
+ CHECK(try_catch.HasCaught());
+ }
+}
+
+
static void ConstTenGetter(Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
info.GetReturnValue().Set(v8_num(10));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698