throw if you try to mkAsync a non-function

This commit is contained in:
ansuz 2020-02-03 18:30:29 -05:00
parent 65ba85d97b
commit d1c6e67d17
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@
}; };
Util.mkAsync = function (f) { Util.mkAsync = function (f) {
if (typeof(f) !== 'function') {
throw new Error('EXPECTED_FUNCTION');
}
return function () { return function () {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
setTimeout(function () { setTimeout(function () {