Skip to content

lib: make callback checks more strict

Rodrigo Muino Tomonari requested to merge github/fork/cjihrig/cb-func into master

Many places in lib/ check if a callback argument is truthy before using the callback. This doesn't make any guarantees that the callback is actually a function though. This commit replaces truthy checks with explicit typeof checks.

FWIW, my personal opinion is that we should throw in the cases where the callback is not a function, but people might find that too disruptive.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows [commit guidelines][]
Affected core subsystem(s)

lib

Merge request reports

Loading