diff --git a/csslint/csslint-worker.js b/csslint/csslint-worker.js index 75b5df44..46a72d4b 100644 --- a/csslint/csslint-worker.js +++ b/csslint/csslint-worker.js @@ -1675,7 +1675,6 @@ Parser.prototype = function() { } tokenStream.mustMatch(Tokens.LBRACE); - this._readWhitespace(); this.fire({ type: "startdocument", @@ -1685,6 +1684,8 @@ Parser.prototype = function() { col: token.startCol }); + this._readWhitespace(); // Stylus hack + var ok = true; while (ok) { switch (tokenStream.peek()) { diff --git a/edit.js b/edit.js index 9bf5c618..2f9ede93 100644 --- a/edit.js +++ b/edit.js @@ -1576,7 +1576,7 @@ function fromMozillaFormat() { } function backtrackTo(parser, tokenType, startEnd) { var tokens = parser._tokenStream._lt; - for (var i = tokens.length - 2; i >= 0; --i) { + for (var i = parser._tokenStream._ltIndex - 1; i >= 0; --i) { if (tokens[i].type == tokenType) { return {line: tokens[i][startEnd+"Line"], col: tokens[i][startEnd+"Col"]}; }