Skip to content

Commit

Permalink
[#1001] Fix corrupted state of tokenizer (#1010)
Browse files Browse the repository at this point in the history
- case of roundBracketLevel inferior to 0.
  • Loading branch information
abarre authored and jakubpawlowicz committed Mar 5, 2018
1 parent 8be4084 commit e944a2b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/tokenizer/tokenize.js
Expand Up @@ -114,6 +114,7 @@ function intoTokens(source, externalContext, internalContext, isNested) {
isCommentStart = !wasCommentEnd && level != Level.COMMENT && !isQuoted && character == Marker.ASTERISK && source[position.index - 1] == Marker.FORWARD_SLASH;
isCommentEndMarker = !wasCommentStart && !isQuoted && character == Marker.FORWARD_SLASH && source[position.index - 1] == Marker.ASTERISK;
isCommentEnd = level == Level.COMMENT && isCommentEndMarker;
roundBracketLevel = Math.max(roundBracketLevel, 0);

metadata = buffer.length === 0 ?
[position.line, position.column, position.source] :
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/issue-1001-min.css
@@ -0,0 +1,2 @@
.a{background-image:url(test/fixtures/bg-buttonh.png)}
.e{background:url(/carte-bienvenue/bg2.jpg)}
4 changes: 4 additions & 0 deletions test/fixtures/issue-1001.css
@@ -0,0 +1,4 @@
.a{background-image:url('bg-buttonh.png'); }
'/imagerie/booking/common/bg-buttonh.png');}
.c{background:url(/carte-bienvenue/bg.jpg)}
.e{background:url(/carte-bienvenue/bg2.jpg)}

0 comments on commit e944a2b

Please sign in to comment.