postcss-selector-parser
Advanced tools
Comparing version
@@ -0,1 +1,6 @@ | ||
# 1.3.3 | ||
* Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs. | ||
Now postcss-selector-parser will throw when it encounters these lone tokens. | ||
# 1.3.2 | ||
@@ -2,0 +7,0 @@ |
@@ -215,2 +215,10 @@ 'use strict'; | ||
Parser.prototype.missingParenthesis = function missingParenthesis() { | ||
return this.error('Expected opening parenthesis.'); | ||
}; | ||
Parser.prototype.missingSquareBracket = function missingSquareBracket() { | ||
return this.error('Expected opening square bracket.'); | ||
}; | ||
Parser.prototype.namespace = function namespace() { | ||
@@ -463,3 +471,3 @@ var before = this.prevToken && this.prevToken[1] || true; | ||
while (this.position < this.tokens.length) { | ||
this.parse(); | ||
this.parse(true); | ||
} | ||
@@ -469,3 +477,3 @@ return this.root; | ||
Parser.prototype.parse = function parse() { | ||
Parser.prototype.parse = function parse(throwOnParenthesis) { | ||
switch (this.currToken[0]) { | ||
@@ -481,5 +489,13 @@ case 'space': | ||
break; | ||
case ')': | ||
if (throwOnParenthesis) { | ||
this.missingParenthesis(); | ||
} | ||
break; | ||
case '[': | ||
this.attribute(); | ||
break; | ||
case ']': | ||
this.missingSquareBracket(); | ||
break; | ||
case 'at-word': | ||
@@ -486,0 +502,0 @@ case 'word': |
{ | ||
"name": "postcss-selector-parser", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"devDependencies": { | ||
@@ -17,3 +17,3 @@ "ava": "^0.12.0", | ||
"eslint-config-cssnano": "^2.0.0", | ||
"nyc": "^5.3.0" | ||
"nyc": "^6.0.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "main": "dist/index.js", |
79860
0.91%1404
1.01%