LGTM

On Tue, Oct 28, 2008 at 9:26 AM,  <[EMAIL PROTECTED]> wrote:
> Reviewers: Mads Ager,
>
> Description:
> Work around issue 131 by checking for empty handles
> in a few places.
>
> Please review this at http://codereview.chromium.org/8828
>
> SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
>
> Affected files:
>  M     src/api.cc
>  M     src/top.cc
>
>
> Index: src/api.cc
> ===================================================================
> --- src/api.cc  (revision 615)
> +++ src/api.cc  (working copy)
> @@ -230,7 +230,13 @@
>
>  v8::Handle<Value> ThrowException(v8::Handle<v8::Value> value) {
>   if (IsDeadCheck("v8::ThrowException()")) return v8::Handle<Value>();
> -  i::Top::ScheduleThrow(*Utils::OpenHandle(*value));
> +  // If we're passed an empty handle, we throw an undefined exception
> +  // to deal more gracefully with out of memory situations.
> +  if (value.IsEmpty()) {
> +    i::Top::ScheduleThrow(i::Heap::undefined_value());
> +  } else {
> +    i::Top::ScheduleThrow(*Utils::OpenHandle(*value));
> +  }
>   return v8::Undefined();
>  }
>
> Index: src/top.cc
> ===================================================================
> --- src/top.cc  (revision 615)
> +++ src/top.cc  (working copy)
> @@ -806,7 +806,7 @@
>   if (report_exception) {
>     if (message != NULL) {
>       MessageHandler::ReportMessage(message);
> -    } else {
> +    } else if (!message_obj.is_null()) {
>       MessageHandler::ReportMessage(location, message_obj);
>     }
>   }
>
>
>

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to