1
문자열로 함수를 하드 코딩하고 함수로 변환하여 실행하려고합니다.문자열을 v8에서 작동하도록 변환
Local<Function> cb = "function(){ console.log('HELLO BOSS'); }";
int argc=0;
v8::Handle<v8::Value> * argv;
cb->Call(Context::GetCurrent()->Global(),argc,argv);
컴파일러 SAIS 내가 직접 수행 할 수 없습니다
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, 새로운 기능 등)은 어디에 있습니까?
자신에게 가장 적합한 답변을 수락하는 것이 좋습니다. –
@EitanT에서 2 일 후 –