Skip to content

Commit cb43632

Browse files
committed
fix _parseJSString()
1 parent cac9f73 commit cb43632

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

lib/CSSValueExpression.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep) {
184184
if (endIdx === -1) {
185185
return false;
186186
} else {
187-
endIdx = endIdx + sep.length;
188-
text = token.substring(idx, endIdx);
187+
text = token.substring(idx, endIdx + sep.length);
189188

190189
return {
191190
idx: endIdx,
@@ -289,20 +288,10 @@ CSSOM.CSSValueExpression.prototype._parseJSRexExp = function(token, idx) {
289288
if (!isLegal) {
290289
return false;
291290
} else {
292-
var sep = '/',
293-
endIdx = this._findMatchedIdx(token, idx, sep),
294-
text;
295-
if (endIdx === -1) {
296-
return false;
297-
} else {
298-
endIdx = endIdx + sep.length;
299-
text = token.substring(idx, endIdx);
291+
var sep = '/';
300292

301-
return {
302-
idx: endIdx,
303-
text: text
304-
}
305-
}
293+
// same logic as string
294+
return this._parseJSString(token, idx, sep);
306295
}
307296
};
308297

0 commit comments

Comments
 (0)