Drop assign default value for parameters

This commit is contained in:
Hossam Hassan 2017-02-01 01:36:20 +02:00
parent 46dbdd7136
commit aa7bf1c019

View File

@ -464,11 +464,14 @@ module.exports = {
Instabug.isInstabugNotification(dict, isInstabugNotificationCallback); Instabug.isInstabugNotification(dict, isInstabugNotificationCallback);
}, },
reportJsException: function (error, errorIdentifier = undefined) { reportJsException: function (error, errorIdentifier) {
if (!error || !error instanceof Error)
throw new Error("You should pass an error object");
let jsStackTrace = instabugParser(error); let jsStackTrace = instabugParser(error);
if (errorIdentifier instanceof undefined && error instanceof Error) if (!errorIdentifier)
Instabug.reportJsException(jsStackTrace, error.message, null); Instabug.reportJsException(jsStackTrace, error.message, null);
else if (errorIdentifier != null && error instanceof Error) { else if (errorIdentifier) {
Instabug.reportJsException(jsStackTrace, error.message, errorIdentifier); Instabug.reportJsException(jsStackTrace, error.message, errorIdentifier);
} }
}, },