Consider the following test:

void SelfGetter(Local<String> name,
                const v8::PropertyCallbackInfo<v8::Value>& info) {
  info.GetReturnValue().Set(info.This());
}


THREADED_TEST(GetterInThePrototypeChain) {
  LocalContext env;
  v8::Isolate* isolate = env->GetIsolate();
  v8::HandleScope scope(isolate);

  v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate);
  obj->SetAccessor(v8_str("self"), SelfGetter);
  env->Global()->Set(v8_str("obj"), obj->NewInstance());
  CHECK(CompileRun("Number.prototype.__proto__ = obj;"
                   "var v = 42..self;"
                   "v + ' is a ' + typeof v")->Equals(v8_str("42 is a
number")));
}




Vyacheslav Egorov


On Wed, May 14, 2014 at 10:19 AM, Sven Panne <[email protected]> wrote:

> On Tue, May 13, 2014 at 11:15 PM, Ben Noordhuis <[email protected]>wrote:
>
>> Yang, isn't that an implementation detail leaking into the API?  [...]
>>
>
> Yup, it is... :-} Fix reverting the external API change under way:
> https://codereview.chromium.org/285643008/
>
> --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to