Hi Nard,
The prototype of FUnction::Call is:
V8EXPORT Local <http://izs.me/v8-docs/classv8_1_1Local.html>< Value <http://izs.me/v8-docs/classv8_1_1Value.html> > Call <http://izs.me/v8-docs/classv8_1_1Function.html#ac61877494d2d8bb81fcef96003ec4059> (Handle <http://izs.me/v8-docs/classv8_1_1Handle.html>< Object <http://izs.me/v8-docs/classv8_1_1Object.html> > recv, int argc, Handle <http://izs.me/v8-docs/classv8_1_1Handle.html>< Value <http://izs.me/v8-docs/classv8_1_1Value.html> > argv[])
You appear to have swapped argc and argv.
Unrelated to your problem, you may wish to look at the difference between args.This() and args.Holder(), jsut to be sure you are using the one tpat is appropriate for your purpose.

Alex

On 12/15/2011 6:25 PM, nardz wrote:
Hi guys,

I was doing the similar thing as Ravi but I got blocked here:

Local<Object> evalObj = v8::Context::GetCurrent()->Global();
Local<Function> eval = v8::Function::Cast( *(evalObj->Get(v8::String::New("eval"))) );

// Copy Arguments data to an array:
std::vector< Handle<Value> > vec( static_cast<size_t>( args.Length() ), v8::Undefined() );
for( int i = 0; i < args.Length(); ++i ) vec[i] = args[i];

// Pass them on to the "real" eval() function:
eval->Call( args.This(), &vec[0], args.Length() );

I got an error like:

2>d:\source_codes\prototyped\phvipre\src\source\javascriptemulation\dom\window_v8binding.cpp(757) : error C2664: 'v8::Function::Call' : cannot convert parameter 2 from 'v8::Handle<T> *__w64 ' to 'int'
2>        with
2>        [
2>            T=v8::Value
2>        ]
2>        There is no context in which this conversion is possible


Pls forgive me, i'm a virgin in v8.

Thanks,
Nard

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

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

Reply via email to