From 47ee2cc99f1022bbc12bef452555980ff36a82b1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 3 Nov 2014 17:53:08 +1100 Subject: [PATCH] simplify err.loc references --- lib/6to5/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/6to5/util.js b/lib/6to5/util.js index 49faad6ce7..6e93d50c41 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -221,8 +221,9 @@ exports.parse = function (opts, code, callback) { err._6to5 = true; var message = opts.filename + ": " + err.message; - if (err.loc) { - var frame = exports.codeFrame(code, err.loc.line, err.loc.column); + var loc = err.loc; + if (loc) { + var frame = exports.codeFrame(code, loc.line, loc.column); message += frame; }