| 1843 | }; |
| 1844 | |
| 1845 | class FunctionReference : public Reference<Function> { |
| 1846 | public: |
| 1847 | FunctionReference(); |
| 1848 | FunctionReference(napi_env env, napi_ref ref); |
| 1849 | |
| 1850 | // A reference can be moved but cannot be copied. |
| 1851 | FunctionReference(Reference<Function>&& other); |
| 1852 | FunctionReference& operator=(Reference<Function>&& other); |
| 1853 | FunctionReference(FunctionReference&& other); |
| 1854 | FunctionReference& operator=(FunctionReference&& other); |
| 1855 | NAPI_DISALLOW_ASSIGN_COPY(FunctionReference) |
| 1856 | |
| 1857 | MaybeOrValue<Napi::Value> operator()( |
| 1858 | const std::initializer_list<napi_value>& args) const; |
| 1859 | |
| 1860 | MaybeOrValue<Napi::Value> Call( |
| 1861 | const std::initializer_list<napi_value>& args) const; |
| 1862 | MaybeOrValue<Napi::Value> Call(const std::vector<napi_value>& args) const; |
| 1863 | MaybeOrValue<Napi::Value> Call( |
| 1864 | napi_value recv, const std::initializer_list<napi_value>& args) const; |
| 1865 | MaybeOrValue<Napi::Value> Call(napi_value recv, |
| 1866 | const std::vector<napi_value>& args) const; |
| 1867 | MaybeOrValue<Napi::Value> Call(napi_value recv, |
| 1868 | size_t argc, |
| 1869 | const napi_value* args) const; |
| 1870 | |
| 1871 | MaybeOrValue<Napi::Value> MakeCallback( |
| 1872 | napi_value recv, |
| 1873 | const std::initializer_list<napi_value>& args, |
| 1874 | napi_async_context context = nullptr) const; |
| 1875 | MaybeOrValue<Napi::Value> MakeCallback( |
| 1876 | napi_value recv, |
| 1877 | const std::vector<napi_value>& args, |
| 1878 | napi_async_context context = nullptr) const; |
| 1879 | MaybeOrValue<Napi::Value> MakeCallback( |
| 1880 | napi_value recv, |
| 1881 | size_t argc, |
| 1882 | const napi_value* args, |
| 1883 | napi_async_context context = nullptr) const; |
| 1884 | |
| 1885 | MaybeOrValue<Object> New(const std::initializer_list<napi_value>& args) const; |
| 1886 | MaybeOrValue<Object> New(const std::vector<napi_value>& args) const; |
| 1887 | }; |
| 1888 | |
| 1889 | // Shortcuts to creating a new reference with inferred type and refcount = 0. |
| 1890 | template <typename T> |
nothing calls this directly
no outgoing calls
no test coverage detected