зеркало из https://github.com/electron/electron.git
fix: wasm codegen in script.runInNewContext (#23129)
This commit is contained in:
Родитель
2541d62486
Коммит
8b2e863a30
|
@ -185,7 +185,6 @@
|
|||
"parallel/test-v8-coverage",
|
||||
"parallel/test-v8-flags",
|
||||
"parallel/test-vm-basic",
|
||||
"parallel/test-vm-codegen",
|
||||
"parallel/test-vm-module-basic",
|
||||
"parallel/test-vm-parse-abort-on-uncaught-exception",
|
||||
"parallel/test-vm-sigint",
|
||||
|
|
|
@ -85,6 +85,13 @@ void HostCleanupFinalizationGroupCallback(
|
|||
env->RegisterFinalizationGroupForCleanup(group);
|
||||
}
|
||||
|
||||
bool AllowWasmCodeGenerationCallback(v8::Local<v8::Context> context,
|
||||
v8::Local<v8::String>) {
|
||||
v8::Local<v8::Value> wasm_code_gen = context->GetEmbedderData(
|
||||
node::ContextEmbedderIndex::kAllowWasmCodeGeneration);
|
||||
return wasm_code_gen->IsUndefined() || wasm_code_gen->IsTrue();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace electron {
|
||||
|
@ -161,6 +168,9 @@ int NodeMain(int argc, char* argv[]) {
|
|||
isolate->SetHostCleanupFinalizationGroupCallback(
|
||||
HostCleanupFinalizationGroupCallback);
|
||||
|
||||
isolate->SetAllowWasmCodeGenerationCallback(
|
||||
AllowWasmCodeGenerationCallback);
|
||||
|
||||
gin_helper::Dictionary process(isolate, env->process_object());
|
||||
#if defined(OS_WIN)
|
||||
process.SetMethod("log", &ElectronBindings::Log);
|
||||
|
|
Загрузка…
Ссылка в новой задаче