Update trampoline by passing the env back to the loader.
typedef void * (*future_resolve_callback)(void *, void *);
typedef void * (*future_reject_callback)(void *, void *);
-typedef napi_value (*future_resolve_trampoline)(void *, future_resolve_callback, napi_value, void *);
-typedef napi_value (*future_reject_trampoline)(void *, future_reject_callback, napi_value, void *);
+typedef napi_value (*future_resolve_trampoline)(void *, napi_env, future_resolve_callback, napi_value, void *);
+typedef napi_value (*future_reject_trampoline)(void *, napi_env, future_reject_callback, napi_value, void *);
typedef struct loader_impl_async_future_await_trampoline_type
{
@@ -213,7 +213,7 @@ napi_value node_loader_trampoline_resolve(napi_env env, napi_callback_info info)
/* Execute the callback */
loader_impl_async_future_await_trampoline trampoline = static_cast<loader_impl_async_future_await_trampoline>(result);
- return trampoline->resolve_trampoline(trampoline->node_loader, trampoline->resolve_callback, args[1], trampoline->context);
+ return trampoline->resolve_trampoline(trampoline->node_loader, env, trampoline->resolve_callback, args[1], trampoline->context);
}
napi_value node_loader_trampoline_reject(napi_env env, napi_callback_info info)
@@ -269,7 +269,7 @@ napi_value node_loader_trampoline_reject(napi_env env, napi_callback_info info)
/* Execute the callback */
loader_impl_async_future_await_trampoline trampoline = static_cast<loader_impl_async_future_await_trampoline>(result);
- return trampoline->reject_trampoline(trampoline->node_loader, trampoline->reject_callback, args[1], trampoline->context);
+ return trampoline->reject_trampoline(trampoline->node_loader, env, trampoline->reject_callback, args[1], trampoline->context);
}
napi_value node_loader_trampoline_initialize(napi_env env, napi_value exports)
