Commit d3af5b67 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix JSReceiver::HasHiddenProperties wrt access-checked objects.

R=jkummerow@chromium.org
BUG=chromium:411877
LOG=N

Review URL: https://codereview.chromium.org/564443002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cf293f77
......@@ -4684,8 +4684,10 @@ void JSObject::DeleteHiddenProperty(Handle<JSObject> object, Handle<Name> key) {
bool JSObject::HasHiddenProperties(Handle<JSObject> object) {
Handle<Name> hidden = object->GetIsolate()->factory()->hidden_string();
LookupIterator it(object, hidden, LookupIterator::OWN_SKIP_INTERCEPTOR);
CHECK_NE(LookupIterator::ACCESS_CHECK, it.state());
return it.IsFound();
Maybe<PropertyAttributes> maybe = GetPropertyAttributes(&it);
// Cannot get an exception since the hidden_string isn't accessible to JS.
DCHECK(maybe.has_value);
return maybe.value != ABSENT;
}
......
......@@ -23000,3 +23000,19 @@ TEST(GetOwnPropertyDescriptor) {
set->Call(x, 1, args);
CHECK_EQ(v8_num(14), get->Call(x, 0, NULL));
}
TEST(Regress411877) {
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> object_template =
v8::ObjectTemplate::New(isolate);
object_template->SetAccessCheckCallbacks(NamedAccessCounter,
IndexedAccessCounter);
v8::Handle<Context> context = Context::New(isolate);
v8::Context::Scope context_scope(context);
context->Global()->Set(v8_str("o"), object_template->NewInstance());
CompileRun("Object.getOwnPropertyNames(o)");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment