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,test: disable freezing V8 flags on initialization · nodejs/node@2e49b99

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.cc
  • test/cctest
    • node_test_fixture.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,11 @@ static ExitCode InitializeNodeWithArgsInternal(
741741
// used in diagnostic reports.
742742
per_process::cli_options->cmdline = *argv;
743743

744+
// Node provides a "v8.setFlagsFromString" method to dynamically change flags.
745+
// Hence do not freeze flags when initializing V8. In a browser setting, this
746+
// is security relevant, for Node it's less important.
747+
V8::SetFlagsFromString("--no-freeze-flags-after-init");
748+
744749
#if defined(NODE_V8_OPTIONS)
745750
// Should come before the call to V8::SetFlagsFromCommandLine()
746751
// so the user can disable a flag --foo at run-time by passing
Collapse file

‎test/cctest/node_test_fixture.cc‎

Copy file name to clipboardExpand all lines: test/cctest/node_test_fixture.cc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ void NodeTestEnvironment::SetUp() {
2424
#endif
2525
cppgc::InitializeProcess(
2626
NodeZeroIsolateTestFixture::platform->GetPageAllocator());
27+
28+
// Before initializing V8, disable the --freeze-flags-after-init flag, so
29+
// individual tests can set their own flags.
30+
v8::V8::SetFlagsFromString("--no-freeze-flags-after-init");
31+
2732
v8::V8::Initialize();
2833
}
2934

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.