MCPcopy
hub / github.com/jquerytools/jquerytools / statement

Function statement

lib/jslint.js:172–178  ·  view source on GitHub ↗
(noindent)

Source from the content-addressed store, hash-verified

170warning("Unreachable '{a}' after '{b}'.",t,t.value,s);break;}
171i+=1;}}
172function statement(noindent){var i=indent,r,s=scope,t=nexttoken;if(t.id===';'){warning("Unnecessary semicolon.",t);advance(';');return;}
173if(t.identifier&&!t.reserved&&peek().id===':'){advance();advance(':');scope=Object.beget(s);addlabel(t.value,'label');if(!nexttoken.labelled){warning("Label '{a}' on {b} statement.",nexttoken,t.value,nexttoken.value);}
174if(jx.test(t.value+':')){warning("Label '{a}' looks like a javascript url.",t,t.value);}
175nexttoken.label=t.value;t=nexttoken;}
176if(!noindent){indentation();}
177r=parse(0,true);if(!t.block){if(nexttoken.id!==';'){warningAt("Missing semicolon.",token.line,token.from+token.value.length);}else{adjacent(token,nexttoken);advance(';');nonadjacent(token,nexttoken);}}
178indent=i;scope=s;return r;}
179function statements(begin){var a=[];if(begin){if(option.adsafe&&nexttoken.type!=='(string)'){warning('ADsafe violation: Missing "use strict" statement.',nexttoken);}
180if(nexttoken.type==='(string)'&&nexttoken.value.slice(0,10)==='use strict'){advance();advance(';');}}
181if(option.adsafe){switch(begin){case'script':if(!adsafe_may){if(nexttoken.value!=='ADSAFE'||peek(0).id!=='.'||(peek(1).value!=='id'&&peek(1).value!=='go')){error('ADsafe violation: Missing ADSAFE.id or ADSAFE.go.',nexttoken);}}

Callers 3

statementsFunction · 0.85
blockFunction · 0.85
jslint.jsFile · 0.85

Calls 9

warningFunction · 0.85
advanceFunction · 0.85
peekFunction · 0.85
addlabelFunction · 0.85
indentationFunction · 0.85
parseFunction · 0.85
warningAtFunction · 0.85
adjacentFunction · 0.85
nonadjacentFunction · 0.85

Tested by

no test coverage detected