Well, is it posible to call a javascript function BEFORE run the script?

Look this code:

             Local<Object>
before=Local<Object>::Cast(context->Global()->Get(JSTR("$BEFORE")));
(1)          if(before.IsEmpty()==false && before->IsObject())
               {
                Local<Function>
session=Local<Function>::Cast(before->Get(JSTR("session")));
                if(session.IsEmpty()==false && session->IsFunction())
                  {
                   session->Call(context->Global(),0,NULL);
                  }
               }
             
             Handle<Value> result = cs->Run();

             ...

It seems that (1) becomes false and then if statement is never executed.

NOTES: "context->Enter()" is called before this statement!!
       Object $BEFORE exists and too $AFTER (which is **actually** called
after "cs->Run()"!!!)

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

Reply via email to