v8::Primitive is immutable and not assignable. Since V8 uses a garbage collector, your program should not generally have v8::Values (including v8::Primitives) in variables, it should use v8::Handle<>s for maintaining references to V8 objects. What is a purpose of your Convert method? What are you trying to achieve?
Kind regards, Dmitry On Wed, Apr 3, 2013 at 5:01 PM, Mike Moening <[email protected]> wrote: > I'm using V8 javascript engine and storing some values in a C++ object > using this: > > v8::Persistent<v8::Primitive> m_Value; > > I want to use the saved value to set another Primitive and return it like > this: > > bool > MyClass::Convert(v8::Primitive& oValue) > { > oValue.Clear(); //Clear() is not a valid method for Primitive. > How can I clear it or set it to Null or Undefined or Empty? > oValue= m_Value; > } > > The 2nd line results in a compiler error: > binary '=' : no operator found which takes a right-hand operand of type > 'v8::Persistent<T>' (or there is no acceptable conversion) > > How do I get the Primitive value back out of the Persistent? > I've tried to dereference m_Value. No luck. > This HAS to be simple... > > -- > -- > 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/groups/opt_out. > > > -- -- 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/groups/opt_out.
