Skip to content

Commit

Permalink
Fix ternary in Nan::MaybeLocal<T>::FromMaybe<S>().
Browse files Browse the repository at this point in the history
Make both arms return the same type to avoid build errors when S != T.

This works correctly in the V8 implementation of FromMaybe() but it
didn't until now in the nan fallback for v0.10 and v0.12.
  • Loading branch information
bnoordhuis authored and kkoopa committed Aug 16, 2017
1 parent 7291008 commit 79a26f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nan_maybe_pre_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MaybeLocal {

template<typename S>
inline v8::Local<S> FromMaybe(v8::Local<S> default_value) const {
return IsEmpty() ? default_value : val_;
return IsEmpty() ? default_value : v8::Local<S>(val_);
}

private:
Expand Down

0 comments on commit 79a26f7

Please sign in to comment.