Hi Stephan,
> The question really boils down to: is it possible to bind AccessGetter/ AccessSetter functions to the constructor of a class? It seems impossible to me [but I am not the V8 API guru]. But you can always meddle with prototype chain: create an auxiliary object with getters and setters corresponding to static variables and put it into __proto__ of constructor. -- Vyacheslav Egorov On Tue, Mar 30, 2010 at 6:19 PM, Stephan Beal <[email protected]> wrote: > Hi, all! > > i have a binding framework which allows me to bind native member > variables (static or not) to their JS-bound counterparts, such that > getting/setting the JS member (or static var) will directly get/set > the native. It's demonstrated here: > > http://code.google.com/p/v8-juice/wiki/ClassWrap#Binding_Member_Variables > > However, i've got a tiny problem (mostly cosmetic) which i would like > to solve. > > Assume i have a class called BoundNative (if you want the details of > the class, see the above link, but they're not important here). The > native side has a static bool member called enableDebug. i can bind > that to JS space, but JS-side i have the following behaviour: > > {{{ > BoundNative.prototype.enableDebug; // === a boolean value > BoundNative.enableDebug; // === undefined > }]} > > i'm looking for a way to bind the accessors to the constructor object, > as opposed to instances of the class, but i haven't yet found a way to > do it. > > The question really boils down to: is it possible to bind AccessGetter/ > AccessSetter functions to the constructor of a class? > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > > To unsubscribe from this group, send email to v8-users+ > unsubscribegooglegroups.com or reply to this email with the words "REMOVE > ME" as the subject. > -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users To unsubscribe from this group, send email to v8-users+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
