Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
Ceres6 and joyeecheung authored Sep 24, 2024
commit a5a555c134094a414349fe4ad7bfbfcdb383fe62
6 changes: 5 additions & 1 deletion doc/contributing/adding-v8-fast-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ for example, they may not trigger garbage collection.
conditions are checked, because otherwise executing the slow callback might
produce visible side effects twice.
* If the receiver is used in the callback it must be passed as a second argument
leaving the first one unused.
leaving the first one unused, to prevent the JS land from accidentally omitting the receiver when
invoking the fast API method.

```cpp
// Instead of invoking the method as `receiver.internalModuleStat(input)`, the JS land should
// invoke it as `internalModuleStat(binding, input)` to make sure the binding is available to
// the native land.
static int32_t FastInternalModuleStat(
Comment thread
Ceres6 marked this conversation as resolved.
Local<Object> unused,
Local<Object> recv,
Expand Down