csslint: fix crashing on unclosed calc() at eof

This commit is contained in:
tophf 2017-04-12 06:14:59 +03:00
parent 279149b8b8
commit 2468784eb3
2 changed files with 13 additions and 1 deletions

12
csslint/WARNING.txt Normal file
View File

@ -0,0 +1,12 @@
1. Until https://github.com/CSSLint/parser-lib/issues/229 is fixed, manually replace:
while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) {
in "_function: function()" with
while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN && lt !== Tokens.EOF) {
2. Apply our hacks unless supported natively:
* Support :any(), :-webkit-any(), :-moz-any()
* Support @supports inside @-moz-document

View File

@ -2781,7 +2781,7 @@ Parser.prototype = function() {
//functionText += this._term();
lt = tokenStream.peek();
while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) {
while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN && lt !== Tokens.EOF) {
tokenStream.get();
functionText += tokenStream.token().value;
lt = tokenStream.peek();