make ToLocalCheck crash in release mode

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1043363005

Cr-Commit-Position: refs/heads/master@{#27585}
This commit is contained in:
dcarney 2015-04-02 03:59:45 -07:00 committed by Commit bot
parent 64b3dc9082
commit ce7cc5119c

View File

@ -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<T> ToLocalChecked();
template <class S>
@ -6909,9 +6909,7 @@ Local<T> Eternal<T>::Get(Isolate* isolate) {
template <class T>
Local<T> MaybeLocal<T>::ToLocalChecked() {
#ifdef V8_ENABLE_CHECKS
if (val_ == nullptr) V8::ToLocalEmpty();
#endif
if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
return Local<T>(val_);
}