Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v11.14.0 proposal #27163

Merged
merged 133 commits into from
Apr 11, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
62f9049
src: refactor node options parsers to mitigate MSVC bug
refack Feb 23, 2019
e6c1ad5
src: fix warnings around node_options
refack Feb 25, 2019
63e7cc7
src: forbid access to CLI options before bootstrapping is done
joyeecheung Mar 6, 2019
ab70c96
src: refactor coverage connection
joyeecheung Mar 8, 2019
03bd649
test: show stderr on v8 coverage test failures
joyeecheung Mar 8, 2019
d4f9509
process: delay process.argv[0] and process.argv0 handling
joyeecheung Mar 8, 2019
75c5d9c
process: create legacy process properties during pre-execution
joyeecheung Mar 8, 2019
5a29a94
http: reduce usage of public util
ZYSzys Mar 9, 2019
c51cc9e
src: apply clang-tidy rule modernize-make-unique
gengjiawen Mar 7, 2019
7671a65
embedding: refactor public `ArrayBufferAllocator` API
addaleax Mar 8, 2019
5e64acd
embedding: make `NewIsolate()` API more flexible
addaleax Mar 8, 2019
1b45704
inspector: patch C++ debug options instead of process._breakFirstLine
joyeecheung Mar 11, 2019
169f3f7
util: require `isNativeError` from internalBinding
ZYSzys Mar 19, 2019
21486e5
util: extract uncurryThis function for reuse
ZYSzys Mar 19, 2019
4defe47
child_process: reduce internal usage of public require of util
toshi1127 Mar 19, 2019
44450ef
worker: remove usage of require('util')
toshi1127 Mar 20, 2019
b24e45a
timers: deprecate active() and _unrefActive()
Fishrock123 Mar 18, 2019
5d9f819
worker: remove usage of require('util') in worker_thread.js
toshi1127 Mar 20, 2019
bb9f1cc
fs: reduce usage of require('util')
toshi1127 Mar 25, 2019
a03552d
process: handle --expose-internals during pre-execution
joyeecheung Mar 18, 2019
e43dbaa
console: remove unreachable code
Trott Mar 25, 2019
80e845e
test: add test about unencrypted PKCS#8 private key for RSA
sasurau4 Mar 25, 2019
c1def07
src: delete unreachable code in heap_utils.cc
gengjiawen Mar 20, 2019
ea7e2c0
src: tidy up include headers in env.cc
gengjiawen Mar 20, 2019
c824127
src: delete unused field in class ModuleWrap
gengjiawen Mar 20, 2019
c969731
src: use deleted function for class BaseObject
gengjiawen Mar 20, 2019
6bfb17f
src: fix task release in cares_wrap.cc
gengjiawen Mar 20, 2019
0427354
src: delete useless code in cares_wrap.cc
gengjiawen Mar 20, 2019
a1cf745
test: refactor path parse test
BridgeAR Mar 26, 2019
bd006e1
path: fix win32 parse regression
BridgeAR Mar 26, 2019
1b08e62
util: improve proxy inspection
BridgeAR Mar 26, 2019
682b410
worker: allow execArgv and eval in combination
addaleax Mar 8, 2019
c756b84
errors: make range mandatory in ERR_OUT_OF_RANGE
BridgeAR Mar 26, 2019
17bff5c
doc: remove reference to "credentials object"
sam-github Mar 25, 2019
a821a96
doc: correct typo: cert.issuerCertificate
srl295 Mar 26, 2019
98552f3
crypto: allow undefined for saltLength and padding
tniessen Mar 26, 2019
de93737
benchmark: remove unused field in class BenchmarkProgress
gengjiawen Mar 26, 2019
25d5198
doc: change links to https in benchmark guide
gengjiawen Mar 26, 2019
5512ecb
benchmark: tidy up eslint ignore in foreach-bench.js
gengjiawen Mar 26, 2019
2ef1bd9
test: do not require flags when executing a file
BridgeAR Mar 22, 2019
edad9af
test: move hasCrypto check
BridgeAR Mar 27, 2019
fd6381b
test: remove test-path-parse-6229.js from known issues
BridgeAR Mar 26, 2019
1aa6e99
util: fix map entries inspection
BridgeAR Mar 26, 2019
b62739c
path: remove dead code
BridgeAR Mar 26, 2019
d3c1de3
dns: remove dns.promises experimental warning
cjihrig Mar 11, 2019
ac12109
dns: make dns.promises enumerable
cjihrig Mar 27, 2019
4a7a84a
doc: move dns.promises to stable status
cjihrig Mar 27, 2019
d76c30c
doc: add note about mkdtemp() platform differences
cjihrig Mar 27, 2019
9330d7e
test: add known_issues test for fs.copyFile()
Trott Mar 27, 2019
769d12c
build: add a `Prepare ccache` job in Travis
richardlau Mar 29, 2019
6cbd6b5
build: fix skipping of flaky tests on Travis
richardlau Mar 28, 2019
e776b01
src: do not call into JS in the maxAsyncCallStackDepthChanged interrupt
joyeecheung Mar 26, 2019
760d089
inspector: display error when ToggleAsyncHook fails
joyeecheung Mar 22, 2019
28efecc
doc: remove "How is an LTS release cut?" section
Trott Mar 28, 2019
8798db3
url: add ws: and wss: to slashedProtocol set
lpinca Mar 27, 2019
17cc117
doc: update changelog for v10.x LTS
BethGriggs Mar 26, 2019
0f615d4
util: add subclass and null prototype support for errors in inspect
BridgeAR Mar 26, 2019
0aea4d1
benchmark,lib: change var to const
BridgeAR Mar 26, 2019
7fe43bd
build: remove unused label from vcbuild.bat
bnoordhuis Mar 25, 2019
dc9ce86
tools: update dependencies in lint-md-cli-rollup
watilde Mar 24, 2019
e5181f8
test: simplify for loop in test-buffer-zero-fill-cli.js
juanarbol Mar 20, 2019
78fad32
readline: replace quadratic regex with linear one
Hakerh400 Mar 19, 2019
d3840bc
src: allow per-Environment set of env vars
addaleax Mar 13, 2019
729e2f2
src: implement generic backend for process.env
addaleax Mar 13, 2019
8bd7909
worker: use copy of process.env
addaleax Feb 22, 2019
3c92926
module: simpler esm loading
BridgeAR Mar 29, 2019
ea47189
stream: do not unconditionally call `_read()` on `resume()`
addaleax Mar 28, 2019
b64b223
build,win: silence MSVC warning C4129 for V8
refack Mar 30, 2019
2396743
child_process: doc deprecate ChildProcess._channel
cjihrig Mar 29, 2019
7a39196
doc: change code lang and update it with latest Node.js
gengjiawen Mar 29, 2019
fbdead7
src: add missing uv_fs_req_cleanup()
cjihrig Mar 30, 2019
06dce39
test: fix error code typo
cjihrig Mar 31, 2019
d0ee1a3
src: fix warning on mismatched fn signature
sam-github Mar 27, 2019
8258f07
test: remove unused triggerAsyncId param in test
juanarbol Mar 20, 2019
7cbe121
tools: update ESLint to 5.16.0
cjihrig Mar 30, 2019
57207e7
doc: list when promiseResolve hook was added to async_hooks
watson Mar 29, 2019
0b94aec
doc: add information about modules cache behavior
BridgeAR Mar 28, 2019
64a74d5
doc: move "Prints: ..." under the code
simon300000 Mar 31, 2019
96e429a
dns: refactor lib/internal/dns/utils.js
Trott Mar 30, 2019
a0b0e42
test: add IPv6 brackets but no port to test-dns
Trott Mar 30, 2019
b766c06
build,meta: tweak Travis config
refack Mar 28, 2019
5102d69
src: remove internal includes from node_crypto.h
sam-github Mar 28, 2019
4c96ef7
doc: improve the doc of the 'information' event
lpinca Mar 30, 2019
687348a
test: move test that creates 1Gb file to pummel
Trott Apr 2, 2019
ccd3b74
fs: remove experimental warning for fs.promises
addaleax Mar 11, 2019
5945cf0
tools: fix `test.py --time`
richardlau Mar 30, 2019
38da9be
test: remove test-trace-events-api-worker-disabled from flaky
Trott Mar 30, 2019
054cf7b
src: replace c-style cast
gengjiawen Mar 24, 2019
5fdee11
doc: remove description duplication in buffer.md
vsemozhetbyt Mar 30, 2019
fd3b031
doc: fix possible typo in buffer.md
vsemozhetbyt Mar 31, 2019
944ce7b
doc: add missing types in buffer.md
vsemozhetbyt Mar 31, 2019
5fd4053
doc: unify number/integer types in buffer.md
vsemozhetbyt Mar 31, 2019
3a35d8a
doc: fix error notes in `Buffer.from()` variants
vsemozhetbyt Mar 30, 2019
f9ef9eb
doc: add note about Buffer octets integer coercion
vsemozhetbyt Mar 31, 2019
ea75d43
doc: mark optional parameters in buffer.md
vsemozhetbyt Mar 31, 2019
19ccee0
doc: add notes about negative offsets in buffer.md
vsemozhetbyt Mar 31, 2019
221bcfb
doc: unify periods in comments in buffer.md
vsemozhetbyt Mar 30, 2019
00eef26
doc: unify link formatting in buffer.md
vsemozhetbyt Mar 31, 2019
e40bfd8
util: `inspect()` should not exceed `breakLength`
BridgeAR Mar 26, 2019
a318cbc
src: elevate v8::Task namespace
juanarbol Mar 21, 2019
addc73a
path: refactor for less indentation
BridgeAR Mar 26, 2019
316372c
doc: remove old system_errors
JungMinu Mar 29, 2019
fec9f76
process: run RunBootstrapping in CreateEnvironment
joyeecheung Mar 19, 2019
d3c1481
report: add cwd to report
cjihrig Mar 31, 2019
0fc5dcc
doc: remove unnecessary intro in governance doc
Trott Mar 31, 2019
26af6fb
doc: document the 'pause' and 'resume' events
lpinca Mar 29, 2019
0ac41fc
stream: make Symbol.asyncIterator support stable
mcollina Mar 29, 2019
6d39460
readline: make Symbol.asyncIterator support stable
mcollina Apr 1, 2019
58da879
module: fix repl require calling the same file again
BridgeAR Mar 26, 2019
3fce303
test: make module test pass with NODE_PENDING_DEPRECATION
addaleax Mar 30, 2019
3e4c03d
deps: update nghttp2 to 1.37.0
gengjiawen Mar 29, 2019
438bc52
src: apply clang-tidy rule bugprone-incorrect-roundings
gengjiawen Mar 24, 2019
1bbe5b3
process: store argv in Environment
joyeecheung Mar 19, 2019
a58437d
build: only emit download ICU warnings once
richardlau Mar 31, 2019
7547d8e
doc: fix default maxBuffer size
koh110 Sep 17, 2018
2f1da92
meta: move ofrobots to TSC emeritus
ofrobots Apr 3, 2019
a21bee7
src: use sizeof(var) instead of sizeof(type)
bnoordhuis Apr 1, 2019
c62b1a2
benchmark: add new module loading benchmarks
BridgeAR Jan 2, 2019
4c7a2f1
benchmark: improve module-loader benchmark
BridgeAR Mar 28, 2019
cdb0d84
module: inline try catch
BridgeAR Mar 28, 2019
8f6921e
module: add path to the module object
BridgeAR Mar 28, 2019
5917f4d
module: add extra caching layer
BridgeAR Mar 28, 2019
36714e1
buffer: fix concat error message
BridgeAR Apr 2, 2019
cee079f
deps: add ARM64 Windows support in openssl
shigeki Feb 23, 2019
ddf7477
deps: add ARM64 Windows configurations in openssl
jkunkee Mar 8, 2019
038b778
querystring: simplify stringify method
ZYSzys Mar 27, 2019
70d9f32
src: prevent crash in TTYWrap::Initialize
Hakerh400 Mar 21, 2019
066cd60
crypto: fix crash of encrypted private key export without cipher
panva Apr 1, 2019
d688a93
async_hooks: minor cleanup and improvements
apapirovski Mar 31, 2019
b502873
build: fix inspector dependency resolution
bnoordhuis Mar 31, 2019
a00d840
crypto: fix crash of encrypted private key export without cipher
panva Apr 1, 2019
75e8377
doc: assign missed deprecation code
richardlau Apr 9, 2019
cd026f8
2019-04-11, Version 11.14.0 (Current)
BethGriggs Apr 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
src: refactor node options parsers to mitigate MSVC bug
Backport-PR-URL: #26649
PR-URL: #26280
Fixes: #25593
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
refack authored and targos committed Mar 28, 2019
commit 62f904974d5c36c9f0d44d0928f23bb3a752398d
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ int ProcessGlobalArgs(std::vector<std::string>* args,
std::vector<std::string> v8_args;

Mutex::ScopedLock lock(per_process::cli_options_mutex);
options_parser::PerProcessOptionsParser::instance.Parse(
options_parser::Parse(
args,
exec_args,
&v8_args,
Expand Down
99 changes: 69 additions & 30 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,60 @@ void EnvironmentOptions::CheckOptions(std::vector<std::string>* errors) {

namespace options_parser {

// Explicitly access the singelton instances in their dependancy order.
// This was moved here to workaround a compiler bug.
// Refs: https://github.com/nodejs/node/issues/25593
class DebugOptionsParser : public OptionsParser<DebugOptions> {
public:
DebugOptionsParser();
};

class EnvironmentOptionsParser : public OptionsParser<EnvironmentOptions> {
public:
EnvironmentOptionsParser();
explicit EnvironmentOptionsParser(const DebugOptionsParser& dop)
: EnvironmentOptionsParser() {
Insert(&dop, &EnvironmentOptions::get_debug_options);
}
};

#if HAVE_INSPECTOR
const DebugOptionsParser DebugOptionsParser::instance;
#endif // HAVE_INSPECTOR
class PerIsolateOptionsParser : public OptionsParser<PerIsolateOptions> {
public:
PerIsolateOptionsParser() = delete;
explicit PerIsolateOptionsParser(const EnvironmentOptionsParser& eop);
};

const EnvironmentOptionsParser EnvironmentOptionsParser::instance;
class PerProcessOptionsParser : public OptionsParser<PerProcessOptions> {
public:
PerProcessOptionsParser() = delete;
explicit PerProcessOptionsParser(const PerIsolateOptionsParser& iop);
};

const PerIsolateOptionsParser PerIsolateOptionsParser::instance;
#if HAVE_INSPECTOR
const DebugOptionsParser _dop_instance{};
const EnvironmentOptionsParser _eop_instance{_dop_instance};
#else
const EnvironmentOptionsParser _eop_instance{};
#endif // HAVE_INSPECTOR
const PerIsolateOptionsParser _piop_instance{_eop_instance};
const PerProcessOptionsParser _ppop_instance{_piop_instance};

template <>
void Parse(
StringVector* const args, StringVector* const exec_args,
StringVector* const v8_args,
PerIsolateOptions* const options,
OptionEnvvarSettings required_env_settings, StringVector* const errors) {
_piop_instance.Parse(
args, exec_args, v8_args, options, required_env_settings, errors);
}

const PerProcessOptionsParser PerProcessOptionsParser::instance;
template <>
void Parse(
StringVector* const args, StringVector* const exec_args,
StringVector* const v8_args,
PerProcessOptions* const options,
OptionEnvvarSettings required_env_settings, StringVector* const errors) {
_ppop_instance.Parse(
args, exec_args, v8_args, options, required_env_settings, errors);
}

// XXX: If you add an option here, please also add it to doc/node.1 and
// doc/api/cli.md
Expand Down Expand Up @@ -286,14 +327,10 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddAlias("-i", "--interactive");

AddOption("--napi-modules", "", NoOp{}, kAllowedInEnvironment);

#if HAVE_INSPECTOR
Insert(&DebugOptionsParser::instance,
&EnvironmentOptions::get_debug_options);
#endif // HAVE_INSPECTOR
}

PerIsolateOptionsParser::PerIsolateOptionsParser() {
PerIsolateOptionsParser::PerIsolateOptionsParser(
const EnvironmentOptionsParser& eop) {
AddOption("--track-heap-objects",
"track heap object allocations for heap snapshots",
&PerIsolateOptions::track_heap_objects,
Expand Down Expand Up @@ -349,11 +386,11 @@ PerIsolateOptionsParser::PerIsolateOptionsParser() {
kAllowedInEnvironment);
#endif // NODE_REPORT

Insert(&EnvironmentOptionsParser::instance,
&PerIsolateOptions::get_per_env_options);
Insert(&eop, &PerIsolateOptions::get_per_env_options);
}

PerProcessOptionsParser::PerProcessOptionsParser() {
PerProcessOptionsParser::PerProcessOptionsParser(
const PerIsolateOptionsParser& iop) {
AddOption("--title",
"the process title to use on startup",
&PerProcessOptions::title,
Expand Down Expand Up @@ -459,8 +496,7 @@ PerProcessOptionsParser::PerProcessOptionsParser() {
#endif
#endif

Insert(&PerIsolateOptionsParser::instance,
&PerProcessOptions::get_per_isolate_options);
Insert(&iop, &PerProcessOptions::get_per_isolate_options);
}

inline std::string RemoveBrackets(const std::string& host) {
Expand Down Expand Up @@ -526,10 +562,8 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) {
per_process::cli_options->per_isolate = original_per_isolate;
});

const auto& parser = PerProcessOptionsParser::instance;

Local<Map> options = Map::New(isolate);
for (const auto& item : parser.options_) {
for (const auto& item : _ppop_instance.options_) {
Local<Value> value;
const auto& option_info = item.second;
auto field = option_info.field;
Expand All @@ -547,29 +581,34 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) {
}
break;
case kBoolean:
value = Boolean::New(isolate, *parser.Lookup<bool>(field, opts));
value = Boolean::New(isolate,
*_ppop_instance.Lookup<bool>(field, opts));
break;
case kInteger:
value = Number::New(isolate, *parser.Lookup<int64_t>(field, opts));
value = Number::New(isolate,
*_ppop_instance.Lookup<int64_t>(field, opts));
break;
case kUInteger:
value = Number::New(isolate, *parser.Lookup<uint64_t>(field, opts));
value = Number::New(isolate,
*_ppop_instance.Lookup<uint64_t>(field, opts));
break;
case kString:
if (!ToV8Value(context, *parser.Lookup<std::string>(field, opts))
if (!ToV8Value(context,
*_ppop_instance.Lookup<std::string>(field, opts))
.ToLocal(&value)) {
return;
}
break;
case kStringList:
if (!ToV8Value(context,
*parser.Lookup<std::vector<std::string>>(field, opts))
*_ppop_instance.Lookup<StringVector>(field, opts))
.ToLocal(&value)) {
return;
}
break;
case kHostPort: {
const HostPort& host_port = *parser.Lookup<HostPort>(field, opts);
const HostPort& host_port =
*_ppop_instance.Lookup<HostPort>(field, opts);
Local<Object> obj = Object::New(isolate);
Local<Value> host;
if (!ToV8Value(context, host_port.host()).ToLocal(&host) ||
Expand Down Expand Up @@ -610,7 +649,7 @@ void GetOptions(const FunctionCallbackInfo<Value>& args) {
}

Local<Value> aliases;
if (!ToV8Value(context, parser.aliases_).ToLocal(&aliases)) return;
if (!ToV8Value(context, _ppop_instance.aliases_).ToLocal(&aliases)) return;

Local<Object> ret = Object::New(isolate);
if (ret->Set(context, env->options_string(), options).IsNothing() ||
Expand Down
45 changes: 12 additions & 33 deletions src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,12 @@ class OptionsParser {
//
// If `*error` is set, the result of the parsing should be discarded and the
// contents of any of the argument vectors should be considered undefined.
virtual void Parse(std::vector<std::string>* const args,
std::vector<std::string>* const exec_args,
std::vector<std::string>* const v8_args,
Options* const options,
OptionEnvvarSettings required_env_settings,
std::vector<std::string>* const errors) const;
void Parse(std::vector<std::string>* const args,
std::vector<std::string>* const exec_args,
std::vector<std::string>* const v8_args,
Options* const options,
OptionEnvvarSettings required_env_settings,
std::vector<std::string>* const errors) const;

private:
// We support the wide variety of different option types by remembering
Expand Down Expand Up @@ -403,33 +403,12 @@ class OptionsParser {
friend void GetOptions(const v8::FunctionCallbackInfo<v8::Value>& args);
};

class DebugOptionsParser : public OptionsParser<DebugOptions> {
public:
DebugOptionsParser();

static const DebugOptionsParser instance;
};

class EnvironmentOptionsParser : public OptionsParser<EnvironmentOptions> {
public:
EnvironmentOptionsParser();

static const EnvironmentOptionsParser instance;
};

class PerIsolateOptionsParser : public OptionsParser<PerIsolateOptions> {
public:
PerIsolateOptionsParser();

static const PerIsolateOptionsParser instance;
};

class PerProcessOptionsParser : public OptionsParser<PerProcessOptions> {
public:
PerProcessOptionsParser();

static const PerProcessOptionsParser instance;
};
using StringVector = std::vector<std::string>;
template <class OptionsType, class = Options>
void Parse(
StringVector* const args, StringVector* const exec_args,
StringVector* const v8_args, OptionsType* const options,
OptionEnvvarSettings required_env_settings, StringVector* const errors);

} // namespace options_parser

Expand Down
2 changes: 1 addition & 1 deletion src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {

// Using invalid_args as the v8_args argument as it stores unknown
// options for the per isolate parser.
options_parser::PerIsolateOptionsParser::instance.Parse(
options_parser::Parse(
&exec_argv,
&exec_argv_out,
&invalid_args,
Expand Down