Skip to content

Commit a3b4d7b

Browse files
committed
Fixed code style issues as requested. Also fixed a problem in the PR - the else if check that increased the valueParenthsisDepth was part of the wrong if block.
1 parent 4919eff commit a3b4d7b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/parse.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CSSOM.parse = function parse(token) {
2424

2525
var index;
2626
var buffer = "";
27-
var valueParenthesisDepth=0;
27+
var valueParenthesisDepth = 0;
2828

2929
var SIGNIFICANT_WHITESPACE = {
3030
"selector": true,
@@ -255,24 +255,24 @@ CSSOM.parse = function parse(token) {
255255
if (state === 'value') {
256256
// ie css expression mode
257257
if (buffer.trim() === 'expression') {
258-
var info = (new CSSOM.CSSValueExpression(token, i)).parse();
258+
var info = (new CSSOM.CSSValueExpression(token, i)).parse();
259259

260-
if (info.error) {
261-
parseError(info.error);
262-
} else {
263-
buffer += info.expression;
264-
i = info.idx;
265-
}
266-
} else if (state === 'value-parenthesis') {
267-
valueParenthesisDepth++;
268-
buffer += character;
260+
if (info.error) {
261+
parseError(info.error);
262+
} else {
263+
buffer += info.expression;
264+
i = info.idx;
265+
}
269266
} else {
270267
state = 'value-parenthesis';
271-
//always ensure this is reset to 1 on transition
268+
//always ensure this is reset to 1 on transition
272269
//from value to value-parenthesis
273-
valueParenthesisDepth=1;
270+
valueParenthesisDepth = 1;
274271
buffer += character;
275272
}
273+
} else if (state === 'value-parenthesis') {
274+
valueParenthesisDepth++;
275+
buffer += character;
276276
} else {
277277
buffer += character;
278278
}
@@ -281,7 +281,7 @@ CSSOM.parse = function parse(token) {
281281
case ")":
282282
if (state === 'value-parenthesis') {
283283
valueParenthesisDepth--;
284-
if(valueParenthesisDepth === 0) state = 'value';
284+
if (valueParenthesisDepth === 0) state = 'value';
285285
}
286286
buffer += character;
287287
break;

0 commit comments

Comments
 (0)