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() |
| + { |
| + if (hadException()) |
| + return ScriptPromise::reject(m_exception.newLocal(m_isolate), m_isolate); |
| + return ScriptPromise::reject(V8ThrowException::createError(v8GeneralError, "Unknown Error", m_isolate), m_isolate); |
|
haraken
2014/04/11 13:57:13
Is this behavior speced? Which should we use, v8Ge
yhirano
2014/04/14 01:03:37
Domenic says[1] DOMException is more preferable th
|
| + } |
| + |
| Context context() const { return m_context; } |
| const char* propertyName() const { return m_propertyName; } |
| const char* interfaceName() const { return m_interfaceName; } |