diff --git a/src/node_options-inl.h b/src/node_options-inl.h index 5eddc400e3f99a..7facb22afc3c9b 100644 --- a/src/node_options-inl.h +++ b/src/node_options-inl.h @@ -188,7 +188,8 @@ auto OptionsParser::Convert( return OptionInfo{original.type, Convert(original.field, get_child), original.env_setting, - original.help_text}; + original.help_text, + original.default_is_true}; } template @@ -402,6 +403,13 @@ void OptionsParser::Parse( } const OptionInfo& info = it->second; + + // Some V8 options can be negated and they are validated by V8 later. + if (is_negation && info.type != kBoolean && info.type != kV8Option) { + errors->push_back(NegationImpliesBooleanError(arg)); + break; + } + std::string value; if (info.type != kBoolean && info.type != kNoOp && info.type != kV8Option) { if (equals_index != std::string::npos) { @@ -428,11 +436,6 @@ void OptionsParser::Parse( } } - // Some V8 options can be negated and they are validated by V8 later. - if (is_negation && info.type != kBoolean && info.type != kV8Option) { - errors->push_back(NegationImpliesBooleanError(arg)); - } - switch (info.type) { case kBoolean: *Lookup(info.field, options) = !is_negation;