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

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

Issue 2629523007: [wasm] JS-API: enable WebAssembly.instantiate tests; fix LinkError (Closed)
Patch Set: fix errors.js Created 3 years, 11 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 | « no previous file | test/mjsunit/wasm/errors.js » ('j') | test/mjsunit/wasm/errors.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 6f44991cf979be0404a21542e43ce0bc3e633c7e..87019128366446f0b75e138c363dff7949f73f12 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1475,9 +1475,9 @@ class WasmInstanceBuilder {
import_name->length(), import_name->ToCString().get(), error);
}
- MaybeHandle<Object> ReportTypeError(const char* error, uint32_t index,
+ MaybeHandle<Object> ReportLinkError(const char* error, uint32_t index,
Handle<String> module_name) {
- thrower_->TypeError("Import #%d module=\"%.*s\" error: %s", index,
+ thrower_->LinkError("Import #%d module=\"%.*s\" error: %s", index,
module_name->length(), module_name->ToCString().get(),
error);
return MaybeHandle<Object>();
@@ -1487,21 +1487,21 @@ class WasmInstanceBuilder {
MaybeHandle<Object> LookupImport(uint32_t index, Handle<String> module_name,
Handle<String> import_name) {
if (ffi_.is_null()) {
- return ReportTypeError("FFI is not an object", index, module_name);
+ return ReportLinkError("FFI is not an object", index, module_name);
rossberg 2017/01/12 23:59:53 This one is not a linking error but a JS-level API
Mircea Trofin 2017/01/13 03:57:47 Oh, true. I'll actually move that out and DCHECK
}
// Look up the module first.
MaybeHandle<Object> result =
Object::GetPropertyOrElement(ffi_, module_name);
if (result.is_null()) {
- return ReportTypeError("module not found", index, module_name);
+ return ReportLinkError("module not found", index, module_name);
}
Handle<Object> module = result.ToHandleChecked();
// Look up the value in the module.
if (!module->IsJSReceiver()) {
- return ReportTypeError("module is not an object or function", index,
+ return ReportLinkError("module is not an object or function", index,
module_name);
}
« no previous file with comments | « no previous file | test/mjsunit/wasm/errors.js » ('j') | test/mjsunit/wasm/errors.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698