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

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

Issue 2350643003: [wasm] Set up Table and Memory constructors (Closed)
Patch Set: Address comments Created 4 years, 3 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
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-result.h
diff --git a/src/wasm/wasm-result.h b/src/wasm/wasm-result.h
index f16c15906dfa896941afa798f26d517984b32a74..efe269a86828ee6b2b498c7ef8e2ed2b582f970a 100644
--- a/src/wasm/wasm-result.h
+++ b/src/wasm/wasm-result.h
@@ -99,31 +99,35 @@ std::ostream& operator<<(std::ostream& os, const ErrorCode& error_code);
// A helper for generating error messages that bubble up to JS exceptions.
class ErrorThrower {
public:
- ErrorThrower(Isolate* isolate, const char* context)
+ ErrorThrower(i::Isolate* isolate, const char* context)
: 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() {
+ i::Handle<i::Object> result = exception_;
+ 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
« no previous file with comments | « 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