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

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

Issue 1034513002: fix attribute lookup for all can read indexed interceptors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api-interceptors.cc
diff --git a/test/cctest/test-api-interceptors.cc b/test/cctest/test-api-interceptors.cc
index 13e511a21f46e2d58477edb6ba1703f913f14e3e..0b060d1e62c250e9cab5015b39b35a65fc8a2d25 100644
--- a/test/cctest/test-api-interceptors.cc
+++ b/test/cctest/test-api-interceptors.cc
@@ -3024,15 +3024,27 @@ THREADED_TEST(NamedAllCanReadInterceptor) {
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);
}
@@ -3090,15 +3102,23 @@ THREADED_TEST(IndexedAllCanReadInterceptor) {
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);
}
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698