From d1c6e67d17493844ffe13b8326e532e9e7eb28fc Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 3 Feb 2020 18:30:29 -0500 Subject: [PATCH] throw if you try to mkAsync a non-function --- www/common/common-util.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/common/common-util.js b/www/common/common-util.js index da83b5960..5f6841983 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -34,6 +34,9 @@ }; Util.mkAsync = function (f) { + if (typeof(f) !== 'function') { + throw new Error('EXPECTED_FUNCTION'); + } return function () { var args = Array.prototype.slice.call(arguments); setTimeout(function () {