Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2e49b99

Browse files
backestargos
authored andcommitted
src,test: disable freezing V8 flags on initialization
Node.js still changes flags after initializationg; either becausetests need to set their own flags (which V8 tests also still allow),or because it's explicitly requested via the "v8.setFlagsFromString"method that Node.js provides.PR-URL:#44741Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>Reviewed-By: Jiawen Geng <technicalcute@gmail.com>Reviewed-By: James M Snell <jasnell@gmail.com>
1 parentfd52c62 commit2e49b99

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎src/node.cc

Lines 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

‎test/cctest/node_test_fixture.cc

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp