From e4bdd2d8035ddab4ad0743a666ae04831cf94f88 Mon Sep 17 00:00:00 2001 From: Marc Knaup Date: Fri, 7 Feb 2014 12:33:33 +0100 Subject: [PATCH] Fixed line number extraction on Windows. --- lib/nlogger.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nlogger.js b/lib/nlogger.js index 89e767a..57a875a 100644 --- a/lib/nlogger.js +++ b/lib/nlogger.js @@ -56,7 +56,8 @@ function getDate() { function getLine() { var e = new Error(); // now magic will happen: get line number from callstack - var line = e.stack.split('\n')[3].split(':')[1]; + var elements = e.stack.split('\n')[3].split(':'); + var line = elements[elements.length - 2]; return line; }