@@ -209,16 +209,14 @@ void WASI::New(const FunctionCallbackInfo<Value>& args) {
209
209
template <typename FT, FT F, typename R, typename ... Args>
210
210
void WASI::WasiFunction<FT, F, R, Args...>::SetFunction(
211
211
Environment* env, const char * name, Local<FunctionTemplate> tmpl) {
212
- auto c_function = CFunction::Make (FastCallback);
213
212
Local<FunctionTemplate> t =
214
213
FunctionTemplate::New (env->isolate (),
215
214
SlowCallback,
216
215
Local<Value>(),
217
216
Local<Signature>(),
218
217
sizeof ...(Args),
219
218
v8::ConstructorBehavior::kThrow ,
220
- v8::SideEffectType::kHasSideEffect ,
221
- &c_function);
219
+ v8::SideEffectType::kHasSideEffect );
222
220
const v8::NewStringType type = v8::NewStringType::kInternalized ;
223
221
Local<String> name_string =
224
222
String::NewFromUtf8 (env->isolate (), name, type).ToLocalChecked ();
@@ -251,7 +249,7 @@ R WASI::WasiFunction<FT, F, R, Args...>::FastCallback(
251
249
v8::Isolate* isolate = receiver->GetIsolate ();
252
250
if (wasi->memory_ .IsEmpty ()) {
253
251
THROW_ERR_WASI_NOT_STARTED (isolate);
254
- return ;
252
+ return EinvalError<R>() ;
255
253
}
256
254
Local<ArrayBuffer> ab = wasi->memory_ .Get (isolate)->Buffer ();
257
255
size_t mem_size = ab->ByteLength ();
0 commit comments