diff --git a/common/api/atom_api_v8_util.cc b/common/api/atom_api_v8_util.cc index 81f42e6c6dce..69b660c63b34 100644 --- a/common/api/atom_api_v8_util.cc +++ b/common/api/atom_api_v8_util.cc @@ -11,6 +11,18 @@ namespace api { namespace { +v8::Handle PropGetter(v8::Local property, + const v8::AccessorInfo& info) { + return info.This()->GetRealNamedPropertyInPrototypeChain(property); +} + +v8::Handle PropSetter(v8::Local property, + v8::Local value, + const v8::AccessorInfo& info) { + info.This()->ForceSet(property, value); + return value; +} + v8::Handle DummyNew(const v8::Arguments& args) { return args.This(); } @@ -20,6 +32,7 @@ v8::Handle CreateObjectWithName(const v8::Arguments& args) { v8::Local t = v8::FunctionTemplate::New(DummyNew); t->SetClassName(args[0]->ToString()); + t->InstanceTemplate()->SetNamedPropertyHandler(PropGetter, PropSetter); return scope.Close(t->GetFunction()->NewInstance()); }