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

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

Issue 1422973002: Fix access check in JSObject::PreventExtensions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add a test. Created 5 years, 2 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.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 178c2189e01772449a004bf14d7a5d2e0e6812e9..e8693d62762234842c95a0568feb4c6963eb5818 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -8660,6 +8660,15 @@ TEST(AccessControl) {
"})()");
CHECK(value->IsTrue());
+ // Test that preventExtensions fails on a non-accessible object even if that
+ // object is already non-extensible.
+ global1->Set(v8_str("checked_object"), global_template->NewInstance());
+ allowed_access = true;
+ CompileRun("Object.preventExtensions(checked_object)");
+ ExpectFalse("Object.isExtensible(checked_object)");
+ allowed_access = false;
+ CHECK(CompileRun("Object.preventExtensions(checked_object)").IsEmpty());
+
context1->Exit();
context0->Exit();
}
« 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