Skip to content

Commit

Permalink
src: initialize Environment members in class definition
Browse files Browse the repository at this point in the history
Initialize primitive members of `Environment` in the class definition
for clarity.

PR-URL: nodejs#25369
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
  • Loading branch information
addaleax authored and BridgeAR committed Jan 16, 2019
1 parent bdde476 commit 197eaac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,9 @@ Environment::Environment(IsolateData* isolate_data,
immediate_info_(context->GetIsolate()),
tick_info_(context->GetIsolate()),
timer_base_(uv_now(isolate_data->event_loop())),
printed_error_(false),
abort_on_uncaught_exception_(false),
emit_env_nonstring_warning_(true),
emit_err_name_warning_(true),
makecallback_cntr_(0),
should_abort_on_uncaught_toggle_(isolate_, 1),
trace_category_state_(isolate_, kTraceCategoryCount),
stream_base_state_(isolate_, StreamBase::kNumStreamBaseStateFields),
http_parser_buffer_(nullptr),
fs_stats_field_array_(isolate_, kFsStatsBufferLength),
fs_stats_field_bigint_array_(isolate_, kFsStatsBufferLength),
context_(context->GetIsolate(), context) {
Expand Down
12 changes: 6 additions & 6 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,11 @@ class Environment {
ImmediateInfo immediate_info_;
TickInfo tick_info_;
const uint64_t timer_base_;
bool printed_error_;
bool abort_on_uncaught_exception_;
bool emit_env_nonstring_warning_;
bool emit_err_name_warning_;
size_t makecallback_cntr_;
bool printed_error_ = false;
bool abort_on_uncaught_exception_ = false;
bool emit_env_nonstring_warning_ = true;
bool emit_err_name_warning_ = true;
size_t makecallback_cntr_ = 0;
std::vector<double> destroy_async_id_list_;

std::shared_ptr<EnvironmentOptions> options_;
Expand Down Expand Up @@ -1004,7 +1004,7 @@ class Environment {
double* heap_statistics_buffer_ = nullptr;
double* heap_space_statistics_buffer_ = nullptr;

char* http_parser_buffer_;
char* http_parser_buffer_ = nullptr;
bool http_parser_buffer_in_use_ = false;
std::unique_ptr<http2::Http2State> http2_state_;

Expand Down

0 comments on commit 197eaac

Please sign in to comment.