Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index c4536d6a7c10f9ed1816ec6850945dee2968bb9f..8b2f39d1235ab534b5d884185a7561110eeaf62a 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -439,7 +439,7 @@ |
return !IsEmpty(); |
} |
- // Will crash if the MaybeLocal<> is empty. |
+ // Will crash when checks are enabled if the MaybeLocal<> is empty. |
V8_INLINE Local<T> ToLocalChecked(); |
template <class S> |
@@ -6909,7 +6909,9 @@ |
template <class T> |
Local<T> MaybeLocal<T>::ToLocalChecked() { |
- if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty(); |
+#ifdef V8_ENABLE_CHECKS |
+ if (val_ == nullptr) V8::ToLocalEmpty(); |
+#endif |
return Local<T>(val_); |
} |