Skip to content

Commit

Permalink
Add Env() to Promise::Deferred.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolftimmermans authored and mhdawson committed Sep 6, 2018
1 parent 0097e96 commit a6f7a6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,10 @@ inline Promise Promise::Deferred::Promise() const {
return Napi::Promise(_env, _promise);
}

inline Napi::Env Promise::Deferred::Env() const {
return Napi::Env(_env);
}

inline void Promise::Deferred::Resolve(napi_value value) const {
napi_status status = napi_resolve_deferred(_env, _deferred, value);
NAPI_THROW_IF_FAILED(_env, status);
Expand Down
1 change: 1 addition & 0 deletions napi.h
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,7 @@ namespace Napi {
Deferred(napi_env env);

Napi::Promise Promise() const;
Napi::Env Env() const;

void Resolve(napi_value value) const;
void Reject(napi_value value) const;
Expand Down

0 comments on commit a6f7a6a

Please sign in to comment.