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

Unified Diff: src/wasm/wasm-js.cc

Issue 2135973002: Adding V8_WARN_UNUSED_RESULT for specified TODOs (Closed) Base URL: git@github.com:danbev/v8.git@master
Patch Set: Using CHECK for Maybe<bool> results Created 3 years, 9 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 | « include/v8.h ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 743a0e19da67aaae9ddb3801abbdcba2f12a6b75..0a81a528895a5118947ea2d0fb5c53a3c4379027 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -189,7 +189,8 @@ void WebAssemblyCompile(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto bytes = GetFirstArgumentAsBytes(args, &thrower);
if (!IsCompilationAllowed(i_isolate, &thrower, args[0], true)) {
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
DCHECK(!thrower.error());
@@ -337,7 +338,8 @@ void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) {
thrower.TypeError(
"Argument 0 must be provided and must be either a buffer source or a "
"WebAssembly.Module object");
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
@@ -345,18 +347,21 @@ void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) {
if (!first_arg->IsJSObject()) {
thrower.TypeError(
"Argument 0 must be a buffer source or a WebAssembly.Module object");
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
auto maybe_imports = GetSecondArgumentAsImports(args, &thrower);
if (thrower.error()) {
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
if (!IsInstantiationAllowed(i_isolate, &thrower, args[0], maybe_imports,
true)) {
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
i::Handle<i::JSPromise> promise = Utils::OpenHandle(*resolver->GetPromise());
@@ -369,7 +374,8 @@ void WebAssemblyInstantiate(const v8::FunctionCallbackInfo<v8::Value>& args) {
// WebAssembly.instantiate(bytes, imports) -> {module, instance}
auto bytes = GetFirstArgumentAsBytes(args, &thrower);
if (thrower.error()) {
- resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ auto maybe = resolver->Reject(context, Utils::ToLocal(thrower.Reify()));
+ CHECK(!maybe.IsNothing());
return;
}
i::wasm::AsyncCompileAndInstantiate(i_isolate, promise, bytes,
« no previous file with comments | « include/v8.h ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698