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
This commit is contained in:
parent
8813d15d18
commit
e79ebd5ceb
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user