napi_is_promise


napi_status napi_is_promise(napi_env env,
                            napi_value value,
                            bool* is_promise); 
  • [in] env:调用 API 的环境。

    ¥[in] env: The environment that the API is invoked under.

  • [in] value:要检查的值

    ¥[in] value: The value to examine

  • [out] is_promise:表示 promise 是否为原生 promise 对象(即底层引擎创建的 promise 对象)的标志。

    ¥[out] is_promise: Flag indicating whether promise is a native promise object (that is, a promise object created by the underlying engine).