mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: wasm codegen in script.runInNewContext (#23146)
This commit is contained in:
@@ -205,7 +205,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",
|
||||
|
||||
@@ -29,6 +29,17 @@
|
||||
#include "shell/common/crash_reporter/crash_reporter_win.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
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 {
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
@@ -99,6 +110,10 @@ int NodeMain(int argc, char* argv[]) {
|
||||
node::BootstrapEnvironment(env);
|
||||
|
||||
gin_helper::Dictionary process(isolate, env->process_object());
|
||||
|
||||
isolate->SetAllowWasmCodeGenerationCallback(
|
||||
AllowWasmCodeGenerationCallback);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
process.SetMethod("log", &ElectronBindings::Log);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user