GeezerVison is showing github.com — src: fix EnvironmentOptions.async_context_frame default value · nodejs/node@902cbe6
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/node_options.h +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -146,7 +146,7 @@ class EnvironmentOptions : public Options { |
146 | 146 | bool allow_worker_threads = false; |
147 | 147 | bool experimental_repl_await = true; |
148 | 148 | bool experimental_vm_modules = false; |
149 | | - bool async_context_frame = false; |
| 149 | + bool async_context_frame = true; |
150 | 150 | bool expose_internals = false; |
151 | 151 | bool force_node_api_uncaught_exceptions_policy = false; |
152 | 152 | bool frozen_intrinsics = false; |
@@ -408,6 +408,10 @@ class OptionsParser { |
408 | 408 | // These methods add a single option to the parser. Optionally, it can be |
409 | 409 | // specified whether the option should be allowed from environment variable |
410 | 410 | // sources (i.e. NODE_OPTIONS). |
| 411 | + |
| 412 | + // default_is_true is only a hint in printing help text, it does not |
| 413 | + // affect the default value of the option. Set the default value in the |
| 414 | + // Options struct instead. |
411 | 415 | void AddOption(const char* name, |
412 | 416 | const char* help_text, |
413 | 417 | bool Options::*field, |
|
Collapse file
Copy file name to clipboard +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +// Flags: --expose-internals --no-async-context-frame |
| 2 | +'use strict'; |
| 3 | + |
| 4 | +require('../common'); |
| 5 | +const assert = require('assert'); |
| 6 | +const AsyncContextFrame = require('internal/async_context_frame'); |
| 7 | + |
| 8 | +// Test that AsyncContextFrame can be disabled. |
| 9 | +assert(!AsyncContextFrame.enabled); |
Collapse file
Copy file name to clipboard +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +// Flags: --expose-internals |
| 2 | +'use strict'; |
| 3 | + |
| 4 | +require('../common'); |
| 5 | +const assert = require('assert'); |
| 6 | +const AsyncContextFrame = require('internal/async_context_frame'); |
| 7 | + |
| 8 | +// Test that AsyncContextFrame is enabled by default. |
| 9 | +assert(AsyncContextFrame.enabled); |