Index: Source/bindings/v8/ExceptionState.h |
diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h |
index 576d370ee2553c3176ddb9e58bb33964d484633f..a58784fdfc13aa864f1fd9bc26e503f7eb3e2fce 100644 |
--- a/Source/bindings/v8/ExceptionState.h |
+++ b/Source/bindings/v8/ExceptionState.h |
@@ -44,11 +44,39 @@ typedef int ExceptionCode; |
class ExceptionState { |
WTF_MAKE_NONCOPYABLE(ExceptionState); |
public: |
+ enum Context { |
+ ConstructionContext, |
+ ExecutionContext, |
+ DeletionContext, |
+ GetterContext, |
+ SetterContext, |
+ UnknownContext, // FIXME: Remove this once we've flipped over to the new API. |
+ }; |
+ |
explicit ExceptionState(const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
: m_code(0) |
+ , m_context(UnknownContext) |
+ , m_propertyName(0) |
+ , m_interfaceName(0) |
+ , m_creationContext(creationContext) |
+ , m_isolate(isolate) { } |
+ |
+ ExceptionState(Context context, const char* propertyName, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
+ : m_code(0) |
+ , m_context(context) |
+ , m_propertyName(propertyName) |
+ , m_interfaceName(interfaceName) |
, m_creationContext(creationContext) |
, m_isolate(isolate) { } |
+ ExceptionState(Context context, const char* interfaceName, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) |
+ : m_code(0) |
+ , m_context(context) |
+ , m_propertyName(0) |
+ , m_interfaceName(interfaceName) |
+ , m_creationContext(creationContext) |
+ , m_isolate(isolate) { ASSERT(m_context == ConstructionContext); } |
+ |
virtual void throwDOMException(const ExceptionCode&, const String& message); |
virtual void throwTypeError(const String& message); |
virtual void throwSecurityError(const String& sanitizedMessage, const String& unsanitizedMessage = String()); |
@@ -74,8 +102,15 @@ public: |
return true; |
} |
+ Context context() { return m_context; } |
+ const char* propertyName() { return m_propertyName; } |
+ const char* interfaceName() { return m_interfaceName; } |
+ |
protected: |
ExceptionCode m_code; |
+ Context m_context; |
+ const char* m_propertyName; |
+ const char* m_interfaceName; |
private: |
void setException(v8::Handle<v8::Value>); |