Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 08c05bfc3a468d52139cf59c249a749715ea1097..87e3c0c10071865c88929b7d4d99468310c1d924 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -3742,6 +3742,36 @@ THREADED_TEST(SimplePropertyWrite) { |
} |
+THREADED_TEST(SetterOnly) { |
+ v8::HandleScope scope; |
+ Local<ObjectTemplate> templ = ObjectTemplate::New(); |
+ templ->SetAccessor(v8_str("x"), NULL, SetXValue, v8_str("donut")); |
+ LocalContext context; |
+ context->Global()->Set(v8_str("obj"), templ->NewInstance()); |
+ Local<Script> script = Script::Compile(v8_str("obj.x = 4; obj.x")); |
+ for (int i = 0; i < 10; i++) { |
+ CHECK(xValue.IsEmpty()); |
+ script->Run(); |
+ CHECK_EQ(v8_num(4), xValue); |
+ xValue.Dispose(); |
+ xValue = v8::Persistent<Value>(); |
+ } |
+} |
+ |
+ |
+THREADED_TEST(NoAccessors) { |
+ v8::HandleScope scope; |
+ Local<ObjectTemplate> templ = ObjectTemplate::New(); |
+ templ->SetAccessor(v8_str("x"), NULL, NULL, v8_str("donut")); |
+ LocalContext context; |
+ context->Global()->Set(v8_str("obj"), templ->NewInstance()); |
+ Local<Script> script = Script::Compile(v8_str("obj.x = 4; obj.x")); |
+ for (int i = 0; i < 10; i++) { |
+ script->Run(); |
+ } |
+} |
+ |
+ |
static v8::Handle<Value> XPropertyGetter(Local<String> property, |
const AccessorInfo& info) { |
ApiTestFuzzer::Fuzz(); |