| Index: src/wasm/wasm-module.cc
|
| diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
|
| index fdec11b33fb572aac5fbc42a3145cef376484fd3..430a99228c87815888bedb00292a4006eb277270 100644
|
| --- a/src/wasm/wasm-module.cc
|
| +++ b/src/wasm/wasm-module.cc
|
| @@ -455,7 +455,7 @@ static MaybeHandle<JSFunction> ReportFFIError(
|
| return MaybeHandle<JSFunction>();
|
| }
|
|
|
| -static MaybeHandle<JSFunction> LookupFunction(
|
| +static MaybeHandle<JSReceiver> LookupFunction(
|
| ErrorThrower& thrower, Factory* factory, Handle<JSReceiver> ffi,
|
| uint32_t index, Handle<String> module_name,
|
| MaybeHandle<String> function_name) {
|
| @@ -493,12 +493,12 @@ static MaybeHandle<JSFunction> LookupFunction(
|
| function = module;
|
| }
|
|
|
| - if (!function->IsJSFunction()) {
|
| - return ReportFFIError(thrower, "not a function", index, module_name,
|
| + if (!function->IsCallable()) {
|
| + return ReportFFIError(thrower, "not a callable", index, module_name,
|
| function_name);
|
| }
|
|
|
| - return Handle<JSFunction>::cast(function);
|
| + return Handle<JSReceiver>::cast(function);
|
| }
|
|
|
| namespace {
|
| @@ -645,7 +645,7 @@ bool CompileWrappersToImportedFunctions(Isolate* isolate,
|
| int param_count = sig_data_size - ret_count;
|
| CHECK(param_count >= 0);
|
|
|
| - MaybeHandle<JSFunction> function = LookupFunction(
|
| + MaybeHandle<JSReceiver> function = LookupFunction(
|
| *thrower, isolate->factory(), ffi, index, module_name, function_name);
|
| if (function.is_null()) return false;
|
|
|
|
|