Remove copyToken from acorn_loose (not needed anymore).

This commit is contained in:
Ingvar Stepanyan 2014-07-31 14:33:40 +03:00
parent 1bf8c1420f
commit ef045b9718

View File

@ -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];
}