mirror of https://github.com/xwiki-labs/cryptpad
throw if you try to mkAsync a non-function
This commit is contained in:
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…
Reference in New Issue