関数を文字列としてハードコードし、関数に変換して実行しようとしています。
Local<Function> cb = "function(){ console.log('HELLO BOSS'); }";
int argc=0;
v8::Handle<v8::Value> * argv;
cb->Call(Context::GetCurrent()->Global(),argc,argv);
コンパイラは、私は直接それを行うことができないと言います:
error C2664: 'v8::Handle<T>::Handle(T *)' : cannot convert parameter 1 from 'const char *' to 'v8::Function *'
with
[
T=v8::Function
]
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
x.cpp(15) : see reference to function template instantiation 'v8::Local<T>::Local<const char>(S *)' being compiled
with
[
T=v8::Function,
S=const char
]
どうすればそれができますか?また、すべてのグッズ (eval、新しい関数など) はどこにありますか?