TEST=cctest/test-api/OutOfMemoryNested
Review URL: http://codereview.chromium.org/7029028
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7930
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
Failure* Isolate::ReThrow(MaybeObject* exception, MessageLocation* location) {
bool can_be_caught_externally = false;
- ShouldReportException(&can_be_caught_externally,
- is_catchable_by_javascript(exception));
+ bool catchable_by_javascript = is_catchable_by_javascript(exception);
+ ShouldReportException(&can_be_caught_externally, catchable_by_javascript);
+
thread_local_top()->catcher_ = can_be_caught_externally ?
try_catch_handler() : NULL;
// Set the exception being re-thrown.
set_pending_exception(exception);
+ if (exception->IsFailure()) return exception->ToFailureUnchecked();
return Failure::Exception();
}
// A template-ized version of the IsXXX functions.
template <class C> static inline bool Is(Object* obj);
+class Failure;
class MaybeObject BASE_EMBEDDED {
public:
*obj = reinterpret_cast<Object*>(this);
return true;
}
+ inline Failure* ToFailureUnchecked() {
+ ASSERT(IsFailure());
+ return reinterpret_cast<Failure*>(this);
+ }
inline Object* ToObjectUnchecked() {
ASSERT(!IsFailure());
return reinterpret_cast<Object*>(this);
ASSERT(args.length() == 2);
CONVERT_CHECKED(String, key, args[0]);
Object* value = args[1];
+ ASSERT(!value->IsFailure());
// Create a catch context extension object.
JSFunction* constructor =
isolate->context()->global_context()->