Chromium Code Reviews| 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); |
| } |