Fix react-native function call arity errors

Reviewed By: zertosh

Differential Revision: D5081816

fbshipit-source-id: 5978770c30a69fb287d03aa7511999ce30f856a1
This commit is contained in:
Gabe Levi
2017-05-18 16:51:37 -07:00
committed by Facebook Github Bot
parent aa3bbf18a1
commit 3ddc7d47d5
22 changed files with 86 additions and 72 deletions

View File

@@ -16,12 +16,12 @@
* `console.error` as a failure callback - it's not properly bound. If passes an
* `Error` object, it will print the message and stack.
*/
var logError = function() {
if (arguments.length === 1 && arguments[0] instanceof Error) {
var err = arguments[0];
var logError = function(...args: $ReadOnlyArray<mixed>) {
if (args.length === 1 && args[0] instanceof Error) {
var err = args[0];
console.error('Error: "' + err.message + '". Stack:\n' + err.stack);
} else {
console.error.apply(console, arguments);
console.error.apply(console, args);
}
};