Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 3737da3aff2ac486b205dd0705b32cee3d26e2ec..9e13cba9e87165d88570fc5e521e1c504f3ad541 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -8738,6 +8738,18 @@ void Isolate::SetAllowWasmInstantiateCallback( |
isolate->set_allow_wasm_instantiate_callback(callback); |
} |
+#define CALLBACK_SETTER(ExternalName, Type, InternalName) \ |
+ void Isolate::Set##ExternalName(Type callback) { \ |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); \ |
+ isolate->set_##InternalName(callback); \ |
+ } |
+ |
+CALLBACK_SETTER(WasmModuleCallback, ExtensionCallback, wasm_module_callback) |
+CALLBACK_SETTER(WasmCompileCallback, ExtensionCallback, wasm_compile_callback) |
+CALLBACK_SETTER(WasmInstanceCallback, ExtensionCallback, wasm_instance_callback) |
+CALLBACK_SETTER(WasmInstantiateCallback, ExtensionCallback, |
+ wasm_instantiate_callback) |
+ |
bool Isolate::IsDead() { |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
return isolate->IsDead(); |