How to call a function without arguments in V8?

I learned how to call a function with arguments.

int argc = 1; v8::Handle<v8::Value> argv[] = { v8::String::New("arg") }; v8::Local<v8::Value> result = function->Call(foo, argc, argv); 

But I would like to call the function without any argument, so argc should be 0 , and argv should be an array of zero length, which is probably not possible in C ++.

How to call JavaScript function without arguments in V8?

+4
source share
1 answer

It is very simple, just use:

 function->Call(function, 0, NULL); 
+2
source

Source: https://habr.com/ru/post/1487242/


All Articles