I haven't found the proper way to get/set static variables for
Javascript functions that will be used as classes. For instance, I
want to have a Javascript class, Mouse, that has 2 static variables:

log(Mouse.x);
Mouse.y = 25;

This is how it would be done for *instances* of the Mouse class in C+
+:
--------------
v8::Handle<v8::FunctionTemplate> functionTpl =
v8::FunctionTemplate::New(constructorFunction);
v8::Handle<v8::ObjectTemplate>     instanceTpl = functionTpl-
>InstanceTemplate();

instanceTpl->SetAccessor(v8::String::New("x"), getX, setX);
instanceTpl->SetAccessor(v8::String::New("Y"), getY, setY);
--------------------

But I don't want to create instances of the Mouse class, since there
is only one mouse. What's the code needed to set and get properties of
the class, not the instances?
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to