forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add C++20 std::span-based APIs for function arguments
Summary: Changelog: [General][Changed] - Add `std::span` methods to `jsi::Function` when compiled as C++20 Adds `std::span<const jsi::Value>` overloads to public JSI methods that currently accept (or are designed to emit) `const jsi::Value* args, size_t count` for a dynamically-sized span of function arguments. These are: * `Function::call` * `Function::callWithThis` * `Function::callAsConstructor` * `Function::createFromHostFunction` We also add a `HostFunctionTypeWithSpanArgs` typedef (naming feedback welcome!) to serve a similar purpose to the existing `HostFunctionType`. ## Backwards compatibility * The new APIs are compiled conditionally to support pre-C++20 compilers. * No overloads are removed. * The new overloads are implemented as `inline` wrappers over the pointer+size versions. No change is made to the JSI contract for implementers (i.e. no new overloads, virtual or otherwise, are added to `Runtime`). Differential Revision: D54901847
- Loading branch information
1 parent
0d7a92b
commit 7cbce63
Showing
2 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters