From ef045b971834a34e5181f8e2eeac34644e2ede41 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Thu, 31 Jul 2014 14:33:40 +0300 Subject: [PATCH] Remove `copyToken` from acorn_loose (not needed anymore). --- acorn_loose.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/acorn_loose.js b/acorn_loose.js index b7bc56dd4f..af0e97add6 100644 --- a/acorn_loose.js +++ b/acorn_loose.js @@ -131,22 +131,9 @@ fetchToken.jumpTo(pos, reAllowed); } - function copyToken(token) { - var copy = {start: token.start, end: token.end, type: token.type, value: token.value}; - if (options.locations) { - copy.startLoc = token.startLoc; - copy.endLoc = token.endLoc; - } - return copy; - } - function lookAhead(n) { - // Copy token objects, because fetchToken will overwrite the one - // it returns, and in this case we still need it - if (!ahead.length) - token = copyToken(token); while (n > ahead.length) - ahead.push(copyToken(readToken())); + ahead.push(readToken()); return ahead[n-1]; }