diff --git a/doc/api/n-api.md b/doc/api/n-api.md index cacf3bba54d926..43e970cd080039 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -4994,12 +4994,12 @@ napiVersion: 1 ```C napi_status napi_is_promise(napi_env env, - napi_value promise, + napi_value value, bool* is_promise); ``` * `[in] env`: The environment that the API is invoked under. -* `[in] promise`: The promise to examine +* `[in] value`: The value to examine * `[out] is_promise`: Flag indicating whether `promise` is a native promise object (that is, a promise object created by the underlying engine). diff --git a/src/js_native_api.h b/src/js_native_api.h index f749232e07c749..cb69fde5d1990e 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -440,7 +440,7 @@ NAPI_EXTERN napi_status napi_reject_deferred(napi_env env, napi_deferred deferred, napi_value rejection); NAPI_EXTERN napi_status napi_is_promise(napi_env env, - napi_value promise, + napi_value value, bool* is_promise); // Running a script diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index e5b0971ea3dc84..b918fff080e672 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -2989,13 +2989,13 @@ napi_status napi_reject_deferred(napi_env env, } napi_status napi_is_promise(napi_env env, - napi_value promise, + napi_value value, bool* is_promise) { CHECK_ENV(env); - CHECK_ARG(env, promise); + CHECK_ARG(env, value); CHECK_ARG(env, is_promise); - *is_promise = v8impl::V8LocalValueFromJsValue(promise)->IsPromise(); + *is_promise = v8impl::V8LocalValueFromJsValue(value)->IsPromise(); return napi_clear_last_error(env); }