Skip to content

Commit

Permalink
doc: format v8.md in preparation for stricter linting
Browse files Browse the repository at this point in the history
PR-URL: #40647
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
Trott authored and targos committed Nov 6, 2021
1 parent c2fabdb commit ecccf48
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ stopHookSet();
```

### `promiseHooks.onInit(init)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -650,6 +651,7 @@ const stop = promiseHooks.onInit((promise, parent) => {});
```

### `promiseHooks.onSettled(settled)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -674,6 +676,7 @@ const stop = promiseHooks.onSettled((promise) => {});
```

### `promiseHooks.onBefore(before)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -698,6 +701,7 @@ const stop = promiseHooks.onBefore((promise) => {});
```

### `promiseHooks.onAfter(after)`

<!-- YAML
added: REPLACEME
-->
Expand All @@ -722,6 +726,7 @@ const stop = promiseHooks.onAfter((promise) => {});
```

### `promiseHooks.createHook(callbacks)`

<!-- YAML
added: REPLACEME
-->
Expand Down Expand Up @@ -778,7 +783,7 @@ not necessarily ever even be garbage collected.

Because promises are asynchronous resources whose lifecycle is tracked
via the promise hooks mechanism, the `init()`, `before()`, `after()`, and
`settled()` callbacks *must not* be async functions as they create more
`settled()` callbacks _must not_ be async functions as they create more
promises which would produce an infinite loop.

While this API is used to feed promise events into [`async_hooks`][], the
Expand Down

0 comments on commit ecccf48

Please sign in to comment.