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

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

Issue 2342623002: [wasm] Set up Table and Memory constructors
Patch Set: Eps 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
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
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-result.cc » ('j') | test/mjsunit/wasm/memory.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698