Skip to content

Commit 697cc34

Browse files
committed
Remove unused variables.
1 parent 50c1388 commit 697cc34

File tree

7 files changed

+20
-62
lines changed

7 files changed

+20
-62
lines changed

src/css/Parser.js

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
/*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit,
2-
PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector,
3-
PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */
1+
/*global Tokens, TokenStream, SyntaxError, Validation, SyntaxUnit */
2+
/*global PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart */
3+
/*global Selector, PropertyName, Combinator, MediaFeature, MediaQuery */
4+
/*global EventTarget */
45

56
/**
67
* A CSS3 parser.
@@ -74,7 +75,6 @@ Parser.prototype = function(){
7475
*/
7576

7677
var tokenStream = this._tokenStream,
77-
charset = null,
7878
count,
7979
token,
8080
tt;
@@ -250,7 +250,6 @@ Parser.prototype = function(){
250250
*/
251251

252252
var tokenStream = this._tokenStream,
253-
tt,
254253
uri,
255254
importToken,
256255
mediaList = [];
@@ -768,7 +767,6 @@ Parser.prototype = function(){
768767

769768
var tokenStream = this._tokenStream,
770769
token,
771-
tt,
772770
functions = [],
773771
prefix = "";
774772

@@ -1161,7 +1159,6 @@ Parser.prototype = function(){
11611159
i = 0,
11621160
len = components.length,
11631161
component = null,
1164-
found = false,
11651162
line,
11661163
col;
11671164

@@ -1535,7 +1532,6 @@ Parser.prototype = function(){
15351532
arg = null,
15361533
i = 0,
15371534
len = args.length,
1538-
elementName,
15391535
line,
15401536
col,
15411537
part;
@@ -1577,7 +1573,6 @@ Parser.prototype = function(){
15771573
property = null,
15781574
expr = null,
15791575
prio = null,
1580-
error = null,
15811576
invalid = null,
15821577
propertyName= "";
15831578

@@ -1651,8 +1646,7 @@ Parser.prototype = function(){
16511646
* ;
16521647
*/
16531648

1654-
var tokenStream = this._tokenStream,
1655-
values = [],
1649+
var values = [],
16561650
//valueParts = [],
16571651
value = null,
16581652
operator = null;
@@ -1867,7 +1861,6 @@ Parser.prototype = function(){
18671861

18681862
var tokenStream = this._tokenStream,
18691863
functionText = null,
1870-
expr = null,
18711864
lt;
18721865

18731866
//IE function can begin like a regular function, too
@@ -2006,8 +1999,7 @@ Parser.prototype = function(){
20061999
* | STRING
20072000
* ;
20082001
*/
2009-
var tokenStream = this._tokenStream,
2010-
token;
2002+
var tokenStream = this._tokenStream;
20112003

20122004
tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]);
20132005
return SyntaxUnit.fromToken(tokenStream.token());
@@ -2021,9 +2013,7 @@ Parser.prototype = function(){
20212013
* '{' S* declaration [ ';' S* declaration ]* '}' S*
20222014
* ;
20232015
*/
2024-
var tokenStream = this._tokenStream,
2025-
token,
2026-
keyList = this._key_list();
2016+
var keyList = this._key_list();
20272017

20282018
this.fire({
20292019
type: "startkeyframerule",
@@ -2051,8 +2041,6 @@ Parser.prototype = function(){
20512041
* ;
20522042
*/
20532043
var tokenStream = this._tokenStream,
2054-
token,
2055-
key,
20562044
keyList = [];
20572045

20582046
//must be least one key

src/css/Properties.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ var Properties = {
162162
var valid = false,
163163
simple = "<length> | <percentage> | inherit",
164164
slash = false,
165-
fill = false,
166165
count = 0,
167166
max = 8,
168167
part;
@@ -226,8 +225,7 @@ var Properties = {
226225
"-webkit-box-pack" : "start | end | center | justify",
227226
"box-decoration-break" : "slice | clone",
228227
"box-shadow" : function (expression) {
229-
var result = false,
230-
part;
228+
var part;
231229

232230
if (!ValidationTypes.isAny(expression, "none")) {
233231
Validation.multiProperty("<shadow>", expression, true, Infinity);

src/css/PropertyValueIterator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*global SyntaxUnit, Parser*/
21
/**
32
* A utility class that allows for easy iteration over the various parts of a
43
* property value.

src/css/TokenStream.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*global Tokens, TokenStreamBase*/
22

33
var h = /^[0-9a-fA-F]$/,
4-
nonascii = /^[\u00A0-\uFFFF]$/,
4+
//nonascii = /^[\u00A0-\uFFFF]$/,
55
nl = /\n|\r\n|\r|\f/,
66
whitespace = /\u0009|\u000a|\u000c|\u000d|\u0020/;
77

@@ -354,9 +354,7 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
354354
var rule = first,
355355
reader = this._reader,
356356
tt = Tokens.CHAR,
357-
valid = false,
358-
ident,
359-
c;
357+
ident;
360358

361359
/*
362360
* First, mark where we are. There are only four @ rules,
@@ -420,8 +418,7 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
420418
* @method commentToken
421419
*/
422420
commentToken: function(first, startLine, startCol){
423-
var reader = this._reader,
424-
comment = this.readComment(first);
421+
var comment = this.readComment(first);
425422

426423
return this.createToken(Tokens.COMMENT, comment, startLine, startCol);
427424
},
@@ -455,8 +452,7 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
455452
* @method hashToken
456453
*/
457454
hashToken: function(first, startLine, startCol){
458-
var reader = this._reader,
459-
name = this.readName(first);
455+
var name = this.readName(first);
460456

461457
return this.createToken(Tokens.HASH, name, startLine, startCol);
462458
},
@@ -784,8 +780,7 @@ TokenStream.prototype = mix(new TokenStreamBase(), {
784780
* @method whitespaceToken
785781
*/
786782
whitespaceToken: function(first, startLine, startCol){
787-
var reader = this._reader,
788-
value = first + this.readWhitespace();
783+
var value = first + this.readWhitespace();
789784
return this.createToken(Tokens.S, value, startLine, startCol);
790785
},
791786

src/css/Validation.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ var Validation = {
66

77
//normalize name
88
var name = property.toString().toLowerCase(),
9-
parts = value.parts,
109
expression = new PropertyValueIterator(value),
11-
spec = Properties[name],
12-
part,
13-
valid,
14-
j, count,
15-
msg,
16-
types,
17-
last,
18-
literals,
19-
max, multi, group;
10+
spec = Properties[name];
2011

2112
if (!spec) {
2213
if (name.indexOf("-") !== 0){ //vendor prefixed are ok
@@ -76,7 +67,6 @@ var Validation = {
7667
var result = false,
7768
value = expression.value,
7869
count = 0,
79-
sep = false,
8070
part;
8171

8272
while(expression.hasNext() && !result && count < max) {

src/css/ValidationTypes.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//This file will likely change a lot! Very experimental!
2-
/*global Properties, Validation, ValidationError, PropertyValueIterator, console*/
2+
/*global ValidationError */
33
var ValidationTypes = {
44

55
isLiteral: function (part, literals) {
@@ -238,15 +238,11 @@ var ValidationTypes = {
238238
complex: {
239239

240240
"<bg-position>": function(expression){
241-
var types = this,
242-
result = false,
241+
var result = false,
243242
numeric = "<percentage> | <length>",
244243
xDir = "left | right",
245244
yDir = "top | bottom",
246-
count = 0,
247-
hasNext = function() {
248-
return expression.hasNext() && expression.peek().text !== ",";
249-
};
245+
count = 0;
250246

251247
while (expression.peek(count) && expression.peek(count).text !== ",") {
252248
count++;
@@ -310,11 +306,8 @@ var ValidationTypes = {
310306

311307
"<bg-size>": function(expression){
312308
//<bg-size> = [ <length> | <percentage> | auto ]{1,2} | cover | contain
313-
var types = this,
314-
result = false,
315-
numeric = "<percentage> | <length> | auto",
316-
part,
317-
i, len;
309+
var result = false,
310+
numeric = "<percentage> | <length> | auto";
318311

319312
if (ValidationTypes.isAny(expression, "cover | contain")) {
320313
result = true;
@@ -378,8 +371,7 @@ var ValidationTypes = {
378371
var result = false,
379372
count = 0,
380373
inset = false,
381-
color = false,
382-
part;
374+
color = false;
383375

384376
if (expression.hasNext()) {
385377

src/util/TokenStreamBase.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,7 @@ TokenStreamBase.prototype = {
196196
get: function(channel){
197197

198198
var tokenInfo = this._tokenData,
199-
reader = this._reader,
200-
value,
201199
i =0,
202-
len = tokenInfo.length,
203-
found = false,
204200
token,
205201
info;
206202

0 commit comments

Comments
 (0)