Index: test/cctest/test-object-observe.cc |
diff --git a/test/cctest/test-object-observe.cc b/test/cctest/test-object-observe.cc |
index 7e9992c19d277c658566dd9f682ca852cc18fe08..2766a4f239cf35f2b307707a66f7a0a59d98b540 100644 |
--- a/test/cctest/test-object-observe.cc |
+++ b/test/cctest/test-object-observe.cc |
@@ -805,3 +805,33 @@ TEST(ObjectObserveCallsFunctionTemplateInstance) { |
"obj.bar = 2;"); |
CHECK_EQ(2, numRecordsSent); |
} |
+ |
+ |
+static void AccessorGetter(Local<String> property, |
+ const PropertyCallbackInfo<Value>& info) { |
+ info.GetReturnValue().Set(Integer::New(info.GetIsolate(), 42)); |
+} |
+ |
+ |
+static void AccessorSetter(Local<String> property, Local<Value> value, |
+ const PropertyCallbackInfo<void>& info) { |
+ info.GetReturnValue().SetUndefined(); |
+} |
+ |
+ |
+TEST(APIAccessorsShouldNotNotify) { |
+ Isolate* isolate = CcTest::isolate(); |
+ HandleScope handle_scope(isolate); |
+ LocalContext context(isolate); |
+ Handle<Object> object = Object::New(isolate); |
+ object->SetAccessor(String::NewFromUtf8(isolate, "accessor"), &AccessorGetter, |
+ &AccessorSetter); |
+ context->Global()->Set(String::NewFromUtf8(isolate, "obj"), object); |
+ CompileRun( |
+ "var records = null;" |
+ "Object.observe(obj, function(r) { records = r });" |
+ "obj.accessor = 43;"); |
+ CHECK(CompileRun("records")->IsNull()); |
+ CompileRun("Object.defineProperty(obj, 'accessor', { value: 44 });"); |
+ CHECK(CompileRun("records")->IsNull()); |
+} |