Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 51ad973f2c2ba133ffc99d29ba0df820db0101ff..8fd87434c1b27aaeb5c31ce8af06026aa834cc62 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -9543,18 +9543,14 @@ TEST(AccessControlES5) { |
} |
-static bool GetOwnPropertyNamesNamedBlocker(Local<v8::Object> global, |
- Local<Value> name, |
- v8::AccessType type, |
- Local<Value> data) { |
+static bool BlockEverythingNamed(Local<v8::Object> object, Local<Value> name, |
+ v8::AccessType type, Local<Value> data) { |
return false; |
} |
-static bool GetOwnPropertyNamesIndexedBlocker(Local<v8::Object> global, |
- uint32_t key, |
- v8::AccessType type, |
- Local<Value> data) { |
+static bool BlockEverythingIndexed(Local<v8::Object> object, uint32_t key, |
+ v8::AccessType type, Local<Value> data) { |
return false; |
} |
@@ -9566,8 +9562,8 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) { |
v8::ObjectTemplate::New(isolate); |
obj_template->Set(v8_str("x"), v8::Integer::New(isolate, 42)); |
- obj_template->SetAccessCheckCallbacks(GetOwnPropertyNamesNamedBlocker, |
- GetOwnPropertyNamesIndexedBlocker); |
+ obj_template->SetAccessCheckCallbacks(BlockEverythingNamed, |
+ BlockEverythingIndexed); |
// Create an environment |
v8::Local<Context> context0 = Context::New(isolate, NULL, obj_template); |
@@ -9602,6 +9598,26 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) { |
} |
+TEST(SuperAccessControl) { |
+ i::FLAG_harmony_classes = true; |
+ v8::Isolate* isolate = CcTest::isolate(); |
+ v8::HandleScope handle_scope(isolate); |
+ v8::Handle<v8::ObjectTemplate> obj_template = |
+ v8::ObjectTemplate::New(isolate); |
+ obj_template->SetAccessCheckCallbacks(BlockEverythingNamed, |
+ BlockEverythingIndexed); |
+ LocalContext env; |
+ env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance()); |
+ |
+ v8::TryCatch try_catch; |
+ CompileRun( |
+ "function f() { return super.hasOwnProperty; };" |
+ "var m = f.toMethod(prohibited);" |
+ "m();"); |
+ CHECK(try_catch.HasCaught()); |
+} |
+ |
+ |
static void IndexedPropertyEnumerator( |
const v8::PropertyCallbackInfo<v8::Array>& info) { |
v8::Handle<v8::Array> result = v8::Array::New(info.GetIsolate(), 2); |