FindIndexedAllCanReadHolder(isolate, holder, where_to_start);
if (!all_can_read_holder.ToHandle(&holder)) break;
auto result =
- JSObject::GetElementAttributeFromInterceptor(object, receiver, index);
+ JSObject::GetElementAttributeFromInterceptor(holder, receiver, index);
if (isolate->has_scheduled_exception()) break;
if (result.IsJust() && result.FromJust() != ABSENT) return result;
where_to_start = PrototypeIterator::START_AT_PROTOTYPE;
access_check_data.result = true;
ExpectInt32("checked.whatever", 17);
- CHECK_EQ(1, access_check_data.count);
+ CHECK(!CompileRun("Object.getOwnPropertyDescriptor(checked, 'whatever')")
+ ->IsUndefined());
+ CHECK_EQ(2, access_check_data.count);
access_check_data.result = false;
ExpectInt32("checked.whatever", intercept_data_0.value);
- CHECK_EQ(2, access_check_data.count);
+ {
+ v8::TryCatch try_catch(isolate);
+ CompileRun("Object.getOwnPropertyDescriptor(checked, 'whatever')");
+ CHECK(try_catch.HasCaught());
+ }
+ CHECK_EQ(4, access_check_data.count);
intercept_data_1.should_intercept = true;
ExpectInt32("checked.whatever", intercept_data_1.value);
- CHECK_EQ(3, access_check_data.count);
+ {
+ v8::TryCatch try_catch(isolate);
+ CompileRun("Object.getOwnPropertyDescriptor(checked, 'whatever')");
+ CHECK(try_catch.HasCaught());
+ }
+ CHECK_EQ(6, access_check_data.count);
}
access_check_data.result = true;
ExpectInt32("checked[15]", 17);
- CHECK_EQ(1, access_check_data.count);
+ CHECK(!CompileRun("Object.getOwnPropertyDescriptor(checked, '15')")
+ ->IsUndefined());
+ CHECK_EQ(3, access_check_data.count);
access_check_data.result = false;
ExpectInt32("checked[15]", intercept_data_0.value);
- CHECK_EQ(2, access_check_data.count);
+ // Note: this should throw but without a LookupIterator it's complicated.
+ CHECK(!CompileRun("Object.getOwnPropertyDescriptor(checked, '15')")
+ ->IsUndefined());
+ CHECK_EQ(6, access_check_data.count);
intercept_data_1.should_intercept = true;
ExpectInt32("checked[15]", intercept_data_1.value);
- CHECK_EQ(3, access_check_data.count);
+ // Note: this should throw but without a LookupIterator it's complicated.
+ CHECK(!CompileRun("Object.getOwnPropertyDescriptor(checked, '15')")
+ ->IsUndefined());
+ CHECK_EQ(9, access_check_data.count);
}