| Index: src/wasm/wasm-result.h
|
| diff --git a/src/wasm/wasm-result.h b/src/wasm/wasm-result.h
|
| index 9aa061de862b2f1f60a4507a38c0c127a51bc52b..e741de8e5e187e8a4fef4053f910128f61235e73 100644
|
| --- a/src/wasm/wasm-result.h
|
| +++ b/src/wasm/wasm-result.h
|
| @@ -8,6 +8,7 @@
|
| #include "src/base/compiler-specific.h"
|
| #include "src/base/smart-pointers.h"
|
|
|
| +#include "src/handles.h"
|
| #include "src/globals.h"
|
|
|
| namespace v8 {
|
| @@ -91,7 +92,8 @@ std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code);
|
| class ErrorThrower {
|
| public:
|
| ErrorThrower(Isolate* isolate, const char* context)
|
| - : isolate_(isolate), context_(context), error_(false) {}
|
| + : isolate_(isolate), context_(context) {}
|
| + ~ErrorThrower();
|
|
|
| PRINTF_FORMAT(2, 3) void Error(const char* fmt, ...);
|
|
|
| @@ -102,12 +104,18 @@ class ErrorThrower {
|
| return Error("%s", str.str().c_str());
|
| }
|
|
|
| - bool error() const { return error_; }
|
| + i::Handle<i::String> Reify() {
|
| + auto result = message_;
|
| + message_ = i::Handle<i::String>();
|
| + return result;
|
| + }
|
| +
|
| + bool error() const { return !message_.is_null(); }
|
|
|
| private:
|
| Isolate* isolate_;
|
| const char* context_;
|
| - bool error_;
|
| + i::Handle<i::String> message_;
|
| };
|
| } // namespace wasm
|
| } // namespace internal
|
|
|