diff --git a/lib/ace/mode/css/csslint.js b/lib/ace/mode/css/csslint.js index d46b0aa19d7..f0217552a7f 100644 --- a/lib/ace/mode/css/csslint.js +++ b/lib/ace/mode/css/csslint.js @@ -1877,10 +1877,12 @@ Parser.prototype = function() { value = new PropertyName(propertyName, hack, line || token.startLine, col || token.startCol); this._readWhitespace(); - } else if (tokenStream.peek() === Tokens.RBRACE) { - // Encountered when there are no more properties. } else { - this._unexpectedToken(tokenStream.LT(1)); + var tt = tokenStream.peek(); + // If this isn't an right brace or the end of the file throw an SyntaxError. + if (tt !== Tokens.EOF && tt !== Tokens.RBRACE) { + this._unexpectedToken(tokenStream.LT(1)); + } } return value; @@ -3129,7 +3131,7 @@ Parser.prototype = function() { if (tt === Tokens.SEMICOLON) { // if there's a semicolon, then there might be another declaration this._readDeclarations(false, readMargins); - } else if (tt !== Tokens.RBRACE) { + } else if (tt !== Tokens.EOF && tt !== Tokens.RBRACE) { // if there's a right brace, the rule is finished so don't do anything // otherwise, rethrow the error because it wasn't handled properly throw ex;