-
Notifications
You must be signed in to change notification settings - Fork 30k
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 <benjamingr@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <benjamingr@gmail.com> Original-Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Original-Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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 <luigipinca@gmail.com> Original-Reviewed-By: Timothy Gu <timothygu99@gmail.com> Original-Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Original-Reviewed-By: Anna Henningsen <anna@addaleax.net> Original-Reviewed-By: Refael Ackermann <refack@gmail.com> Original-Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Original-Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> PR-URL: #13750 Reviewed-By: Anna Henningsen <anna@addaleax.net>
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