Hi  peop, 

When I try to compile this code with node-gyp rebuild, i get the errors : 

'HandleScope' undeclared identifier

'scope': identifier not found

'GetCurrentContext' is not a member of v8 function

v8::Function::Call : take 3 args does not take 3 args

Help please : I'm using node v12.24.1


Thanks

//-------------------------------------------------------------------------------------------------------------------//
static Persistent<v8::Function> cb; 

void PostMessage(){
 
Isolate* isolate = Isolate::GetCurrent(); v8::Locker locker(isolate); 
 HandleScope scope(isolate);

const unsigned argc = 1; Local<Value> argv[argc] = { 
String::NewFromUtf8(isolate, "test") }; 

 Local<v8::Function> PostMessageCb = Local<v8::Function>::New(isolate, cb);
(PostMessageCb)->Call(isolate->GetCurrentContext()->Global(), argc, argv); 
} 
//-------------------------------------------------------------------------------------------------------------------//
void SetupCallback(const FunctionCallbackInfo<Value>& args) { 
 Isolate* isolate = Isolate::GetCurrent(); 
 v8::Locker locker(isolate); HandleScope scope(isolate);
 
Local<v8::Function> local_cb = Local<v8::Function>::Cast(args[0]); 
cb.Reset(isolate, local_cb); } 


Error code : 

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/89926617-09d2-49cf-89d8-b9452021d47an%40googlegroups.com.

Reply via email to