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