diff --git a/acorn.js b/acorn.js index bbd32cfcea..c335f650e0 100644 --- a/acorn.js +++ b/acorn.js @@ -142,6 +142,7 @@ var t = {}; function getToken(forceRegexp) { + lastEnd = tokEnd; readToken(forceRegexp); t.start = tokStart; t.end = tokEnd; t.startLoc = tokStartLoc; t.endLoc = tokEndLoc; diff --git a/index.html b/index.html index c1df00bd45..7d7e579cab 100644 --- a/index.html +++ b/index.html @@ -96,6 +96,7 @@ reset the internal state, and invalidate existing tokenizers.
var t = {}; function getToken(forceRegexp) { + lastEnd = tokEnd; readToken(forceRegexp); t.start = tokStart; t.end = tokEnd; t.startLoc = tokStartLoc; t.endLoc = tokEndLoc;