From 6eb3166de9d9faa07fbb1cf349159d274f7d2285 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Fri, 21 Aug 2015 18:24:26 +0200 Subject: [PATCH] Avoid declaring the same variable twice. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src is an argument to Lexer.prototype.token so there is no need to declare it as a variable. It doesn’t seem to do any harm, but some linters/compilers (read: Closure Compiler) complain. Since there’s almost zero cost in getting rid of the duplicate declaration, do so. --- lib/marked.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index f1d66ed4f9..526b32b6c1 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -154,8 +154,7 @@ Lexer.prototype.lex = function(src) { */ Lexer.prototype.token = function(src, top) { - var src = src.replace(/^ +$/gm, '') - , next + var next , loose , cap , bull @@ -165,6 +164,7 @@ Lexer.prototype.token = function(src, top) { , i , tag , l; + src = src.replace(/^ +$/gm, ''); while (src) { // newline