| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 00cc8bccc294a6e139d7ed8b62a136e1e3798e27..29bb7335cba221d7de1a76c29168f907dfc0288f 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -20903,3 +20903,30 @@ TEST(EscapeableHandleScope) {
|
| }
|
| }
|
| }
|
| +
|
| +
|
| +TEST(Regress354123) {
|
| + LocalContext current;
|
| + v8::Isolate* isolate = current->GetIsolate();
|
| + v8::HandleScope scope(isolate);
|
| +
|
| + v8::Handle<v8::ObjectTemplate> templ = v8::ObjectTemplate::New(isolate);
|
| + templ->SetAccessCheckCallbacks(NamedAccessCounter, IndexedAccessCounter);
|
| + current->Global()->Set(v8_str("friend"), templ->NewInstance());
|
| +
|
| + // Test access using __proto__ from the prototype chain.
|
| + named_access_count = 0;
|
| + CompileRun("friend.__proto__ = {};");
|
| + CHECK_EQ(2, named_access_count);
|
| + CompileRun("friend.__proto__;");
|
| + CHECK_EQ(4, named_access_count);
|
| +
|
| + // Test access using __proto__ as a hijacked function.
|
| + named_access_count = 0;
|
| + CompileRun("var f = Object.prototype.__lookupSetter__('__proto__');"
|
| + "f.call(friend, {});");
|
| + CHECK_EQ(1, named_access_count);
|
| + CompileRun("var f = Object.prototype.__lookupGetter__('__proto__');"
|
| + "f.call(friend);");
|
| + CHECK_EQ(2, named_access_count);
|
| +}
|
|
|