Index: webkit/port/bridge/ExceptionContextV8.cpp |
=================================================================== |
--- webkit/port/bridge/ExceptionContextV8.cpp (revision 4425) |
+++ webkit/port/bridge/ExceptionContextV8.cpp (working copy) |
@@ -34,75 +34,15 @@ |
namespace WebCore { |
-// Unlike JSC, which stores exceptions in ExecState that is accessible from |
-// ScriptController that is retrievable from Node*, V8 uses static chain of |
-// handlers (encapsulated as v8::TryCatch and here as ExceptionCatcher) |
-// to track exceptions, so it has no need for Node*. |
-ExceptionContext::ExceptionContext(Node* node) |
+ExceptionContext::ExceptionContext(Node*) |
+ : m_data() |
{ |
} |
-ExceptionContext::ExceptionContext() |
- : m_exception() |
- , m_exceptionCatcher(0) |
-{ |
-} |
- |
-void ExceptionContext::setExceptionCatcher(ExceptionCatcher* exceptionCatcher) |
-{ |
- if (m_exceptionCatcher && exceptionCatcher) |
- m_exceptionCatcher->detachContext(); |
- |
- m_exceptionCatcher = exceptionCatcher; |
-} |
- |
bool ExceptionContext::hadException() |
{ |
- if (m_exceptionCatcher) |
- m_exceptionCatcher->updateContext(); |
- |
- return !m_exception.IsEmpty(); |
+ return !m_data.IsEmpty(); |
} |
-JSException ExceptionContext::exception() const |
-{ |
- return m_exception; |
-} |
-JSException ExceptionContext::noException() |
-{ |
- return v8::Local<v8::Value>(); |
-} |
- |
-ExceptionCatcher::ExceptionCatcher(ExceptionContext* exceptionContext) |
- : m_context(exceptionContext) |
- , m_catcher() |
-{ |
- exceptionContext->setExceptionCatcher(this); |
-} |
- |
-void ExceptionCatcher::detachContext() |
-{ |
- m_context = 0; |
-} |
- |
-void ExceptionCatcher::updateContext() |
-{ |
- ASSERT(m_context); |
- |
- if (m_catcher.HasCaught()) |
- m_context->setException(m_catcher.Exception()); |
- else |
- m_context->setException(ExceptionContext::noException()); |
-} |
- |
-ExceptionCatcher::~ExceptionCatcher() |
-{ |
- if (!m_context) |
- return; |
- |
- updateContext(); |
- m_context->setExceptionCatcher(0); |
-} |
- |
} // namespace WebCore |