From 2468784eb34a7b9f7c5960f8c044c94a72157f3c Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 12 Apr 2017 06:14:59 +0300 Subject: [PATCH] csslint: fix crashing on unclosed calc() at eof --- csslint/WARNING.txt | 12 ++++++++++++ csslint/csslint-worker.js | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 csslint/WARNING.txt diff --git a/csslint/WARNING.txt b/csslint/WARNING.txt new file mode 100644 index 00000000..bf059aff --- /dev/null +++ b/csslint/WARNING.txt @@ -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 diff --git a/csslint/csslint-worker.js b/csslint/csslint-worker.js index e55704cc..bb6be9df 100644 --- a/csslint/csslint-worker.js +++ b/csslint/csslint-worker.js @@ -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();