Ok, I actually need to keep a persistent object, but I cant. It works
for process.cc but not for my class.

error C2678: binary '=' : no operator found which takes a left-hand
operand of type 'const v8::Persistent<T>' (or there is no acceptable
conversion)

// I'm trying to make an assignment here, for _context, and that's the
line that gets the error.
void Foo::bar()
{
        // Create the scope for variables.
        v8::HandleScope handleScope;

        // Create a template for the global object.
        v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();

        // Create the execution environment which contains the global
functions.
        v8::Handle<v8::Context> context = v8::Context::New(NULL, global);

        _context = v8::Persistent<v8::Context>::New(context);
}

In the header, it's simply defined as:
...
private:
v8::Persistent<v8::Context> _context;


I grabbed this code from process.cc sample.
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to