Skip to content

Commit

Permalink
Remove unneeded code. If there is an unexpected end of file, return a…
Browse files Browse the repository at this point in the history
…ll the queries we found up to that point.
  • Loading branch information
pifantastic committed May 7, 2011
1 parent 92d439c commit 535f5b2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions respond.parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
case '}':
stack.pop();
if (stack.length === 0 && inMediaQuery) {
// We might be in a media query!
if (media.length) {
var start = media.pop();
queries.push(str.substring(start, index));
queries.push(str.substring(media.pop(), index));
}
inMediaQuery = false;
}
Expand All @@ -37,12 +35,10 @@
while (str[index] !== '{' && index++ < len);

// Save the location of this media query. If we hit the end of the file
// just fucking, i don't know, return.
// just fucking, i don't know.
if (str[index] === '{') {
media.push(start);
index--;
} else {
return;
}
}
break;
Expand All @@ -65,10 +61,6 @@
while (str[++index] !== '/' && str[index - 1] !== '*');
}
break;

default:
// wat.
break;
};

index++;
Expand Down

0 comments on commit 535f5b2

Please sign in to comment.