Revert of make ToLocalCheck crash in release mode (patchset #1 id:1 of https://codere...
authordcarney <dcarney@chromium.org>
Thu, 2 Apr 2015 13:09:23 +0000 (06:09 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 2 Apr 2015 13:09:28 +0000 (13:09 +0000)
Reason for revert:
breaks some devtools things

Original issue's description:
> make ToLocalCheck crash in release mode
>
> R=svenpanne@chromium.org
> BUG=
>
> Committed: https://crrev.com/ce7cc5119c1e031bf1eb8476fbf5e55bef738f94
> Cr-Commit-Position: refs/heads/master@{#27585}

TBR=svenpanne@chromium.org,machenbach@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27589}

include/v8.h

index c4536d6..8b2f39d 100644 (file)
@@ -439,7 +439,7 @@ class MaybeLocal {
     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 @@ Local<T> Eternal<T>::Get(Isolate* isolate) {
 
 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_);
 }