Chromium Code Reviews| Index: src/wasm/wasm-result.h |
| diff --git a/src/wasm/wasm-result.h b/src/wasm/wasm-result.h |
| index f16c15906dfa896941afa798f26d517984b32a74..92a66779d4eefb4b24be33cf315d25523df88977 100644 |
| --- a/src/wasm/wasm-result.h |
| +++ b/src/wasm/wasm-result.h |
| @@ -100,30 +100,34 @@ std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code); |
| class ErrorThrower { |
| public: |
| ErrorThrower(Isolate* isolate, const char* context) |
|
ahaas
2016/09/15 14:41:06
Why does the constructor not use i::Isolate* isola
ahaas
2016/09/19 14:02:37
I changed it to i::Isolate*
|
| - : isolate_(isolate), context_(context) {} |
| + : isolate_(reinterpret_cast<i::Isolate*>(isolate)), context_(context) {} |
| ~ErrorThrower(); |
| PRINTF_FORMAT(2, 3) void Error(const char* fmt, ...); |
| + PRINTF_FORMAT(2, 3) void TypeError(const char* fmt, ...); |
| + PRINTF_FORMAT(2, 3) void RangeError(const char* fmt, ...); |
| template <typename T> |
| void Failed(const char* error, Result<T>& result) { |
| std::ostringstream str; |
| str << error << result; |
| - return Error("%s", str.str().c_str()); |
| + Error("%s", str.str().c_str()); |
| } |
| - i::Handle<i::String> Reify() { |
| - auto result = message_; |
| - message_ = i::Handle<i::String>(); |
| + i::Handle<i::Object> Reify() { |
| + auto result = exception_; |
|
ahaas
2016/09/15 14:41:06
Could you not use auto here please?
ahaas
2016/09/19 14:02:37
Done.
ahaas
2016/09/19 14:02:37
Done.
|
| + exception_ = i::Handle<i::Object>::null(); |
| return result; |
| } |
| - bool error() const { return !message_.is_null(); } |
| + bool error() const { return !exception_.is_null(); } |
| private: |
| - Isolate* isolate_; |
| + void Format(i::Handle<i::JSFunction> constructor, const char* fmt, va_list); |
| + |
| + i::Isolate* isolate_; |
| const char* context_; |
| - i::Handle<i::String> message_; |
| + i::Handle<i::Object> exception_; |
| }; |
| } // namespace wasm |
| } // namespace internal |