diff --git a/doc/api/util.md b/doc/api/util.md index 510b8c92ac9e5f..c284d023498dfc 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -512,8 +512,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.js style callback, it will still be passed a Node.js style callback +as its last argument. ### Custom promisified functions @@ -548,6 +550,8 @@ doSomething[util.promisify.custom] = (foo) => { }); }; ``` +If `promisify.custom` is defined but is not a function, `promisify()` will +throw an error. ### util.promisify.custom