Skip to content

Commit

Permalink
Breaking Change: Merging logJSError to logError method for consis…
Browse files Browse the repository at this point in the history
…tency and standard.

wizpanda#8 (comment)
  • Loading branch information
sagrawal31 committed Jun 24, 2019
1 parent 688b634 commit 6a965f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
13 changes: 5 additions & 8 deletions www/firebase-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ exports.logEvent = function (name, params, success, error) {
}
};

exports.logError = function (message, success, error) {
if (typeof success === 'function') {
success();
}
};

exports.logJSError = function (message, stackTrace, success, error) {
if (typeof success === 'function') {
exports.logError = function (message, stackTrace, success, error) {
// "stackTrace" is an optional arg and is an array of objects.
if (typeof stackTrace === 'function') {
stackTrace();
} else if (typeof success === 'function') {
success();
}
};
Expand Down
14 changes: 7 additions & 7 deletions www/firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ exports.logEvent = function (name, params, success, error) {
exec(success, error, "FirebasePlugin", "logEvent", [name, params]);
};

// @Deprecated. Use "logJSError" method instead
exports.logError = function (message, success, error) {
exec(success, error, "FirebasePlugin", "logError", [message]);
};

exports.logJSError = function (message, stackTrace, success, error) {
exports.logError = function (message, stackTrace, success, error) {
var args = [message];
// "stackTrace" is an optional arg that's an array of objects.
if (stackTrace) {
args.push(stackTrace);
if (typeof stackTrace === 'function') {
error = success;
success = stackTrace;
} else {
args.push(stackTrace);
}
}
exec(success, error, "FirebasePlugin", "logError", args);
};
Expand Down

0 comments on commit 6a965f6

Please sign in to comment.