From 2d535a63952b74fd88e15d588396b5e78fadc46e Mon Sep 17 00:00:00 2001 From: Samuel Tribehou Date: Mon, 9 Jan 2017 18:14:50 +0100 Subject: [PATCH] Anonymise some functions to work around Safari bug Some Safari versions will error with a syntax error if a function has the same name as one of its parameter. Found the bug in safari included with iOS 9.3.5. Fixed for me with this patch. --- lib/bunyan.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bunyan.js b/lib/bunyan.js index ec3bd84..5cadb8e 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -1087,7 +1087,7 @@ Logger.prototype.fatal = mkLogEmitter(FATAL); Logger.stdSerializers = {}; // Serialize an HTTP request. -Logger.stdSerializers.req = function req(req) { +Logger.stdSerializers.req = function (req) { if (!req || !req.connection) return req; return { @@ -1105,7 +1105,7 @@ Logger.stdSerializers.req = function req(req) { }; // Serialize an HTTP response. -Logger.stdSerializers.res = function res(res) { +Logger.stdSerializers.res = function (res) { if (!res || !res.statusCode) return res; return { @@ -1138,7 +1138,7 @@ function getFullErrorStack(ex) // Serialize an Error object // (Core error properties are enumerable in node 0.4, not in 0.6). -var errSerializer = Logger.stdSerializers.err = function err(err) { +var errSerializer = Logger.stdSerializers.err = function (err) { if (!err || !err.stack) return err; var obj = {