Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

napi: rename 'promise' parameter to 'value' #31544

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/api/n-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion src/js_native_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/js_native_api_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2999,13 +2999,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);
}
Expand Down