Chromium Code Reviews| Index: Source/bindings/v8/ExceptionState.h |
| diff --git a/Source/bindings/v8/ExceptionState.h b/Source/bindings/v8/ExceptionState.h |
| index d9c2b05b8efbf964243352d5fbea2f0cb792aa08..bd4ee703b55928c521c7a78c2d775eb4be03f738 100644 |
| --- a/Source/bindings/v8/ExceptionState.h |
| +++ b/Source/bindings/v8/ExceptionState.h |
| @@ -32,6 +32,7 @@ |
| #define ExceptionState_h |
| #include "bindings/v8/ScopedPersistent.h" |
| +#include "bindings/v8/ScriptPromise.h" |
| #include "bindings/v8/V8ThrowException.h" |
| #include "wtf/Noncopyable.h" |
| #include "wtf/text/WTFString.h" |
| @@ -92,6 +93,13 @@ public: |
| return true; |
| } |
| + ScriptPromise reject() |
|
rmacnak
2014/04/16 18:40:42
DBC: Should this be asserted to be unreachable for
|
| + { |
| + if (hadException()) |
| + return ScriptPromise::reject(m_exception.newLocal(m_isolate), m_isolate); |
| + return ScriptPromise::reject(V8ThrowException::createError(v8GeneralError, "Unknown Error", m_isolate), m_isolate); |
| + } |
| + |
| Context context() const { return m_context; } |
| const char* propertyName() const { return m_propertyName; } |
| const char* interfaceName() const { return m_interfaceName; } |