Index: test/cctest/test-api.cc |
=================================================================== |
--- test/cctest/test-api.cc (revision 7168) |
+++ test/cctest/test-api.cc (working copy) |
@@ -5659,6 +5659,14 @@ |
global_template->SetAccessCheckCallbacks(NamedAccessBlocker, |
IndexedAccessBlocker); |
+ // Add accessible accessor. |
+ global_template->SetAccessor( |
+ v8_str("accessible_prop"), |
+ EchoGetter, EchoSetter, |
+ v8::Handle<Value>(), |
+ v8::AccessControl(v8::ALL_CAN_READ | v8::ALL_CAN_WRITE)); |
+ |
+ |
// Add an accessor that is not accessible by cross-domain JS code. |
global_template->SetAccessor(v8_str("blocked_prop"), |
UnreachableGetter, UnreachableSetter, |
@@ -5699,6 +5707,17 @@ |
CompileRun("Object.seal(other)"); |
ExpectTrue("Object.isExtensible(other)"); |
+ |
+ // Regression test for issue 1250. |
+ // Make sure that we can set the accessible accessors value using normal |
+ // assignment. |
+ CompileRun("other.accessible_prop = 42"); |
+ CHECK_EQ(42, g_echo_value); |
+ |
+ v8::Handle<Value> value; |
Mads Ager (chromium)
2011/03/15 09:12:50
Add comment here saying something like: We follow
|
+ CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})"); |
+ value = CompileRun("other.accessible_prop == 42"); |
+ CHECK(value->IsTrue()); |
} |