MCPcopy
hub / github.com/jquerytools/jquerytools / addlabel

Function addlabel

lib/jslint.js:83–86  ·  view source on GitHub ↗
(t,type)

Source from the content-addressed store, hash-verified

81token=nexttoken;nexttoken=syntax['(end)'];for(;;){i=s.indexOf(t||'<');if(i>=0){character+=i+t.length;s=s.substr(i+t.length);return true;}
82if(!nextLine()){break;}}
83return false;}};}();function addlabel(t,type){if(t==='hasOwnProperty'){error("'hasOwnProperty' is a really bad name.");}
84if(option.adsafe&&funct['(global)']){warning('ADsafe global: '+t+'.',token);}
85if(funct.hasOwnProperty(t)){warning(funct[t]===true?"'{a}' was used before it was defined.":"'{a}' is already defined.",nexttoken,t);}
86funct[t]=type;if(type==='label'){scope[t]=funct;}else if(funct['(global)']){global[t]=funct;if(implied.hasOwnProperty(t)){warning("'{a}' was used before it was defined.",nexttoken,t);delete implied[t];}}else{funct['(scope)'][t]=funct;}}
87function doOption(){var b,obj,filter,o=nexttoken.value,t,v;switch(o){case'*/':error("Unbegun comment.");break;case'/*global':case'/*extern':if(option.adsafe){warning("ADsafe restriction.");}
88obj=predefined;break;case'/*members':case'/*member':o='/*members';if(!membersOnly){membersOnly={};}
89obj=membersOnly;break;case'/*jslint':if(option.adsafe){warning("ADsafe restriction.");}

Callers 6

statementFunction · 0.85
xmlFunction · 0.85
varstatementFunction · 0.85
functionparamsFunction · 0.85
doFunctionFunction · 0.85
jslint.jsFile · 0.85

Calls 2

errorFunction · 0.85
warningFunction · 0.85

Tested by

no test coverage detected