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

Appearance settings

Commit 7cc5153

Browse filesBrowse files
committed
src: remove has_experimental_policy option
This would be set when `--experimental-policy` was set, but since an empty string does not refer to a valid file, we can just check the value of `--experimental-policy` directly. PR-URL: #25628 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
1 parent 0640b09 commit 7cc5153
Copy full SHA for 7cc5153

File tree

Expand file treeCollapse file tree

4 files changed

+3
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+3
-8
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ function startup() {
172172
}
173173

174174
// TODO(joyeecheung): move this down further to get better snapshotting
175-
if (getOptionValue('[has_experimental_policy]')) {
175+
const experimentalPolicy = getOptionValue('--experimental-policy');
176+
if (experimentalPolicy) {
176177
process.emitWarning('Policies are experimental.',
177178
'ExperimentalWarning');
178-
const experimentalPolicy = getOptionValue('--experimental-policy');
179179
const { pathToFileURL, URL } = NativeModule.require('url');
180180
// URL here as it is slightly different parsing
181181
// no bare specifiers for now
Collapse file

‎lib/internal/modules/cjs/loader.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/cjs/loader.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const { getOptionValue } = require('internal/options');
4545
const preserveSymlinks = getOptionValue('--preserve-symlinks');
4646
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
4747
const experimentalModules = getOptionValue('--experimental-modules');
48-
const manifest = getOptionValue('[has_experimental_policy]') ?
48+
const manifest = getOptionValue('--experimental-policy') ?
4949
require('internal/process/policy').manifest :
5050
null;
5151

Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,11 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
143143
"experimental ES Module support and caching modules",
144144
&EnvironmentOptions::experimental_modules,
145145
kAllowedInEnvironment);
146-
AddOption("[has_experimental_policy]",
147-
"",
148-
&EnvironmentOptions::has_experimental_policy);
149146
AddOption("--experimental-policy",
150147
"use the specified file as a "
151148
"security policy",
152149
&EnvironmentOptions::experimental_policy,
153150
kAllowedInEnvironment);
154-
Implies("--experimental-policy", "[has_experimental_policy]");
155151
AddOption("--experimental-repl-await",
156152
"experimental await keyword support in REPL",
157153
&EnvironmentOptions::experimental_repl_await,
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class EnvironmentOptions : public Options {
9595
bool abort_on_uncaught_exception = false;
9696
bool experimental_modules = false;
9797
std::string experimental_policy;
98-
bool has_experimental_policy;
9998
bool experimental_repl_await = false;
10099
bool experimental_vm_modules = false;
101100
bool expose_internals = false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.