Skip to content

Commit 8d1a474

Browse files
vsemozhetbytMylesBorins
authored andcommitted
doc: fix confusing example in process.md
PR-URL: #12282 Fixes: #12280 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 88f402c commit 8d1a474

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/api/process.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1257,9 +1257,12 @@ function maybeSync(arg, cb) {
12571257
This API is hazardous because in the following case:
12581258

12591259
```js
1260-
maybeSync(true, () => {
1260+
const maybeTrue = Math.random() > 0.5;
1261+
1262+
maybeSync(maybeTrue, () => {
12611263
foo();
12621264
});
1265+
12631266
bar();
12641267
```
12651268

0 commit comments

Comments
 (0)