diff --git a/doc/api/util.md b/doc/api/util.md index 033224ba0cc16c..26b74b2d6eb9a1 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -552,8 +552,10 @@ If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see [Custom promisified functions][]. `promisify()` assumes that `original` is a function taking a callback as its -final argument in all cases, and the returned function will result in undefined -behavior if it does not. +final argument in all cases. If `original` is not a function, `promisify()` +will throw an error. If `original` is a function but its last argument is not a +node-style callback, it will be still be passed a node-style callback as its last +argument anyways. ### Custom promisified functions @@ -588,6 +590,8 @@ doSomething[util.promisify.custom] = (foo) => { }); }; ``` +If `promisify.custom` is defined but is not a function, `promisify()` will +throw an error. ### util.promisify.custom