-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(v8.x backport) 12712 - util: add util.callbackify() #13750
Conversation
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` PR-URL: nodejs#12712 Fixes: nodejs/CTC#109 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by nodejs#12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. PR-URL: nodejs#13604 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
This commit adds coverage for util.callbackify() type checking. PR-URL: nodejs#13705
I’ll still wait for it to land then |
Landed, so this is ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but there was no need for a backport of #13705 so I’ll not land that and instead cherry-pick it as usual
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
cool. |
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
Add `util.callbackify(function)` for creating callback style functions from functions returning a `Thenable` Original-PR-URL: #12712 Fixes: nodejs/CTC#109 Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> Original-Reviewed-By: Teddy Katz <[email protected]> Original-Reviewed-By: Matteo Collina <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
The `FALSY_VALUE_REJECTION` error code added by #12712 did not have the `ERR_` prefix, nor was it added to the errors.md documentation. Add the prefix in for consistency. Original-PR-URL: #13604 Original-Reviewed-By: Luigi Pinca <[email protected]> Original-Reviewed-By: Timothy Gu <[email protected]> Original-Reviewed-By: Gibson Fahnestock <[email protected]> Original-Reviewed-By: Anna Henningsen <[email protected]> Original-Reviewed-By: Refael Ackermann <[email protected]> Original-Reviewed-By: Colin Ihrig <[email protected]> Original-Reviewed-By: Benjamin Gruenbaum <[email protected]> PR-URL: #13750 Reviewed-By: Anna Henningsen <[email protected]>
Should this be backported to |
My intuition is if we don't backport |
I'm not sure, this is an API change that is mostly reactive to a feature 6.x doesn't have (async/await). I'm fine with backporting it it's just not really required IMO. |
Refs: #12712
Refs: #13604
Refs: #13705
(#13705 hasn't landed onmaster
but it's ready)Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
util