From 14ebef70cb35edba58576901fce343fbe9f1514b Mon Sep 17 00:00:00 2001 From: Marco Date: Sun, 18 May 2014 21:58:53 +0200 Subject: [PATCH] fixed 'TypeError: Promise.resolve is not a constructor' in Firefox --- js/crypto.js | 4 ++-- js/webcrypto.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/crypto.js b/js/crypto.js index 4f79aa1cb7..f253036be4 100644 --- a/js/crypto.js +++ b/js/crypto.js @@ -87,9 +87,9 @@ window.textsecure.crypto = new function() { priv[0] |= 0x0001; //TODO: fscking type conversion - return new Promise.resolve({ pubKey: prependVersion(toArrayBuffer(curve25519(priv))), privKey: privKey}); + return Promise.resolve({ pubKey: prependVersion(toArrayBuffer(curve25519(priv))), privKey: privKey}); } - + } var privToPub = function(privKey, isIdentity) { return testing_only.privToPub(privKey, isIdentity); } diff --git a/js/webcrypto.js b/js/webcrypto.js index be9d240381..1394ea7dce 100644 --- a/js/webcrypto.js +++ b/js/webcrypto.js @@ -73,7 +73,7 @@ window.crypto.subtle = (function() { function promise(implementation) { var args = Array.prototype.slice.call(arguments); args.shift(); - return new Promise.resolve(toArrayBuffer(implementation.apply(this, args))); + return Promise.resolve(toArrayBuffer(implementation.apply(this, args))); } // public interface functions