MCPcopy
hub / github.com/jquerytools/jquerytools / varstatement

Function varstatement

lib/jslint.js:305–310  ·  view source on GitHub ↗
(prefix)

Source from the content-addressed store, hash-verified

303countMember(i);advance(':');nonadjacent(token,nexttoken);parse(10);if(nexttoken.id===','){adjacent(token,nexttoken);advance(',');if(nexttoken.id===','||nexttoken.id==='}'){warning("Extra comma.",token);}
304nonadjacent(token,nexttoken);}else{if(b){indent-=option.indent;indentation();}
305advance('}',this);return;}}};x.fud=function(){error("Expected to see a statement and instead saw a block.",token);};})(delim('{'));function varstatement(prefix){if(funct['(global)']&&option.glovar){warning("Use '/*global "+nexttoken.value+"*/' instead of 'var'.",token);}
306for(;;){nonadjacent(token,nexttoken);addlabel(identifier(),'unused');if(prefix){return;}
307if(nexttoken.id==='='){nonadjacent(token,nexttoken);advance('=');nonadjacent(token,nexttoken);if(peek(0).id==='='){error("Variable {a} was not declared correctly.",nexttoken,nexttoken.value);}
308parse(20);}
309if(nexttoken.id!==','){return;}
310adjacent(token,nexttoken);advance(',');nonadjacent(token,nexttoken);}}
311stmt('var',varstatement);stmt('new',function(){error("'new' should not be used as a statement.");});function functionparams(){var i,t=nexttoken,p=[];advance('(');nospace();if(nexttoken.id===')'){advance(')');nospace(prevtoken,token);return;}
312for(;;){i=identifier();p.push(i);addlabel(i,'parameter');if(nexttoken.id===','){advance(',');nonadjacent(token,nexttoken);}else{advance(')',t);nospace(prevtoken,token);return p.join(', ');}}}
313function doFunction(i){var s=scope;scope=Object.beget(s);funct={'(name)':i||'"'+anonname+'"','(line)':nexttoken.line+1,'(context)':funct,'(breakage)':0,'(loopage)':0,'(scope)':scope};functions.push(funct);if(i){addlabel(i,'function');}

Callers 1

jslint.jsFile · 0.85

Calls 9

warningFunction · 0.85
nonadjacentFunction · 0.85
addlabelFunction · 0.85
identifierFunction · 0.85
advanceFunction · 0.85
peekFunction · 0.85
errorFunction · 0.85
parseFunction · 0.85
adjacentFunction · 0.85

Tested by

no test coverage detected