Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: src/api.cc

Issue 8828: Work around issue 131 by checking for empty handles (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/top.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698