diff --git a/src/node_wasi.cc b/src/node_wasi.cc index b77a1f57854261..fbeecb048cf1c3 100644 --- a/src/node_wasi.cc +++ b/src/node_wasi.cc @@ -209,7 +209,6 @@ void WASI::New(const FunctionCallbackInfo& args) { template void WASI::WasiFunction::SetFunction( Environment* env, const char* name, Local tmpl) { - auto c_function = CFunction::Make(FastCallback); Local t = FunctionTemplate::New(env->isolate(), SlowCallback, @@ -217,8 +216,7 @@ void WASI::WasiFunction::SetFunction( Local(), sizeof...(Args), v8::ConstructorBehavior::kThrow, - v8::SideEffectType::kHasSideEffect, - &c_function); + v8::SideEffectType::kHasSideEffect); const v8::NewStringType type = v8::NewStringType::kInternalized; Local name_string = String::NewFromUtf8(env->isolate(), name, type).ToLocalChecked(); @@ -251,7 +249,7 @@ R WASI::WasiFunction::FastCallback( v8::Isolate* isolate = receiver->GetIsolate(); if (wasi->memory_.IsEmpty()) { THROW_ERR_WASI_NOT_STARTED(isolate); - return; + return EinvalError(); } Local ab = wasi->memory_.Get(isolate)->Buffer(); size_t mem_size = ab->ByteLength();