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

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

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: Fix debug tests Created 4 years 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/module-decoder.cc ('k') | src/wasm/wasm-module-builder.cc » ('j') | no next file with comments »
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 0d7d7e08502a82c2bacc9ed529a6f340a0f62366..1141585e5ca20e08ea1b0e6cf7bc75fab7895f2d 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1409,21 +1409,16 @@ class WasmInstanceBuilder {
Handle<Object> module = result.ToHandleChecked();
- // TODO(bradnelson): Making this conditional on non-empty names violates the
- // Wasm spec, but seems to be a hack intended for the asm-to-wasm pipeline.
- // We need to get rid of it.
- if (import_name->length() != 0) {
- // Look up the value in the module.
- if (!module->IsJSReceiver()) {
- return ReportTypeError("module is not an object or function", index,
- module_name);
- }
+ // Look up the value in the module.
+ if (!module->IsJSReceiver()) {
+ return ReportTypeError("module is not an object or function", index,
+ module_name);
+ }
- result = Object::GetPropertyOrElement(module, import_name);
- if (result.is_null()) {
- ReportLinkError("import not found", index, module_name, import_name);
- return MaybeHandle<JSFunction>();
- }
+ result = Object::GetPropertyOrElement(module, import_name);
+ if (result.is_null()) {
+ ReportLinkError("import not found", index, module_name, import_name);
+ return MaybeHandle<JSFunction>();
}
return result;
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698