Local<ObjectTemplate> parent    =ObjectTemplate::New();
Local<ObjectTemplate> child     =ObjectTemplate::New();
Local<ObjectTemplate> grandchild=ObjectTemplate::New();

parent->Set(JSTR("child"),child);
child->Set(JSTR("grandchild"),grandchild);
//'global' is the global ObjectTemplate
global->Set(JSTR("parent"),parent);

//for example....
grandchild->SetCallAsFunctionHandler(callback);

//or
child->Set(JSTR("grandchild"),FunctionTemplate::New(callback));
//with this last, grandchild template is not necessary

//instance it and you'll have "parent.child.grandchild()"

Get it right, I did it by memory!!

-----Mensaje original-----
De: [email protected] [mailto:[email protected]] En nombre
de LG
Enviado el: martes, 25 de mayo de 2010 18:48
Para: v8-users
Asunto: [v8-users] how do i achieve a a.b.c() behavior

Hi All,

i am new to v8
and i need to achieve a.b.c() behavior

i have a parentObject, childObject and methods in childObject

currently i am trying like this
parentObject->Set(v8String(key),childObject);

can you please let me know the correct way to achieve this

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to