Skip to content

Commit 72e39c3

Browse files
jasnellanonrig
andauthored
Apply suggestions from code review
Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
1 parent c9962a6 commit 72e39c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/node_url_pattern.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void URLPattern::New(const FunctionCallbackInfo<Value>& args) {
168168
// If init does not have a value here, the implication is that an
169169
// error was thrown. Let's allow that to be handled now by returning
170170
// early. If we don't, the error thrown will be swallowed.
171-
if (!init.has_value()) return;
171+
if (!init) return;
172172
} else {
173173
THROW_ERR_INVALID_ARG_TYPE(env, "Input must be an object or a string");
174174
return;
@@ -244,7 +244,7 @@ MaybeLocal<Value> URLPattern::URLPatternInit::ToJsObject(
244244
auto result = Object::New(isolate);
245245

246246
const auto trySet = [&](auto name, const std::optional<std::string>& val) {
247-
if (!val.has_value()) return true;
247+
if (!val) return true;
248248
Local<Value> temp;
249249
return ToV8Value(context, *val).ToLocal(&temp) &&
250250
result->Set(context, name, temp).IsJust();

0 commit comments

Comments
 (0)