From dc4497c5cae6f84423bb0f248d28bf0b1f2f0381 Mon Sep 17 00:00:00 2001 From: Piotr Pilz Date: Fri, 15 Sep 2017 00:43:19 +0200 Subject: [PATCH] Modfied validationResult checking Previous if statement returned false on Safari --- atom.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/atom.js b/atom.js index be6024a..b908851 100644 --- a/atom.js +++ b/atom.js @@ -161,7 +161,9 @@ var validationResult = validation[validationKey](value, keyOrMap); if (typeof validationResult === 'boolean') { return !validationResult; - } else if (validationResult instanceof Promise) { + // better check if validationResult is a Promise; instanceof Promise was false on Safari + } else if (typeof validationResult.then === 'function' + && typeof validationResult.catch === 'function') { promises[validationKey] = new Promise(function(resolve, reject) { validationResult .then(resolve, function() {