src: fix EnvironmentOptions.async_context_frame default value
Some checks are pending
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run

`default_is_true` in bool OptionsParser is a hint for help text. The
default value for an option is still required to be set in the option
struct.

PR-URL: https://github.com/nodejs/node/pull/58030
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Chengzhong Wu 2025-04-28 00:10:30 +02:00 committed by GitHub
parent 8e7ae60e3b
commit 6cd1c09c10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View File

@ -146,7 +146,7 @@ class EnvironmentOptions : public Options {
bool allow_worker_threads = false;
bool experimental_repl_await = true;
bool experimental_vm_modules = false;
bool async_context_frame = false;
bool async_context_frame = true;
bool expose_internals = false;
bool force_node_api_uncaught_exceptions_policy = false;
bool frozen_intrinsics = false;
@ -408,6 +408,10 @@ class OptionsParser {
// These methods add a single option to the parser. Optionally, it can be
// specified whether the option should be allowed from environment variable
// sources (i.e. NODE_OPTIONS).
// default_is_true is only a hint in printing help text, it does not
// affect the default value of the option. Set the default value in the
// Options struct instead.
void AddOption(const char* name,
const char* help_text,
bool Options::*field,

View File

@ -0,0 +1,9 @@
// Flags: --expose-internals --no-async-context-frame
'use strict';
require('../common');
const assert = require('assert');
const AsyncContextFrame = require('internal/async_context_frame');
// Test that AsyncContextFrame can be disabled.
assert(!AsyncContextFrame.enabled);

View File

@ -0,0 +1,9 @@
// Flags: --expose-internals
'use strict';
require('../common');
const assert = require('assert');
const AsyncContextFrame = require('internal/async_context_frame');
// Test that AsyncContextFrame is enabled by default.
assert(AsyncContextFrame.enabled);