From 49d64e77537cf9931817960e4da43f96dc388e6a Mon Sep 17 00:00:00 2001 From: Joe Esposito Date: Sun, 22 Feb 2015 14:50:12 -0500 Subject: [PATCH] Remove leading newline from getErrorSource. --- source-map-support.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source-map-support.js b/source-map-support.js index e0978c9..78f7942 100644 --- a/source-map-support.js +++ b/source-map-support.js @@ -335,7 +335,7 @@ function getErrorSource(error) { if (contents) { var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1]; if (code) { - return '\n' + source + ':' + line + '\n' + code + '\n' + + return source + ':' + line + '\n' + code + '\n' + new Array(column).join(' ') + '^'; } } @@ -349,7 +349,10 @@ function handleUncaughtExceptions(error) { console.error('Uncaught exception:', error); } else { var source = getErrorSource(error); - if (source !== null) console.error(source); + if (source !== null) { + console.error(); + console.error(source); + } console.error(error.stack); } process.exit(1);