Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: src/wasm/wasm-result.h

Issue 2084573002: Upgrade Wasm JS API, step 1 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Separate test refactorings Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« src/wasm/wasm-js.cc ('K') | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698