GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: allow embedder control of code generation policy · nodejs/node@17eea18

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • api
      • environment.cc
    • node.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/api/environment.cc‎

Copy file name to clipboardExpand all lines: src/api/environment.cc
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,16 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) {
263263
auto* allow_wasm_codegen_cb = s.allow_wasm_code_generation_callback ?
264264
s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback;
265265
isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb);
266+
267+
auto* modify_code_generation_from_strings_callback =
268+
ModifyCodeGenerationFromStrings;
269+
if (s.flags & ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK &&
270+
s.modify_code_generation_from_strings_callback) {
271+
modify_code_generation_from_strings_callback =
272+
s.modify_code_generation_from_strings_callback;
273+
}
266274
isolate->SetModifyCodeGenerationFromStringsCallback(
267-
ModifyCodeGenerationFromStrings);
275+
modify_code_generation_from_strings_callback);
268276

269277
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
270278
if (per_process::cli_options->get_per_isolate_options()
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ enum IsolateSettingsFlags {
438438
MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0,
439439
DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1,
440440
SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2,
441-
SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3
441+
SHOULD_NOT_SET_PREPARE_STACK_TRACE_CALLBACK = 1 << 3,
442+
ALLOW_MODIFY_CODE_GENERATION_FROM_STRINGS_CALLBACK = 1 << 4,
442443
};
443444

444445
struct IsolateSettings {
@@ -456,6 +457,8 @@ struct IsolateSettings {
456457
v8::PromiseRejectCallback promise_reject_callback = nullptr;
457458
v8::AllowWasmCodeGenerationCallback
458459
allow_wasm_code_generation_callback = nullptr;
460+
v8::ModifyCodeGenerationFromStringsCallback2
461+
modify_code_generation_from_strings_callback = nullptr;
459462
};
460463

461464
// Overriding IsolateSettings may produce unexpected behavior

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.