fixup 1406cae6: ) may belong to the parent, also fix readString

This commit is contained in:
tophf 2017-12-25 15:25:47 +03:00
parent fc673fe9c6
commit 37f7f1898f

View File

@ -2665,7 +2665,9 @@ Parser.prototype = function() {
const value = []; const value = [];
const endings = []; const endings = [];
let end = /[;!}]/; // a custom property value may end before these characters
// that belong to the parent declaration, not to the custom property
let end = /[;!})]/;
readValue: readValue:
while (!reader.eof()) { while (!reader.eof()) {
@ -2684,7 +2686,7 @@ Parser.prototype = function() {
case "'": case "'":
reader.reset(); reader.reset();
value.pop(); value.pop();
value.push(reader.readString()); value.push(this._tokenStream.readString());
continue; continue;
case '{': case '{':
endings.push(end); endings.push(end);
@ -2712,7 +2714,7 @@ Parser.prototype = function() {
} }
end = endings.pop(); end = endings.pop();
if (end) continue; if (end) continue;
if (c === '}') { if (c === '}' || c === ')') {
// unget parent } // unget parent }
reader.reset(); reader.reset();
value.pop(); value.pop();