From 8098dbdc030554d78548bfc3c2be052fc35bc717 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Thu, 23 May 2013 13:43:50 -0700 Subject: [PATCH] Make line number a number and add comments. --- packages/logging/logging.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/logging/logging.js b/packages/logging/logging.js index 4faac5122b..41eaa14b26 100644 --- a/packages/logging/logging.js +++ b/packages/logging/logging.js @@ -56,6 +56,7 @@ var logInBrowser = function (obj) { } }; +// @returns {Object: { line: Number, fileName: String }} var getCallerDetails = function () { var e = new Error(); // now magic will happen: get line number from callstack @@ -68,7 +69,7 @@ var getCallerDetails = function () { line = lines[++index]; var details = {}; - details.line = line.split(':')[1]; + details.line = +line.split(':')[1]; // line can be in two formats depending on function description availability: // 0) at functionName (/filePath/file.js:line:position)