Permalink
Browse files

More descriptive variable names

* Indent a code properly
* Use one `var` per variable
  • Loading branch information...
1 parent ae566d1 commit a7ded1f50024c89d12bdf5e1656ea0af67a8ce3b @NV committed Jun 26, 2012
Showing with 10 additions and 11 deletions.
  1. +10 −11 lib/parse.js
View
21 lib/parse.js
@@ -55,17 +55,16 @@ CSSOM.parse = function parse(token) {
var atKeyframesRegExp = /@(-(?:\w+-)+)?keyframes/g;
- var parseError = function (msg) {
- var tmp = token.substring(0, i).split('\n'),
- lines = tmp.length,
- chars = tmp.pop().length;
- var err = new Error(msg + ' (line ' + lines + ', char ' + chars + ')');
- err.line = lines;
- err.char = chars;
- err.styleSheet = styleSheet;
- throw err;
- };
-
+ var parseError = function(message) {
+ var lines = token.substring(0, i).split('\n');
+ var lineCount = lines.length;
+ var charCount = lines.pop().length;
+ var error = new Error(message + ' (line ' + lineCount + ', char ' + charCount + ')');
+ error.line = lineCount;
+ error.char = charCount;
+ error.styleSheet = styleSheet;
+ throw error;
+ };
for (var character; character = token.charAt(i); i++) {

0 comments on commit a7ded1f

Please sign in to comment.