Currently passing an object or function as parameter causes an unhandled exception, without calling error callbacks or rejecting promise. The reason is that, on such inputs, an undefined function plugin.error()/plugin.warn() is called.
Reading the code, it was expected to accept anything other than functions, but this PR reject objects as well, because it is more consistent with the current behaviour, and I think such inputs should be regarded as invalid anyway.
PS: my editor automatically removes extra spaces from some irrelevant lines. Sorry about that.
Currently passing an object or function as parameter causes an unhandled exception, without calling error callbacks or rejecting promise. The reason is that, on such inputs, an undefined function
plugin.error()
/plugin.warn()
is called. Reading the code, it was expected to accept anything other than functions, but this PR reject objects as well, because it is more consistent with the current behaviour, and I think such inputs should be regarded as invalid anyway.PS: my editor automatically removes extra spaces from some irrelevant lines. Sorry about that.