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

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

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: 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
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 5035e91fbc91a49f8c6e71c7b37a212dfe7fcf72..1fa545bb7a2d65ea9fde9d32507015349d3d113b 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;

Powered by Google App Engine
This is Rietveld 408576698