It seems Google's official documentation at (
https://developers.google.com/v8/embed) is outdated and is not compatible 
with available release of v8 source repository.

Examples are Accessors and Interceptors sections where the presented 
examples, APIs and classes are neither directly exposed to V8 embedder via 
(include/v8.h) nor the APIs are compatible with latest available 
implementation of V8, following are the examples or poor, bad and incorrect 
sample code presented in google's offical documentation.

Local<Value> XGetter(Local<String> property,
                        const AccessorInfo& info) {
    return Integer::New(x);
  }

  void XSetter(Local<String> property, Local<Value> value,
               const AccessorInfo& info) {
    x = value->Int32Value();
  }

  // YGetter/YSetter are so similar they are omitted for brevity

  Local<ObjectTemplate> global_templ = ObjectTemplate::New();
  global_templ->SetAccessor(String::New("x"), XGetter, XSetter);
  global_templ->SetAccessor(String::New("y"), YGetter, YSetter);
  Persistent<Context> context = Context::New(NULL, global_templ);

It is really disappointing and discouraging for developers who are 
interested to adopt V8 for their applications and it seems like team google 
is not interested in external users of V8 and they are developing this 
library for their own specific needs without taking any care for backward 
compatibility and documentation updates. 










-- 
-- 
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