Commit e79ebd5c authored by kasperl@chromium.org's avatar kasperl@chromium.org

Work around issue 131 by checking for empty handles

in a few places.
Review URL: http://codereview.chromium.org/8828

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@616 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8813d15d
......@@ -230,7 +230,13 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
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();
}
......
......@@ -806,7 +806,7 @@ void Top::DoThrow(Object* exception,
if (report_exception) {
if (message != NULL) {
MessageHandler::ReportMessage(message);
} else {
} else if (!message_obj.is_null()) {
MessageHandler::ReportMessage(location, message_obj);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment