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