throw if you try to mkAsync a non-function

pull/1/head
ansuz 5 years ago
parent 65ba85d97b
commit d1c6e67d17

@ -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 () {

Loading…
Cancel
Save