postcss-selector-parser
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -0,1 +1,6 @@ | ||
# 1.1.4 | ||
* Fixes a crash when a selector started with a `>` combinator. The module will | ||
now no longer throw if a selector has a leading/trailing combinator node. | ||
# 1.1.3 | ||
@@ -2,0 +7,0 @@ |
@@ -144,3 +144,3 @@ 'use strict'; | ||
combinator.spaces.before = this.currToken[1]; | ||
} else if (this.prevToken[0] === 'combinator') { | ||
} else if (this.prevToken && this.prevToken[0] === 'combinator') { | ||
combinator.spaces.after = this.currToken[1]; | ||
@@ -151,9 +151,3 @@ } else if (this.currToken[0] === 'space' || this.currToken[0] === 'combinator') { | ||
this.position++; | ||
if (this.position === this.tokens.length) { | ||
this.error('Unexpected right hand side combinator.'); | ||
} | ||
} | ||
if (!this.current.last) { | ||
this.error('Unexpected left hand side combinator.'); | ||
} | ||
return this.newNode(combinator); | ||
@@ -210,4 +204,8 @@ } | ||
while (this.position < this.tokens.length && balanced) { | ||
if (this.currToken[0] === '(') balanced++; | ||
if (this.currToken[0] === ')') balanced--; | ||
if (this.currToken[0] === '(') { | ||
balanced++; | ||
} | ||
if (this.currToken[0] === ')') { | ||
balanced--; | ||
} | ||
if (balanced) { | ||
@@ -228,4 +226,8 @@ this.parse(); | ||
while (this.position < this.tokens.length && balanced) { | ||
if (this.currToken[0] === '(') balanced++; | ||
if (this.currToken[0] === ')') balanced--; | ||
if (this.currToken[0] === '(') { | ||
balanced++; | ||
} | ||
if (this.currToken[0] === ')') { | ||
balanced--; | ||
} | ||
last.value += this.currToken[1]; | ||
@@ -232,0 +234,0 @@ this.position++; |
{ | ||
"name": "postcss-selector-parser", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"devDependencies": { | ||
@@ -5,0 +5,0 @@ "babel": "^5.4.3", |
84203
1411