File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Open diff view settings
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -265,8 +265,16 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
265265 auto * allow_wasm_codegen_cb = s.allow_wasm_code_generation_callback ?
266266 s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback;
267267 isolate->SetAllowWasmCodeGenerationCallback (allow_wasm_codegen_cb);
268+
269+ auto * modify_code_generation_from_strings_callback =
270+ ModifyCodeGenerationFromStrings;
271+ if (s.flags & ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK &&
272+ s.modify_code_generation_from_strings_callback ) {
273+ modify_code_generation_from_strings_callback =
274+ s.modify_code_generation_from_strings_callback ;
275+ }
268276 isolate->SetModifyCodeGenerationFromStringsCallback (
269- ModifyCodeGenerationFromStrings );
277+ modify_code_generation_from_strings_callback );
270278
271279 Mutex::ScopedLock lock (node::per_process::cli_options_mutex);
272280 if (per_process::cli_options->get_per_isolate_options ()
Original file line number Diff line number Diff line change @@ -453,7 +453,8 @@ enum IsolateSettingsFlags {
453453 MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0 ,
454454 DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1 ,
455455 SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2 ,
456- SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3
456+ SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3 ,
457+ ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 1 << 4 ,
457458};
458459
459460struct IsolateSettings {
@@ -471,6 +472,8 @@ struct IsolateSettings {
471472 v8::PromiseRejectCallback promise_reject_callback = nullptr ;
472473 v8::AllowWasmCodeGenerationCallback
473474 allow_wasm_code_generation_callback = nullptr ;
475+ v8::ModifyCodeGenerationFromStringsCallback2
476+ modify_code_generation_from_strings_callback = nullptr ;
474477};
475478
476479// Overriding IsolateSettings may produce unexpected behavior
You can’t perform that action at this time.
0 commit comments