未做任何修改时,编译没有问题
当我在函数内添加这两句代码就会编译出错
Local global = ObjectTemplate::New(isolate);
global->Set(isolate, "test", Number::New(isolate, 99.99));
我也不知道什么原因;
auto IsolateEnvironment::NewContext() -> Local {
auto context =
Context::New(isolate, nullptr, {}, {}, &DeserializeInternalFieldsCallback);
context->AllowCodeGenerationFromStrings(false);
// TODO (but I'm not going to do it): This causes a DCHECK failure in debug builds. Tested nodejs
// v14.17.3 & v16.5.1.
// context->SetErrorMessageForCodeGenerationFromStrings(StringTable::Get().codeGenerationError);
return context;
}
未做任何修改时,编译没有问题 当我在函数内添加这两句代码就会编译出错 Local global = ObjectTemplate::New(isolate);
global->Set(isolate, "test", Number::New(isolate, 99.99));
我也不知道什么原因;
auto IsolateEnvironment::NewContext() -> Local {
auto context =
Context::New(isolate, nullptr, {}, {}, &DeserializeInternalFieldsCallback);
context->AllowCodeGenerationFromStrings(false);
// TODO (but I'm not going to do it): This causes a DCHECK failure in debug builds. Tested nodejs
// v14.17.3 & v16.5.1.
// context->SetErrorMessageForCodeGenerationFromStrings(StringTable::Get().codeGenerationError);
return context;
}