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(); |
} |