diff --git a/jshint/jshint-2.1.4.min.js b/jshint/jshint-2.1.4.min.js new file mode 100644 index 0000000..e7ecc19 --- /dev/null +++ b/jshint/jshint-2.1.4.min.js @@ -0,0 +1,5 @@ +var JSHINT;(function(){var a;a=function(b,c,d){function e(d,g){if(!c[d]){if(!b[d]){var h="function"==typeof a&&a;if(!g&&h)return h(d,!0);if(f)return f(d,!0);throw Error("Cannot find module '"+d+"'")}var i=c[d]={exports:{}};b[d][0].call(i.exports,function(a){var c=b[d][1][a];return e(c?c:a)},i,i.exports)}return c[d].exports}for(var f="function"==typeof a&&a,g=0;d.length>g;g++)e(d[g]);return e}({1:[function(a,b){var d=b.exports={};d.nextTick=function(){var a="undefined"!=typeof window&&window.setImmediate,b="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(a)return function(a){return window.setImmediate(a)};if(b){var c=[];return window.addEventListener("message",function(a){if(a.source===window&&"process-tick"===a.data&&(a.stopPropagation(),c.length>0)){var b=c.shift();b()}},!0),function(a){c.push(a),window.postMessage("process-tick","*")}}return function(a){setTimeout(a,0)}}(),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.binding=function(){throw Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(){throw Error("process.chdir is not supported")}},{}],2:[function(a,b,c){(function(a){function e(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0;a.length>c;c++)if(b===a[c])return c;return-1}a.EventEmitter||(a.EventEmitter=function(){});var b=c.EventEmitter=a.EventEmitter,d="function"==typeof Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},f=10;b.prototype.setMaxListeners=function(a){this._events||(this._events={}),this._events.maxListeners=a},b.prototype.emit=function(a){if("error"===a&&(!this._events||!this._events.error||d(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var b=this._events[a];if(!b)return!1;if("function"==typeof b){switch(arguments.length){case 1:b.call(this);break;case 2:b.call(this,arguments[1]);break;case 3:b.call(this,arguments[1],arguments[2]);break;default:var c=Array.prototype.slice.call(arguments,1);b.apply(this,c)}return!0}if(d(b)){for(var c=Array.prototype.slice.call(arguments,1),e=b.slice(),f=0,g=e.length;g>f;f++)e[f].apply(this,c);return!0}return!1},b.prototype.addListener=function(a,b){if("function"!=typeof b)throw Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",a,b),this._events[a])if(d(this._events[a])){if(!this._events[a].warned){var c;c=void 0!==this._events.maxListeners?this._events.maxListeners:f,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),console.trace())}this._events[a].push(b)}else this._events[a]=[this._events[a],b];else this._events[a]=b;return this},b.prototype.on=b.prototype.addListener,b.prototype.once=function(a,b){var c=this;return c.on(a,function d(){c.removeListener(a,d),b.apply(this,arguments)}),this},b.prototype.removeListener=function(a,b){if("function"!=typeof b)throw Error("removeListener only takes instances of Function");if(!this._events||!this._events[a])return this;var c=this._events[a];if(d(c)){var f=e(c,b);if(0>f)return this;c.splice(f,1),0==c.length&&delete this._events[a]}else this._events[a]===b&&delete this._events[a];return this},b.prototype.removeAllListeners=function(a){return 0===arguments.length?(this._events={},this):(a&&this._events&&this._events[a]&&(this._events[a]=null),this)},b.prototype.listeners=function(a){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),d(this._events[a])||(this._events[a]=[this._events[a]]),this._events[a]}})(a("__browserify_process"))},{__browserify_process:1}],3:[function(a,b,c){(function(){"use strict";c.reservedVars={arguments:!1,NaN:!1},c.ecmaIdentifiers={Array:!1,Boolean:!1,Date:!1,decodeURI:!1,decodeURIComponent:!1,encodeURI:!1,encodeURIComponent:!1,Error:!1,eval:!1,EvalError:!1,Function:!1,hasOwnProperty:!1,isFinite:!1,isNaN:!1,JSON:!1,Math:!1,Map:!1,Number:!1,Object:!1,parseInt:!1,parseFloat:!1,RangeError:!1,ReferenceError:!1,RegExp:!1,Set:!1,String:!1,SyntaxError:!1,TypeError:!1,URIError:!1,WeakMap:!1},c.browser={ArrayBuffer:!1,ArrayBufferView:!1,Audio:!1,Blob:!1,addEventListener:!1,applicationCache:!1,atob:!1,blur:!1,btoa:!1,clearInterval:!1,clearTimeout:!1,close:!1,closed:!1,DataView:!1,DOMParser:!1,defaultStatus:!1,document:!1,Element:!1,ElementTimeControl:!1,event:!1,FileReader:!1,Float32Array:!1,Float64Array:!1,FormData:!1,focus:!1,frames:!1,getComputedStyle:!1,HTMLElement:!1,HTMLAnchorElement:!1,HTMLBaseElement:!1,HTMLBlockquoteElement:!1,HTMLBodyElement:!1,HTMLBRElement:!1,HTMLButtonElement:!1,HTMLCanvasElement:!1,HTMLDirectoryElement:!1,HTMLDivElement:!1,HTMLDListElement:!1,HTMLFieldSetElement:!1,HTMLFontElement:!1,HTMLFormElement:!1,HTMLFrameElement:!1,HTMLFrameSetElement:!1,HTMLHeadElement:!1,HTMLHeadingElement:!1,HTMLHRElement:!1,HTMLHtmlElement:!1,HTMLIFrameElement:!1,HTMLImageElement:!1,HTMLInputElement:!1,HTMLIsIndexElement:!1,HTMLLabelElement:!1,HTMLLayerElement:!1,HTMLLegendElement:!1,HTMLLIElement:!1,HTMLLinkElement:!1,HTMLMapElement:!1,HTMLMenuElement:!1,HTMLMetaElement:!1,HTMLModElement:!1,HTMLObjectElement:!1,HTMLOListElement:!1,HTMLOptGroupElement:!1,HTMLOptionElement:!1,HTMLParagraphElement:!1,HTMLParamElement:!1,HTMLPreElement:!1,HTMLQuoteElement:!1,HTMLScriptElement:!1,HTMLSelectElement:!1,HTMLStyleElement:!1,HTMLTableCaptionElement:!1,HTMLTableCellElement:!1,HTMLTableColElement:!1,HTMLTableElement:!1,HTMLTableRowElement:!1,HTMLTableSectionElement:!1,HTMLTextAreaElement:!1,HTMLTitleElement:!1,HTMLUListElement:!1,HTMLVideoElement:!1,history:!1,Int16Array:!1,Int32Array:!1,Int8Array:!1,Image:!1,length:!1,localStorage:!1,location:!1,MessageChannel:!1,MessageEvent:!1,MessagePort:!1,moveBy:!1,moveTo:!1,MutationObserver:!1,name:!1,Node:!1,NodeFilter:!1,navigator:!1,onbeforeunload:!0,onblur:!0,onerror:!0,onfocus:!0,onload:!0,onresize:!0,onunload:!0,open:!1,openDatabase:!1,opener:!1,Option:!1,parent:!1,print:!1,removeEventListener:!1,resizeBy:!1,resizeTo:!1,screen:!1,scroll:!1,scrollBy:!1,scrollTo:!1,sessionStorage:!1,setInterval:!1,setTimeout:!1,SharedWorker:!1,status:!1,SVGAElement:!1,SVGAltGlyphDefElement:!1,SVGAltGlyphElement:!1,SVGAltGlyphItemElement:!1,SVGAngle:!1,SVGAnimateColorElement:!1,SVGAnimateElement:!1,SVGAnimateMotionElement:!1,SVGAnimateTransformElement:!1,SVGAnimatedAngle:!1,SVGAnimatedBoolean:!1,SVGAnimatedEnumeration:!1,SVGAnimatedInteger:!1,SVGAnimatedLength:!1,SVGAnimatedLengthList:!1,SVGAnimatedNumber:!1,SVGAnimatedNumberList:!1,SVGAnimatedPathData:!1,SVGAnimatedPoints:!1,SVGAnimatedPreserveAspectRatio:!1,SVGAnimatedRect:!1,SVGAnimatedString:!1,SVGAnimatedTransformList:!1,SVGAnimationElement:!1,SVGCSSRule:!1,SVGCircleElement:!1,SVGClipPathElement:!1,SVGColor:!1,SVGColorProfileElement:!1,SVGColorProfileRule:!1,SVGComponentTransferFunctionElement:!1,SVGCursorElement:!1,SVGDefsElement:!1,SVGDescElement:!1,SVGDocument:!1,SVGElement:!1,SVGElementInstance:!1,SVGElementInstanceList:!1,SVGEllipseElement:!1,SVGExternalResourcesRequired:!1,SVGFEBlendElement:!1,SVGFEColorMatrixElement:!1,SVGFEComponentTransferElement:!1,SVGFECompositeElement:!1,SVGFEConvolveMatrixElement:!1,SVGFEDiffuseLightingElement:!1,SVGFEDisplacementMapElement:!1,SVGFEDistantLightElement:!1,SVGFEFloodElement:!1,SVGFEFuncAElement:!1,SVGFEFuncBElement:!1,SVGFEFuncGElement:!1,SVGFEFuncRElement:!1,SVGFEGaussianBlurElement:!1,SVGFEImageElement:!1,SVGFEMergeElement:!1,SVGFEMergeNodeElement:!1,SVGFEMorphologyElement:!1,SVGFEOffsetElement:!1,SVGFEPointLightElement:!1,SVGFESpecularLightingElement:!1,SVGFESpotLightElement:!1,SVGFETileElement:!1,SVGFETurbulenceElement:!1,SVGFilterElement:!1,SVGFilterPrimitiveStandardAttributes:!1,SVGFitToViewBox:!1,SVGFontElement:!1,SVGFontFaceElement:!1,SVGFontFaceFormatElement:!1,SVGFontFaceNameElement:!1,SVGFontFaceSrcElement:!1,SVGFontFaceUriElement:!1,SVGForeignObjectElement:!1,SVGGElement:!1,SVGGlyphElement:!1,SVGGlyphRefElement:!1,SVGGradientElement:!1,SVGHKernElement:!1,SVGICCColor:!1,SVGImageElement:!1,SVGLangSpace:!1,SVGLength:!1,SVGLengthList:!1,SVGLineElement:!1,SVGLinearGradientElement:!1,SVGLocatable:!1,SVGMPathElement:!1,SVGMarkerElement:!1,SVGMaskElement:!1,SVGMatrix:!1,SVGMetadataElement:!1,SVGMissingGlyphElement:!1,SVGNumber:!1,SVGNumberList:!1,SVGPaint:!1,SVGPathElement:!1,SVGPathSeg:!1,SVGPathSegArcAbs:!1,SVGPathSegArcRel:!1,SVGPathSegClosePath:!1,SVGPathSegCurvetoCubicAbs:!1,SVGPathSegCurvetoCubicRel:!1,SVGPathSegCurvetoCubicSmoothAbs:!1,SVGPathSegCurvetoCubicSmoothRel:!1,SVGPathSegCurvetoQuadraticAbs:!1,SVGPathSegCurvetoQuadraticRel:!1,SVGPathSegCurvetoQuadraticSmoothAbs:!1,SVGPathSegCurvetoQuadraticSmoothRel:!1,SVGPathSegLinetoAbs:!1,SVGPathSegLinetoHorizontalAbs:!1,SVGPathSegLinetoHorizontalRel:!1,SVGPathSegLinetoRel:!1,SVGPathSegLinetoVerticalAbs:!1,SVGPathSegLinetoVerticalRel:!1,SVGPathSegList:!1,SVGPathSegMovetoAbs:!1,SVGPathSegMovetoRel:!1,SVGPatternElement:!1,SVGPoint:!1,SVGPointList:!1,SVGPolygonElement:!1,SVGPolylineElement:!1,SVGPreserveAspectRatio:!1,SVGRadialGradientElement:!1,SVGRect:!1,SVGRectElement:!1,SVGRenderingIntent:!1,SVGSVGElement:!1,SVGScriptElement:!1,SVGSetElement:!1,SVGStopElement:!1,SVGStringList:!1,SVGStylable:!1,SVGStyleElement:!1,SVGSwitchElement:!1,SVGSymbolElement:!1,SVGTRefElement:!1,SVGTSpanElement:!1,SVGTests:!1,SVGTextContentElement:!1,SVGTextElement:!1,SVGTextPathElement:!1,SVGTextPositioningElement:!1,SVGTitleElement:!1,SVGTransform:!1,SVGTransformList:!1,SVGTransformable:!1,SVGURIReference:!1,SVGUnitTypes:!1,SVGUseElement:!1,SVGVKernElement:!1,SVGViewElement:!1,SVGViewSpec:!1,SVGZoomAndPan:!1,TimeEvent:!1,top:!1,Uint16Array:!1,Uint32Array:!1,Uint8Array:!1,Uint8ClampedArray:!1,WebSocket:!1,window:!1,Worker:!1,XMLHttpRequest:!1,XMLSerializer:!1,XPathEvaluator:!1,XPathException:!1,XPathExpression:!1,XPathNamespace:!1,XPathNSResolver:!1,XPathResult:!1},c.devel={alert:!1,confirm:!1,console:!1,Debug:!1,opera:!1,prompt:!1},c.worker={importScripts:!0,postMessage:!0,self:!0},c.nonstandard={escape:!1,unescape:!1},c.couch={require:!1,respond:!1,getRow:!1,emit:!1,send:!1,start:!1,sum:!1,log:!1,exports:!1,module:!1,provides:!1},c.node={__filename:!1,__dirname:!1,Buffer:!1,DataView:!1,console:!1,exports:!0,GLOBAL:!1,global:!1,module:!1,process:!1,require:!1,setTimeout:!1,clearTimeout:!1,setInterval:!1,clearInterval:!1,setImmediate:!1,clearImmediate:!1},c.phantom={phantom:!0,require:!0,WebPage:!0},c.rhino={defineClass:!1,deserialize:!1,gc:!1,help:!1,importPackage:!1,java:!1,load:!1,loadClass:!1,print:!1,quit:!1,readFile:!1,readUrl:!1,runCommand:!1,seal:!1,serialize:!1,spawn:!1,sync:!1,toint32:!1,version:!1},c.shelljs={target:!1,echo:!1,exit:!1,cd:!1,pwd:!1,ls:!1,find:!1,cp:!1,rm:!1,mv:!1,mkdir:!1,test:!1,cat:!1,sed:!1,grep:!1,which:!1,dirs:!1,pushd:!1,popd:!1,env:!1,exec:!1,chmod:!1,config:!1,error:!1,tempdir:!1},c.wsh={ActiveXObject:!0,Enumerator:!0,GetObject:!0,ScriptEngine:!0,ScriptEngineBuildVersion:!0,ScriptEngineMajorVersion:!0,ScriptEngineMinorVersion:!0,VBArray:!0,WSH:!0,WScript:!0,XDomainRequest:!0},c.dojo={dojo:!1,dijit:!1,dojox:!1,define:!1,require:!1},c.jquery={$:!1,jQuery:!1},c.mootools={$:!1,$$:!1,Asset:!1,Browser:!1,Chain:!1,Class:!1,Color:!1,Cookie:!1,Core:!1,Document:!1,DomReady:!1,DOMEvent:!1,DOMReady:!1,Drag:!1,Element:!1,Elements:!1,Event:!1,Events:!1,Fx:!1,Group:!1,Hash:!1,HtmlTable:!1,Iframe:!1,IframeShim:!1,InputValidator:!1,instanceOf:!1,Keyboard:!1,Locale:!1,Mask:!1,MooTools:!1,Native:!1,Options:!1,OverText:!1,Request:!1,Scroller:!1,Slick:!1,Slider:!1,Sortables:!1,Spinner:!1,Swiff:!1,Tips:!1,Type:!1,typeOf:!1,URI:!1,Window:!1},c.prototypejs={$:!1,$$:!1,$A:!1,$F:!1,$H:!1,$R:!1,$break:!1,$continue:!1,$w:!1,Abstract:!1,Ajax:!1,Class:!1,Enumerable:!1,Element:!1,Event:!1,Field:!1,Form:!1,Hash:!1,Insertion:!1,ObjectRange:!1,PeriodicalExecuter:!1,Position:!1,Prototype:!1,Selector:!1,Template:!1,Toggle:!1,Try:!1,Autocompleter:!1,Builder:!1,Control:!1,Draggable:!1,Draggables:!1,Droppables:!1,Effect:!1,Sortable:!1,SortableObserver:!1,Sound:!1,Scriptaculous:!1},c.yui={YUI:!1,Y:!1,YUI_config:!1}})()},{}],4:[function(a,b,c){"use string";c.unsafeString=/@cc|<\/?|script|\]\s*\]|<\s*!|</i,c.unsafeChars=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,c.needEsc=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,c.needEscGlobal=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c.starSlash=/\*\//,c.identifier=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,c.javascriptURL=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,c.fallsThrough=/^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/},{}],5:[function(a,b,c){"use strict";var d={syntax:{},reset:function(){this.tokens={prev:null,next:null,curr:null},this.option={},this.ignored={},this.directive={},this.jsonMode=!1,this.jsonWarnings=[],this.lines=[],this.tab="",this.cache={}}};c.state=d},{}],6:[function(a,b,c){(function(){"use strict";c.register=function(a){a.on("Identifier",function(b){a.getOption("proto")||"__proto__"===b.name&&a.warn("W103",{line:b.line,"char":b.char,data:[b.name]})}),a.on("Identifier",function(b){a.getOption("iterator")||"__iterator__"===b.name&&a.warn("W104",{line:b.line,"char":b.char,data:[b.name]})}),a.on("Identifier",function(b){a.getOption("nomen")&&"_"!==b.name&&(a.getOption("node")&&/^(__dirname|__filename)$/.test(b.name)&&!b.isProperty||/^(_+.*|.*_+)$/.test(b.name)&&a.warn("W105",{line:b.line,"char":b.from,data:["dangling '_'",b.name]}))}),a.on("Identifier",function(b){a.getOption("camelcase")&&b.name.replace(/^_+/,"").indexOf("_")>-1&&!b.name.match(/^[A-Z0-9_]*$/)&&a.warn("W106",{line:b.line,"char":b.from,data:[b.name]})}),a.on("String",function(b){var d,c=a.getOption("quotmark");c&&("single"===c&&"'"!==b.quote&&(d="W109"),"double"===c&&'"'!==b.quote&&(d="W108"),c===!0&&(a.getCache("quotmark")||a.setCache("quotmark",b.quote),a.getCache("quotmark")!==b.quote&&(d="W110")),d&&a.warn(d,{line:b.line,"char":b.char}))}),a.on("Number",function(b){"."===b.value.charAt(0)&&a.warn("W008",{line:b.line,"char":b.char,data:[b.value]}),"."===b.value.substr(b.value.length-1)&&a.warn("W047",{line:b.line,"char":b.char,data:[b.value]}),/^00+/.test(b.value)&&a.warn("W046",{line:b.line,"char":b.char,data:[b.value]})}),a.on("String",function(b){var c=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i;a.getOption("scripturl")||c.test(b.value)&&a.warn("W107",{line:b.line,"char":b.char})})}})()},{}],7:[function(a,b){(function(c){function n(){}function o(){g.log.apply(g,arguments)}function p(){g.log.apply(g,arguments)}function q(){g.warn.apply(g,arguments)}function r(a){h[a]=Date.now()}function s(a){var b=h[a];if(!b)throw Error("No such label: "+a);var c=Date.now()-b;g.log(a+": "+c+"ms")}function t(){var a=Error();a.name="Trace",a.message=d.format.apply(null,arguments),g.error(a.stack)}function u(a){g.log(d.inspect(a)+"\n")}function e(a){if(!a){var b=f.call(arguments,1);e.ok(!1,d.format.apply(null,b))}}var g,d=a("util"),e=a("assert"),f=Array.prototype.slice,h={};g=c!==void 0&&c.console?c.console:"undefined"!=typeof window&&window.console?window.console:window.console={};for(var i=[[n,"log"],[o,"info"],[p,"warn"],[q,"error"],[r,"time"],[s,"timeEnd"],[t,"trace"],[u,"dir"],[e,"assert"]],j=0;i.length>j;j++){var k=i[j],l=k[0],m=k[1];g[m]||(g[m]=l)}b.exports=g})(window)},{util:8,assert:9}],jshint:[function(a,b){b.exports=a("E/GbHF")},{}],"E/GbHF":[function(a,b,c){(function(){var b=a("underscore"),d=a("events"),e=a("../shared/vars.js"),f=a("../shared/messages.js"),g=a("./lex.js").Lexer,h=a("./reg.js"),i=a("./state.js").state,j=a("./style.js");a("console-browserify");var l=function(){"use strict";function M(a,b){return a=a.trim(),/^[+-]W\d{3}$/g.test(a)?!0:void 0===n[a]&&void 0===m[a]&&"jslint"!==b.type?(Y("E001",b,a),!1):!0}function N(a){return"[object String]"===Object.prototype.toString.call(a)}function O(a,b){return a?a.identifier&&a.value===b?!0:!1:!1}function P(a){if(!a.reserved)return!1;if(a.meta&&a.meta.isFutureReservedWord){if(i.option.inES5(!0)&&!a.meta.es5)return!1;if(a.meta.strictOnly&&!i.option.strict&&!i.directive["use strict"])return!1;if(a.isProperty)return!1}return!0}function Q(a,b){return a.replace(/\{([^{}]*)\}/g,function(a,c){var d=b[c];return"string"==typeof d||"number"==typeof d?d:a})}function R(a,c){var d;for(d in c)b.has(c,d)&&!b.has(l.blacklist,d)&&(a[d]=c[d])}function S(){Object.keys(l.blacklist).forEach(function(a){delete E[a]})}function T(){i.option.es5&&W("I003"),i.option.couch&&R(E,e.couch),i.option.rhino&&R(E,e.rhino),i.option.shelljs&&R(E,e.shelljs),i.option.phantom&&R(E,e.phantom),i.option.prototypejs&&R(E,e.prototypejs),i.option.node&&R(E,e.node),i.option.devel&&R(E,e.devel),i.option.dojo&&R(E,e.dojo),i.option.browser&&R(E,e.browser),i.option.nonstandard&&R(E,e.nonstandard),i.option.jquery&&R(E,e.jquery),i.option.mootools&&R(E,e.mootools),i.option.worker&&R(E,e.worker),i.option.wsh&&R(E,e.wsh),i.option.globalstrict&&i.option.strict!==!1&&(i.option.strict=!0),i.option.yui&&R(E,e.yui),i.option.inMoz=function(a){return a?i.option.moz&&!i.option.esnext:i.option.moz},i.option.inESNext=function(a){return a?!i.option.moz&&i.option.esnext:i.option.moz||i.option.esnext},i.option.inES5=function(){return!i.option.es3},i.option.inES3=function(a){return a?!i.option.moz&&!i.option.esnext&&i.option.es3:i.option.es3}}function U(a,b,c){var d=Math.floor(100*(b/i.lines.length)),e=f.errors[a].desc;throw{name:"JSHintError",line:b,character:c,message:e+" ("+d+"% scanned).",raw:e}}function V(a,b,c,d){return l.undefs.push([a,b,c,d])}function W(a,b,c,d,e,g){var h,j,k,m;if(/^W\d{3}$/.test(a)){if(i.ignored[a])return;m=f.warnings[a]}else/E\d{3}/.test(a)?m=f.errors[a]:/I\d{3}/.test(a)&&(m=f.info[a]);return b=b||i.tokens.next,"(end)"===b.id&&(b=i.tokens.curr),j=b.line||0,h=b.from||0,k={id:"(error)",raw:m.desc,code:m.code,evidence:i.lines[j-1]||"",line:j,character:h,scope:l.scope,a:c,b:d,c:e,d:g},k.reason=Q(m.desc,k),l.errors.push(k),i.option.passfail&&U("E042",j,h),J+=1,J>=i.option.maxerr&&U("E043",j,h),k}function X(a,b,c,d,e,f,g){return W(a,{line:b,from:c},d,e,f,g)}function Y(a,b,c,d,e,f){W(a,b,c,d,e,f)}function Z(a,b,c,d,e,f,g){return Y(a,{line:b,from:c},d,e,f,g)}function $(a,b){var c;return c={id:"(internal)",elem:a,value:b},l.internals.push(c),c}function _(a,c,d,e){"exception"===c&&b.has(t["(context)"],a)&&(t[a]===!0||i.option.node||W("W002",i.tokens.next,a)),b.has(t,a)&&!t["(global)"]&&(t[a]===!0?i.option.latedef&&(i.option.latedef===!0&&b.contains([t[a],c],"unction")||!b.contains([t[a],c],"unction"))&&W("W003",i.tokens.next,a):(!i.option.shadow&&"exception"!==c||t["(blockscope)"].getlabel(a))&&W("W004",i.tokens.next,a)),t["(blockscope)"]&&t["(blockscope)"].current.has(a)&&Y("E044",i.tokens.next,a),e?t["(blockscope)"].current.add(a,c,i.tokens.curr):(t[a]=c,d&&(t["(tokens)"][a]=d),t["(global)"]?(v[a]=t,b.has(w,a)&&(i.option.latedef&&(i.option.latedef===!0&&b.contains([t[a],c],"unction")||!b.contains([t[a],c],"unction"))&&W("W003",i.tokens.next,a),delete w[a])):F[a]=t)}function ab(){var a=i.tokens.next,c=a.body.split(",").map(function(a){return a.trim()}),d={};if("globals"===a.type){c.forEach(function(a){a=a.split(":");var b=a[0],c=a[1];"-"===b.charAt(0)?(b=b.slice(1),c=!1,l.blacklist[b]=b,S()):d[b]="true"===c}),R(E,d);for(var e in d)b.has(d,e)&&(q[e]=a)}"exported"===a.type&&c.forEach(function(a){r[a]=!0}),"members"===a.type&&(C=C||{},c.forEach(function(a){var b=a.charAt(0),c=a.charAt(a.length-1);b!==c||'"'!==b&&"'"!==b||(a=a.substr(1,a.length-2).replace("\\b","\b").replace("\\t"," ").replace("\\n","\n").replace("\\v"," ").replace("\\f","\f").replace("\\r","\r").replace("\\\\","\\").replace('\\"','"')),C[a]=!1}));var f=["maxstatements","maxparams","maxdepth","maxcomplexity","maxerr","maxlen","indent"];("jshint"===a.type||"jslint"===a.type)&&(c.forEach(function(b){b=b.split(":");var c=(b[0]||"").trim(),d=(b[1]||"").trim();if(M(c,a))if(f.indexOf(c)>=0)if("false"!==d){if(d=+d,"number"!=typeof d||!isFinite(d)||0>=d||Math.floor(d)!==d)return Y("E032",a,b[1].trim()),void 0;"indent"===c&&(i.option["(explicitIndent)"]=!0),i.option[c]=d}else"indent"===c?i.option["(explicitIndent)"]=!1:i.option[c]=!1;else{if("validthis"===c)return t["(global)"]?Y("E009"):"true"===d||"false"===d?i.option.validthis="true"===d:Y("E002",a),void 0;if("quotmark"!==c)if("unused"!==c){if("latedef"!==c){var e=/^([+-])(W\d{3})$/g.exec(c);if(e)return i.ignored[e[2]]="-"===e[1],void 0;var g;return"true"===d||"false"===d?("jslint"===a.type?(g=p[c]||c,i.option[g]="true"===d,void 0!==o[g]&&(i.option[g]=!i.option[g])):i.option[c]="true"===d,"newcap"===c&&(i.option["(explicitNewcap)"]=!0),void 0):(Y("E002",a),void 0)}switch(d){case"true":i.option.latedef=!0;break;case"false":i.option.latedef=!1;break;case"nofunc":i.option.latedef="nofunc";break;default:Y("E002",a)}}else switch(d){case"true":i.option.unused=!0;break;case"false":i.option.unused=!1;break;case"vars":case"strict":i.option.unused=d;break;default:Y("E002",a)}else switch(d){case"true":case"false":i.option.quotmark="true"===d;break;case"double":case"single":i.option.quotmark=d;break;default:Y("E002",a)}}}),T())}function bb(a){for(var d,b=a||0,c=0;b>=c;)d=z[c],d||(d=z[c]=A.token()),c+=1;return d}function cb(b,c){switch(i.tokens.curr.id){case"(number)":"."===i.tokens.next.id&&W("W005",i.tokens.curr);break;case"-":("-"===i.tokens.next.id||"--"===i.tokens.next.id)&&W("W006");break;case"+":("+"===i.tokens.next.id||"++"===i.tokens.next.id)&&W("W007")}for(("(string)"===i.tokens.curr.type||i.tokens.curr.identifier)&&(a=i.tokens.curr.value),b&&i.tokens.next.id!==b&&(c?"(end)"===i.tokens.next.id?Y("E019",c,c.id):Y("E020",i.tokens.next,b,c.id,c.line,i.tokens.next.value):("(identifier)"!==i.tokens.next.type||i.tokens.next.value!==b)&&W("W116",i.tokens.next,b,i.tokens.next.value)),i.tokens.prev=i.tokens.curr,i.tokens.curr=i.tokens.next;;){if(i.tokens.next=z.shift()||A.token(),i.tokens.next||U("E041",i.tokens.curr.line),"(end)"===i.tokens.next.id||"(error)"===i.tokens.next.id)return;if(i.tokens.next.check&&i.tokens.next.check(),i.tokens.next.isSpecial)ab();else if("(endline)"!==i.tokens.next.id)break}}function db(b,c){var d,e=!1,f=!1,g=!1;if(c||"let"!==i.tokens.next.value||"("!==bb(0).value||(i.option.inMoz(!0)||W("W118",i.tokens.next,"let expressions"),g=!0,t["(blockscope)"].stack(),cb("let"),cb("("),i.syntax.let.fud.call(i.syntax.let.fud,!1),cb(")")),"(end)"===i.tokens.next.id&&Y("E006",i.tokens.curr),cb(),c&&(a="anonymous",t["(verb)"]=i.tokens.curr.value),c===!0&&i.tokens.curr.fud)d=i.tokens.curr.fud();else{i.tokens.curr.nud?d=i.tokens.curr.nud():Y("E030",i.tokens.curr,i.tokens.curr.id);for(var h=i.tokens.next.identifier&&!i.tokens.curr.led&&i.tokens.curr.line!==i.tokens.next.line;i.tokens.next.lbp>b&&!h;)e="Array"===i.tokens.curr.value,f="Object"===i.tokens.curr.value,d&&(d.value||d.first&&d.first.value)&&("new"!==d.value||d.first&&d.first.value&&"."===d.first.value)&&(e=!1,d.value!==i.tokens.curr.value&&(f=!1)),cb(),e&&"("===i.tokens.curr.id&&")"===i.tokens.next.id&&W("W009",i.tokens.curr),f&&"("===i.tokens.curr.id&&")"===i.tokens.next.id&&W("W010",i.tokens.curr),d&&i.tokens.curr.led?d=i.tokens.curr.led(d):Y("E033",i.tokens.curr,i.tokens.curr.id)}return g&&t["(blockscope)"].unstack(),d}function eb(a,b){a=a||i.tokens.curr,b=b||i.tokens.next,i.option.white&&a.character!==b.from&&a.line===b.line&&(a.from+=a.character-a.from,W("W011",a,a.value))}function fb(a,b){a=a||i.tokens.curr,b=b||i.tokens.next,!i.option.white||a.character===b.from&&a.line===b.line||W("W012",b,b.value)}function gb(a,b){a=a||i.tokens.curr,b=b||i.tokens.next,i.option.white&&!a.comment&&a.line===b.line&&eb(a,b)}function hb(a,b){if(i.option.white){if(a=a||i.tokens.curr,b=b||i.tokens.next,";"===a.value&&";"===b.value)return;a.line===b.line&&a.character===b.from&&(a.from+=a.character-a.from,W("W013",a,a.value))}}function ib(a,b){a=a||i.tokens.curr,b=b||i.tokens.next,i.option.laxbreak||a.line===b.line?i.option.white&&(a=a||i.tokens.curr,b=b||i.tokens.next,a.character===b.from&&(a.from+=a.character-a.from,W("W013",a,a.value))):W("W014",b,b.id)}function jb(a){if((i.option.white||i.option["(explicitIndent)"])&&"(end)"!==i.tokens.next.id){var b=y+(a||0);i.tokens.next.from!==b&&W("W015",i.tokens.next,i.tokens.next.value,b,i.tokens.next.from)}}function kb(a){a=a||i.tokens.curr,a.line!==i.tokens.next.line&&W("E022",a,a.value)}function lb(a){if(a=a||{},a.peek||(i.tokens.curr.line!==i.tokens.next.line?i.option.laxcomma||(lb.first&&(W("I001"),lb.first=!1),W("W014",i.tokens.curr,i.tokens.next.value)):!i.tokens.curr.comment&&i.tokens.curr.character!==i.tokens.next.from&&i.option.white&&(i.tokens.curr.from+=i.tokens.curr.character-i.tokens.curr.from,W("W011",i.tokens.curr,i.tokens.curr.value)),cb(",")),"]"!==i.tokens.next.value&&"}"!==i.tokens.next.value&&hb(i.tokens.curr,i.tokens.next),i.tokens.next.identifier&&(!a.property||!i.option.inES5()))switch(i.tokens.next.value){case"break":case"case":case"catch":case"continue":case"default":case"do":case"else":case"finally":case"for":case"if":case"in":case"instanceof":case"return":case"yield":case"switch":case"throw":case"try":case"var":case"let":case"while":case"with":return Y("E024",i.tokens.next,i.tokens.next.value),!1}if("(punctuator)"===i.tokens.next.type)switch(i.tokens.next.value){case"}":case"]":case",":if(a.allowTrailing)return!0;case")":return Y("E024",i.tokens.next,i.tokens.next.value),!1}return!0}function mb(a,b){var c=i.syntax[a];return c&&"object"==typeof c||(i.syntax[a]=c={id:a,lbp:b,value:a}),c}function nb(a){return mb(a,0)}function ob(a,b){var c=nb(a);return c.identifier=c.reserved=!0,c.fud=b,c}function pb(a,b){var c=ob(a,b);return c.block=!0,c}function qb(a){var b=a.id.charAt(0);return(b>="a"&&"z">=b||b>="A"&&"Z">=b)&&(a.identifier=a.reserved=!0),a}function rb(a,b){var c=mb(a,150);return qb(c),c.nud="function"==typeof b?b:function(){return this.right=db(150),this.arity="unary",("++"===this.id||"--"===this.id)&&(i.option.plusplus?W("W016",this,this.id):this.right.identifier&&!P(this.right)||"."===this.right.id||"["===this.right.id||W("W017",this)),this},c}function sb(a,b){var c=nb(a);return c.type=a,c.nud=b,c}function tb(a,b){var c=sb(a,b);return c.identifier=!0,c.reserved=!0,c}function ub(a,b){var c=sb(a,b&&b.nud||function(){return this});return b=b||{},b.isFutureReservedWord=!0,c.value=a,c.identifier=!0,c.reserved=!0,c.meta=b,c}function vb(a,b){return tb(a,function(){return"function"==typeof b&&b(this),this})}function wb(a,b,c,d){var e=mb(a,c);return qb(e),e.led=function(e){return d||(ib(i.tokens.prev,i.tokens.curr),hb(i.tokens.curr,i.tokens.next)),"in"===a&&"!"===e.id&&W("W018",e,"!"),"function"==typeof b?b(e,this):(this.left=e,this.right=db(c),this)},e}function xb(a){var b=mb(a,42);return b.led=function(a){return i.option.inESNext()||W("W104",i.tokens.curr,"arrow function syntax (=>)"),ib(i.tokens.prev,i.tokens.curr),hb(i.tokens.curr,i.tokens.next),this.left=a,this.right=Qb(void 0,void 0,!1,a),this},b}function yb(a,b){var c=mb(a,100);return c.led=function(a){ib(i.tokens.prev,i.tokens.curr),hb(i.tokens.curr,i.tokens.next);var c=db(100);return O(a,"NaN")||O(c,"NaN")?W("W019",this):b&&b.apply(this,[a,c]),a&&c||U("E041",i.tokens.curr.line),"!"===a.id&&W("W018",a,"!"),"!"===c.id&&W("W018",c,"!"),this.left=a,this.right=c,this},c}function zb(a){return a&&("(number)"===a.type&&0===+a.value||"(string)"===a.type&&""===a.value||"null"===a.type&&!i.option.eqnull||"true"===a.type||"false"===a.type||"undefined"===a.type)}function Ab(a){return mb(a,20).exps=!0,wb(a,function(a,b){if(b.left=a,a){if(E[a.value]===!1&&F[a.value]["(global)"]===!0?W("W020",a):a["function"]&&W("W021",a,a.value),"const"===t[a.value]&&Y("E013",a,a.value),"."===a.id)return a.left?"arguments"!==a.left.value||i.directive["use strict"]||W("E031",b):W("E031",b),b.right=db(19),b;if("["===a.id)return i.tokens.curr.left.first?i.tokens.curr.left.first.forEach(function(a){"const"===t[a.value]&&Y("E013",a,a.value)}):a.left?"arguments"!==a.left.value||i.directive["use strict"]||W("E031",b):W("E031",b),b.right=db(19),b;if(a.identifier&&!P(a))return"exception"===t[a.value]&&W("W022",a),b.right=db(19),b;a===i.syntax["function"]&&W("W023",i.tokens.curr)}Y("E031",b)},20)}function Bb(a,b,c){var d=mb(a,c);return qb(d),d.led="function"==typeof b?b:function(a){return i.option.bitwise&&W("W016",this,this.id),this.left=a,this.right=db(c),this},d}function Cb(a){return mb(a,20).exps=!0,wb(a,function(a,b){return i.option.bitwise&&W("W016",b,b.id),hb(i.tokens.prev,i.tokens.curr),hb(i.tokens.curr,i.tokens.next),a?"."===a.id||"["===a.id||a.identifier&&!P(a)?(db(19),b):(a===i.syntax["function"]&&W("W023",i.tokens.curr),b):(Y("E031",b),void 0)},20)}function Db(a){var b=mb(a,150);return b.led=function(a){return i.option.plusplus?W("W016",this,this.id):a.identifier&&!P(a)||"."===a.id||"["===a.id||W("W017",this),this.left=a,this},b}function Eb(a,b){if(i.tokens.next.identifier){cb();var d=i.tokens.curr,e=d.meta||{},f=i.tokens.curr.value;return P(d)?b&&(i.option.inES5()||e.isFutureReservedWord)?f:a&&"undefined"===f?f:(b&&!c.getCache("displayed:I002")&&(c.setCache("displayed:I002",!0),W("I002")),W("W024",i.tokens.curr,i.tokens.curr.id),f):f}}function Fb(a,b){var c=Eb(a,b);return c?c:("function"===i.tokens.curr.id&&"("===i.tokens.next.id?W("W025"):Y("E030",i.tokens.next,i.tokens.next.value),void 0)}function Gb(a){var c,b=0;if(";"===i.tokens.next.id&&!D)for(;;){if(c=bb(b),c.reach)return;if("(endline)"!==c.id){if("function"===c.id){if(!i.option.latedef)break;W("W026",c);break}W("W027",c,c.value,a);break}b+=1}}function Hb(a){var c,e,d=y,f=F,g=i.tokens.next;if(";"===g.id)return cb(";"),void 0;var h=P(g);return h&&g.meta&&g.meta.isFutureReservedWord&&":"===bb().id&&(W("W024",g,g.id),h=!1),b.has(["[","{"],g.value)&&_b().isDestAssign?(i.option.inESNext()||W("W104",i.tokens.curr,"destructuring expression"),c=Ub(),c.forEach(function(a){V(t,"W117",a.token,a.id)}),cb("="),Vb(c,db(5,!0)),cb(";"),void 0):(g.identifier&&!h&&":"===bb().id&&(cb(),cb(":"),F=Object.create(f),_(g.value,"label"),i.tokens.next.labelled||"{"===i.tokens.next.value||W("W028",i.tokens.next,g.value,i.tokens.next.value),i.tokens.next.label=g.value,g=i.tokens.next),"{"===g.id?(Kb(!0,!0),void 0):(a||jb(),e=db(0,!0),g.block||(i.option.expr||e&&e.exps?i.option.nonew&&e&&e.left&&"("===e.id&&"new"===e.left.id&&W("W031",g):W("W030",i.tokens.curr),";"!==i.tokens.next.id?i.option.asi||i.option.lastsemic&&"}"===i.tokens.next.id&&i.tokens.next.line===i.tokens.curr.line||X("W033",i.tokens.curr.line,i.tokens.curr.character):(eb(i.tokens.curr,i.tokens.next),cb(";"),hb(i.tokens.curr,i.tokens.next))),y=d,F=f,e))}function Ib(a){for(var c,b=[];!i.tokens.next.reach&&"(end)"!==i.tokens.next.id;)";"===i.tokens.next.id?(c=bb(),(!c||"("!==c.id&&"["!==c.id)&&W("W032"),cb(";")):b.push(Hb(a===i.tokens.next.line));return b}function Jb(){for(var a,b,c;"(string)"===i.tokens.next.id;){if(b=bb(0),"(endline)"===b.id){a=1;do c=bb(a),a+=1;while("(endline)"===c.id);if(";"!==c.id){if("(string)"!==c.id&&"(number)"!==c.id&&"(regexp)"!==c.id&&c.identifier!==!0&&"}"!==c.id)break;W("W033",i.tokens.next)}else b=c}else if("}"===b.id)W("W033",b);else if(";"!==b.id)break;jb(),cb(),i.directive[i.tokens.curr.value]&&W("W034",i.tokens.curr,i.tokens.curr.value),"use strict"===i.tokens.curr.value&&(i.option["(explicitNewcap)"]||(i.option.newcap=!0),i.option.undef=!0),i.directive[i.tokens.curr.value]=!0,";"===b.id&&cb(";")}}function Kb(a,c,d,e){var f,j,l,m,n,g=x,h=y,k=F;x=a,a&&i.option.funcscope||(F=Object.create(F)),hb(i.tokens.curr,i.tokens.next),l=i.tokens.next;var o=t["(metrics)"];if(o.nestedBlockDepth+=1,o.verifyMaxNestedBlockDepthPerFunction(),"{"===i.tokens.next.id){if(cb("{"),t["(blockscope)"].stack(),m=i.tokens.curr.line,"}"!==i.tokens.next.id){for(y+=i.option.indent;!a&&i.tokens.next.from>y;)y+=i.option.indent; +if(d){j={};for(n in i.directive)b.has(i.directive,n)&&(j[n]=i.directive[n]);Jb(),i.option.strict&&t["(context)"]["(global)"]&&(j["use strict"]||i.directive["use strict"]||W("E007"))}f=Ib(m),o.statementCount+=f.length,d&&(i.directive=j),y-=i.option.indent,m!==i.tokens.next.line&&jb()}else m!==i.tokens.next.line&&jb();cb("}",l),t["(blockscope)"].unstack(),y=h}else if(a)t["(nolet)"]=!0,(!c||i.option.curly)&&W("W116",i.tokens.next,"{",i.tokens.next.value),D=!0,y+=i.option.indent,f=[Hb(i.tokens.next.line===i.tokens.curr.line)],y-=i.option.indent,D=!1,delete t["(nolet)"];else if(d){if(j={},!c||e||i.option.inMoz(!0)||Y("W118",i.tokens.curr,"function closure expressions"),!c)for(n in i.directive)b.has(i.directive,n)&&(j[n]=i.directive[n]);db(5),i.option.strict&&t["(context)"]["(global)"]&&(j["use strict"]||i.directive["use strict"]||W("E007"))}else Y("E021",i.tokens.next,"{",i.tokens.next.value);return t["(verb)"]=null,a&&i.option.funcscope||(F=k),x=g,!a||!i.option.noempty||f&&0!==f.length||W("W035"),o.nestedBlockDepth-=1,f}function Lb(a){C&&"boolean"!=typeof C[a]&&W("W036",i.tokens.curr,a),"number"==typeof B[a]?B[a]+=1:B[a]=1}function Mb(a){var b=a.value,c=a.line,d=w[b];"function"==typeof d&&(d=!1),d?d[d.length-1]!==c&&d.push(c):(d=[c],w[b]=d)}function Nb(){var a={};return a.exps=!0,t["(comparray)"].stack(),a.right=db(5),cb("for"),"each"===i.tokens.next.value&&(cb("each"),i.option.inMoz(!0)||W("W118",i.tokens.curr,"for each")),cb("("),t["(comparray)"].setState("define"),a.left=db(5),cb(")"),"if"===i.tokens.next.value&&(cb("if"),cb("("),t["(comparray)"].setState("filter"),a.filter=db(5),cb(")")),cb("]"),t["(comparray)"].unstack(),a}function Ob(){var a=Eb(!1,!0);return a||("(string)"===i.tokens.next.id?(a=i.tokens.next.value,cb()):"(number)"===i.tokens.next.id&&(a=""+i.tokens.next.value,cb())),"hasOwnProperty"===a&&W("W001"),a}function Pb(a){var c,d,f,h,e=[],g=[];if(a){if(a instanceof Array){for(var j in a)if(c=a[j],b.contains(["{","["],c.id))for(h in c.left)h=g[h],h.id&&(e.push(h.id),_(h.id,"unused",h.token));else{if("..."===c.value){i.option.inESNext()||W("W104",c,"spread/rest operator");continue}_(c.value,"unused",c)}return e}if(a.identifier===!0)return _(a.value,"unused",a),[a]}if(d=i.tokens.next,cb("("),gb(),")"===i.tokens.next.id)return cb(")"),void 0;for(;;){if(b.contains(["{","["],i.tokens.next.id)){g=Ub();for(h in g)h=g[h],h.id&&(e.push(h.id),_(h.id,"unused",h.token))}else"..."===i.tokens.next.value?(i.option.inESNext()||W("W104",i.tokens.next,"spread/rest operator"),cb("..."),gb(),f=Fb(!0),e.push(f),_(f,"unused",i.tokens.curr)):(f=Fb(!0),e.push(f),_(f,"unused",i.tokens.curr));if(","!==i.tokens.next.id)return cb(")",d),gb(i.tokens.prev,i.tokens.curr),e;lb()}}function Qb(b,c,d,e){var f,g=i.option,h=i.ignored,j=F;return i.option=Object.create(i.option),i.ignored=Object.create(i.ignored),F=Object.create(F),t={"(name)":b||'"'+a+'"',"(line)":i.tokens.next.line,"(character)":i.tokens.next.character,"(context)":t,"(breakage)":0,"(loopage)":0,"(metrics)":Rb(i.tokens.next),"(scope)":F,"(statement)":c,"(tokens)":{},"(blockscope)":t["(blockscope)"],"(comparray)":t["(comparray)"]},d&&(t["(generator)"]=!0),f=t,i.tokens.curr.funct=t,u.push(t),b&&_(b,"function"),t["(params)"]=Pb(e),t["(metrics)"].verifyMaxParametersPerFunction(t["(params)"]),Kb(!1,!0,!0,e?!0:!1),d&&"yielded"!==t["(generator)"]&&Y("E047",i.tokens.curr),t["(metrics)"].verifyMaxStatementsPerFunction(),t["(metrics)"].verifyMaxComplexityPerFunction(),t["(unusedOption)"]=i.option.unused,F=j,i.option=g,i.ignored=h,t["(last)"]=i.tokens.curr.line,t["(lastcharacter)"]=i.tokens.curr.character,t=t["(context)"],f}function Rb(a){return{statementCount:0,nestedBlockDepth:-1,ComplexityCount:1,verifyMaxStatementsPerFunction:function(){i.option.maxstatements&&this.statementCount>i.option.maxstatements&&W("W071",a,this.statementCount)},verifyMaxParametersPerFunction:function(b){b=b||[],i.option.maxparams&&b.length>i.option.maxparams&&W("W072",a,b.length)},verifyMaxNestedBlockDepthPerFunction:function(){i.option.maxdepth&&this.nestedBlockDepth>0&&this.nestedBlockDepth===i.option.maxdepth+1&&W("W073",null,this.nestedBlockDepth)},verifyMaxComplexityPerFunction:function(){var b=i.option.maxcomplexity,c=this.ComplexityCount;b&&c>b&&W("W074",a,c)}}}function Sb(){t["(metrics)"].ComplexityCount+=1}function Tb(a){var b,c;switch(a&&(b=a.id,c=a.paren,","===b&&(a=a.exprs[a.exprs.length-1])&&(b=a.id,c=c||a.paren)),b){case"=":case"+=":case"-=":case"*=":case"%=":case"&=":case"|=":case"^=":case"/=":c||i.option.boss||W("W084")}}function Ub(){var a,c,d=[];i.option.inESNext()||W("W104",i.tokens.curr,"destructuring expression");var e=function(){var a;if(b.contains(["[","{"],i.tokens.next.value)){c=Ub();for(var e in c)e=c[e],d.push({id:e.id,token:e.token})}else","===i.tokens.next.value?d.push({id:null,token:i.tokens.curr}):(a=Fb(),a&&d.push({id:a,token:i.tokens.curr}))};if("["===i.tokens.next.value){for(cb("["),e();"]"!==i.tokens.next.value;)cb(","),e();cb("]")}else if("{"===i.tokens.next.value){for(cb("{"),a=Fb(),":"===i.tokens.next.value?(cb(":"),e()):d.push({id:a,token:i.tokens.curr});"}"!==i.tokens.next.value;)cb(","),a=Fb(),":"===i.tokens.next.value?(cb(":"),e()):d.push({id:a,token:i.tokens.curr});cb("}")}return d}function Vb(a,c){c.first&&b.zip(a,c.first).forEach(function(a){var b=a[0],c=a[1];b&&c?b.first=c:b&&b.first&&!c&&W("W080",b.first,b.first.value)})}function Zb(a){return i.option.inESNext()||W("W104",i.tokens.curr,"class"),a?(this.name=Fb(),_(this.name,"unused",i.tokens.curr)):i.tokens.next.identifier&&"extends"!==i.tokens.next.value&&(this.name=Fb()),$b(this),this}function $b(a){var b=i.directive["use strict"];"extends"===i.tokens.next.value&&(cb("extends"),a.heritage=db(10)),i.directive["use strict"]=!0,cb("{"),a.body=i.syntax["{"].nud(!0),i.directive["use strict"]=b}function ac(){var a=_b();a.notJson?(!i.option.inESNext()&&a.isDestAssign&&W("W104",i.tokens.curr,"destructuring assignment"),Ib()):(i.option.laxbreak=!0,i.jsonMode=!0,cc())}function cc(){function a(){var a={},b=i.tokens.next;if(cb("{"),"}"!==i.tokens.next.id)for(;;){if("(end)"===i.tokens.next.id)Y("E026",i.tokens.next,b.line);else{if("}"===i.tokens.next.id){W("W094",i.tokens.curr);break}","===i.tokens.next.id?Y("E028",i.tokens.next):"(string)"!==i.tokens.next.id&&W("W095",i.tokens.next,i.tokens.next.value)}if(a[i.tokens.next.value]===!0?W("W075",i.tokens.next,i.tokens.next.value):"__proto__"===i.tokens.next.value&&!i.option.proto||"__iterator__"===i.tokens.next.value&&!i.option.iterator?W("W096",i.tokens.next,i.tokens.next.value):a[i.tokens.next.value]=!0,cb(),cb(":"),cc(),","!==i.tokens.next.id)break;cb(",")}cb("}")}function b(){var a=i.tokens.next;if(cb("["),"]"!==i.tokens.next.id)for(;;){if("(end)"===i.tokens.next.id)Y("E027",i.tokens.next,a.line);else{if("]"===i.tokens.next.id){W("W094",i.tokens.curr);break}","===i.tokens.next.id&&Y("E028",i.tokens.next)}if(cc(),","!==i.tokens.next.id)break;cb(",")}cb("]")}switch(i.tokens.next.id){case"{":a();break;case"[":b();break;case"true":case"false":case"null":case"(number)":case"(string)":cb();break;case"-":cb("-"),i.tokens.curr.character!==i.tokens.next.from&&W("W011",i.tokens.curr),eb(i.tokens.curr,i.tokens.next),cb("(number)");break;default:Y("E003",i.tokens.next)}}var a,c,q,r,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,k={"<":!0,"<=":!0,"==":!0,"===":!0,"!==":!0,"!=":!0,">":!0,">=":!0,"+":!0,"-":!0,"*":!0,"/":!0,"%":!0},m={asi:!0,bitwise:!0,boss:!0,browser:!0,camelcase:!0,couch:!0,curly:!0,debug:!0,devel:!0,dojo:!0,eqeqeq:!0,eqnull:!0,es3:!0,es5:!0,esnext:!0,moz:!0,evil:!0,expr:!0,forin:!0,funcscope:!0,gcl:!0,globalstrict:!0,immed:!0,iterator:!0,jquery:!0,lastsemic:!0,laxbreak:!0,laxcomma:!0,loopfunc:!0,mootools:!0,multistr:!0,newcap:!0,noarg:!0,node:!0,noempty:!0,nonew:!0,nonstandard:!0,nomen:!0,onevar:!0,passfail:!0,phantom:!0,plusplus:!0,proto:!0,prototypejs:!0,rhino:!0,shelljs:!0,undef:!0,scripturl:!0,shadow:!0,smarttabs:!0,strict:!0,sub:!0,supernew:!0,trailing:!0,validthis:!0,withstmt:!0,white:!0,worker:!0,wsh:!0,yui:!0,onecase:!0,regexp:!0,regexdash:!0},n={maxlen:!1,indent:!1,maxerr:!1,predef:!1,quotmark:!1,scope:!1,maxstatements:!1,maxdepth:!1,maxparams:!1,maxcomplexity:!1,unused:!0,latedef:!1},o={bitwise:!0,forin:!0,newcap:!0,nomen:!0,plusplus:!0,regexp:!0,undef:!0,white:!0,eqeqeq:!0,onevar:!0,strict:!0},p={eqeq:"eqeqeq",vars:"onevar",windows:"wsh",sloppy:"strict"},s=["closure","exception","global","label","outer","unused","var"],K=[],L=new d.EventEmitter;sb("(number)",function(){return this}),sb("(string)",function(){return this}),i.syntax["(identifier)"]={type:"(identifier)",lbp:0,identifier:!0,nud:function(){var e,c=this.value,d=F[c];"function"==typeof d?d=void 0:"boolean"==typeof d&&(e=t,t=u[0],_(c,"var"),d=t,t=e);var f;if(b.has(t,"(blockscope)")&&(f=t["(blockscope)"].getlabel(c)),t===d||f)switch(f?f[c]["(type)"]:t[c]){case"unused":f?f[c]["(type)"]="var":t[c]="var";break;case"unction":f?f[c]["(type)"]="function":t[c]="function",this["function"]=!0;break;case"function":this["function"]=!0;break;case"label":W("W037",i.tokens.curr,c)}else if(t["(global)"])"boolean"!=typeof E[c]&&("typeof"!==a&&"delete"!==a||i.tokens.next&&("."===i.tokens.next.value||"["===i.tokens.next.value))&&(t["(comparray)"].check(c)||V(t,"W117",i.tokens.curr,c)),Mb(i.tokens.curr);else switch(t[c]){case"closure":case"function":case"var":case"unused":W("W038",i.tokens.curr,c);break;case"label":W("W037",i.tokens.curr,c);break;case"outer":case"global":break;default:if(d===!0)t[c]=!0;else if(null===d)W("W039",i.tokens.curr,c),Mb(i.tokens.curr);else if("object"!=typeof d)("typeof"!==a&&"delete"!==a||i.tokens.next&&("."===i.tokens.next.value||"["===i.tokens.next.value))&&V(t,"W117",i.tokens.curr,c),t[c]=!0,Mb(i.tokens.curr);else switch(d[c]){case"function":case"unction":this["function"]=!0,d[c]="closure",t[c]=d["(global)"]?"global":"outer";break;case"var":case"unused":d[c]="closure",t[c]=d["(global)"]?"global":"outer";break;case"closure":t[c]=d["(global)"]?"global":"outer";break;case"label":W("W037",i.tokens.curr,c)}}return this},led:function(){Y("E033",i.tokens.next,i.tokens.next.value)}},sb("(regexp)",function(){return this}),nb("(endline)"),nb("(begin)"),nb("(end)").reach=!0,nb("(error)").reach=!0,nb("}").reach=!0,nb(")"),nb("]"),nb('"').reach=!0,nb("'").reach=!0,nb(";"),nb(":").reach=!0,nb("#"),tb("else"),tb("case").reach=!0,tb("catch"),tb("default").reach=!0,tb("finally"),vb("arguments",function(a){i.directive["use strict"]&&t["(global)"]&&W("E008",a)}),vb("eval"),vb("false"),vb("Infinity"),vb("null"),vb("this",function(a){i.directive["use strict"]&&!i.option.validthis&&(t["(statement)"]&&t["(name)"].charAt(0)>"Z"||t["(global)"])&&W("W040",a)}),vb("true"),vb("undefined"),Ab("=","assign",20),Ab("+=","assignadd",20),Ab("-=","assignsub",20),Ab("*=","assignmult",20),Ab("/=","assigndiv",20).nud=function(){Y("E014")},Ab("%=","assignmod",20),Cb("&=","assignbitand",20),Cb("|=","assignbitor",20),Cb("^=","assignbitxor",20),Cb("<<=","assignshiftleft",20),Cb(">>=","assignshiftright",20),Cb(">>>=","assignshiftrightunsigned",20),wb(",",function(a,b){var c;if(b.exprs=[a],!lb({peek:!0}))return b;for(;;){if(!(c=db(5)))break;if(b.exprs.push(c),","!==i.tokens.next.value||!lb())break}return b},5,!0),wb("?",function(a,b){return b.left=a,b.right=db(10),cb(":"),b["else"]=db(10),b},30),wb("||","or",40),wb("&&","and",50),Bb("|","bitor",70),Bb("^","bitxor",80),Bb("&","bitand",90),yb("==",function(a,b){var c=i.option.eqnull&&("null"===a.value||"null"===b.value);return!c&&i.option.eqeqeq?W("W116",this,"===","=="):zb(a)?W("W041",this,"===",a.value):zb(b)&&W("W041",this,"===",b.value),this}),yb("==="),yb("!=",function(a,b){var c=i.option.eqnull&&("null"===a.value||"null"===b.value);return!c&&i.option.eqeqeq?W("W116",this,"!==","!="):zb(a)?W("W041",this,"!==",a.value):zb(b)&&W("W041",this,"!==",b.value),this}),yb("!=="),yb("<"),yb(">"),yb("<="),yb(">="),Bb("<<","shiftleft",120),Bb(">>","shiftright",120),Bb(">>>","shiftrightunsigned",120),wb("in","in",120),wb("instanceof","instanceof",120),wb("+",function(a,b){var c=db(130);return a&&c&&"(string)"===a.id&&"(string)"===c.id?(a.value+=c.value,a.character=c.character,!i.option.scripturl&&h.javascriptURL.test(a.value)&&W("W050",a),a):(b.left=a,b.right=c,b)},130),rb("+","num"),rb("+++",function(){return W("W007"),this.right=db(150),this.arity="unary",this}),wb("+++",function(a){return W("W007"),this.left=a,this.right=db(130),this},130),wb("-","sub",130),rb("-","neg"),rb("---",function(){return W("W006"),this.right=db(150),this.arity="unary",this}),wb("---",function(a){return W("W006"),this.left=a,this.right=db(130),this},130),wb("*","mult",140),wb("/","div",140),wb("%","mod",140),Db("++","postinc"),rb("++","preinc"),i.syntax["++"].exps=!0,Db("--","postdec"),rb("--","predec"),i.syntax["--"].exps=!0,rb("delete",function(){var a=db(5);return(!a||"."!==a.id&&"["!==a.id)&&W("W051"),this.first=a,this}).exps=!0,rb("~",function(){return i.option.bitwise&&W("W052",this,"~"),db(150),this}),rb("...",function(){return i.option.inESNext()||W("W104",this,"spread/rest operator"),i.tokens.next.identifier||Y("E030",i.tokens.next,i.tokens.next.value),db(150),this}),rb("!",function(){return this.right=db(150),this.arity="unary",this.right||U("E041",this.line||0),k[this.right.id]===!0&&W("W018",this,"!"),this}),rb("typeof","typeof"),rb("new",function(){var c,a=db(155);if(a&&"function"!==a.id)if(a.identifier)switch(a["new"]=!0,a.value){case"Number":case"String":case"Boolean":case"Math":case"JSON":W("W053",i.tokens.prev,a.value);break;case"Function":i.option.evil||W("W054");break;case"Date":case"RegExp":break;default:"function"!==a.id&&(c=a.value.substr(0,1),i.option.newcap&&("A">c||c>"Z")&&!b.has(v,a.value)&&W("W055",i.tokens.curr))}else"."!==a.id&&"["!==a.id&&"("!==a.id&&W("W056",i.tokens.curr);else i.option.supernew||W("W057",this);return eb(i.tokens.curr,i.tokens.next),"("===i.tokens.next.id||i.option.supernew||W("W058",i.tokens.curr,i.tokens.curr.value),this.first=a,this}),i.syntax["new"].exps=!0,rb("void").exps=!0,wb(".",function(a,b){eb(i.tokens.prev,i.tokens.curr),fb();var c=Fb(!1,!0);return"string"==typeof c&&Lb(c),b.left=a,b.right=c,c&&"hasOwnProperty"===c&&"="===i.tokens.next.value&&W("W001"),!a||"arguments"!==a.value||"callee"!==c&&"caller"!==c?i.option.evil||!a||"document"!==a.value||"write"!==c&&"writeln"!==c||W("W060",a):i.option.noarg?W("W059",a,c):i.directive["use strict"]&&Y("E008"),i.option.evil||"eval"!==c&&"execScript"!==c||W("W061"),b},160,!0),wb("(",function(a,b){"}"!==i.tokens.prev.id&&")"!==i.tokens.prev.id&&fb(i.tokens.prev,i.tokens.curr),gb(),i.option.immed&&a&&!a.immed&&"function"===a.id&&W("W062");var c=0,d=[];if(a&&"(identifier)"===a.type&&a.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)&&-1==="Number String Boolean Date Object".indexOf(a.value)&&("Math"===a.value?W("W063",a):i.option.newcap&&W("W064",a)),")"!==i.tokens.next.id)for(;d[d.length]=db(10),c+=1,","===i.tokens.next.id;)lb();return cb(")"),gb(i.tokens.prev,i.tokens.curr),"object"==typeof a&&("parseInt"===a.value&&1===c&&W("W065",i.tokens.curr),i.option.evil||("eval"===a.value||"Function"===a.value||"execScript"===a.value?(W("W061",a),d[0]&&"(string)"===[0].id&&$(a,d[0].value)):!d[0]||"(string)"!==d[0].id||"setTimeout"!==a.value&&"setInterval"!==a.value?!d[0]||"(string)"!==d[0].id||"."!==a.value||"window"!==a.left.value||"setTimeout"!==a.right&&"setInterval"!==a.right||(W("W066",a),$(a,d[0].value)):(W("W066",a),$(a,d[0].value))),a.identifier||"."===a.id||"["===a.id||"("===a.id||"&&"===a.id||"||"===a.id||"?"===a.id||W("W067",a)),b.left=a,b},155,!0).exps=!0,rb("(",function(){gb();var a,c,d,f,b=[],e=0;do c=bb(e),e+=1,d=bb(e),e+=1;while(")"!==c.value&&"=>"!==d.value&&";"!==d.value&&"(end)"!==d.type);"function"===i.tokens.next.id&&(i.tokens.next.immed=!0);var g=[];if(")"!==i.tokens.next.id)for(;;){if("=>"===d.value&&"{"===i.tokens.next.value){a=i.tokens.next,a.left=Ub(),b.push(a);for(var h in a.left)g.push(a.left[h].token)}else g.push(db(5));if(","!==i.tokens.next.id)break;lb()}return cb(")",this),gb(i.tokens.prev,i.tokens.curr),i.option.immed&&g[0]&&"function"===g[0].id&&"("!==i.tokens.next.id&&("."!==i.tokens.next.id||"call"!==bb().value&&"apply"!==bb().value)&&W("W068",this),"=>"===i.tokens.next.value?g:g.length?(g.length>1?(f=Object.create(i.syntax[","]),f.exprs=g):f=g[0],f&&(f.paren=!0),f):void 0}),xb("=>"),wb("[",function(a,b){fb(i.tokens.prev,i.tokens.curr),gb();var d,c=db(5);return c&&"(string)"===c.type&&(i.option.evil||"eval"!==c.value&&"execScript"!==c.value||W("W061",b),Lb(c.value),!i.option.sub&&h.identifier.test(c.value)&&(d=i.syntax[c.value],d&&P(d)||W("W069",i.tokens.prev,c.value))),cb("]",b),c&&"hasOwnProperty"===c.value&&"="===i.tokens.next.value&&W("W001"),gb(i.tokens.prev,i.tokens.curr),b.left=a,b.right=c,b},160,!0),rb("[",function(){var a=_b(!0);if(a.isCompArray)return i.option.inMoz(!0)||W("W118",i.tokens.curr,"array comprehension"),Nb();a.isDestAssign&&!i.option.inESNext()&&W("W104",i.tokens.curr,"destructuring assignment");var b=i.tokens.curr.line!==i.tokens.next.line;for(this.first=[],b&&(y+=i.option.indent,i.tokens.next.from===y+i.option.indent&&(y+=i.option.indent));"(end)"!==i.tokens.next.id;){for(;","===i.tokens.next.id;)i.option.inES5()||W("W070"),cb(",");if("]"===i.tokens.next.id)break;if(b&&i.tokens.curr.line!==i.tokens.next.line&&jb(),this.first.push(db(10)),","!==i.tokens.next.id)break;if(lb({allowTrailing:!0}),"]"===i.tokens.next.id&&!i.option.inES5(!0)){W("W070",i.tokens.curr);break}}return b&&(y-=i.option.indent,jb()),cb("]",this),this},160),function(a){a.nud=function(a){function l(a,c){j[a]&&b.has(j,a)?W("W075",i.tokens.next,e):j[a]={},j[a].basic=!0,j[a].basictkn=c}function m(a,c){j[a]&&b.has(j,a)?(j[a].basic||j[a].setter)&&W("W075",i.tokens.next,e):j[a]={},j[a].setter=!0,j[a].setterToken=c}function n(a){j[a]&&b.has(j,a)?(j[a].basic||j[a].getter)&&W("W075",i.tokens.next,e):j[a]={},j[a].getter=!0,j[a].getterToken=i.tokens.curr}var c,d,e,f,g,h,j={},k="";for(c=i.tokens.curr.line!==i.tokens.next.line,c&&(y+=i.option.indent,i.tokens.next.from===y+i.option.indent&&(y+=i.option.indent));"}"!==i.tokens.next.id;){if(c&&jb(),a&&"static"===i.tokens.next.value&&(cb("static"),k="static "),"get"===i.tokens.next.value&&":"!==bb().id)cb("get"),i.option.inES5(!a)||Y("E034"),e=Ob(),e||Y("E035"),a&&"constructor"===e&&Y("E049",i.tokens.next,"class getter method",e),n(k+e),g=i.tokens.next,eb(i.tokens.curr,i.tokens.next),d=Qb(),f=d["(params)"],f&&W("W076",g,f[0],e),eb(i.tokens.curr,i.tokens.next);else if("set"===i.tokens.next.value&&":"!==bb().id)cb("set"),i.option.inES5(!a)||Y("E034"),e=Ob(),e||Y("E035"),a&&"constructor"===e&&Y("E049",i.tokens.next,"class setter method",e),m(k+e,i.tokens.next),g=i.tokens.next,eb(i.tokens.curr,i.tokens.next),d=Qb(),f=d["(params)"],f&&1===f.length||W("W077",g,e);else{if(h=!1,"*"===i.tokens.next.value&&"(punctuator)"===i.tokens.next.type&&(i.option.inESNext()||W("W104",i.tokens.next,"generator functions"),cb("*"),h=!0),e=Ob(),l(k+e,i.tokens.next),"string"!=typeof e)break;"("===i.tokens.next.value?(i.option.inESNext()||W("W104",i.tokens.curr,"concise methods"),Qb(e,void 0,h)):a||(cb(":"),hb(i.tokens.curr,i.tokens.next),db(10))}if(a&&"prototype"===e&&Y("E049",i.tokens.next,"class method",e),Lb(e),a)k="";else{if(","!==i.tokens.next.id)break;lb({allowTrailing:!0,property:!0}),","===i.tokens.next.id?W("W070",i.tokens.curr):"}"!==i.tokens.next.id||i.option.inES5(!0)||W("W070",i.tokens.curr)}}if(c&&(y-=i.option.indent,jb()),cb("}",this),i.option.inES5())for(var o in j)b.has(j,o)&&j[o].setter&&!j[o].getter&&W("W078",j[o].setterToken);return this},a.fud=function(){Y("E036",i.tokens.curr)}}(nb("{"));var Wb=ob("const",function(a){var c,d,e;for(i.option.inESNext()||W("W104",i.tokens.curr,"const"),this.first=[];;){var f=[];hb(i.tokens.curr,i.tokens.next),b.contains(["{","["],i.tokens.next.value)?(c=Ub(),e=!1):(c=[{id:Fb(),token:i.tokens.curr}],e=!0);for(var g in c)g=c[g],"const"===t[g.id]&&W("E011",null,g.id),t["(global)"]&&E[g.id]===!1&&W("W079",g.token,g.id),g.id&&(_(g.id,"const"),f.push(g.token));if(a)break;if(this.first=this.first.concat(f),"="!==i.tokens.next.id&&W("E012",i.tokens.curr,i.tokens.curr.value),"="===i.tokens.next.id&&(hb(i.tokens.curr,i.tokens.next),cb("="),hb(i.tokens.curr,i.tokens.next),"undefined"===i.tokens.next.id&&W("W080",i.tokens.prev,i.tokens.prev.value),"="===bb(0).id&&i.tokens.next.identifier&&Y("E037",i.tokens.next,i.tokens.next.value),d=db(5),e?c[0].first=d:Vb(f,d)),","!==i.tokens.next.id)break;lb()}return this});Wb.exps=!0;var Xb=ob("var",function(a){var c,d,e;for(t["(onevar)"]&&i.option.onevar?W("W081"):t["(global)"]||(t["(onevar)"]=!0),this.first=[];;){var f=[];hb(i.tokens.curr,i.tokens.next),b.contains(["{","["],i.tokens.next.value)?(c=Ub(),d=!1):(c=[{id:Fb(),token:i.tokens.curr}],d=!0);for(var g in c)g=c[g],i.option.inESNext()&&"const"===t[g.id]&&W("E011",null,g.id),t["(global)"]&&E[g.id]===!1&&W("W079",g.token,g.id),g.id&&(_(g.id,"unused",g.token),f.push(g.token));if(a)break;if(this.first=this.first.concat(f),"="===i.tokens.next.id&&(hb(i.tokens.curr,i.tokens.next),cb("="),hb(i.tokens.curr,i.tokens.next),"undefined"===i.tokens.next.id&&W("W080",i.tokens.prev,i.tokens.prev.value),"="===bb(0).id&&i.tokens.next.identifier&&Y("E038",i.tokens.next,i.tokens.next.value),e=db(5),d?c[0].first=e:Vb(f,e)),","!==i.tokens.next.id)break;lb()}return this});Xb.exps=!0;var Yb=ob("let",function(a){var c,d,e,f;for(i.option.inESNext()||W("W104",i.tokens.curr,"let"),"("===i.tokens.next.value?(i.option.inMoz(!0)||W("W118",i.tokens.next,"let block"),cb("("),t["(blockscope)"].stack(),f=!0):t["(nolet)"]&&Y("E048",i.tokens.curr),t["(onevar)"]&&i.option.onevar?W("W081"):t["(global)"]||(t["(onevar)"]=!0),this.first=[];;){var g=[];hb(i.tokens.curr,i.tokens.next),b.contains(["{","["],i.tokens.next.value)?(c=Ub(),d=!1):(c=[{id:Fb(),token:i.tokens.curr.value}],d=!0);for(var h in c)h=c[h],i.option.inESNext()&&"const"===t[h.id]&&W("E011",null,h.id),t["(global)"]&&E[h.id]===!1&&W("W079",h.token,h.id),h.id&&!t["(nolet)"]&&(_(h.id,"unused",h.token,!0),g.push(h.token));if(a)break;if(this.first=this.first.concat(g),"="===i.tokens.next.id&&(hb(i.tokens.curr,i.tokens.next),cb("="),hb(i.tokens.curr,i.tokens.next),"undefined"===i.tokens.next.id&&W("W080",i.tokens.prev,i.tokens.prev.value),"="===bb(0).id&&i.tokens.next.identifier&&Y("E037",i.tokens.next,i.tokens.next.value),e=db(5),d?c[0].first=e:Vb(g,e)),","!==i.tokens.next.id)break;lb()}return f&&(cb(")"),Kb(!0,!0),this.block=!0,t["(blockscope)"].unstack()),this});Yb.exps=!0,pb("class",function(){return Zb.call(this,!0)}),pb("function",function(){var a=!1;"*"===i.tokens.next.value&&(cb("*"),i.option.inESNext(!0)?a=!0:W("W119",i.tokens.curr,"function*")),x&&W("W082",i.tokens.curr);var b=Fb();return"const"===t[b]&&W("E011",null,b),eb(i.tokens.curr,i.tokens.next),_(b,"unction",i.tokens.curr),Qb(b,{statement:!0},a),"("===i.tokens.next.id&&i.tokens.next.line===i.tokens.curr.line&&Y("E039"),this}),rb("function",function(){var a=!1;"*"===i.tokens.next.value&&(i.option.inESNext()||W("W119",i.tokens.curr,"function*"),cb("*"),a=!0);var b=Eb();return b||i.option.gcl?eb(i.tokens.curr,i.tokens.next):hb(i.tokens.curr,i.tokens.next),Qb(b,void 0,a),!i.option.loopfunc&&t["(loopage)"]&&W("W083"),this}),pb("if",function(){var a=i.tokens.next;return Sb(),i.condition=!0,cb("("),hb(this,a),gb(),Tb(db(0)),cb(")",a),i.condition=!1,gb(i.tokens.prev,i.tokens.curr),Kb(!0,!0),"else"===i.tokens.next.id&&(hb(i.tokens.curr,i.tokens.next),cb("else"),"if"===i.tokens.next.id||"switch"===i.tokens.next.id?Hb(!0):Kb(!0,!0)),this}),pb("try",function(){function b(){var b,a=F;cb("catch"),hb(i.tokens.curr,i.tokens.next),cb("("),F=Object.create(a),b=i.tokens.next.value,"(identifier)"!==i.tokens.next.type&&(b=null,W("E030",i.tokens.next,b)),cb(),t={"(name)":"(catch)","(line)":i.tokens.next.line,"(character)":i.tokens.next.character,"(context)":t,"(breakage)":t["(breakage)"],"(loopage)":t["(loopage)"],"(scope)":F,"(statement)":!1,"(metrics)":Rb(i.tokens.next),"(catch)":!0,"(tokens)":{},"(blockscope)":t["(blockscope)"],"(comparray)":t["(comparray)"]},b&&_(b,"exception"),"if"===i.tokens.next.value&&(i.option.inMoz(!0)||W("W118",i.tokens.curr,"catch filter"),cb("if"),db(0)),cb(")"),i.tokens.curr.funct=t,u.push(t),Kb(!1),F=a,t["(last)"]=i.tokens.curr.line,t["(lastcharacter)"]=i.tokens.curr.character,t=t["(context)"]}var a;for(Kb(!1);"catch"===i.tokens.next.id;)Sb(),a&&!i.option.inMoz(!0)&&W("W118",i.tokens.next,"multiple catch blocks"),b(),a=!0;return"finally"===i.tokens.next.id?(cb("finally"),Kb(!1),void 0):(a||Y("E021",i.tokens.next,"catch",i.tokens.next.value),this)}),pb("while",function(){var a=i.tokens.next;return t["(breakage)"]+=1,t["(loopage)"]+=1,Sb(),cb("("),hb(this,a),gb(),Tb(db(0)),cb(")",a),gb(i.tokens.prev,i.tokens.curr),Kb(!0,!0),t["(breakage)"]-=1,t["(loopage)"]-=1,this}).labelled=!0,pb("with",function(){var a=i.tokens.next;return i.directive["use strict"]?Y("E010",i.tokens.curr):i.option.withstmt||W("W085",i.tokens.curr),cb("("),hb(this,a),gb(),db(0),cb(")",a),gb(i.tokens.prev,i.tokens.curr),Kb(!0,!0),this}),pb("switch",function(){var a=i.tokens.next,b=!1;for(t["(breakage)"]+=1,cb("("),hb(this,a),gb(),Tb(db(0)),cb(")",a),gb(i.tokens.prev,i.tokens.curr),hb(i.tokens.curr,i.tokens.next),a=i.tokens.next,cb("{"),hb(i.tokens.curr,i.tokens.next),y+=i.option.indent,this.cases=[];;)switch(i.tokens.next.id){case"case":switch(t["(verb)"]){case"yield":case"break":case"case":case"continue":case"return":case"switch":case"throw":break;default:h.fallsThrough.test(i.lines[i.tokens.next.line-2])||W("W086",i.tokens.curr,"case")}jb(-i.option.indent),cb("case"),this.cases.push(db(20)),Sb(),b=!0,cb(":"),t["(verb)"]="case";break;case"default":switch(t["(verb)"]){case"yield":case"break":case"continue":case"return":case"throw":break;default:this.cases.length&&(h.fallsThrough.test(i.lines[i.tokens.next.line-2])||W("W086",i.tokens.curr,"default"))}jb(-i.option.indent),cb("default"),b=!0,cb(":");break;case"}":return y-=i.option.indent,jb(),cb("}",a),t["(breakage)"]-=1,t["(verb)"]=void 0,void 0;case"(end)":return Y("E023",i.tokens.next,"}"),void 0;default:if(b)switch(i.tokens.curr.id){case",":return Y("E040"),void 0;case":":b=!1,Ib();break;default:return Y("E025",i.tokens.curr),void 0}else{if(":"!==i.tokens.curr.id)return Y("E021",i.tokens.next,"case",i.tokens.next.value),void 0;cb(":"),Y("E024",i.tokens.curr,":"),Ib()}}}).labelled=!0,ob("debugger",function(){return i.option.debug||W("W087"),this}).exps=!0,function(){var a=ob("do",function(){t["(breakage)"]+=1,t["(loopage)"]+=1,Sb(),this.first=Kb(!0,!0),cb("while");var a=i.tokens.next;return hb(i.tokens.curr,a),cb("("),gb(),Tb(db(0)),cb(")",a),gb(i.tokens.prev,i.tokens.curr),t["(breakage)"]-=1,t["(loopage)"]-=1,this});a.labelled=!0,a.exps=!0}(),pb("for",function(){var a,c=i.tokens.next,d=!1,e=null;"each"===c.value&&(e=c,cb("each"),i.option.inMoz(!0)||W("W118",i.tokens.curr,"for each")),t["(breakage)"]+=1,t["(loopage)"]+=1,Sb(),cb("("),hb(this,c),gb();var f,g=0,h=["in","of"];do f=bb(g),++g;while(!b.contains(h,f.value)&&";"!==f.value&&"(end)"!==f.type);if(b.contains(h,f.value)){if(i.option.inESNext()||"of"!==f.value||Y("W104",f,"for of"),"var"===i.tokens.next.id)cb("var"),i.syntax["var"].fud.call(i.syntax["var"].fud,!0);else if("let"===i.tokens.next.id)cb("let"),d=!0,t["(blockscope)"].stack(),i.syntax.let.fud.call(i.syntax.let.fud,!0);else{switch(t[i.tokens.next.value]){case"unused":t[i.tokens.next.value]="var";break;case"var":break;default:t["(blockscope)"].getlabel(i.tokens.next.value)||W("W088",i.tokens.next,i.tokens.next.value)}cb()}cb(f.value),db(20),cb(")",c),a=Kb(!0,!0),i.option.forin&&a&&(a.length>1||"object"!=typeof a[0]||"if"!==a[0].value)&&W("W089",this),t["(breakage)"]-=1,t["(loopage)"]-=1}else{if(e&&Y("E045",e),";"!==i.tokens.next.id)if("var"===i.tokens.next.id)cb("var"),i.syntax["var"].fud.call(i.syntax["var"].fud);else if("let"===i.tokens.next.id)cb("let"),d=!0,t["(blockscope)"].stack(),i.syntax.let.fud.call(i.syntax.let.fud);else for(;db(0,"for"),","===i.tokens.next.id;)lb();if(kb(i.tokens.curr),cb(";"),";"!==i.tokens.next.id&&Tb(db(0)),kb(i.tokens.curr),cb(";"),";"===i.tokens.next.id&&Y("E021",i.tokens.next,")",";"),")"!==i.tokens.next.id)for(;db(0,"for"),","===i.tokens.next.id;)lb();cb(")",c),gb(i.tokens.prev,i.tokens.curr),Kb(!0,!0),t["(breakage)"]-=1,t["(loopage)"]-=1}return d&&t["(blockscope)"].unstack(),this}).labelled=!0,ob("break",function(){var a=i.tokens.next.value;return 0===t["(breakage)"]&&W("W052",i.tokens.next,this.value),i.option.asi||kb(this),";"===i.tokens.next.id||i.tokens.next.reach||i.tokens.curr.line===i.tokens.next.line&&("label"!==t[a]?W("W090",i.tokens.next,a):F[a]!==t&&W("W091",i.tokens.next,a),this.first=i.tokens.next,cb()),Gb("break"),this}).exps=!0,ob("continue",function(){var a=i.tokens.next.value;return 0===t["(breakage)"]&&W("W052",i.tokens.next,this.value),i.option.asi||kb(this),";"===i.tokens.next.id||i.tokens.next.reach?t["(loopage)"]||W("W052",i.tokens.next,this.value):i.tokens.curr.line===i.tokens.next.line&&("label"!==t[a]?W("W090",i.tokens.next,a):F[a]!==t&&W("W091",i.tokens.next,a),this.first=i.tokens.next,cb()),Gb("continue"),this}).exps=!0,ob("return",function(){return this.line===i.tokens.next.line?("(regexp)"===i.tokens.next.id&&W("W092"),";"===i.tokens.next.id||i.tokens.next.reach||(hb(i.tokens.curr,i.tokens.next),this.first=db(0),this.first&&"(punctuator)"===this.first.type&&"="===this.first.value&&!i.option.boss&&X("W093",this.first.line,this.first.character))):"(punctuator)"===i.tokens.next.type&&["[","{","+","-"].indexOf(i.tokens.next.value)>-1&&kb(this),Gb("return"),this}).exps=!0,ob("yield",function(){return i.option.inESNext(!0)&&t["(generator)"]!==!0?Y("E046",i.tokens.curr,"yield"):i.option.inESNext()||W("W104",i.tokens.curr,"yield"),t["(generator)"]="yielded",this.line===i.tokens.next.line?("(regexp)"===i.tokens.next.id&&W("W092"),";"===i.tokens.next.id||i.tokens.next.reach||(hb(i.tokens.curr,i.tokens.next),this.first=db(0),"(punctuator)"!==this.first.type||"="!==this.first.value||i.option.boss||X("W093",this.first.line,this.first.character))):i.option.asi||kb(this),this}).exps=!0,ob("throw",function(){return kb(this),hb(i.tokens.curr,i.tokens.next),this.first=db(20),Gb("throw"),this}).exps=!0,ub("abstract"),ub("boolean"),ub("byte"),ub("char"),ub("class",{es5:!0,nud:Zb}),ub("double"),ub("enum",{es5:!0}),ub("export",{es5:!0}),ub("extends",{es5:!0}),ub("final"),ub("float"),ub("goto"),ub("implements",{es5:!0,strictOnly:!0}),ub("import",{es5:!0}),ub("int"),ub("interface",{es5:!0,strictOnly:!0}),ub("long"),ub("native"),ub("package",{es5:!0,strictOnly:!0}),ub("private",{es5:!0,strictOnly:!0}),ub("protected",{es5:!0,strictOnly:!0}),ub("public",{es5:!0,strictOnly:!0}),ub("short"),ub("static",{es5:!0,strictOnly:!0}),ub("super",{es5:!0}),ub("synchronized"),ub("throws"),ub("transient"),ub("volatile");var _b=function(){var a,c,d=0,e=0,f={};b.contains(["[","{"],i.tokens.curr.value)&&(e+=1),b.contains(["[","{"],i.tokens.next.value)&&(e+=1),b.contains(["]","}"],i.tokens.next.value)&&(e-=1);do{if(a=bb(d),c=bb(d+1),d+=1,b.contains(["[","{"],a.value)?e+=1:b.contains(["]","}"],a.value)&&(e-=1),a.identifier&&"for"===a.value&&1===e){f.isCompArray=!0,f.notJson=!0;break}if(b.contains(["}","]"],a.value)&&"="===c.value){f.isDestAssign=!0,f.notJson=!0;break}";"===a.value&&(f.isBlock=!0,f.notJson=!0)}while(e>0&&"(end)"!==a.id&&15>d);return f},bc=function(){function e(a){var b=d.variables.filter(function(b){return b.value===a?(b.undef=!1,a):void 0}).length;return 0!==b}function f(a){var b=d.variables.filter(function(b){return b.value!==a||b.undef?void 0:(b.unused===!0&&(b.unused=!1),a)}).length;return 0===b}var d,a=function(){this.mode="use",this.variables=[]},c=[];return{stack:function(){d=new a,c.push(d)},unstack:function(){d.variables.filter(function(a){a.unused&&W("W098",a.token,a.value),a.undef&&V(a.funct,"W117",a.token,a.value)}),c.splice(c[c.length-1],1),d=c[c.length-1]},setState:function(a){b.contains(["use","define","filter"],a)&&(d.mode=a)},check:function(a){return d&&"use"===d.mode?(d.variables.push({funct:t,token:i.tokens.curr,value:a,undef:!0,unused:!1}),!0):d&&"define"===d.mode?(e(a)||d.variables.push({funct:t,token:i.tokens.curr,value:a,undef:!1,unused:!0}),!0):d&&"filter"===d.mode?(f(a)&&V(t,"W117",i.tokens.curr,a),!0):!1 +}}},dc=function(){function d(){for(var b in a)if("unused"===a[b]["(type)"]&&i.option.unused){var c=a[b]["(token)"],d=c.line,e=c.character;X("W098",d,e,b)}}var a={},c=[a];return{stack:function(){a={},c.push(a)},unstack:function(){d(),c.splice(c.length-1,1),a=b.last(c)},getlabel:function(a){for(var d=c.length-1;d>=0;--d)if(b.has(c[d],a))return c[d]},current:{has:function(c){return b.has(a,c)},add:function(b,c,d){a[b]={"(type)":c,"(token)":d}}}}},ec=function(a,d,f){function p(a,b){a&&(Array.isArray(a)||"object"!=typeof a||(a=Object.keys(a)),a.forEach(b))}var h,j,k,m,n={},o={};if(i.reset(),d&&d.scope?l.scope=d.scope:(l.errors=[],l.undefs=[],l.internals=[],l.blacklist={},l.scope="(main)"),E=Object.create(null),R(E,e.ecmaIdentifiers),R(E,e.reservedVars),R(E,f||{}),q=Object.create(null),r=Object.create(null),d)for(p(d.predef||null,function(a){var b,c;"-"===a[0]?(b=a.slice(1),l.blacklist[b]=b):(c=Object.getOwnPropertyDescriptor(d.predef,a),E[a]=c?c.value:!1)}),p(d.exported||null,function(a){r[a]=!0}),delete d.predef,delete d.exported,m=Object.keys(d),k=0;m.length>k;k++)/^-W\d{3}$/g.test(m[k])?o[m[k].slice(1)]=!0:(n[m[k]]=d[m[k]],"newcap"===m[k]&&d[m[k]]===!1&&(n["(explicitNewcap)"]=!0),"indent"===m[k]&&(n["(explicitIndent)"]=d[m[k]]===!1?!1:!0));if(i.option=n,i.ignored=o,i.option.indent=i.option.indent||4,i.option.maxerr=i.option.maxerr||50,y=1,v=Object.create(E),F=v,t={"(global)":!0,"(name)":"(global)","(scope)":F,"(breakage)":0,"(loopage)":0,"(tokens)":{},"(metrics)":Rb(i.tokens.next),"(blockscope)":dc(),"(comparray)":bc()},u=[t],I=[],G=null,B={},C=null,w={},x=!1,z=[],J=0,H=[],!N(a)&&!Array.isArray(a))return Z("E004",0),!1;c={get isJSON(){return i.jsonMode},getOption:function(a){return i.option[a]||null},getCache:function(a){return i.cache[a]},setCache:function(a,b){i.cache[a]=b},warn:function(a,b){X.apply(null,[a,b.line,b.char].concat(b.data))},on:function(a,b){a.split(" ").forEach(function(a){L.on(a,b)}.bind(this))}},L.removeAllListeners(),(K||[]).forEach(function(a){a(c)}),i.tokens.prev=i.tokens.curr=i.tokens.next=i.syntax["(begin)"],A=new g(a),A.on("warning",function(a){X.apply(null,[a.code,a.line,a.character].concat(a.data))}),A.on("error",function(a){Z.apply(null,[a.code,a.line,a.character].concat(a.data))}),A.on("fatal",function(a){U("E041",a.line,a.from)}),A.on("Identifier",function(a){L.emit("Identifier",a)}),A.on("String",function(a){L.emit("String",a)}),A.on("Number",function(a){L.emit("Number",a)}),A.start();for(var s in d)b.has(d,s)&&M(s,i.tokens.curr);T(),R(E,f||{}),lb.first=!0;try{switch(cb(),i.tokens.next.id){case"{":case"[":ac();break;default:Jb(),i.directive["use strict"]&&(i.option.globalstrict||i.option.node||W("W097",i.tokens.prev)),Ib()}cb(i.tokens.next&&"."!==i.tokens.next.value?"(end)":void 0),t["(blockscope)"].unstack();var D=function(a,b){do{if("string"==typeof b[a])return"unused"===b[a]?b[a]="var":"unction"===b[a]&&(b[a]="closure"),!0;b=b["(context)"]}while(b);return!1},O=function(a,b){if(w[a]){for(var c=[],d=0;w[a].length>d;d+=1)w[a][d]!==b&&c.push(w[a][d]);0===c.length?delete w[a]:w[a]=c}},P=function(a,b,c,d){var e=b.line,f=b.character;void 0===d&&(d=i.option.unused),d===!0&&(d="last-param");var g={vars:["var"],"last-param":["var","param"],strict:["var","param","last-param"]};d&&g[d]&&-1!==g[d].indexOf(c)&&X("W098",e,f,a),H.push({name:a,line:e,character:f})},Q=function(a,c){var d=a[c],e=a["(tokens)"][c];"("!==c.charAt(0)&&("unused"===d||"unction"===d)&&(a["(params)"]&&-1!==a["(params)"].indexOf(c)||a["(global)"]&&b.has(r,c)||P(c,e,"var"))};for(h=0;l.undefs.length>h;h+=1)j=l.undefs[h].slice(0),D(j[2].value,j[0])?O(j[2].value,j[2].line):i.option.undef&&W.apply(W,j.slice(1));u.forEach(function(a){if(a["(unusedOption)"]!==!1){for(var c in a)b.has(a,c)&&Q(a,c);if(a["(params)"])for(var f,g,d=a["(params)"].slice(),e=d.pop();e;){if(f=a[e],g=a["(unusedOption)"]||i.option.unused,g=g===!0?"last-param":g,"undefined"===e)return;if("unused"===f||"unction"===f)P(e,a["(tokens)"][e],"param",a["(unusedOption)"]);else if("last-param"===g)return;e=d.pop()}}});for(var S in q)b.has(q,S)&&!b.has(v,S)&&P(S,q[S],"var")}catch(V){if(!V||"JSHintError"!==V.name)throw V;var Y=i.tokens.next||{};l.errors.push({scope:"(main)",raw:V.raw,reason:V.message,line:V.line||Y.line,character:V.character||Y.from},null)}if("(main)"===l.scope)for(d=d||{},h=0;l.internals.length>h;h+=1)j=l.internals[h],d.scope=j.elem,ec(j.value,d,f);return 0===l.errors.length};return ec.addModule=function(a){K.push(a)},ec.addModule(j.register),ec.data=function(){var e,f,g,h,j,k,a={functions:[],options:i.option},c=[],d=[];ec.errors.length&&(a.errors=ec.errors),i.jsonMode&&(a.json=!0);for(j in w)b.has(w,j)&&c.push({name:j,line:w[j]});for(c.length>0&&(a.implieds=c),I.length>0&&(a.urls=I),k=Object.keys(F),k.length>0&&(a.globals=k),g=1;u.length>g;g+=1){for(f=u[g],e={},h=0;s.length>h;h+=1)e[s[h]]=[];for(h=0;s.length>h;h+=1)0===e[s[h]].length&&delete e[s[h]];e.name=f["(name)"],e.param=f["(params)"],e.line=f["(line)"],e.character=f["(character)"],e.last=f["(last)"],e.lastcharacter=f["(lastcharacter)"],a.functions.push(e)}H.length>0&&(a.unused=H),d=[];for(j in B)if("number"==typeof B[j]){a.member=B;break}return a},ec.jshint=ec,ec}();"object"==typeof c&&c&&(c.JSHINT=l)})()},{events:2,"../shared/vars.js":3,"../shared/messages.js":10,"./lex.js":11,"./reg.js":4,"./state.js":5,"./style.js":6,"console-browserify":7,underscore:12}],10:[function(a,b,c){(function(){"use strict";var b=a("underscore"),d={E001:"Bad option: '{a}'.",E002:"Bad option value.",E003:"Expected a JSON value.",E004:"Input is neither a string nor an array of strings.",E005:"Input is empty.",E006:"Unexpected early end of program.",E007:'Missing "use strict" statement.',E008:"Strict violation.",E009:"Option 'validthis' can't be used in a global scope.",E010:"'with' is not allowed in strict mode.",E011:"const '{a}' has already been declared.",E012:"const '{a}' is initialized to 'undefined'.",E013:"Attempting to override '{a}' which is a constant.",E014:"A regular expression literal can be confused with '/='.",E015:"Unclosed regular expression.",E016:"Invalid regular expression.",E017:"Unclosed comment.",E018:"Unbegun comment.",E019:"Unmatched '{a}'.",E020:"Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",E021:"Expected '{a}' and instead saw '{b}'.",E022:"Line breaking error '{a}'.",E023:"Missing '{a}'.",E024:"Unexpected '{a}'.",E025:"Missing ':' on a case clause.",E026:"Missing '}' to match '{' from line {a}.",E027:"Missing ']' to match '[' form line {a}.",E028:"Illegal comma.",E029:"Unclosed string.",E030:"Expected an identifier and instead saw '{a}'.",E031:"Bad assignment.",E032:"Expected a small integer or 'false' and instead saw '{a}'.",E033:"Expected an operator and instead saw '{a}'.",E034:"get/set are ES5 features.",E035:"Missing property name.",E036:"Expected to see a statement and instead saw a block.",E037:"Constant {a} was not declared correctly.",E038:"Variable {a} was not declared correctly.",E039:"Function declarations are not invocable. Wrap the whole function invocation in parens.",E040:"Each value should have its own case label.",E041:"Unrecoverable syntax error.",E042:"Stopping.",E043:"Too many errors.",E044:"'{a}' is already defined and can't be redefined.",E045:"Invalid for each loop.",E046:"A yield statement shall be within a generator function (with syntax: `function*`)",E047:"A generator function shall contain a yield statement.",E048:"Let declaration not directly within block.",E049:"A {a} cannot be named '{b}'."},e={W001:"'hasOwnProperty' is a really bad name.",W002:"Value of '{a}' may be overwritten in IE 8 and earlier.",W003:"'{a}' was used before it was defined.",W004:"'{a}' is already defined.",W005:"A dot following a number can be confused with a decimal point.",W006:"Confusing minuses.",W007:"Confusing pluses.",W008:"A leading decimal point can be confused with a dot: '{a}'.",W009:"The array literal notation [] is preferrable.",W010:"The object literal notation {} is preferrable.",W011:"Unexpected space after '{a}'.",W012:"Unexpected space before '{a}'.",W013:"Missing space after '{a}'.",W014:"Bad line breaking before '{a}'.",W015:"Expected '{a}' to have an indentation at {b} instead at {c}.",W016:"Unexpected use of '{a}'.",W017:"Bad operand.",W018:"Confusing use of '{a}'.",W019:"Use the isNaN function to compare with NaN.",W020:"Read only.",W021:"'{a}' is a function.",W022:"Do not assign to the exception parameter.",W023:"Expected an identifier in an assignment and instead saw a function invocation.",W024:"Expected an identifier and instead saw '{a}' (a reserved word).",W025:"Missing name in function declaration.",W026:"Inner functions should be listed at the top of the outer function.",W027:"Unreachable '{a}' after '{b}'.",W028:"Label '{a}' on {b} statement.",W030:"Expected an assignment or function call and instead saw an expression.",W031:"Do not use 'new' for side effects.",W032:"Unnecessary semicolon.",W033:"Missing semicolon.",W034:'Unnecessary directive "{a}".',W035:"Empty block.",W036:"Unexpected /*member '{a}'.",W037:"'{a}' is a statement label.",W038:"'{a}' used out of scope.",W039:"'{a}' is not allowed.",W040:"Possible strict violation.",W041:"Use '{a}' to compare with '{b}'.",W042:"Avoid EOL escaping.",W043:"Bad escaping of EOL. Use option multistr if needed.",W044:"Bad or unnecessary escaping.",W045:"Bad number '{a}'.",W046:"Don't use extra leading zeros '{a}'.",W047:"A trailing decimal point can be confused with a dot: '{a}'.",W048:"Unexpected control character in regular expression.",W049:"Unexpected escaped character '{a}' in regular expression.",W050:"JavaScript URL.",W051:"Variables should not be deleted.",W052:"Unexpected '{a}'.",W053:"Do not use {a} as a constructor.",W054:"The Function constructor is a form of eval.",W055:"A constructor name should start with an uppercase letter.",W056:"Bad constructor.",W057:"Weird construction. Is 'new' unnecessary?",W058:"Missing '()' invoking a constructor.",W059:"Avoid arguments.{a}.",W060:"document.write can be a form of eval.",W061:"eval can be harmful.",W062:"Wrap an immediate function invocation in parens to assist the reader in understanding that the expression is the result of a function, and not the function itself.",W063:"Math is not a function.",W064:"Missing 'new' prefix when invoking a constructor.",W065:"Missing radix parameter.",W066:"Implied eval. Consider passing a function instead of a string.",W067:"Bad invocation.",W068:"Wrapping non-IIFE function literals in parens is unnecessary.",W069:"['{a}'] is better written in dot notation.",W070:"Extra comma. (it breaks older versions of IE)",W071:"This function has too many statements. ({a})",W072:"This function has too many parameters. ({a})",W073:"Blocks are nested too deeply. ({a})",W074:"This function's cyclomatic complexity is too high. ({a})",W075:"Duplicate key '{a}'.",W076:"Unexpected parameter '{a}' in get {b} function.",W077:"Expected a single parameter in set {a} function.",W078:"Setter is defined without getter.",W079:"Redefinition of '{a}'.",W080:"It's not necessary to initialize '{a}' to 'undefined'.",W081:"Too many var statements.",W082:"Function declarations should not be placed in blocks. Use a function expression or move the statement to the top of the outer function.",W083:"Don't make functions within a loop.",W084:"Expected a conditional expression and instead saw an assignment.",W085:"Don't use 'with'.",W086:"Expected a 'break' statement before '{a}'.",W087:"Forgotten 'debugger' statement?",W088:"Creating global 'for' variable. Should be 'for (var {a} ...'.",W089:"The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.",W090:"'{a}' is not a statement label.",W091:"'{a}' is out of scope.",W092:"Wrap the /regexp/ literal in parens to disambiguate the slash operator.",W093:"Did you mean to return a conditional instead of an assignment?",W094:"Unexpected comma.",W095:"Expected a string and instead saw {a}.",W096:"The '{a}' key may produce unexpected results.",W097:'Use the function form of "use strict".',W098:"'{a}' is defined but never used.",W099:"Mixed spaces and tabs.",W100:"This character may get silently deleted by one or more browsers.",W101:"Line is too long.",W102:"Trailing whitespace.",W103:"The '{a}' property is deprecated.",W104:"'{a}' is only available in JavaScript 1.7.",W105:"Unexpected {a} in '{b}'.",W106:"Identifier '{a}' is not in camel case.",W107:"Script URL.",W108:"Strings must use doublequote.",W109:"Strings must use singlequote.",W110:"Mixed double and single quotes.",W112:"Unclosed string.",W113:"Control character in string: {a}.",W114:"Avoid {a}.",W115:"Octal literals are not allowed in strict mode.",W116:"Expected '{a}' and instead saw '{b}'.",W117:"'{a}' is not defined.",W118:"'{a}' is only available in Mozilla JavaScript extensions (use moz option).",W119:"'{a}' is only available in ES6 (use esnext option)."},f={I001:"Comma warnings can be turned off with 'laxcomma'.",I002:"Reserved words as properties can be used under the 'es5' option.",I003:"ES5 option is now set per default"};c.errors={},c.warnings={},c.info={},b.each(d,function(a,b){c.errors[b]={code:b,desc:a}}),b.each(e,function(a,b){c.warnings[b]={code:b,desc:a}}),b.each(f,function(a,b){c.info[b]={code:b,desc:a}})})()},{underscore:12}],11:[function(a,b,c){(function(){"use strict";function l(){var a=[];return{push:function(b){a.push(b)},check:function(){for(var b=0;a.length>b;++b)a[b]();a.splice(0,a.length)}}}function m(a){var b=a;"string"==typeof b&&(b=b.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n")),b[0]&&"#!"===b[0].substr(0,2)&&(b[0]=""),this.emitter=new d.EventEmitter,this.source=a,this.setLines(b),this.prereg=!0,this.line=0,this.char=1,this.from=1,this.input="";for(var c=0;f.option.indent>c;c+=1)f.tab+=" "}for(var b=a("underscore"),d=a("events"),e=a("./reg.js"),f=a("./state.js").state,g={Identifier:1,Punctuator:2,NumericLiteral:3,StringLiteral:4,Comment:5,Keyword:6,NullLiteral:7,BooleanLiteral:8,RegExp:9},h=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1319,1329,1366,1369,1369,1377,1415,1488,1514,1520,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2308,2361,2365,2365,2384,2384,2392,2401,2417,2423,2425,2431,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3123,3125,3129,3133,3133,3160,3161,3168,3169,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3294,3294,3296,3297,3313,3314,3333,3340,3342,3344,3346,3386,3389,3389,3406,3406,3424,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3719,3720,3722,3722,3725,3725,3732,3735,3737,3743,3745,3747,3749,3749,3751,3751,3754,3755,3757,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3805,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4304,4346,4348,4348,4352,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5108,5121,5740,5743,5759,5761,5786,5792,5866,5870,5872,5888,5900,5902,5905,5920,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6263,6272,6312,6314,6314,6320,6389,6400,6428,6480,6509,6512,6516,6528,6571,6593,6599,6656,6678,6688,6740,6823,6823,6917,6963,6981,6987,7043,7072,7086,7087,7104,7141,7168,7203,7245,7247,7258,7293,7401,7404,7406,7409,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8473,8477,8484,8484,8486,8486,8488,8488,8490,8493,8495,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11310,11312,11358,11360,11492,11499,11502,11520,11557,11568,11621,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11823,11823,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12445,12447,12449,12538,12540,12543,12549,12589,12593,12686,12704,12730,12784,12799,13312,13312,19893,19893,19968,19968,40907,40907,40960,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42647,42656,42735,42775,42783,42786,42888,42891,42894,42896,42897,42912,42921,43002,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43648,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43968,44002,44032,44032,55203,55203,55216,55238,55243,55291,63744,64045,64048,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66334,66352,66378,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67840,67861,67872,67897,68096,68096,68112,68115,68117,68119,68121,68147,68192,68220,68352,68405,68416,68437,68448,68466,68608,68680,69635,69687,69763,69807,73728,74606,74752,74850,77824,78894,92160,92728,110592,110593,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,131072,131072,173782,173782,173824,173824,177972,177972,177984,177984,178205,178205,194560,195101],i=[],j=0;128>j;j++)i[j]=36===j||j>=65&&90>=j||95===j||j>=97&&122>=j;for(var k=[],j=0;128>j;j++)k[j]=i[j]||j>=48&&57>=j;m.prototype={_lines:[],getLines:function(){return this._lines=f.lines,this._lines},setLines:function(a){this._lines=a,f.lines=this._lines},peek:function(a){return this.input.charAt(a||0)},skip:function(a){a=a||1,this.char+=a,this.input=this.input.slice(a)},on:function(a,b){a.split(" ").forEach(function(a){this.emitter.on(a,b)}.bind(this))},trigger:function(){this.emitter.emit.apply(this.emitter,Array.prototype.slice.call(arguments))},triggerAsync:function(a,b,c,d){c.push(function(){d()&&this.trigger(a,b)}.bind(this))},scanPunctuator:function(){var b,c,d,a=this.peek();switch(a){case".":if(/^[0-9]$/.test(this.peek(1)))return null;if("."===this.peek(1)&&"."===this.peek(2))return{type:g.Punctuator,value:"..."};case"(":case")":case";":case",":case"{":case"}":case"[":case"]":case":":case"~":case"?":return{type:g.Punctuator,value:a};case"#":return{type:g.Punctuator,value:a};case"":return null}return b=this.peek(1),c=this.peek(2),d=this.peek(3),">"===a&&">"===b&&">"===c&&"="===d?{type:g.Punctuator,value:">>>="}:"="===a&&"="===b&&"="===c?{type:g.Punctuator,value:"==="}:"!"===a&&"="===b&&"="===c?{type:g.Punctuator,value:"!=="}:">"===a&&">"===b&&">"===c?{type:g.Punctuator,value:">>>"}:"<"===a&&"<"===b&&"="===c?{type:g.Punctuator,value:"<<="}:">"===a&&">"===b&&"="===c?{type:g.Punctuator,value:">>="}:"="===a&&">"===b?{type:g.Punctuator,value:a+b}:a===b&&"+-<>&|".indexOf(a)>=0?{type:g.Punctuator,value:a+b}:"<>=!+-*%&|^".indexOf(a)>=0?"="===b?{type:g.Punctuator,value:a+b}:{type:g.Punctuator,value:a}:"/"===a?"="===b&&/\/=(?!(\S*\/[gim]?))/.test(this.input)?{type:g.Punctuator,value:"/="}:{type:g.Punctuator,value:"/"}:null},scanComments:function(){function f(a,b,c){var d=["jshint","jslint","members","member","globals","global","exported"],e=!1,f=a+b,h="plain";return c=c||{},c.isMultiline&&(f+="*/"),d.forEach(function(c){if(!e&&("//"!==a||"jshint"===c)&&(b.substr(0,c.length)===c&&(e=!0,a+=c,b=b.substr(c.length)),e||" "!==b.charAt(0)||b.substr(1,c.length)!==c||(e=!0,a=a+" "+c,b=b.substr(c.length+1)),e))switch(c){case"member":h="members";break;case"global":h="globals";break;default:h=c}}),{type:g.Comment,commentType:h,value:f,body:b,isSpecial:e,isMultiline:c.isMultiline||!1,isMalformed:c.isMalformed||!1}}var a=this.peek(),b=this.peek(1),c=this.input.substr(2),d=this.line,e=this.char;if("*"===a&&"/"===b)return this.trigger("error",{code:"E018",line:d,character:e}),this.skip(2),null;if("/"!==a||"*"!==b&&"/"!==b)return null;if("/"===b)return this.skip(this.input.length),f("//",c);var h="";if("*"===b){for(this.skip(2);"*"!==this.peek()||"/"!==this.peek(1);)if(""===this.peek()){if(h+="\n",!this.nextLine())return this.trigger("error",{code:"E017",line:d,character:e}),f("/*",h,{isMultiline:!0,isMalformed:!0})}else h+=this.peek(),this.skip();return this.skip(2),f("/*",h,{isMultiline:!0})}},scanKeyword:function(){var a=/^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input),b=["if","in","do","var","for","new","try","let","this","else","case","void","with","enum","while","break","catch","throw","const","yield","class","super","return","typeof","delete","switch","export","import","default","finally","extends","function","continue","debugger","instanceof"];return a&&b.indexOf(a[0])>=0?{type:g.Keyword,value:a[0]}:null},scanIdentifier:function(){function e(a){for(var b=0;h.length>b;){if(h[b++]>a)return!1;if(h[b++]>=a)return!0}return!1}function f(a){return/^[0-9a-fA-F]$/.test(a)}var c,d,a="",b=0,j=function(){if(b+=1,"u"!==this.peek(b))return null;var h,a=this.peek(b+1),c=this.peek(b+2),d=this.peek(b+3),g=this.peek(b+4);return f(a)&&f(c)&&f(d)&&f(g)?(h=parseInt(a+c+d+g,16),e(h)?(b+=5,"\\u"+a+c+d+g):null):null}.bind(this),l=function(){var a=this.peek(b),c=a.charCodeAt(0);return 92===c?j():128>c?i[c]?(b+=1,a):null:e(c)?(b+=1,a):null}.bind(this),m=function(){var a=this.peek(b),c=a.charCodeAt(0);return 92===c?j():128>c?k[c]?(b+=1,a):null:e(c)?(b+=1,a):null}.bind(this);if(d=l(),null===d)return null;for(a=d;d=m(),null!==d;)a+=d;switch(a){case"true":case"false":c=g.BooleanLiteral;break;case"null":c=g.NullLiteral;break;default:c=g.Identifier}return{type:c,value:a}},scanNumericLiteral:function(){function f(a){return/^[0-9]$/.test(a)}function h(a){return/^[0-7]$/.test(a)}function i(a){return/^[0-9a-fA-F]$/.test(a)}function j(a){return"$"===a||"_"===a||"\\"===a||a>="a"&&"z">=a||a>="A"&&"Z">=a}var e,a=0,b="",c=this.input.length,d=this.peek(a);if("."!==d&&!f(d))return null;if("."!==d){if(b=this.peek(a),a+=1,d=this.peek(a),"0"===b){if("x"===d||"X"===d){for(a+=1,b+=d;c>a&&(d=this.peek(a),i(d));)b+=d,a+=1;return 2>=b.length?{type:g.NumericLiteral,value:b,isMalformed:!0}:c>a&&(d=this.peek(a),j(d))?null:{type:g.NumericLiteral,value:b,base:16,isMalformed:!1}}if(h(d)){for(a+=1,b+=d,e=!1;c>a;){if(d=this.peek(a),f(d))e=!0;else if(!h(d))break;b+=d,a+=1}return c>a&&(d=this.peek(a),j(d))?null:{type:g.NumericLiteral,value:b,base:8,isMalformed:!1}}f(d)&&(a+=1,b+=d)}for(;c>a&&(d=this.peek(a),f(d));)b+=d,a+=1}if("."===d)for(b+=d,a+=1;c>a&&(d=this.peek(a),f(d));)b+=d,a+=1;if("e"===d||"E"===d){if(b+=d,a+=1,d=this.peek(a),("+"===d||"-"===d)&&(b+=this.peek(a),a+=1),d=this.peek(a),!f(d))return null;for(b+=d,a+=1;c>a&&(d=this.peek(a),f(d));)b+=d,a+=1}return c>a&&(d=this.peek(a),j(d))?null:{type:g.NumericLiteral,value:b,base:10,isMalformed:!isFinite(b)}},scanStringLiteral:function(a){var b=this.peek();if('"'!==b&&"'"!==b)return null;this.triggerAsync("warning",{code:"W108",line:this.line,character:this.char},a,function(){return f.jsonMode&&'"'!==b});var c="",d=this.line,e=this.char,h=!1;for(this.skip();this.peek()!==b;){for(;""===this.peek();)if(h?(h=!1,this.triggerAsync("warning",{code:"W043",line:this.line,character:this.char},a,function(){return!f.option.multistr}),this.triggerAsync("warning",{code:"W042",line:this.line,character:this.char},a,function(){return f.jsonMode&&f.option.multistr})):this.trigger("warning",{code:"W112",line:this.line,character:this.char}),!this.nextLine())return this.trigger("error",{code:"E029",line:d,character:e}),{type:g.StringLiteral,value:c,isUnclosed:!0,quote:b};h=!1;var i=this.peek(),j=1;if(" ">i&&this.trigger("warning",{code:"W113",line:this.line,character:this.char,data:[""]}),"\\"===i)switch(this.skip(),i=this.peek()){case"'":this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\'"]},a,function(){return f.jsonMode});break;case"b":i="\b";break;case"f":i="\f";break;case"n":i="\n";break;case"r":i="\r";break;case"t":i=" ";break;case"0":i="\0";var k=parseInt(this.peek(1),10);this.triggerAsync("warning",{code:"W115",line:this.line,character:this.char},a,function(){return k>=0&&7>=k&&f.directive["use strict"]});break;case"u":i=String.fromCharCode(parseInt(this.input.substr(1,4),16)),j=5;break;case"v":this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\v"]},a,function(){return f.jsonMode}),i=" ";break;case"x":var l=parseInt(this.input.substr(1,2),16);this.triggerAsync("warning",{code:"W114",line:this.line,character:this.char,data:["\\x-"]},a,function(){return f.jsonMode}),i=String.fromCharCode(l),j=3;break;case"\\":case'"':case"/":break;case"":h=!0,i="";break;case"!":if("<"===c.slice(c.length-2))break;default:this.trigger("warning",{code:"W044",line:this.line,character:this.char})}c+=i,this.skip(j)}return this.skip(),{type:g.StringLiteral,value:c,isUnclosed:!1,quote:b}},scanRegExp:function(){var j,a=0,b=this.input.length,c=this.peek(),d=c,e="",f=[],h=!1,i=!1,k=function(){" ">c&&(h=!0,this.trigger("warning",{code:"W048",line:this.line,character:this.char})),"<"===c&&(h=!0,this.trigger("warning",{code:"W049",line:this.line,character:this.char,data:[c]}))}.bind(this);if(!this.prereg||"/"!==c)return null;for(a+=1,j=!1;b>a;)if(c=this.peek(a),d+=c,e+=c,i)"]"===c&&("\\"!==this.peek(a-1)||"\\"===this.peek(a-2))&&(i=!1),"\\"===c&&(a+=1,c=this.peek(a),e+=c,d+=c,k()),a+=1;else{if("\\"===c){if(a+=1,c=this.peek(a),e+=c,d+=c,k(),"/"===c){a+=1;continue}if("["===c){a+=1;continue}}if("["!==c){if("/"===c){e=e.substr(0,e.length-1),j=!0,a+=1;break}a+=1}else i=!0,a+=1}if(!j)return this.trigger("error",{code:"E015",line:this.line,character:this.from}),void this.trigger("fatal",{line:this.line,from:this.from});for(;b>a&&(c=this.peek(a),/[gim]/.test(c));)f.push(c),d+=c,a+=1;try{RegExp(e,f.join(""))}catch(l){h=!0,this.trigger("error",{code:"E016",line:this.line,character:this.char,data:[l.message]})}return{type:g.RegExp,value:d,flags:f,isMalformed:h}},scanMixedSpacesAndTabs:function(){var a,b;return f.option.smarttabs?(b=this.input.match(/(\/\/|^\s?\*)? \t/),a=b&&!b[1]?0:-1):a=this.input.search(/ \t|\t [^\*]/),a},scanUnsafeChars:function(){return this.input.search(e.unsafeChars)},next:function(a){this.from=this.char;var b;if(/\s/.test(this.peek())){for(b=this.char;/\s/.test(this.peek());)this.from+=1,this.skip();""===this.peek()&&!/^\s*$/.test(this.getLines()[this.line-1])&&f.option.trailing&&this.trigger("warning",{code:"W102",line:this.line,character:b})}var c=this.scanComments()||this.scanStringLiteral(a);return c?c:(c=this.scanRegExp()||this.scanPunctuator()||this.scanKeyword()||this.scanIdentifier()||this.scanNumericLiteral(),c?(this.skip(c.value.length),c):null)},nextLine:function(){var a;return this.line>=this.getLines().length?!1:(this.input=this.getLines()[this.line],this.line+=1,this.char=1,this.from=1,a=this.scanMixedSpacesAndTabs(),a>=0&&this.trigger("warning",{code:"W099",line:this.line,character:a+1}),this.input=this.input.replace(/\t/g,f.tab),a=this.scanUnsafeChars(),a>=0&&this.trigger("warning",{code:"W100",line:this.line,character:a}),f.option.maxlen&&f.option.maxlend)return f(a)?j(""+a,"regexp"):j("[Object]","special");i.push(a);var u=o.map(function(b){var c,f;if(a.__lookupGetter__&&(a.__lookupGetter__(b)?f=a.__lookupSetter__(b)?j("[Getter/Setter]","special"):j("[Getter]","special"):a.__lookupSetter__(b)&&(f=j("[Setter]","special"))),0>n.indexOf(b)&&(c="["+b+"]"),f||(0>i.indexOf(a[b])?(f=null===d?m(a[b]):m(a[b],d-1),f.indexOf("\n")>-1&&(f=e(a)?f.split("\n").map(function(a){return" "+a}).join("\n").substr(2):"\n"+f.split("\n").map(function(a){return" "+a}).join("\n"))):f=j("[Circular]","special")),c===void 0){if("Array"===r&&b.match(/^\d+$/))return f;c=JSON.stringify(""+b),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=j(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=j(c,"string"))}return c+": "+f});i.pop();var v=0,w=u.reduce(function(a,b){return v++,b.indexOf("\n")>=0&&v++,a+b.length+1},0);return u=w>50?s[0]+(""===q?"":q+"\n ")+" "+u.join(",\n ")+" "+s[1]:s[0]+q+" "+u.join(", ")+" "+s[1]}var i=[],j=function(a,b){var c={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},d={special:"cyan",number:"blue","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"}[b];return d?"["+c[d][0]+"m"+a+"["+c[d][1]+"m":a};return h||(j=function(a){return a}),m(a,d===void 0?2:d)},c.log=function(){},c.pump=null;var k=Object.keys||function(a){var b=[];for(var c in a)b.push(c);return b},l=Object.getOwnPropertyNames||function(a){var b=[];for(var c in a)Object.hasOwnProperty.call(a,c)&&b.push(c);return b},m=Object.create||function(a,b){var c;if(null===a)c={__proto__:null};else{if("object"!=typeof a)throw new TypeError("typeof prototype["+typeof a+"] != 'object'");var d=function(){};d.prototype=a,c=new d,c.__proto__=a}return b!==void 0&&Object.defineProperties&&Object.defineProperties(c,b),c};c.inherits=function(a,b){a.super_=b,a.prototype=m(b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}})};var n=/%[sdj%]/g;c.format=function(a){if("string"!=typeof a){for(var b=[],d=0;arguments.length>d;d++)b.push(c.inspect(arguments[d]));return b.join(" ")}for(var d=1,e=arguments,f=e.length,g=(a+"").replace(n,function(a){if("%%"===a)return"%";if(d>=f)return a;switch(a){case"%s":return e[d++]+"";case"%d":return Number(e[d++]);case"%j":return JSON.stringify(e[d++]);default:return a}}),h=e[d];f>d;h=e[++d])g+=null===h||"object"!=typeof h?" "+h:" "+c.inspect(h);return g}},{events:2}],9:[function(a,b){(function(){function f(a){if(Object.keys)return Object.keys(a);var b=[];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c);return b}function i(a,b){return void 0===b?""+b:"number"!=typeof b||!isNaN(b)&&isFinite(b)?"function"==typeof b||b instanceof RegExp?""+b:b:""+b}function j(a,b){return"string"==typeof a?b>a.length?a:a.slice(0,b):a}function k(a,b,c,d,e){throw new g.AssertionError({message:c,actual:a,expected:b,operator:d,stackStartFunction:e})}function l(a,b){a||k(a,!0,b,"==",g.ok)}function p(a,b){if(a===b)return!0;if(d.isBuffer(a)&&d.isBuffer(b)){if(a.length!=b.length)return!1;for(var c=0;a.length>c;c++)if(a[c]!==b[c])return!1;return!0}return a instanceof Date&&b instanceof Date?a.getTime()===b.getTime():"object"!=typeof a&&"object"!=typeof b?a==b:s(a,b)}function q(a){return null===a||void 0===a}function r(a){return"[object Arguments]"==Object.prototype.toString.call(a)}function s(a,b){if(q(a)||q(b))return!1;if(a.prototype!==b.prototype)return!1;if(r(a))return r(b)?(a=e.call(a),b=e.call(b),p(a,b)):!1;try{var g,h,c=f(a),d=f(b)}catch(i){return!1}if(c.length!=d.length)return!1;for(c.sort(),d.sort(),h=c.length-1;h>=0;h--)if(c[h]!=d[h])return!1;for(h=c.length-1;h>=0;h--)if(g=c[h],!p(a[g],b[g]))return!1;return!0}function w(a,b){return a&&b?b instanceof RegExp?b.test(a):a instanceof b?!0:b.call({},a)===!0?!0:!1:!1}function x(a,b,c,d){var e;"string"==typeof c&&(d=c,c=null);try{b()}catch(f){e=f}if(d=(c&&c.name?" ("+c.name+").":".")+(d?" "+d:"."),a&&!e&&k("Missing expected exception"+d),!a&&w(e,c)&&k("Got unwanted exception"+d),a&&e&&c&&!w(e,c)||!a&&e)throw e}var c=a("util"),d=a("buffer").Buffer,e=Array.prototype.slice,g=b.exports=l;g.AssertionError=function(a){this.name="AssertionError",this.message=a.message,this.actual=a.actual,this.expected=a.expected,this.operator=a.operator;var b=a.stackStartFunction||k;Error.captureStackTrace&&Error.captureStackTrace(this,b)},c.inherits(g.AssertionError,Error),g.AssertionError.prototype.toString=function(){return this.message?[this.name+":",this.message].join(" "):[this.name+":",j(JSON.stringify(this.actual,i),128),this.operator,j(JSON.stringify(this.expected,i),128)].join(" ")},g.AssertionError.__proto__=Error.prototype,g.fail=k,g.ok=l,g.equal=function(a,b,c){a!=b&&k(a,b,c,"==",g.equal)},g.notEqual=function(a,b,c){a==b&&k(a,b,c,"!=",g.notEqual)},g.deepEqual=function(a,b,c){p(a,b)||k(a,b,c,"deepEqual",g.deepEqual)},g.notDeepEqual=function(a,b,c){p(a,b)&&k(a,b,c,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(a,b,c){a!==b&&k(a,b,c,"===",g.strictEqual)},g.notStrictEqual=function(a,b,c){a===b&&k(a,b,c,"!==",g.notStrictEqual)},g.throws=function(){x.apply(this,[!0].concat(e.call(arguments)))},g.doesNotThrow=function(){x.apply(this,[!1].concat(e.call(arguments)))},g.ifError=function(a){if(a)throw a}})()},{util:8,buffer:13}],12:[function(a,b,c){(function(){(function(){var a=this,d=a._,e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=f.push,j=f.slice,k=f.concat,l=g.toString,m=g.hasOwnProperty,n=f.forEach,o=f.map,p=f.reduce,q=f.reduceRight,r=f.filter,s=f.every,t=f.some,u=f.indexOf,v=f.lastIndexOf,w=Array.isArray,x=Object.keys,y=h.bind,z=function(a){return a instanceof z?a:this instanceof z?(this._wrapped=a,void 0):new z(a)};c!==void 0?(b!==void 0&&b.exports&&(c=b.exports=z),c._=z):a._=z,z.VERSION="1.4.4";var A=z.each=z.forEach=function(a,b,c){if(null!=a)if(n&&a.forEach===n)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;f>d;d++)if(b.call(c,a[d],d,a)===e)return}else for(var g in a)if(z.has(a,g)&&b.call(c,a[g],g,a)===e)return};z.map=z.collect=function(a,b,c){var d=[];return null==a?d:o&&a.map===o?a.map(b,c):(A(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)};var B="Reduce of empty array with no initial value";z.reduce=z.foldl=z.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),p&&a.reduce===p)return d&&(b=z.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(A(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(B);return c},z.reduceRight=z.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),q&&a.reduceRight===q)return d&&(b=z.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=z.keys(a);f=g.length}if(A(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(B);return c},z.find=z.detect=function(a,b,c){var d;return C(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},z.filter=z.select=function(a,b,c){var d=[];return null==a?d:r&&a.filter===r?a.filter(b,c):(A(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},z.reject=function(a,b,c){return z.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},z.every=z.all=function(a,b,c){b||(b=z.identity);var d=!0;return null==a?d:s&&a.every===s?a.every(b,c):(A(a,function(a,f,g){return(d=d&&b.call(c,a,f,g))?void 0:e}),!!d)};var C=z.some=z.any=function(a,b,c){b||(b=z.identity);var d=!1;return null==a?d:t&&a.some===t?a.some(b,c):(A(a,function(a,f,g){return d||(d=b.call(c,a,f,g))?e:void 0}),!!d)};z.contains=z.include=function(a,b){return null==a?!1:u&&a.indexOf===u?-1!=a.indexOf(b):C(a,function(a){return a===b})},z.invoke=function(a,b){var c=j.call(arguments,2),d=z.isFunction(b);return z.map(a,function(a){return(d?b:a[b]).apply(a,c)})},z.pluck=function(a,b){return z.map(a,function(a){return a[b]})},z.where=function(a,b,c){return z.isEmpty(b)?c?null:[]:z[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},z.findWhere=function(a,b){return z.where(a,b,!0)},z.max=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.max.apply(Math,a);if(!b&&z.isEmpty(a))return-1/0;var d={computed:-1/0,value:-1/0};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},z.min=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&65535>a.length)return Math.min.apply(Math,a);if(!b&&z.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;d.computed>g&&(d={value:a,computed:g})}),d.value},z.shuffle=function(a){var b,c=0,d=[];return A(a,function(a){b=z.random(c++),d[c-1]=d[b],d[b]=a}),d};var D=function(a){return z.isFunction(a)?a:function(b){return b[a]}};z.sortBy=function(a,b,c){var d=D(b);return z.pluck(z.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.indexf;){var h=f+g>>>1;e>c.call(d,a[h])?f=h+1:g=h}return f},z.toArray=function(a){return a?z.isArray(a)?j.call(a):a.length===+a.length?z.map(a,z.identity):z.values(a):[]},z.size=function(a){return null==a?0:a.length===+a.length?a.length:z.keys(a).length},z.first=z.head=z.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:j.call(a,0,b)},z.initial=function(a,b,c){return j.call(a,0,a.length-(null==b||c?1:b))},z.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:j.call(a,Math.max(a.length-b,0))},z.rest=z.tail=z.drop=function(a,b,c){return j.call(a,null==b||c?1:b)},z.compact=function(a){return z.filter(a,z.identity)};var F=function(a,b,c){return A(a,function(a){z.isArray(a)?b?i.apply(c,a):F(a,b,c):c.push(a)}),c};z.flatten=function(a,b){return F(a,b,[])},z.without=function(a){return z.difference(a,j.call(arguments,1))},z.uniq=z.unique=function(a,b,c,d){z.isFunction(b)&&(d=c,c=b,b=!1);var e=c?z.map(a,c,d):a,f=[],g=[];return A(e,function(c,d){(b?d&&g[g.length-1]===c:z.contains(g,c))||(g.push(c),f.push(a[d]))}),f},z.union=function(){return z.uniq(k.apply(f,arguments))},z.intersection=function(a){var b=j.call(arguments,1);return z.filter(z.uniq(a),function(a){return z.every(b,function(b){return z.indexOf(b,a)>=0})})},z.difference=function(a){var b=k.apply(f,j.call(arguments,1));return z.filter(a,function(a){return!z.contains(b,a)})},z.zip=function(){for(var a=j.call(arguments),b=z.max(z.pluck(a,"length")),c=Array(b),d=0;b>d;d++)c[d]=z.pluck(a,""+d);return c},z.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},z.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=z.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(u&&a.indexOf===u)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},z.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(v&&a.lastIndexOf===v)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},z.range=function(a,b,c){1>=arguments.length&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=Array(d);d>e;)f[e++]=a,a+=c;return f},z.bind=function(a,b){if(a.bind===y&&y)return y.apply(a,j.call(arguments,1));var c=j.call(arguments,2);return function(){return a.apply(b,c.concat(j.call(arguments)))}},z.partial=function(a){var b=j.call(arguments,1);return function(){return a.apply(this,b.concat(j.call(arguments)))}},z.bindAll=function(a){var b=j.call(arguments,1);return 0===b.length&&(b=z.functions(a)),A(b,function(b){a[b]=z.bind(a[b],a)}),a},z.memoize=function(a,b){var c={};return b||(b=z.identity),function(){var d=b.apply(this,arguments);return z.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},z.delay=function(a,b){var c=j.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},z.defer=function(a){return z.delay.apply(z,[a,1].concat(j.call(arguments,1)))},z.throttle=function(a,b){var c,d,e,f,g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)};return function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},z.debounce=function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},z.once=function(a){var c,b=!1;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}},z.wrap=function(a,b){return function(){var c=[a];return i.apply(c,arguments),b.apply(this,c)}},z.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},z.after=function(a,b){return 0>=a?b():function(){return 1>--a?b.apply(this,arguments):void 0}},z.keys=x||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)z.has(a,c)&&(b[b.length]=c);return b},z.values=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push(a[c]);return b},z.pairs=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push([c,a[c]]);return b},z.invert=function(a){var b={};for(var c in a)z.has(a,c)&&(b[a[c]]=c);return b},z.functions=z.methods=function(a){var b=[];for(var c in a)z.isFunction(a[c])&&b.push(c);return b.sort()},z.extend=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},z.pick=function(a){var b={},c=k.apply(f,j.call(arguments,1));return A(c,function(c){c in a&&(b[c]=a[c])}),b},z.omit=function(a){var b={},c=k.apply(f,j.call(arguments,1));for(var d in a)z.contains(c,d)||(b[d]=a[d]);return b},z.defaults=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)null==a[c]&&(a[c]=b[c])}),a},z.clone=function(a){return z.isObject(a)?z.isArray(a)?a.slice():z.extend({},a):a},z.tap=function(a,b){return b(a),a};var G=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof z&&(a=a._wrapped),b instanceof z&&(b=b._wrapped);var e=l.call(a);if(e!=l.call(b))return!1;switch(e){case"[object String]":return a==b+"";case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;c.push(a),d.push(b);var g=0,h=!0;if("[object Array]"==e){if(g=a.length,h=g==b.length)for(;g--&&(h=G(a[g],b[g],c,d)););}else{var i=a.constructor,j=b.constructor;if(i!==j&&!(z.isFunction(i)&&i instanceof i&&z.isFunction(j)&&j instanceof j))return!1;for(var k in a)if(z.has(a,k)&&(g++,!(h=z.has(b,k)&&G(a[k],b[k],c,d))))break;if(h){for(k in b)if(z.has(b,k)&&!g--)break;h=!g}}return c.pop(),d.pop(),h};z.isEqual=function(a,b){return G(a,b,[],[])},z.isEmpty=function(a){if(null==a)return!0;if(z.isArray(a)||z.isString(a))return 0===a.length;for(var b in a)if(z.has(a,b))return!1;return!0},z.isElement=function(a){return!(!a||1!==a.nodeType)},z.isArray=w||function(a){return"[object Array]"==l.call(a)},z.isObject=function(a){return a===Object(a)},A(["Arguments","Function","String","Number","Date","RegExp"],function(a){z["is"+a]=function(b){return l.call(b)=="[object "+a+"]"}}),z.isArguments(arguments)||(z.isArguments=function(a){return!(!a||!z.has(a,"callee"))}),z.isFunction=function(a){return"function"==typeof a},z.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},z.isNaN=function(a){return z.isNumber(a)&&a!=+a},z.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==l.call(a)},z.isNull=function(a){return null===a},z.isUndefined=function(a){return void 0===a},z.has=function(a,b){return m.call(a,b)},z.noConflict=function(){return a._=d,this},z.identity=function(a){return a},z.times=function(a,b,c){for(var d=Array(a),e=0;a>e;e++)d[e]=b.call(c,e);return d},z.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var H={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};H.unescape=z.invert(H.escape);var I={escape:RegExp("["+z.keys(H.escape).join("")+"]","g"),unescape:RegExp("("+z.keys(H.unescape).join("|")+")","g")};z.each(["escape","unescape"],function(a){z[a]=function(b){return null==b?"":(""+b).replace(I[a],function(b){return H[a][b]})}}),z.result=function(a,b){if(null==a)return null;var c=a[b];return z.isFunction(c)?c.call(a):c},z.mixin=function(a){A(z.functions(a),function(b){var c=z[b]=a[b];z.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),N.call(this,c.apply(z,a))}})};var J=0;z.uniqueId=function(a){var b=++J+"";return a?a+b:b},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,L={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},M=/\\|'|\r|\n|\t|\u2028|\u2029/g;z.template=function(a,b,c){var d;c=z.defaults({},c,z.templateSettings);var e=RegExp([(c.escape||K).source,(c.interpolate||K).source,(c.evaluate||K).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(M,function(a){return"\\"+L[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,z);var i=function(a){return d.call(this,a,z)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},z.chain=function(a){return z(a).chain()};var N=function(a){return this._chain?z(a).chain():a};z.mixin(z),A(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];z.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],N.call(this,c)}}),A(["concat","join","slice"],function(a){var b=f[a];z.prototype[a]=function(){return N.call(this,b.apply(this._wrapped,arguments))}}),z.extend(z.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)})()},{}],14:[function(a,b,c){c.readIEEE754=function(a,b,c,d,e){var f,g,h=8*e-d-1,i=(1<>1,k=-7,l=c?0:e-1,m=c?1:-1,n=a[b+l];for(l+=m,f=n&(1<<-k)-1,n>>=-k,k+=h;k>0;f=256*f+a[b+l],l+=m,k-=8);for(g=f&(1<<-k)-1,f>>=-k,k+=d;k>0;g=256*g+a[b+l],l+=m,k-=8);if(0===f)f=1-j;else{if(f===i)return g?0/0:1/0*(n?-1:1);g+=Math.pow(2,d),f-=j}return(n?-1:1)*g*Math.pow(2,f-d)},c.writeIEEE754=function(a,b,c,d,e,f){var g,h,i,j=8*f-e-1,k=(1<>1,m=23===e?Math.pow(2,-24)-Math.pow(2,-77):0,n=d?f-1:0,o=d?-1:1,p=0>b||0===b&&0>1/b?1:0;for(b=Math.abs(b),isNaN(b)||1/0===b?(h=isNaN(b)?1:0,g=k):(g=Math.floor(Math.log(b)/Math.LN2),1>b*(i=Math.pow(2,-g))&&(g--,i*=2),b+=g+l>=1?m/i:m*Math.pow(2,1-l),b*i>=2&&(g++,i/=2),g+l>=k?(h=0,g=k):g+l>=1?(h=(b*i-1)*Math.pow(2,e),g+=l):(h=b*Math.pow(2,l-1)*Math.pow(2,e),g=0));e>=8;a[c+n]=255&h,n+=o,h/=256,e-=8);for(g=g<0;a[c+n]=255&g,n+=o,g/=256,j-=8);a[c+n-o]|=128*p}},{}],13:[function(a,b,c){(function(){function b(a){this.length=a}function e(a){return 16>a?"0"+a.toString(16):a.toString(16)}function f(a){for(var b=[],c=0;a.length>c;c++)if(127>=a.charCodeAt(c))b.push(a.charCodeAt(c));else for(var d=encodeURIComponent(a.charAt(c)).substr(1).split("%"),e=0;d.length>e;e++)b.push(parseInt(d[e],16));return b}function g(a){for(var b=[],c=0;a.length>c;c++)b.push(255&a.charCodeAt(c));return b}function h(b){return a("base64-js").toByteArray(b)}function i(a,b,c,d){for(var f=0;d>f&&!(f+c>=b.length||f>=a.length);)b[f+c]=a[f],f++;return f}function j(a){try{return decodeURIComponent(a)}catch(b){return String.fromCharCode(65533)}}function k(a){return a=~~Math.ceil(+a),0>a?0:a}function l(a,c,d){if(!(this instanceof l))return new l(a,c,d);var e;if("number"==typeof d)this.length=k(c),this.parent=a,this.offset=d;else{switch(e=typeof a){case"number":this.length=k(a);break;case"string":this.length=l.byteLength(a,c);break;case"object":this.length=k(a.length);break;default:throw Error("First argument needs to be a number, array or string.")}if(this.length>l.poolSize?(this.parent=new b(this.length),this.offset=0):((!n||n.length-n.usedf;f++)this.parent[f+this.offset]=a instanceof l?a.readUInt8(f):a[f];else"string"==e&&(this.length=this.write(a,0,c))}}function m(a){return Array.isArray(a)||l.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length}function o(){n=new b(l.poolSize),n.used=0}function u(a,b,c,e){var f=0;return e||(d.ok("boolean"==typeof c,"missing or invalid endian"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(a.length>b+1,"Trying to read beyond buffer length")),b>=a.length?0:(c?(f=a.parent[a.offset+b]<<8,a.length>b+1&&(f|=a.parent[a.offset+b+1])):(f=a.parent[a.offset+b],a.length>b+1&&(f|=a.parent[a.offset+b+1]<<8)),f)}function v(a,b,c,e){var f=0;return e||(d.ok("boolean"==typeof c,"missing or invalid endian"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(a.length>b+3,"Trying to read beyond buffer length")),b>=a.length?0:(c?(a.length>b+1&&(f=a.parent[a.offset+b+1]<<16),a.length>b+2&&(f|=a.parent[a.offset+b+2]<<8),a.length>b+3&&(f|=a.parent[a.offset+b+3]),f+=a.parent[a.offset+b]<<24>>>0):(a.length>b+2&&(f=a.parent[a.offset+b+2]<<16),a.length>b+1&&(f|=a.parent[a.offset+b+1]<<8),f|=a.parent[a.offset+b],a.length>b+3&&(f+=a.parent[a.offset+b+3]<<24>>>0)),f)}function w(a,b,c,e){var f,g;return e||(d.ok("boolean"==typeof c,"missing or invalid endian"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(a.length>b+1,"Trying to read beyond buffer length")),g=u(a,b,c,e),f=32768&g,f?-1*(65535-g+1):g}function x(a,b,c,e){var f,g;return e||(d.ok("boolean"==typeof c,"missing or invalid endian"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(a.length>b+3,"Trying to read beyond buffer length")),g=v(a,b,c,e),f=2147483648&g,f?-1*(4294967295-g+1):g}function y(b,c,e,f){return f||(d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(b.length>c+3,"Trying to read beyond buffer length")),a("./buffer_ieee754").readIEEE754(b,c,e,23,4)}function z(b,c,e,f){return f||(d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(b.length>c+7,"Trying to read beyond buffer length")),a("./buffer_ieee754").readIEEE754(b,c,e,52,8)}function A(a,b){d.ok("number"==typeof a,"cannot write a non-number as a number"),d.ok(a>=0,"specified a negative value for writing an unsigned value"),d.ok(b>=a,"value is larger than maximum value for type"),d.ok(Math.floor(a)===a,"value has a fractional component")}function B(a,b,c,e,f){f||(d.ok(void 0!==b&&null!==b,"missing value"),d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(void 0!==c&&null!==c,"missing offset"),d.ok(a.length>c+1,"trying to write beyond buffer length"),A(b,65535));for(var g=0;Math.min(a.length-c,2)>g;g++)a.parent[a.offset+c+g]=(b&255<<8*(e?1-g:g))>>>8*(e?1-g:g)}function C(a,b,c,e,f){f||(d.ok(void 0!==b&&null!==b,"missing value"),d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(void 0!==c&&null!==c,"missing offset"),d.ok(a.length>c+3,"trying to write beyond buffer length"),A(b,4294967295));for(var g=0;Math.min(a.length-c,4)>g;g++)a.parent[a.offset+c+g]=255&b>>>8*(e?3-g:g)}function D(a,b,c){d.ok("number"==typeof a,"cannot write a non-number as a number"),d.ok(b>=a,"value larger than maximum allowed value"),d.ok(a>=c,"value smaller than minimum allowed value"),d.ok(Math.floor(a)===a,"value has a fractional component")}function E(a,b,c){d.ok("number"==typeof a,"cannot write a non-number as a number"),d.ok(b>=a,"value larger than maximum allowed value"),d.ok(a>=c,"value smaller than minimum allowed value")}function F(a,b,c,e,f){f||(d.ok(void 0!==b&&null!==b,"missing value"),d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(void 0!==c&&null!==c,"missing offset"),d.ok(a.length>c+1,"Trying to write beyond buffer length"),D(b,32767,-32768)),b>=0?B(a,b,c,e,f):B(a,65535+b+1,c,e,f)}function G(a,b,c,e,f){f||(d.ok(void 0!==b&&null!==b,"missing value"),d.ok("boolean"==typeof e,"missing or invalid endian"),d.ok(void 0!==c&&null!==c,"missing offset"),d.ok(a.length>c+3,"Trying to write beyond buffer length"),D(b,2147483647,-2147483648)),b>=0?C(a,b,c,e,f):C(a,4294967295+b+1,c,e,f)}function H(b,c,e,f,g){g||(d.ok(void 0!==c&&null!==c,"missing value"),d.ok("boolean"==typeof f,"missing or invalid endian"),d.ok(void 0!==e&&null!==e,"missing offset"),d.ok(b.length>e+3,"Trying to write beyond buffer length"),E(c,3.4028234663852886e38,-3.4028234663852886e38)),a("./buffer_ieee754").writeIEEE754(b,c,e,f,23,4)}function I(b,c,e,f,g){g||(d.ok(void 0!==c&&null!==c,"missing value"),d.ok("boolean"==typeof f,"missing or invalid endian"),d.ok(void 0!==e&&null!==e,"missing offset"),d.ok(b.length>e+7,"Trying to write beyond buffer length"),E(c,1.7976931348623157e308,-1.7976931348623157e308)),a("./buffer_ieee754").writeIEEE754(b,c,e,f,52,8)}var d=a("assert");c.INSPECT_MAX_BYTES=50,b.byteLength=function(a,b){switch(b||"utf8"){case"hex":return a.length/2;case"utf8":case"utf-8":return f(a).length;case"ascii":case"binary":return a.length;case"base64":return h(a).length;default:throw Error("Unknown encoding")}},b.prototype.utf8Write=function(a,c,d){return b._charsWritten=i(f(a),this,c,d)},b.prototype.asciiWrite=function(a,c,d){return b._charsWritten=i(g(a),this,c,d)},b.prototype.binaryWrite=b.prototype.asciiWrite,b.prototype.base64Write=function(a,c,d){return b._charsWritten=i(h(a),this,c,d)},b.prototype.base64Slice=function(){var d=Array.prototype.slice.apply(this,arguments);return a("base64-js").fromByteArray(d)},b.prototype.utf8Slice=function(){for(var a=Array.prototype.slice.apply(this,arguments),b="",c="",d=0;a.length>d;)127>=a[d]?(b+=j(c)+String.fromCharCode(a[d]),c=""):c+="%"+a[d].toString(16),d++;return b+j(c)},b.prototype.asciiSlice=function(){for(var a=Array.prototype.slice.apply(this,arguments),b="",c=0;a.length>c;c++)b+=String.fromCharCode(a[c]);return b},b.prototype.binarySlice=b.prototype.asciiSlice,b.prototype.inspect=function(){for(var a=[],b=this.length,d=0;b>d;d++)if(a[d]=e(this[d]),d==c.INSPECT_MAX_BYTES){a[d+1]="...";break}return""},b.prototype.hexSlice=function(a,b){var c=this.length;(!a||0>a)&&(a=0),(!b||0>b||b>c)&&(b=c);for(var d="",f=a;b>f;f++)d+=e(this[f]);return d},b.prototype.toString=function(a,b,c){if(a=((a||"utf8")+"").toLowerCase(),b=+b||0,c===void 0&&(c=this.length),+c==b)return"";switch(a){case"hex":return this.hexSlice(b,c);case"utf8":case"utf-8":return this.utf8Slice(b,c);case"ascii":return this.asciiSlice(b,c);case"binary":return this.binarySlice(b,c);case"base64":return this.base64Slice(b,c);case"ucs2":case"ucs-2":return this.ucs2Slice(b,c);default:throw Error("Unknown encoding")}},b.prototype.hexWrite=function(a,c,d){c=+c||0;var e=this.length-c;d?(d=+d,d>e&&(d=e)):d=e;var f=a.length;if(f%2)throw Error("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;d>g;g++){var h=parseInt(a.substr(2*g,2),16);if(isNaN(h))throw Error("Invalid hex string");this[c+g]=h}return b._charsWritten=2*g,g},b.prototype.write=function(a,b,c,d){if(isFinite(b))isFinite(c)||(d=c,c=void 0);else{var e=d;d=b,b=c,c=e}b=+b||0;var f=this.length-b;switch(c?(c=+c,c>f&&(c=f)):c=f,d=((d||"utf8")+"").toLowerCase()){case"hex":return this.hexWrite(a,b,c);case"utf8":case"utf-8":return this.utf8Write(a,b,c);case"ascii":return this.asciiWrite(a,b,c);case"binary":return this.binaryWrite(a,b,c);case"base64":return this.base64Write(a,b,c);case"ucs2":case"ucs-2":return this.ucs2Write(a,b,c);default:throw Error("Unknown encoding")}},b.prototype.slice=function(a,b){if(void 0===b&&(b=this.length),b>this.length)throw Error("oob");if(a>b)throw Error("oob");return new l(this,b-a,+a)},b.prototype.copy=function(a,b,c,e){for(var f=[],g=c;e>g;g++)d.ok(this[g]!==void 0,"copying undefined buffer bytes!"),f.push(this[g]);for(var g=b;b+f.length>g;g++)a[g]=f[g-b]},b.prototype.fill=function(a,b,c){if(c>this.length)throw Error("oob");if(b>c)throw Error("oob");for(var d=b;c>d;d++)this[d]=a},c.SlowBuffer=b,c.Buffer=l,l.poolSize=8192;var n;l.isBuffer=function(a){return a instanceof l||a instanceof b},l.concat=function(a,b){if(!Array.isArray(a))throw Error("Usage: Buffer.concat(list, [totalLength])\n list should be an Array.");if(0===a.length)return new l(0);if(1===a.length)return a[0];if("number"!=typeof b){b=0;for(var c=0;a.length>c;c++){var d=a[c];b+=d.length}}for(var e=new l(b),f=0,c=0;a.length>c;c++){var d=a[c];d.copy(e,f),f+=d.length}return e},l.prototype.inspect=function(){for(var a=[],b=this.length,d=0;b>d;d++)if(a[d]=e(this.parent[d+this.offset]),d==c.INSPECT_MAX_BYTES){a[d+1]="...";break}return""},l.prototype.get=function(a){if(0>a||a>=this.length)throw Error("oob");return this.parent[this.offset+a]},l.prototype.set=function(a,b){if(0>a||a>=this.length)throw Error("oob");return this.parent[this.offset+a]=b},l.prototype.write=function(a,c,d,e){if(isFinite(c))isFinite(d)||(e=d,d=void 0);else{var f=e;e=c,c=d,d=f}c=+c||0;var g=this.length-c;d?(d=+d,d>g&&(d=g)):d=g,e=((e||"utf8")+"").toLowerCase();var h;switch(e){case"hex":h=this.parent.hexWrite(a,this.offset+c,d);break;case"utf8":case"utf-8":h=this.parent.utf8Write(a,this.offset+c,d);break;case"ascii":h=this.parent.asciiWrite(a,this.offset+c,d);break;case"binary":h=this.parent.binaryWrite(a,this.offset+c,d);break;case"base64":h=this.parent.base64Write(a,this.offset+c,d);break;case"ucs2":case"ucs-2":h=this.parent.ucs2Write(a,this.offset+c,d);break;default:throw Error("Unknown encoding")}return l._charsWritten=b._charsWritten,h},l.prototype.toString=function(a,b,c){switch(a=((a||"utf8")+"").toLowerCase(),b===void 0||0>b?b=0:b>this.length&&(b=this.length),c===void 0||c>this.length?c=this.length:0>c&&(c=0),b+=this.offset,c+=this.offset,a){case"hex":return this.parent.hexSlice(b,c);case"utf8":case"utf-8":return this.parent.utf8Slice(b,c);case"ascii":return this.parent.asciiSlice(b,c);case"binary":return this.parent.binarySlice(b,c);case"base64":return this.parent.base64Slice(b,c);case"ucs2":case"ucs-2":return this.parent.ucs2Slice(b,c);default:throw Error("Unknown encoding")}},l.byteLength=b.byteLength,l.prototype.fill=function(a,b,c){if(a||(a=0),b||(b=0),c||(c=this.length),"string"==typeof a&&(a=a.charCodeAt(0)),"number"!=typeof a||isNaN(a))throw Error("value is not a number");if(b>c)throw Error("end < start");if(c===b)return 0;if(0==this.length)return 0;if(0>b||b>=this.length)throw Error("start out of bounds");if(0>c||c>this.length)throw Error("end out of bounds");return this.parent.fill(a,b+this.offset,c+this.offset)},l.prototype.copy=function(a,b,c,d){var e=this; +if(c||(c=0),d||(d=this.length),b||(b=0),c>d)throw Error("sourceEnd < sourceStart");if(d===c)return 0;if(0==a.length||0==e.length)return 0;if(0>b||b>=a.length)throw Error("targetStart out of bounds");if(0>c||c>=e.length)throw Error("sourceStart out of bounds");if(0>d||d>e.length)throw Error("sourceEnd out of bounds");return d>this.length&&(d=this.length),d-c>a.length-b&&(d=a.length-b+c),this.parent.copy(a.parent,b+a.offset,c+this.offset,d+this.offset)},l.prototype.slice=function(a,b){if(void 0===b&&(b=this.length),b>this.length)throw Error("oob");if(a>b)throw Error("oob");return new l(this.parent,b-a,+a+this.offset)},l.prototype.utf8Slice=function(a,b){return this.toString("utf8",a,b)},l.prototype.binarySlice=function(a,b){return this.toString("binary",a,b)},l.prototype.asciiSlice=function(a,b){return this.toString("ascii",a,b)},l.prototype.utf8Write=function(a,b){return this.write(a,b,"utf8")},l.prototype.binaryWrite=function(a,b){return this.write(a,b,"binary")},l.prototype.asciiWrite=function(a,b){return this.write(a,b,"ascii")},l.prototype.readUInt8=function(a,b){var c=this;return b||(d.ok(void 0!==a&&null!==a,"missing offset"),d.ok(c.length>a,"Trying to read beyond buffer length")),a>=c.length?void 0:c.parent[c.offset+a]},l.prototype.readUInt16LE=function(a,b){return u(this,a,!1,b)},l.prototype.readUInt16BE=function(a,b){return u(this,a,!0,b)},l.prototype.readUInt32LE=function(a,b){return v(this,a,!1,b)},l.prototype.readUInt32BE=function(a,b){return v(this,a,!0,b)},l.prototype.readInt8=function(a,b){var e,c=this;return b||(d.ok(void 0!==a&&null!==a,"missing offset"),d.ok(c.length>a,"Trying to read beyond buffer length")),a>=c.length?void 0:(e=128&c.parent[c.offset+a],e?-1*(255-c.parent[c.offset+a]+1):c.parent[c.offset+a])},l.prototype.readInt16LE=function(a,b){return w(this,a,!1,b)},l.prototype.readInt16BE=function(a,b){return w(this,a,!0,b)},l.prototype.readInt32LE=function(a,b){return x(this,a,!1,b)},l.prototype.readInt32BE=function(a,b){return x(this,a,!0,b)},l.prototype.readFloatLE=function(a,b){return y(this,a,!1,b)},l.prototype.readFloatBE=function(a,b){return y(this,a,!0,b)},l.prototype.readDoubleLE=function(a,b){return z(this,a,!1,b)},l.prototype.readDoubleBE=function(a,b){return z(this,a,!0,b)},l.prototype.writeUInt8=function(a,b,c){var e=this;c||(d.ok(void 0!==a&&null!==a,"missing value"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(e.length>b,"trying to write beyond buffer length"),A(a,255)),e.length>b&&(e.parent[e.offset+b]=a)},l.prototype.writeUInt16LE=function(a,b,c){B(this,a,b,!1,c)},l.prototype.writeUInt16BE=function(a,b,c){B(this,a,b,!0,c)},l.prototype.writeUInt32LE=function(a,b,c){C(this,a,b,!1,c)},l.prototype.writeUInt32BE=function(a,b,c){C(this,a,b,!0,c)},l.prototype.writeInt8=function(a,b,c){var e=this;c||(d.ok(void 0!==a&&null!==a,"missing value"),d.ok(void 0!==b&&null!==b,"missing offset"),d.ok(e.length>b,"Trying to write beyond buffer length"),D(a,127,-128)),a>=0?e.writeUInt8(a,b,c):e.writeUInt8(255+a+1,b,c)},l.prototype.writeInt16LE=function(a,b,c){F(this,a,b,!1,c)},l.prototype.writeInt16BE=function(a,b,c){F(this,a,b,!0,c)},l.prototype.writeInt32LE=function(a,b,c){G(this,a,b,!1,c)},l.prototype.writeInt32BE=function(a,b,c){G(this,a,b,!0,c)},l.prototype.writeFloatLE=function(a,b,c){H(this,a,b,!1,c)},l.prototype.writeFloatBE=function(a,b,c){H(this,a,b,!0,c)},l.prototype.writeDoubleLE=function(a,b,c){I(this,a,b,!1,c)},l.prototype.writeDoubleBE=function(a,b,c){I(this,a,b,!0,c)},b.prototype.readUInt8=l.prototype.readUInt8,b.prototype.readUInt16LE=l.prototype.readUInt16LE,b.prototype.readUInt16BE=l.prototype.readUInt16BE,b.prototype.readUInt32LE=l.prototype.readUInt32LE,b.prototype.readUInt32BE=l.prototype.readUInt32BE,b.prototype.readInt8=l.prototype.readInt8,b.prototype.readInt16LE=l.prototype.readInt16LE,b.prototype.readInt16BE=l.prototype.readInt16BE,b.prototype.readInt32LE=l.prototype.readInt32LE,b.prototype.readInt32BE=l.prototype.readInt32BE,b.prototype.readFloatLE=l.prototype.readFloatLE,b.prototype.readFloatBE=l.prototype.readFloatBE,b.prototype.readDoubleLE=l.prototype.readDoubleLE,b.prototype.readDoubleBE=l.prototype.readDoubleBE,b.prototype.writeUInt8=l.prototype.writeUInt8,b.prototype.writeUInt16LE=l.prototype.writeUInt16LE,b.prototype.writeUInt16BE=l.prototype.writeUInt16BE,b.prototype.writeUInt32LE=l.prototype.writeUInt32LE,b.prototype.writeUInt32BE=l.prototype.writeUInt32BE,b.prototype.writeInt8=l.prototype.writeInt8,b.prototype.writeInt16LE=l.prototype.writeInt16LE,b.prototype.writeInt16BE=l.prototype.writeInt16BE,b.prototype.writeInt32LE=l.prototype.writeInt32LE,b.prototype.writeInt32BE=l.prototype.writeInt32BE,b.prototype.writeFloatLE=l.prototype.writeFloatLE,b.prototype.writeFloatBE=l.prototype.writeFloatBE,b.prototype.writeDoubleLE=l.prototype.writeDoubleLE,b.prototype.writeDoubleBE=l.prototype.writeDoubleBE})()},{assert:9,"./buffer_ieee754":14,"base64-js":15}],15:[function(a,b){(function(){"use strict";function d(a){var b,d,e,f,g,h;if(a.length%4>0)throw"Invalid string. Length must be a multiple of 4";for(g=a.indexOf("="),g=g>0?a.length-g:0,h=[],e=g>0?a.length-4:a.length,b=0,d=0;e>b;b+=4,d+=3)f=c.indexOf(a[b])<<18|c.indexOf(a[b+1])<<12|c.indexOf(a[b+2])<<6|c.indexOf(a[b+3]),h.push((16711680&f)>>16),h.push((65280&f)>>8),h.push(255&f);return 2===g?(f=c.indexOf(a[b])<<2|c.indexOf(a[b+1])>>4,h.push(255&f)):1===g&&(f=c.indexOf(a[b])<<10|c.indexOf(a[b+1])<<4|c.indexOf(a[b+2])>>2,h.push(255&f>>8),h.push(255&f)),h}function e(a){function h(a){return c[63&a>>18]+c[63&a>>12]+c[63&a>>6]+c[63&a]}var b,f,g,d=a.length%3,e="";for(b=0,g=a.length-d;g>b;b+=3)f=(a[b]<<16)+(a[b+1]<<8)+a[b+2],e+=h(f);switch(d){case 1:f=a[a.length-1],e+=c[f>>2],e+=c[63&f<<4],e+="==";break;case 2:f=(a[a.length-2]<<8)+a[a.length-1],e+=c[f>>10],e+=c[63&f>>4],e+=c[63&f<<2],e+="="}return e}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";b.exports.toByteArray=d,b.exports.fromByteArray=e})()},{}]},{},["E/GbHF"]),JSHINT=a("jshint").JSHINT})(); \ No newline at end of file diff --git a/lib/config___users-template.php b/lib/config___users-template.php index 4fa366b..e7ca762 100644 --- a/lib/config___users-template.php +++ b/lib/config___users-template.php @@ -14,7 +14,6 @@ $ICEcoderUserSettings = array( "allowedIPs" => array("*"), "plugins" => array( array("Adminer\\nMySQL database manager","plugins/adminer/icon.png","margin-top: 3px","plugins/adminer/adminer-3.6.3-mysql-en.php","_blank",""), - array("JS Hint\\nJavaScript linter","plugins/jshint/icon.png","margin-top: 3px","http://www.jshint.com","_blank",""), array("Emmet\\nSnippet type booster","plugins/emmet/icon.png","margin-top: 3px","http://docs.emmet.io","_blank",""), array("ICErepo\\nGithub repo manager","plugins/ice-repo/icon.png","margin-top: 3px","plugins/ice-repo","_blank",""), array("Dochub\\nCoding syntax info","plugins/dochub/icon.png","margin-top: 3px","http://dochub.io","_blank",""), diff --git a/plugins/jshint/icon.png b/plugins/jshint/icon.png deleted file mode 100644 index a70bf61..0000000 Binary files a/plugins/jshint/icon.png and /dev/null differ diff --git a/plugins/jshint/jshint.js b/plugins/jshint/jshint.js deleted file mode 100644 index 53724f5..0000000 --- a/plugins/jshint/jshint.js +++ /dev/null @@ -1,4832 +0,0 @@ -/*! - * JSHint, by JSHint Community. - * - * Licensed under the same slightly modified MIT license that JSLint is. - * It stops evil-doers everywhere. - * - * JSHint is a derivative work of JSLint: - * - * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * The Software shall be used for Good, not Evil. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * JSHint was forked from the 2010-12-16 edition of JSLint. - * - */ - -/* - JSHINT is a global function. It takes two parameters. - - var myResult = JSHINT(source, option); - - The first parameter is either a string or an array of strings. If it is a - string, it will be split on '\n' or '\r'. If it is an array of strings, it - is assumed that each string represents one line. The source can be a - JavaScript text or a JSON text. - - The second parameter is an optional object of options which control the - operation of JSHINT. Most of the options are booleans: They are all - optional and have a default value of false. One of the options, predef, - can be an array of names, which will be used to declare global variables, - or an object whose keys are used as global names, with a boolean value - that determines if they are assignable. - - If it checks out, JSHINT returns true. Otherwise, it returns false. - - If false, you can inspect JSHINT.errors to find out the problems. - JSHINT.errors is an array of objects containing these members: - - { - line : The line (relative to 1) at which the lint was found - character : The character (relative to 1) at which the lint was found - reason : The problem - evidence : The text line in which the problem occurred - raw : The raw message before the details were inserted - a : The first detail - b : The second detail - c : The third detail - d : The fourth detail - } - - If a fatal error was found, a null will be the last element of the - JSHINT.errors array. - - You can request a data structure which contains JSHint's results. - - var myData = JSHINT.data(); - - It returns a structure with this form: - - { - errors: [ - { - line: NUMBER, - character: NUMBER, - reason: STRING, - evidence: STRING - } - ], - functions: [ - name: STRING, - line: NUMBER, - character: NUMBER, - last: NUMBER, - lastcharacter: NUMBER, - param: [ - STRING - ], - closure: [ - STRING - ], - var: [ - STRING - ], - exception: [ - STRING - ], - outer: [ - STRING - ], - unused: [ - STRING - ], - global: [ - STRING - ], - label: [ - STRING - ] - ], - globals: [ - STRING - ], - member: { - STRING: NUMBER - }, - unused: [ - { - name: STRING, - line: NUMBER - } - ], - implieds: [ - { - name: STRING, - line: NUMBER - } - ], - urls: [ - STRING - ], - json: BOOLEAN - } - - Empty arrays will not be included. - -*/ - -/*jshint - evil: true, nomen: false, onevar: false, regexp: false, strict: true, boss: true, - undef: true, maxlen: 100, indent: 4, quotmark: double, unused: true -*/ - -/*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%", "(begin)", - "(breakage)", "(character)", "(context)", "(error)", "(explicitNewcap)", "(global)", - "(identifier)", "(last)", "(lastcharacter)", "(line)", "(loopage)", "(metrics)", - "(name)", "(onevar)", "(params)", "(scope)", "(statement)", "(verb)", "(tokens)", "(catch)", - "*", "+", "++", "-", "--", "\/", "<", "<=", "==", - "===", ">", ">=", $, $$, $A, $F, $H, $R, $break, $continue, $w, Abstract, Ajax, - __filename, __dirname, ActiveXObject, Array, ArrayBuffer, ArrayBufferView, Audio, - Autocompleter, Asset, Boolean, Builder, Buffer, Browser, Blob, COM, CScript, Canvas, - CustomAnimation, Class, Control, ComplexityCount, Chain, Color, Cookie, Core, DataView, Date, - Debug, Draggable, Draggables, Droppables, Document, DomReady, DOMEvent, DOMReady, DOMParser, - Drag, E, Enumerator, Enumerable, Element, Elements, Error, Effect, EvalError, Event, - Events, FadeAnimation, Field, Flash, Float32Array, Float64Array, Form, - FormField, Frame, FormData, Function, Fx, GetObject, Group, Hash, HotKey, - HTMLElement, HTMLAnchorElement, HTMLBaseElement, HTMLBlockquoteElement, - HTMLBodyElement, HTMLBRElement, HTMLButtonElement, HTMLCanvasElement, HTMLDirectoryElement, - HTMLDivElement, HTMLDListElement, HTMLFieldSetElement, - HTMLFontElement, HTMLFormElement, HTMLFrameElement, HTMLFrameSetElement, - HTMLHeadElement, HTMLHeadingElement, HTMLHRElement, HTMLHtmlElement, - HTMLIFrameElement, HTMLImageElement, HTMLInputElement, HTMLIsIndexElement, - HTMLLabelElement, HTMLLayerElement, HTMLLegendElement, HTMLLIElement, - HTMLLinkElement, HTMLMapElement, HTMLMenuElement, HTMLMetaElement, - HTMLModElement, HTMLObjectElement, HTMLOListElement, HTMLOptGroupElement, - HTMLOptionElement, HTMLParagraphElement, HTMLParamElement, HTMLPreElement, - HTMLQuoteElement, HTMLScriptElement, HTMLSelectElement, HTMLStyleElement, - HtmlTable, HTMLTableCaptionElement, HTMLTableCellElement, HTMLTableColElement, - HTMLTableElement, HTMLTableRowElement, HTMLTableSectionElement, - HTMLTextAreaElement, HTMLTitleElement, HTMLUListElement, HTMLVideoElement, - Iframe, IframeShim, Image, importScripts, Int16Array, Int32Array, Int8Array, - Insertion, InputValidator, JSON, Keyboard, Locale, LN10, LN2, LOG10E, LOG2E, - MAX_VALUE, MIN_VALUE, Map, Mask, Math, MenuItem, MessageChannel, MessageEvent, MessagePort, - MoveAnimation, MooTools, MutationObserver, NaN, Native, NEGATIVE_INFINITY, Node, NodeFilter, - Number, Object, ObjectRange, - Option, Options, OverText, PI, POSITIVE_INFINITY, PeriodicalExecuter, Point, Position, Prototype, - RangeError, Rectangle, ReferenceError, RegExp, ResizeAnimation, Request, RotateAnimation, Set, - SQRT1_2, SQRT2, ScrollBar, ScriptEngine, ScriptEngineBuildVersion, - ScriptEngineMajorVersion, ScriptEngineMinorVersion, Scriptaculous, Scroller, - Slick, Slider, Selector, SharedWorker, String, Style, SyntaxError, Sortable, Sortables, - SortableObserver, Sound, Spinner, System, Swiff, Text, TextArea, Template, - Timer, Tips, Type, TypeError, Toggle, Try, "use strict", unescape, URI, URIError, URL, - VBArray, WeakMap, WSH, WScript, XDomainRequest, Web, Window, XMLDOM, XMLHttpRequest, XMLSerializer, - XPathEvaluator, XPathException, XPathExpression, XPathNamespace, XPathNSResolver, XPathResult, - "\\", a, abs, addEventListener, address, alert, apply, applicationCache, arguments, arity, - asi, atob, b, basic, basicToken, bitwise, blacklist, block, blur, boolOptions, boss, - browser, btoa, c, call, callee, caller, camelcase, cases, charAt, charCodeAt, character, - clearInterval, clearTimeout, close, closed, closure, comment, complexityCount, condition, - confirm, console, constructor, content, couch, create, css, curly, d, data, datalist, dd, debug, - decodeURI, decodeURIComponent, defaultStatus, defineClass, deserialize, devel, document, - dojo, dijit, dojox, define, else, emit, encodeURI, encodeURIComponent, elem, - eqeq, eqeqeq, eqnull, errors, es5, escape, esnext, eval, event, evidence, evil, - ex, exception, exec, exps, expr, exports, FileReader, first, floor, focus, forEach, - forin, fragment, frames, from, fromCharCode, fud, funcscope, funct, function, functions, - g, gc, getComputedStyle, getRow, getter, getterToken, GLOBAL, global, globals, globalstrict, - hasOwnProperty, help, history, i, id, identifier, immed, implieds, importPackage, include, - indent, indexOf, init, ins, internals, instanceOf, isAlpha, isApplicationRunning, isArray, - isDigit, isFinite, isNaN, iterator, java, join, jshint, - JSHINT, json, jquery, jQuery, keys, label, labelled, last, lastcharacter, lastsemic, laxbreak, - laxcomma, latedef, lbp, led, left, length, line, load, loadClass, localStorage, location, - log, loopfunc, m, match, max, maxcomplexity, maxdepth, maxerr, maxlen, maxstatements, maxparams, - member, message, meta, module, moveBy, moveTo, mootools, multistr, name, navigator, new, newcap, - nestedBlockDepth, noarg, node, noempty, nomen, nonew, nonstandard, nud, onbeforeunload, onblur, - onerror, onevar, onecase, onfocus, onload, onresize, onunload, open, openDatabase, openURL, - opener, opera, options, outer, param, parent, parseFloat, parseInt, passfail, plusplus, - postMessage, pop, predef, print, process, prompt, proto, prototype, prototypejs, provides, push, - quit, quotmark, range, raw, reach, reason, regexp, readFile, readUrl, regexdash, - removeEventListener, replace, report, require, reserved, resizeBy, resizeTo, resolvePath, - resumeUpdates, respond, rhino, right, runCommand, scroll, scope, screen, scripturl, scrollBy, - scrollTo, scrollbar, search, seal, self, send, serialize, sessionStorage, setInterval, setTimeout, - setter, setterToken, shift, slice, smarttabs, sort, spawn, split, statement, statementCount, stack, - status, start, strict, sub, substr, supernew, shadow, supplant, sum, sync, test, toLowerCase, - toString, toUpperCase, toint32, token, tokens, top, trailing, type, typeOf, Uint16Array, - Uint32Array, Uint8Array, undef, undefs, unused, urls, validthis, value, valueOf, var, vars, - version, verifyMaxParametersPerFunction, verifyMaxStatementsPerFunction, - verifyMaxComplexityPerFunction, verifyMaxNestedBlockDepthPerFunction, WebSocket, withstmt, white, - window, windows, Worker, worker, wsh, yui, YUI, Y, YUI_config*/ - -/*global exports: false */ - -// We build the application inside a function so that we produce only a single -// global variable. That function will be invoked immediately, and its return -// value is the JSHINT function itself. - -var JSHINT = (function () { - "use strict"; - - var anonname, // The guessed name for anonymous functions. - -// These are operators that should not be used with the ! operator. - - bang = { - "<" : true, - "<=" : true, - "==" : true, - "===": true, - "!==": true, - "!=" : true, - ">" : true, - ">=" : true, - "+" : true, - "-" : true, - "*" : true, - "/" : true, - "%" : true - }, - - // These are the JSHint boolean options. - boolOptions = { - asi : true, // if automatic semicolon insertion should be tolerated - bitwise : true, // if bitwise operators should not be allowed - boss : true, // if advanced usage of assignments should be allowed - browser : true, // if the standard browser globals should be predefined - camelcase : true, // if identifiers should be required in camel case - couch : true, // if CouchDB globals should be predefined - curly : true, // if curly braces around all blocks should be required - debug : true, // if debugger statements should be allowed - devel : true, // if logging globals should be predefined (console, - // alert, etc.) - dojo : true, // if Dojo Toolkit globals should be predefined - eqeqeq : true, // if === should be required - eqnull : true, // if == null comparisons should be tolerated - es5 : true, // if ES5 syntax should be allowed - esnext : true, // if es.next specific syntax should be allowed - evil : true, // if eval should be allowed - expr : true, // if ExpressionStatement should be allowed as Programs - forin : true, // if for in statements must filter - funcscope : true, // if only function scope should be used for scope tests - globalstrict: true, // if global "use strict"; should be allowed (also - // enables 'strict') - immed : true, // if immediate invocations must be wrapped in parens - iterator : true, // if the `__iterator__` property should be allowed - jquery : true, // if jQuery globals should be predefined - lastsemic : true, // if semicolons may be ommitted for the trailing - // statements inside of a one-line blocks. - latedef : true, // if the use before definition should not be tolerated - laxbreak : true, // if line breaks should not be checked - laxcomma : true, // if line breaks should not be checked around commas - loopfunc : true, // if functions should be allowed to be defined within - // loops - mootools : true, // if MooTools globals should be predefined - multistr : true, // allow multiline strings - newcap : true, // if constructor names must be capitalized - noarg : true, // if arguments.caller and arguments.callee should be - // disallowed - node : true, // if the Node.js environment globals should be - // predefined - noempty : true, // if empty blocks should be disallowed - nonew : true, // if using `new` for side-effects should be disallowed - nonstandard : true, // if non-standard (but widely adopted) globals should - // be predefined - nomen : true, // if names should be checked - onevar : true, // if only one var statement per function should be - // allowed - onecase : true, // if one case switch statements should be allowed - passfail : true, // if the scan should stop on first error - plusplus : true, // if increment/decrement should not be allowed - proto : true, // if the `__proto__` property should be allowed - prototypejs : true, // if Prototype and Scriptaculous globals should be - // predefined - regexdash : true, // if unescaped first/last dash (-) inside brackets - // should be tolerated - regexp : true, // if the . should not be allowed in regexp literals - rhino : true, // if the Rhino environment globals should be predefined - undef : true, // if variables should be declared before used - unused : true, // if variables should be always used - scripturl : true, // if script-targeted URLs should be tolerated - shadow : true, // if variable shadowing should be tolerated - smarttabs : true, // if smarttabs should be tolerated - // (http://www.emacswiki.org/emacs/SmartTabs) - strict : true, // require the "use strict"; pragma - sub : true, // if all forms of subscript notation are tolerated - supernew : true, // if `new function () { ... };` and `new Object;` - // should be tolerated - trailing : true, // if trailing whitespace rules apply - validthis : true, // if 'this' inside a non-constructor function is valid. - // This is a function scoped option only. - withstmt : true, // if with statements should be allowed - white : true, // if strict whitespace rules apply - worker : true, // if Web Worker script symbols should be allowed - wsh : true, // if the Windows Scripting Host environment globals - // should be predefined - yui : true // YUI variables should be predefined - }, - - // These are the JSHint options that can take any value - // (we use this object to detect invalid options) - valOptions = { - maxlen : false, - indent : false, - maxerr : false, - predef : false, - quotmark : false, //'single'|'double'|true - scope : false, - maxstatements: false, // {int} max statements per function - maxdepth : false, // {int} max nested block depth per function - maxparams : false, // {int} max params per function - maxcomplexity: false // {int} max cyclomatic complexity per function - }, - - // These are JSHint boolean options which are shared with JSLint - // where the definition in JSHint is opposite JSLint - invertedOptions = { - bitwise : true, - forin : true, - newcap : true, - nomen : true, - plusplus : true, - regexp : true, - undef : true, - white : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - onevar : true - }, - - // These are JSHint boolean options which are shared with JSLint - // where the name has been changed but the effect is unchanged - renamedOptions = { - eqeq : "eqeqeq", - vars : "onevar", - windows : "wsh" - }, - - - // browser contains a set of global names which are commonly provided by a - // web browser environment. - browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement : false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement : false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement : false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false - }, - - couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false - }, - - declared, // Globals that were declared using /*global ... */ syntax. - - devel = { - alert : false, - confirm : false, - console : false, - Debug : false, - opera : false, - prompt : false - }, - - dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require" : false - }, - - funct, // The current function - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - jsonmode, - - jquery = { - "$" : false, - jQuery : false - }, - - lines, - lookahead, - member, - membersOnly, - - mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator : false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false - }, - - nexttoken, - - node = { - __filename : false, - __dirname : false, - Buffer : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval : false - }, - - noreach, - option, - predefined, // Global variables defined by option - prereg, - prevtoken, - - prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false - }, - - quotmark, - - rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false - }, - - scope, // The current scope - stack, - - // standard contains the global names that are provided by the - // ECMAScript standard. - standard = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Map : false, - Math : false, - NaN : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false - }, - - // widely adopted global names that are not part of ECMAScript standard - nonstandard = { - escape : false, - unescape : false - }, - - directive, - syntax = {}, - tab, - token, - unuseds, - urls, - useESNextSyntax, - warnings, - - worker = { - importScripts : true, - postMessage : true, - self : true - }, - - wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true - }, - - yui = { - YUI : false, - Y : false, - YUI_config : false - }; - // Regular expressions. Some of these are stupidly long. - var ax, cx, tx, nx, nxg, lx, ix, jx, ft; - (function () { - /*jshint maxlen:300 */ - - // unsafe comment or string - ax = /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - - // unsafe characters that are silently deleted by one or more browsers - cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - - // token - tx = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/=(?!(\S*\/[gim]?))|\/(\*(jshint|jslint|members?|global)?|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/; - - // characters in strings that need escapement - nx = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - nxg = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - - // star slash - lx = /\*\//; - - // identifier - ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - - // javascript url - jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i; - - // catches /* falls through */ comments - ft = /^\s*\/\*\s*falls\sthrough\s*\*\/\s*$/; - }()); - - function F() {} // Used by Object.create - - function is_own(object, name) { - // The object.hasOwnProperty method fails when the property under consideration - // is named 'hasOwnProperty'. So we have to use this more convoluted form. - return Object.prototype.hasOwnProperty.call(object, name); - } - - function checkOption(name, t) { - if (valOptions[name] === undefined && boolOptions[name] === undefined) { - warning("Bad option: '" + name + "'.", t); - } - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - // Provide critical ES5 functions to ES3. - - if (typeof Array.isArray !== "function") { - Array.isArray = function (o) { - return Object.prototype.toString.apply(o) === "[object Array]"; - }; - } - - if (!Array.prototype.forEach) { - Array.prototype.forEach = function (fn, scope) { - var len = this.length; - - for (var i = 0; i < len; i++) { - fn.call(scope || this, this[i], i, this); - } - }; - } - - if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { - if (this === null || this === undefined) { - throw new TypeError(); - } - - var t = new Object(this); - var len = t.length >>> 0; - - if (len === 0) { - return -1; - } - - var n = 0; - if (arguments.length > 0) { - n = Number(arguments[1]); - if (n != n) { // shortcut for verifying if it's NaN - n = 0; - } else if (n !== 0 && n != Infinity && n != -Infinity) { - n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } - } - - if (n >= len) { - return -1; - } - - var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); - for (; k < len; k++) { - if (k in t && t[k] === searchElement) { - return k; - } - } - - return -1; - }; - } - - if (typeof Object.create !== "function") { - Object.create = function (o) { - F.prototype = o; - return new F(); - }; - } - - if (typeof Object.keys !== "function") { - Object.keys = function (o) { - var a = [], k; - for (k in o) { - if (is_own(o, k)) { - a.push(k); - } - } - return a; - }; - } - - // Non standard methods - - function isAlpha(str) { - return (str >= "a" && str <= "z\uffff") || - (str >= "A" && str <= "Z\uffff"); - } - - function isDigit(str) { - return (str >= "0" && str <= "9"); - } - - function isIdentifier(token, value) { - if (!token) - return false; - - if (!token.identifier || token.value !== value) - return false; - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function (a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(t, o) { - var n; - for (n in o) { - if (is_own(o, n) && !is_own(JSHINT.blacklist, n)) { - t[n] = o[n]; - } - } - } - - function updatePredefined() { - Object.keys(JSHINT.blacklist).forEach(function (key) { - delete predefined[key]; - }); - } - - function assume() { - if (option.couch) { - combine(predefined, couch); - } - - if (option.rhino) { - combine(predefined, rhino); - } - - if (option.prototypejs) { - combine(predefined, prototypejs); - } - - if (option.node) { - combine(predefined, node); - option.globalstrict = true; - } - - if (option.devel) { - combine(predefined, devel); - } - - if (option.dojo) { - combine(predefined, dojo); - } - - if (option.browser) { - combine(predefined, browser); - } - - if (option.nonstandard) { - combine(predefined, nonstandard); - } - - if (option.jquery) { - combine(predefined, jquery); - } - - if (option.mootools) { - combine(predefined, mootools); - } - - if (option.worker) { - combine(predefined, worker); - } - - if (option.wsh) { - combine(predefined, wsh); - } - - if (option.esnext) { - useESNextSyntax(); - } - - if (option.globalstrict && option.strict !== false) { - option.strict = true; - } - - if (option.yui) { - combine(predefined, yui); - } - } - - - // Produce an error warning. - function quit(message, line, chr) { - var percentage = Math.floor((line / lines.length) * 100); - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message - }; - } - - function isundef(scope, m, t, a) { - return JSHINT.undefs.push([scope, m, t, a]); - } - - function warning(m, t, a, b, c, d) { - var ch, l, w; - t = t || nexttoken; - if (t.id === "(end)") { // `~ - t = token; - } - l = t.line || 0; - ch = t.from || 0; - w = { - id: "(error)", - raw: m, - evidence: lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - w.reason = supplant(m, w); - JSHINT.errors.push(w); - if (option.passfail) { - quit("Stopping. ", l, ch); - } - warnings += 1; - if (warnings >= option.maxerr) { - quit("Too many errors.", l, ch); - } - return w; - } - - function warningAt(m, l, ch, a, b, c, d) { - return warning(m, { - line: l, - from: ch - }, a, b, c, d); - } - - function error(m, t, a, b, c, d) { - warning(m, t, a, b, c, d); - } - - function errorAt(m, l, ch, a, b, c, d) { - return error(m, { - line: l, - from: ch - }, a, b, c, d); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - -// lexical analysis and token construction - - var lex = (function lex() { - var character, from, line, s; - -// Private lex methods - - function nextLine() { - var at, - match, - tw; // trailing whitespace check - - if (line >= lines.length) - return false; - - character = 1; - s = lines[line]; - line += 1; - - // If smarttabs option is used check for spaces followed by tabs only. - // Otherwise check for any occurence of mixed tabs and spaces. - // Tabs and one space followed by block comment is allowed. - if (option.smarttabs) { - // negative look-behind for "//" - match = s.match(/(\/\/)? \t/); - at = match && !match[1] ? 0 : -1; - } else { - at = s.search(/ \t|\t [^\*]/); - } - - if (at >= 0) - warningAt("Mixed spaces and tabs.", line, at + 1); - - s = s.replace(/\t/g, tab); - at = s.search(cx); - - if (at >= 0) - warningAt("Unsafe character.", line, at); - - if (option.maxlen && option.maxlen < s.length) - warningAt("Line too long.", line, s.length); - - // Check for trailing whitespaces - tw = option.trailing && s.match(/^(.*?)\s+$/); - if (tw && !/^\s+$/.test(s)) { - warningAt("Trailing whitespace.", line, tw[1].length + 1); - } - return true; - } - -// Produce a token object. The token inherits from a syntax symbol. - - function it(type, value) { - var i, t; - - function checkName(name) { - if (!option.proto && name === "__proto__") { - warningAt("The '{a}' property is deprecated.", line, from, name); - return; - } - - if (!option.iterator && name === "__iterator__") { - warningAt("'{a}' is only available in JavaScript 1.7.", line, from, name); - return; - } - - // Check for dangling underscores unless we're in Node - // environment and this identifier represents built-in - // Node globals with underscores. - - var hasDangling = /^(_+.*|.*_+)$/.test(name); - - if (option.nomen && hasDangling && name !== "_") { - if (option.node && token.id !== "." && /^(__dirname|__filename)$/.test(name)) - return; - - warningAt("Unexpected {a} in '{b}'.", line, from, "dangling '_'", name); - return; - } - - // Check for non-camelcase names. Names like MY_VAR and - // _myVar are okay though. - - if (option.camelcase) { - if (name.replace(/^_+/, "").indexOf("_") > -1 && !name.match(/^[A-Z0-9_]*$/)) { - warningAt("Identifier '{a}' is not in camel case.", line, from, value); - } - } - } - - if (type === "(color)" || type === "(range)") { - t = {type: type}; - } else if (type === "(punctuator)" || - (type === "(identifier)" && is_own(syntax, value))) { - t = syntax[value] || syntax["(error)"]; - } else { - t = syntax[type]; - } - - t = Object.create(t); - - if (type === "(string)" || type === "(range)") { - if (!option.scripturl && jx.test(value)) { - warningAt("Script URL.", line, from); - } - } - - if (type === "(identifier)") { - t.identifier = true; - checkName(value); - } - - t.value = value; - t.line = line; - t.character = character; - t.from = from; - i = t.id; - if (i !== "(endline)") { - prereg = i && - (("(,=:[!&|?{};".indexOf(i.charAt(i.length - 1)) >= 0) || - i === "return" || - i === "case"); - } - return t; - } - - // Public lex methods - return { - init: function (source) { - if (typeof source === "string") { - lines = source - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } else { - lines = source; - } - - // If the first line is a shebang (#!), make it a blank and move on. - // Shebangs are used by Node scripts. - if (lines[0] && lines[0].substr(0, 2) === "#!") - lines[0] = ""; - - line = 0; - nextLine(); - from = 1; - }, - - range: function (begin, end) { - var c, value = ""; - from = character; - if (s.charAt(0) !== begin) { - errorAt("Expected '{a}' and instead saw '{b}'.", - line, character, begin, s.charAt(0)); - } - for (;;) { - s = s.slice(1); - character += 1; - c = s.charAt(0); - switch (c) { - case "": - errorAt("Missing '{a}'.", line, character, c); - break; - case end: - s = s.slice(1); - character += 1; - return it("(range)", value); - case "\\": - warningAt("Unexpected '{a}'.", line, character, c); - } - value += c; - } - - }, - - - // token -- this is called by advance to get the next token - token: function () { - var b, c, captures, d, depth, high, i, l, low, q, t, isLiteral, isInRange, n; - - function match(x) { - var r = x.exec(s), r1; - - if (r) { - l = r[0].length; - r1 = r[1]; - c = r1.charAt(0); - s = s.substr(l); - from = character + l - r1.length; - character += l; - return r1; - } - } - - function string(x) { - var c, j, r = "", allowNewLine = false; - - if (jsonmode && x !== "\"") { - warningAt("Strings must use doublequote.", - line, character); - } - - if (option.quotmark) { - if (option.quotmark === "single" && x !== "'") { - warningAt("Strings must use singlequote.", - line, character); - } else if (option.quotmark === "double" && x !== "\"") { - warningAt("Strings must use doublequote.", - line, character); - } else if (option.quotmark === true) { - quotmark = quotmark || x; - if (quotmark !== x) { - warningAt("Mixed double and single quotes.", - line, character); - } - } - } - - function esc(n) { - var i = parseInt(s.substr(j + 1, n), 16); - j += n; - if (i >= 32 && i <= 126 && - i !== 34 && i !== 92 && i !== 39) { - warningAt("Unnecessary escapement.", line, character); - } - character += n; - c = String.fromCharCode(i); - } - - j = 0; -unclosedString: for (;;) { - while (j >= s.length) { - j = 0; - - var cl = line, cf = from; - if (!nextLine()) { - errorAt("Unclosed string.", cl, cf); - break unclosedString; - } - - if (allowNewLine) { - allowNewLine = false; - } else { - warningAt("Unclosed string.", cl, cf); - } - } - - c = s.charAt(j); - if (c === x) { - character += 1; - s = s.substr(j + 1); - return it("(string)", r, x); - } - - if (c < " ") { - if (c === "\n" || c === "\r") { - break; - } - warningAt("Control character in string: {a}.", - line, character + j, s.slice(0, j)); - } else if (c === "\\") { - j += 1; - character += 1; - c = s.charAt(j); - n = s.charAt(j + 1); - switch (c) { - case "\\": - case "\"": - case "/": - break; - case "\'": - if (jsonmode) { - warningAt("Avoid \\'.", line, character); - } - break; - case "b": - c = "\b"; - break; - case "f": - c = "\f"; - break; - case "n": - c = "\n"; - break; - case "r": - c = "\r"; - break; - case "t": - c = "\t"; - break; - case "0": - c = "\0"; - // Octal literals fail in strict mode - // check if the number is between 00 and 07 - // where 'n' is the token next to 'c' - if (n >= 0 && n <= 7 && directive["use strict"]) { - warningAt( - "Octal literals are not allowed in strict mode.", - line, character); - } - break; - case "u": - esc(4); - break; - case "v": - if (jsonmode) { - warningAt("Avoid \\v.", line, character); - } - c = "\v"; - break; - case "x": - if (jsonmode) { - warningAt("Avoid \\x-.", line, character); - } - esc(2); - break; - case "": - // last character is escape character - // always allow new line if escaped, but show - // warning if option is not set - allowNewLine = true; - if (option.multistr) { - if (jsonmode) { - warningAt("Avoid EOL escapement.", line, character); - } - c = ""; - character -= 1; - break; - } - warningAt("Bad escapement of EOL. Use option multistr if needed.", - line, character); - break; - case "!": - if (s.charAt(j - 2) === "<") - break; - /*falls through*/ - default: - warningAt("Bad escapement.", line, character); - } - } - r += c; - character += 1; - j += 1; - } - } - - for (;;) { - if (!s) { - return it(nextLine() ? "(endline)" : "(end)", ""); - } - - t = match(tx); - - if (!t) { - t = ""; - c = ""; - while (s && s < "!") { - s = s.substr(1); - } - if (s) { - errorAt("Unexpected '{a}'.", line, character, s.substr(0, 1)); - s = ""; - } - } else { - - // identifier - - if (isAlpha(c) || c === "_" || c === "$") { - return it("(identifier)", t); - } - - // number - - if (isDigit(c)) { - if (!isFinite(Number(t))) { - warningAt("Bad number '{a}'.", - line, character, t); - } - if (isAlpha(s.substr(0, 1))) { - warningAt("Missing space after '{a}'.", - line, character, t); - } - if (c === "0") { - d = t.substr(1, 1); - if (isDigit(d)) { - if (token.id !== ".") { - warningAt("Don't use extra leading zeros '{a}'.", - line, character, t); - } - } else if (jsonmode && (d === "x" || d === "X")) { - warningAt("Avoid 0x-. '{a}'.", - line, character, t); - } - } - if (t.substr(t.length - 1) === ".") { - warningAt( -"A trailing decimal point can be confused with a dot '{a}'.", line, character, t); - } - return it("(number)", t); - } - switch (t) { - - // string - - case "\"": - case "'": - return string(t); - - // // comment - - case "//": - s = ""; - token.comment = true; - break; - - // /* comment - - case "/*": - for (;;) { - i = s.search(lx); - if (i >= 0) { - break; - } - if (!nextLine()) { - errorAt("Unclosed comment.", line, character); - } - } - s = s.substr(i + 2); - token.comment = true; - break; - - // /*members /*jshint /*global - - case "/*members": - case "/*member": - case "/*jshint": - case "/*jslint": - case "/*global": - case "*/": - return { - value: t, - type: "special", - line: line, - character: character, - from: from - }; - - case "": - break; - // / - case "/": - if (s.charAt(0) === "=") { - errorAt("A regular expression literal can be confused with '/='.", - line, from); - } - - if (prereg) { - depth = 0; - captures = 0; - l = 0; - for (;;) { - b = true; - c = s.charAt(l); - l += 1; - switch (c) { - case "": - errorAt("Unclosed regular expression.", line, from); - return quit("Stopping.", line, from); - case "/": - if (depth > 0) { - warningAt("{a} unterminated regular expression " + - "group(s).", line, from + l, depth); - } - c = s.substr(0, l - 1); - q = { - g: true, - i: true, - m: true - }; - while (q[s.charAt(l)] === true) { - q[s.charAt(l)] = false; - l += 1; - } - character += l; - s = s.substr(l); - q = s.charAt(0); - if (q === "/" || q === "*") { - errorAt("Confusing regular expression.", - line, from); - } - return it("(regexp)", c); - case "\\": - c = s.charAt(l); - if (c < " ") { - warningAt( -"Unexpected control character in regular expression.", line, from + l); - } else if (c === "<") { - warningAt( -"Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - break; - case "(": - depth += 1; - b = false; - if (s.charAt(l) === "?") { - l += 1; - switch (s.charAt(l)) { - case ":": - case "=": - case "!": - l += 1; - break; - default: - warningAt( -"Expected '{a}' and instead saw '{b}'.", line, from + l, ":", s.charAt(l)); - } - } else { - captures += 1; - } - break; - case "|": - b = false; - break; - case ")": - if (depth === 0) { - warningAt("Unescaped '{a}'.", - line, from + l, ")"); - } else { - depth -= 1; - } - break; - case " ": - q = 1; - while (s.charAt(l) === " ") { - l += 1; - q += 1; - } - if (q > 1) { - warningAt( -"Spaces are hard to count. Use {{a}}.", line, from + l, q); - } - break; - case "[": - c = s.charAt(l); - if (c === "^") { - l += 1; - if (s.charAt(l) === "]") { - errorAt("Unescaped '{a}'.", - line, from + l, "^"); - } - } - if (c === "]") { - warningAt("Empty class.", line, - from + l - 1); - } - isLiteral = false; - isInRange = false; -klass: do { - c = s.charAt(l); - l += 1; - switch (c) { - case "[": - case "^": - warningAt("Unescaped '{a}'.", - line, from + l, c); - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "-": - if (isLiteral && !isInRange) { - isLiteral = false; - isInRange = true; - } else if (isInRange) { - isInRange = false; - } else if (s.charAt(l) === "]") { - isInRange = true; - } else { - if (option.regexdash !== (l === 2 || (l === 3 && - s.charAt(1) === "^"))) { - warningAt("Unescaped '{a}'.", - line, from + l - 1, "-"); - } - isLiteral = true; - } - break; - case "]": - if (isInRange && !option.regexdash) { - warningAt("Unescaped '{a}'.", - line, from + l - 1, "-"); - } - break klass; - case "\\": - c = s.charAt(l); - if (c < " ") { - warningAt( -"Unexpected control character in regular expression.", line, from + l); - } else if (c === "<") { - warningAt( -"Unexpected escaped character '{a}' in regular expression.", line, from + l, c); - } - l += 1; - - // \w, \s and \d are never part of a character range - if (/[wsd]/i.test(c)) { - if (isInRange) { - warningAt("Unescaped '{a}'.", - line, from + l, "-"); - isInRange = false; - } - isLiteral = false; - } else if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "/": - warningAt("Unescaped '{a}'.", - line, from + l - 1, "/"); - - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - case "<": - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - break; - default: - if (isInRange) { - isInRange = false; - } else { - isLiteral = true; - } - } - } while (c); - break; - case ".": - if (option.regexp) { - warningAt("Insecure '{a}'.", line, - from + l, c); - } - break; - case "]": - case "?": - case "{": - case "}": - case "+": - case "*": - warningAt("Unescaped '{a}'.", line, - from + l, c); - } - if (b) { - switch (s.charAt(l)) { - case "?": - case "+": - case "*": - l += 1; - if (s.charAt(l) === "?") { - l += 1; - } - break; - case "{": - l += 1; - c = s.charAt(l); - if (c < "0" || c > "9") { - warningAt( -"Expected a number and instead saw '{a}'.", line, from + l, c); - break; // No reason to continue checking numbers. - } - l += 1; - low = +c; - for (;;) { - c = s.charAt(l); - if (c < "0" || c > "9") { - break; - } - l += 1; - low = +c + (low * 10); - } - high = low; - if (c === ",") { - l += 1; - high = Infinity; - c = s.charAt(l); - if (c >= "0" && c <= "9") { - l += 1; - high = +c; - for (;;) { - c = s.charAt(l); - if (c < "0" || c > "9") { - break; - } - l += 1; - high = +c + (high * 10); - } - } - } - if (s.charAt(l) !== "}") { - warningAt( -"Expected '{a}' and instead saw '{b}'.", line, from + l, "}", c); - } else { - l += 1; - } - if (s.charAt(l) === "?") { - l += 1; - } - if (low > high) { - warningAt( -"'{a}' should not be greater than '{b}'.", line, from + l, low, high); - } - } - } - } - c = s.substr(0, l - 1); - character += l; - s = s.substr(l); - return it("(regexp)", c); - } - return it("(punctuator)", t); - - // punctuator - - case "#": - return it("(punctuator)", t); - default: - return it("(punctuator)", t); - } - } - } - } - }; - }()); - - - function addlabel(t, type, token) { - if (t === "hasOwnProperty") { - warning("'hasOwnProperty' is a really bad name."); - } - - // Define t in the current function in the current scope. - if (type === "exception") { - if (is_own(funct["(context)"], t)) { - if (funct[t] !== true && !option.node) { - warning("Value of '{a}' may be overwritten in IE.", nexttoken, t); - } - } - } - - if (is_own(funct, t) && !funct["(global)"]) { - if (funct[t] === true) { - if (option.latedef) - warning("'{a}' was used before it was defined.", nexttoken, t); - } else { - if (!option.shadow && type !== "exception") { - warning("'{a}' is already defined.", nexttoken, t); - } - } - } - - funct[t] = type; - - if (token) { - funct["(tokens)"][t] = token; - } - - if (funct["(global)"]) { - global[t] = funct; - if (is_own(implied, t)) { - if (option.latedef) - warning("'{a}' was used before it was defined.", nexttoken, t); - delete implied[t]; - } - } else { - scope[t] = funct; - } - } - - - function doOption() { - var nt = nexttoken; - var o = nt.value; - var quotmarkValue = option.quotmark; - var predef = {}; - var b, obj, filter, t, tn, v, minus; - - switch (o) { - case "*/": - error("Unbegun comment."); - break; - case "/*members": - case "/*member": - o = "/*members"; - if (!membersOnly) { - membersOnly = {}; - } - obj = membersOnly; - option.quotmark = false; - break; - case "/*jshint": - case "/*jslint": - obj = option; - filter = boolOptions; - break; - case "/*global": - obj = predef; - break; - default: - error("What?"); - } - - t = lex.token(); -loop: for (;;) { - minus = false; - for (;;) { - if (t.type === "special" && t.value === "*/") { - break loop; - } - if (t.id !== "(endline)" && t.id !== ",") { - break; - } - t = lex.token(); - } - - if (o === "/*global" && t.value === "-") { - minus = true; - t = lex.token(); - } - - if (t.type !== "(string)" && t.type !== "(identifier)" && o !== "/*members") { - error("Bad option.", t); - } - - v = lex.token(); - if (v.id === ":") { - v = lex.token(); - - if (obj === membersOnly) { - error("Expected '{a}' and instead saw '{b}'.", t, "*/", ":"); - } - - if (o === "/*jshint") { - checkOption(t.value, t); - } - - var numericVals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (numericVals.indexOf(t.value) > -1 && (o === "/*jshint" || o === "/*jslint")) { - b = +v.value; - - if (typeof b !== "number" || !isFinite(b) || b <= 0 || Math.floor(b) !== b) { - error("Expected a small integer and instead saw '{a}'.", v, v.value); - } - - if (t.value === "indent") - obj.white = true; - - obj[t.value] = b; - } else if (t.value === "validthis") { - if (funct["(global)"]) { - error("Option 'validthis' can't be used in a global scope."); - } else { - if (v.value === "true" || v.value === "false") - obj[t.value] = v.value === "true"; - else - error("Bad option value.", v); - } - } else if (t.value === "quotmark" && (o === "/*jshint")) { - switch (v.value) { - case "true": - obj.quotmark = true; - break; - case "false": - obj.quotmark = false; - break; - case "double": - case "single": - obj.quotmark = v.value; - break; - default: - error("Bad option value.", v); - } - } else if (v.value === "true" || v.value === "false") { - if (o === "/*jslint") { - tn = renamedOptions[t.value] || t.value; - obj[tn] = v.value === "true"; - if (invertedOptions[tn] !== undefined) { - obj[tn] = !obj[tn]; - } - } else { - obj[t.value] = v.value === "true"; - } - - if (t.value === "newcap") - obj["(explicitNewcap)"] = true; - } else { - error("Bad option value.", v); - } - t = lex.token(); - } else { - if (o === "/*jshint" || o === "/*jslint") { - error("Missing option value.", t); - } - - obj[t.value] = false; - - if (o === "/*global" && minus === true) { - JSHINT.blacklist[t.value] = t.value; - updatePredefined(); - } - - t = v; - } - } - - if (o === "/*members") { - option.quotmark = quotmarkValue; - } - - combine(predefined, predef); - - for (var key in predef) { - if (is_own(predef, key)) { - declared[key] = nt; - } - } - - if (filter) { - assume(); - } - } - - -// We need a peek function. If it has an argument, it peeks that much farther -// ahead. It is used to distinguish -// for ( var i in ... -// from -// for ( var i = ... - - function peek(p) { - var i = p || 0, j = 0, t; - - while (j <= i) { - t = lookahead[j]; - if (!t) { - t = lookahead[j] = lex.token(); - } - j += 1; - } - return t; - } - - - -// Produce the next token. It looks for programming errors. - - function advance(id, t) { - switch (token.id) { - case "(number)": - if (nexttoken.id === ".") { - warning("A dot following a number can be confused with a decimal point.", token); - } - break; - case "-": - if (nexttoken.id === "-" || nexttoken.id === "--") { - warning("Confusing minusses."); - } - break; - case "+": - if (nexttoken.id === "+" || nexttoken.id === "++") { - warning("Confusing plusses."); - } - break; - } - - if (token.type === "(string)" || token.identifier) { - anonname = token.value; - } - - if (id && nexttoken.id !== id) { - if (t) { - if (nexttoken.id === "(end)") { - warning("Unmatched '{a}'.", t, t.id); - } else { - warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - nexttoken, id, t.id, t.line, nexttoken.value); - } - } else if (nexttoken.type !== "(identifier)" || - nexttoken.value !== id) { - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, id, nexttoken.value); - } - } - - prevtoken = token; - token = nexttoken; - for (;;) { - nexttoken = lookahead.shift() || lex.token(); - if (nexttoken.id === "(end)" || nexttoken.id === "(error)") { - return; - } - if (nexttoken.type === "special") { - doOption(); - } else { - if (nexttoken.id !== "(endline)") { - break; - } - } - } - } - - -// This is the heart of JSHINT, the Pratt parser. In addition to parsing, it -// is looking for ad hoc lint patterns. We add .fud to Pratt's model, which is -// like .nud except that it is only used on the first token of a statement. -// Having .fud makes it much easier to define statement-oriented languages like -// JavaScript. I retained Pratt's nomenclature. - -// .nud Null denotation -// .fud First null denotation -// .led Left denotation -// lbp Left binding power -// rbp Right binding power - -// They are elements of the parsing method called Top Down Operator Precedence. - - function expression(rbp, initial) { - var left, isArray = false, isObject = false; - - if (nexttoken.id === "(end)") - error("Unexpected early end of program.", token); - - advance(); - if (initial) { - anonname = "anonymous"; - funct["(verb)"] = token.value; - } - if (initial === true && token.fud) { - left = token.fud(); - } else { - if (token.nud) { - left = token.nud(); - } else { - if (nexttoken.type === "(number)" && token.id === ".") { - warning("A leading decimal point can be confused with a dot: '.{a}'.", - token, nexttoken.value); - advance(); - return token; - } else { - error("Expected an identifier and instead saw '{a}'.", - token, token.id); - } - } - while (rbp < nexttoken.lbp) { - isArray = token.value === "Array"; - isObject = token.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and token.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== token.value) { - isObject = false; - } - } - } - - advance(); - if (isArray && token.id === "(" && nexttoken.id === ")") - warning("Use the array literal notation [].", token); - if (isObject && token.id === "(" && nexttoken.id === ")") - warning("Use the object literal notation {}.", token); - if (token.led) { - left = token.led(left); - } else { - error("Expected an operator and instead saw '{a}'.", - token, token.id); - } - } - } - return left; - } - - -// Functions for conformance of style. - - function adjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white) { - if (left.character !== right.from && left.line === right.line) { - left.from += (left.character - left.from); - warning("Unexpected space after '{a}'.", left, left.value); - } - } - } - - function nobreak(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white && (left.character !== right.from || left.line !== right.line)) { - warning("Unexpected space before '{a}'.", right, right.value); - } - } - - function nospace(left, right) { - left = left || token; - right = right || nexttoken; - if (option.white && !left.comment) { - if (left.line === right.line) { - adjacent(left, right); - } - } - } - - function nonadjacent(left, right) { - if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.value === ";" && right.value === ";") { - return; - } - if (left.line === right.line && left.character === right.from) { - left.from += (left.character - left.from); - warning("Missing space after '{a}'.", - left, left.value); - } - } - } - - function nobreaknonadjacent(left, right) { - left = left || token; - right = right || nexttoken; - if (!option.laxbreak && left.line !== right.line) { - warning("Bad line breaking before '{a}'.", right, right.id); - } else if (option.white) { - left = left || token; - right = right || nexttoken; - if (left.character === right.from) { - left.from += (left.character - left.from); - warning("Missing space after '{a}'.", - left, left.value); - } - } - } - - function indentation(bias) { - var i; - if (option.white && nexttoken.id !== "(end)") { - i = indent + (bias || 0); - if (nexttoken.from !== i) { - warning( -"Expected '{a}' to have an indentation at {b} instead at {c}.", - nexttoken, nexttoken.value, i, nexttoken.from); - } - } - } - - function nolinebreak(t) { - t = t || token; - if (t.line !== nexttoken.line) { - warning("Line breaking error '{a}'.", t, t.value); - } - } - - - function comma() { - if (token.line !== nexttoken.line) { - if (!option.laxcomma) { - if (comma.first) { - warning("Comma warnings can be turned off with 'laxcomma'"); - comma.first = false; - } - warning("Bad line breaking before '{a}'.", token, nexttoken.id); - } - } else if (!token.comment && token.character !== nexttoken.from && option.white) { - token.from += (token.character - token.from); - warning("Unexpected space after '{a}'.", token, token.value); - } - advance(","); - nonadjacent(token, nexttoken); - } - - -// Functional constructors for making the symbols that will be inherited by -// tokens. - - function symbol(s, p) { - var x = syntax[s]; - if (!x || typeof x !== "object") { - syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - - function delim(s) { - return symbol(s, 0); - } - - - function stmt(s, f) { - var x = delim(s); - x.identifier = x.reserved = true; - x.fud = f; - return x; - } - - - function blockstmt(s, f) { - var x = stmt(s, f); - x.block = true; - return x; - } - - - function reserveName(x) { - var c = x.id.charAt(0); - if ((c >= "a" && c <= "z") || (c >= "A" && c <= "Z")) { - x.identifier = x.reserved = true; - } - return x; - } - - - function prefix(s, f) { - var x = symbol(s, 150); - reserveName(x); - x.nud = (typeof f === "function") ? f : function () { - this.right = expression(150); - this.arity = "unary"; - if (this.id === "++" || this.id === "--") { - if (option.plusplus) { - warning("Unexpected use of '{a}'.", this, this.id); - } else if ((!this.right.identifier || this.right.reserved) && - this.right.id !== "." && this.right.id !== "[") { - warning("Bad operand.", this); - } - } - return this; - }; - return x; - } - - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - - function reserve(s, f) { - var x = type(s, f); - x.identifier = x.reserved = true; - return x; - } - - - function reservevar(s, v) { - return reserve(s, function () { - if (typeof v === "function") { - v(this); - } - return this; - }); - } - - - function infix(s, f, p, w) { - var x = symbol(s, p); - reserveName(x); - x.led = function (left) { - if (!w) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - } - if (s === "in" && left.id === "!") { - warning("Confusing use of '{a}'.", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function relation(s, f) { - var x = symbol(s, 100); - x.led = function (left) { - nobreaknonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("Use the isNaN function to compare with NaN.", this); - } else if (f) { - f.apply(this, [left, right]); - } - if (left.id === "!") { - warning("Confusing use of '{a}'.", left, "!"); - } - if (right.id === "!") { - warning("Confusing use of '{a}'.", right, "!"); - } - this.left = left; - this.right = right; - return this; - }; - return x; - } - - - function isPoorRelation(node) { - return node && - ((node.type === "(number)" && +node.value === 0) || - (node.type === "(string)" && node.value === "") || - (node.type === "null" && !option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - - function assignop(s) { - symbol(s, 20).exps = true; - - return infix(s, function (left, that) { - that.left = left; - - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("Read only.", left); - } else if (left["function"]) { - warning("'{a}' is a function.", left, left.value); - } - - if (left) { - if (option.esnext && funct[left.value] === "const") { - warning("Attempting to override '{a}' which is a constant", left, left.value); - } - - if (left.id === "." || left.id === "[") { - if (!left.left || left.left.value === "arguments") { - warning("Bad assignment.", that); - } - that.right = expression(19); - return that; - } else if (left.identifier && !left.reserved) { - if (funct[left.value] === "exception") { - warning("Do not assign to the exception parameter.", left); - } - that.right = expression(19); - return that; - } - - if (left === syntax["function"]) { - warning( -"Expected an identifier in an assignment and instead saw a function invocation.", - token); - } - } - - error("Bad assignment.", that); - }, 20); - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function (left) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - symbol(s, 20).exps = true; - return infix(s, function (left, that) { - if (option.bitwise) { - warning("Unexpected use of '{a}'.", that, that.id); - } - nonadjacent(prevtoken, token); - nonadjacent(token, nexttoken); - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !left.reserved)) { - expression(19); - return that; - } - if (left === syntax["function"]) { - warning( -"Expected an identifier in an assignment, and instead saw a function invocation.", - token); - } - return that; - } - error("Bad assignment.", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - x.led = function (left) { - if (option.plusplus) { - warning("Unexpected use of '{a}'.", this, this.id); - } else if ((!left.identifier || left.reserved) && - left.id !== "." && left.id !== "[") { - warning("Bad operand.", this); - } - this.left = left; - return this; - }; - return x; - } - - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - function optionalidentifier(fnparam) { - if (nexttoken.identifier) { - advance(); - if (token.reserved && !option.es5) { - // `undefined` as a function param is a common pattern to protect - // against the case when somebody does `undefined = true` and - // help with minification. More info: https://gist.github.com/315916 - if (!fnparam || token.value !== "undefined") { - warning("Expected an identifier and instead saw '{a}' (a reserved word).", - token, token.id); - } - } - return token.value; - } - } - - // fnparam means that this identifier is being defined as a function - // argument - function identifier(fnparam) { - var i = optionalidentifier(fnparam); - if (i) { - return i; - } - if (token.id === "function" && nexttoken.id === "(") { - warning("Missing name in function declaration."); - } else { - error("Expected an identifier and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - } - - - function reachable(s) { - var i = 0, t; - if (nexttoken.id !== ";" || noreach) { - return; - } - for (;;) { - t = peek(i); - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (!option.latedef) { - break; - } - warning( -"Inner functions should be listed at the top of the outer function.", t); - break; - } - warning("Unreachable '{a}' after '{b}'.", t, t.value, s); - break; - } - i += 1; - } - } - - - function statement(noindent) { - var i = indent, r, s = scope, t = nexttoken; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - - if (t.identifier && !t.reserved && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, "label"); - - if (!nexttoken.labelled && nexttoken.value !== "{") { - warning("Label '{a}' on {b} statement.", nexttoken, t.value, nexttoken.value); - } - - if (jx.test(t.value + ":")) { - warning("Label '{a}' looks like a javascript url.", t, t.value); - } - - nexttoken.label = t.value; - t = nexttoken; - } - - // Is it a lonely block? - - if (t.id === "{") { - block(true, true); - return; - } - - // Parse the statement. - - if (!noindent) { - indentation(); - } - r = expression(0, true); - - // Look for the final semicolon. - - if (!t.block) { - if (!option.expr && (!r || !r.exps)) { - warning("Expected an assignment or function call and instead saw an expression.", - token); - } else if (option.nonew && r.id === "(" && r.left.id === "new") { - warning("Do not use 'new' for side effects.", t); - } - - if (nexttoken.id === ",") { - return comma(); - } - - if (nexttoken.id !== ";") { - if (!option.asi) { - // If this is the last statement in a block that ends on - // the same line *and* option lastsemic is on, ignore the warning. - // Otherwise, complain about missing semicolon. - if (!option.lastsemic || nexttoken.id !== "}" || - nexttoken.line !== token.line) { - warningAt("Missing semicolon.", token.line, token.character); - } - } - } else { - adjacent(token, nexttoken); - advance(";"); - nonadjacent(token, nexttoken); - } - } - -// Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements(startLine) { - var a = [], p; - - while (!nexttoken.reach && nexttoken.id !== "(end)") { - if (nexttoken.id === ";") { - p = peek(); - if (!p || p.id !== "(") { - warning("Unnecessary semicolon."); - } - advance(";"); - } else { - a.push(statement(startLine === nexttoken.line)); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - for (;;) { - if (nexttoken.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i); - i = i + 1; - } while (pn.id === "(endline)"); - - if (pn.id !== ";") { - if (pn.id !== "(string)" && pn.id !== "(number)" && - pn.id !== "(regexp)" && pn.identifier !== true && - pn.id !== "}") { - break; - } - warning("Missing semicolon.", nexttoken); - } else { - p = pn; - } - } else if (p.id === "}") { - // directive with no other statements, warn about missing semicolon - warning("Missing semicolon.", p); - } else if (p.id !== ";") { - break; - } - - indentation(); - advance(); - if (directive[token.value]) { - warning("Unnecessary directive \"{a}\".", token, token.value); - } - - if (token.value === "use strict") { - if (!option["(explicitNewcap)"]) - option.newcap = true; - option.undef = true; - } - - // there's no directive negation, so always set to true - directive[token.value] = true; - - if (p.id === ";") { - advance(";"); - } - continue; - } - break; - } - } - - - /* - * Parses a single block. A block is a sequence of statements wrapped in - * braces. - * - * ordinary - true for everything but function bodies and try blocks. - * stmt - true if block can be a single statement (e.g. in if/for/while). - * isfunc - true if block is a function body - */ - function block(ordinary, stmt, isfunc) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !option.funcscope) - scope = Object.create(scope); - - nonadjacent(token, nexttoken); - t = nexttoken; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (nexttoken.id === "{") { - advance("{"); - line = token.line; - if (nexttoken.id !== "}") { - indent += option.indent; - while (!ordinary && nexttoken.from > indent) { - indent += option.indent; - } - - if (isfunc) { - m = {}; - for (d in directive) { - if (is_own(directive, d)) { - m[d] = directive[d]; - } - } - directives(); - - if (option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !directive["use strict"]) { - warning("Missing \"use strict\" statement."); - } - } - } - - a = statements(line); - - metrics.statementCount += a.length; - - if (isfunc) { - directive = m; - } - - indent -= option.indent; - if (line !== nexttoken.line) { - indentation(); - } - } else if (line !== nexttoken.line) { - indentation(); - } - advance("}", t); - indent = old_indent; - } else if (!ordinary) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "{", nexttoken.value); - } else { - if (!stmt || option.curly) - warning("Expected '{a}' and instead saw '{b}'.", - nexttoken, "{", nexttoken.value); - - noreach = true; - indent += option.indent; - // test indentation only if statement is in new line - a = [statement(nexttoken.line === token.line)]; - indent -= option.indent; - noreach = false; - } - funct["(verb)"] = null; - if (!ordinary || !option.funcscope) scope = s; - inblock = b; - if (ordinary && option.noempty && (!a || a.length === 0)) { - warning("Empty block."); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("Unexpected /*member '{a}'.", token, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(token) { - var name = token.value, line = token.line, a = implied[name]; - if (typeof a === "function") { - a = false; - } - - if (!a) { - a = [line]; - implied[name] = a; - } else if (a[a.length - 1] !== line) { - a.push(line); - } - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function () { - return this; - }); - - type("(string)", function () { - return this; - }); - - syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - nud: function () { - var v = this.value, - s = scope[v], - f; - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, "var"); - s = funct; - funct = f; - } - - // The name is in scope and defined in the current function. - if (funct === s) { - // Change 'unused' to 'var', and reject labels. - switch (funct[v]) { - case "unused": - funct[v] = "var"; - break; - case "unction": - funct[v] = "function"; - this["function"] = true; - break; - case "function": - this["function"] = true; - break; - case "label": - warning("'{a}' is a statement label.", token, v); - break; - } - } else if (funct["(global)"]) { - // The name is not defined in the function. If we are in the global - // scope, then we have an undefined variable. - // - // Operators typeof and delete do not raise runtime errors even if - // the base object of a reference is null so no need to display warning - // if we're inside of typeof or delete. - - if (option.undef && typeof predefined[v] !== "boolean") { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (nexttoken && (nexttoken.value === "." || nexttoken.value === "["))) { - - isundef(funct, "'{a}' is not defined.", token, v); - } - } - - note_implied(token); - } else { - // If the name is already defined in the current - // function, but not as outer, then there is a scope error. - - switch (funct[v]) { - case "closure": - case "function": - case "var": - case "unused": - warning("'{a}' used out of scope.", token, v); - break; - case "label": - warning("'{a}' is a statement label.", token, v); - break; - case "outer": - case "global": - break; - default: - // If the name is defined in an outer function, make an outer entry, - // and if it was unused, make it var. - if (s === true) { - funct[v] = true; - } else if (s === null) { - warning("'{a}' is not allowed.", token, v); - note_implied(token); - } else if (typeof s !== "object") { - // Operators typeof and delete do not raise runtime errors even - // if the base object of a reference is null so no need to - // display warning if we're inside of typeof or delete. - if (option.undef) { - // Attempting to subscript a null reference will throw an - // error, even within the typeof and delete operators - if (!(anonname === "typeof" || anonname === "delete") || - (nexttoken && - (nexttoken.value === "." || nexttoken.value === "["))) { - - isundef(funct, "'{a}' is not defined.", token, v); - } - } - funct[v] = true; - note_implied(token); - } else { - switch (s[v]) { - case "function": - case "unction": - this["function"] = true; - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "var": - case "unused": - s[v] = "closure"; - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("'{a}' is a statement label.", token, v); - } - } - } - } - return this; - }, - led: function () { - error("Expected an operator and instead saw '{a}'.", - nexttoken, nexttoken.value); - } - }; - - type("(regexp)", function () { - return this; - }); - - -// ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim(""); - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim(","); - delim("#"); - delim("@"); - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function (x) { - if (directive["use strict"] && funct["(global)"]) { - warning("Strict violation.", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function (x) { - if (directive["use strict"] && !option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("Possible strict violation.", x); - } - }); - reservevar("true"); - reservevar("undefined"); - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function () { - error("A regular expression literal can be confused with '/='."); - }; - assignop("%=", "assignmod", 20); - bitwiseassignop("&=", "assignbitand", 20); - bitwiseassignop("|=", "assignbitor", 20); - bitwiseassignop("^=", "assignbitxor", 20); - bitwiseassignop("<<=", "assignshiftleft", 20); - bitwiseassignop(">>=", "assignshiftright", 20); - bitwiseassignop(">>>=", "assignshiftrightunsigned", 20); - infix("?", function (left, that) { - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - infix("||", "or", 40); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function (left, right) { - var eqnull = option.eqnull && (left.value === "null" || right.value === "null"); - - if (!eqnull && option.eqeqeq) - warning("Expected '{a}' and instead saw '{b}'.", this, "===", "=="); - else if (isPoorRelation(left)) - warning("Use '{a}' to compare with '{b}'.", this, "===", left.value); - else if (isPoorRelation(right)) - warning("Use '{a}' to compare with '{b}'.", this, "===", right.value); - - return this; - }); - relation("==="); - relation("!=", function (left, right) { - var eqnull = option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && option.eqeqeq) { - warning("Expected '{a}' and instead saw '{b}'.", - this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("Use '{a}' to compare with '{b}'.", - this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("Use '{a}' to compare with '{b}'.", - this, "!==", right.value); - } - return this; - }); - relation("!=="); - relation("<"); - relation(">"); - relation("<="); - relation(">="); - bitwise("<<", "shiftleft", 120); - bitwise(">>", "shiftright", 120); - bitwise(">>>", "shiftrightunsigned", 120); - infix("in", "in", 120); - infix("instanceof", "instanceof", 120); - infix("+", function (left, that) { - var right = expression(130); - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!option.scripturl && jx.test(left.value)) { - warning("JavaScript URL.", left); - } - return left; - } - that.left = left; - that.right = right; - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function () { - warning("Confusing pluses."); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("+++", function (left) { - warning("Confusing pluses."); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function () { - warning("Confusing minuses."); - this.right = expression(150); - this.arity = "unary"; - return this; - }); - infix("---", function (left) { - warning("Confusing minuses."); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++", "postinc"); - prefix("++", "preinc"); - syntax["++"].exps = true; - - suffix("--", "postdec"); - prefix("--", "predec"); - syntax["--"].exps = true; - prefix("delete", function () { - var p = expression(0); - if (!p || (p.id !== "." && p.id !== "[")) { - warning("Variables should not be deleted."); - } - this.first = p; - return this; - }).exps = true; - - prefix("~", function () { - if (option.bitwise) { - warning("Unexpected '{a}'.", this, "~"); - } - expression(150); - return this; - }); - - prefix("!", function () { - this.right = expression(150); - this.arity = "unary"; - if (bang[this.right.id] === true) { - warning("Confusing use of '{a}'.", this, "!"); - } - return this; - }); - prefix("typeof", "typeof"); - prefix("new", function () { - var c = expression(155), i; - if (c && c.id !== "function") { - if (c.identifier) { - c["new"] = true; - switch (c.value) { - case "Number": - case "String": - case "Boolean": - case "Math": - case "JSON": - warning("Do not use {a} as a constructor.", prevtoken, c.value); - break; - case "Function": - if (!option.evil) { - warning("The Function constructor is eval."); - } - break; - case "Date": - case "RegExp": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (option.newcap && (i < "A" || i > "Z") && !is_own(global, c.value)) { - warning("A constructor name should start with an uppercase letter.", - token); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("Bad constructor.", token); - } - } - } else { - if (!option.supernew) - warning("Weird construction. Delete 'new'.", this); - } - adjacent(token, nexttoken); - if (nexttoken.id !== "(" && !option.supernew) { - warning("Missing '()' invoking a constructor.", - token, token.value); - } - this.first = c; - return this; - }); - syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function (left, that) { - adjacent(prevtoken, token); - nobreak(); - var m = identifier(); - if (typeof m === "string") { - countMember(m); - } - that.left = left; - that.right = m; - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (option.noarg) - warning("Avoid arguments.{a}.", left, m); - else if (directive["use strict"]) - error("Strict violation."); - } else if (!option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("document.write can be a form of eval.", left); - } - if (!option.evil && (m === "eval" || m === "execScript")) { - warning("eval is evil."); - } - return that; - }, 160, true); - - infix("(", function (left, that) { - if (prevtoken.id !== "}" && prevtoken.id !== ")") { - nobreak(prevtoken, token); - } - nospace(); - if (option.immed && !left.immed && left.id === "function") { - warning("Wrap an immediate function invocation in parentheses " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself."); - } - var n = 0, - p = []; - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("Math is not a function.", left); - } else if (option.newcap) { - warning("Missing 'new' prefix when invoking a constructor.", left); - } - } - } - } - } - if (nexttoken.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - advance(")"); - nospace(prevtoken, token); - if (typeof left === "object") { - if (left.value === "parseInt" && n === 1) { - warning("Missing radix parameter.", token); - } - if (!option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("eval is evil.", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning( - "Implied eval is evil. Pass a function instead of a string.", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning( - "Implied eval is evil. Pass a function instead of a string.", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?") { - warning("Bad invocation.", left); - } - } - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function () { - nospace(); - if (nexttoken.id === "function") { - nexttoken.immed = true; - } - var v = expression(0); - advance(")", this); - nospace(prevtoken, token); - if (option.immed && v.id === "function") { - if (nexttoken.id !== "(" && - (nexttoken.id !== "." || (peek().value !== "call" && peek().value !== "apply"))) { - warning( -"Do not wrap function literals in parens unless they are to be immediately invoked.", - this); - } - } - - return v; - }); - - infix("[", function (left, that) { - nobreak(prevtoken, token); - nospace(); - var e = expression(0), s; - if (e && e.type === "(string)") { - if (!option.evil && (e.value === "eval" || e.value === "execScript")) { - warning("eval is evil.", that); - } - countMember(e.value); - if (!option.sub && ix.test(e.value)) { - s = syntax[e.value]; - if (!s || !s.reserved) { - warning("['{a}'] is better written in dot notation.", - prevtoken, e.value); - } - } - } - advance("]", that); - nospace(prevtoken, token); - that.left = left; - that.right = e; - return that; - }, 160, true); - - prefix("[", function () { - var b = token.line !== nexttoken.line; - this.first = []; - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - while (nexttoken.id !== "(end)") { - while (nexttoken.id === ",") { - if (!option.es5) - warning("Extra comma."); - advance(","); - } - if (nexttoken.id === "]") { - break; - } - if (b && token.line !== nexttoken.line) { - indentation(); - } - this.first.push(expression(10)); - if (nexttoken.id === ",") { - comma(); - if (nexttoken.id === "]" && !option.es5) { - warning("Extra comma.", token); - break; - } - } else { - break; - } - } - if (b) { - indent -= option.indent; - indentation(); - } - advance("]", this); - return this; - }, 160); - - - function property_name() { - var id = optionalidentifier(true); - if (!id) { - if (nexttoken.id === "(string)") { - id = nexttoken.value; - advance(); - } else if (nexttoken.id === "(number)") { - id = nexttoken.value.toString(); - advance(); - } - } - return id; - } - - - function functionparams() { - var next = nexttoken; - var params = []; - var ident; - - advance("("); - nospace(); - - if (nexttoken.id === ")") { - advance(")"); - return; - } - - for (;;) { - ident = identifier(true); - params.push(ident); - addlabel(ident, "unused", token); - if (nexttoken.id === ",") { - comma(); - } else { - advance(")", next); - nospace(prevtoken, token); - return params; - } - } - } - - - function doFunction(name, statement) { - var f; - var oldOption = option; - var oldScope = scope; - - option = Object.create(option); - scope = Object.create(scope); - - funct = { - "(name)" : name || "\"" + anonname + "\"", - "(line)" : nexttoken.line, - "(character)": nexttoken.character, - "(context)" : funct, - "(breakage)" : 0, - "(loopage)" : 0, - "(metrics)" : createMetrics(nexttoken), - "(scope)" : scope, - "(statement)": statement, - "(tokens)" : {} - }; - - f = funct; - token.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, "function"); - } - - funct["(params)"] = functionparams(); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - block(false, false, true); - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - - scope = oldScope; - option = oldOption; - funct["(last)"] = token.line; - funct["(lastcharacter)"] = token.character; - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - verifyMaxStatementsPerFunction: function () { - if (option.maxstatements && - this.statementCount > option.maxstatements) { - var message = "Too many statements per function (" + this.statementCount + ")."; - warning(message, functionStartToken); - } - }, - - verifyMaxParametersPerFunction: function (params) { - params = params || []; - - if (option.maxparams && params.length > option.maxparams) { - var message = "Too many parameters per function (" + params.length + ")."; - warning(message, functionStartToken); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function () { - if (option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === option.maxdepth + 1) { - var message = "Blocks are nested too deeply (" + this.nestedBlockDepth + ")."; - warning(message); - } - }, - - verifyMaxComplexityPerFunction: function () { - var max = option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - var message = "Cyclomatic complexity is too high per function (" + cc + ")."; - warning(message, functionStartToken); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - - (function (x) { - x.nud = function () { - var b, f, i, p, t; - var props = {}; // All properties, including accessors - - function saveProperty(name, token) { - if (props[name] && is_own(props, name)) - warning("Duplicate member '{a}'.", nexttoken, i); - else - props[name] = {}; - - props[name].basic = true; - props[name].basicToken = token; - } - - function saveSetter(name, token) { - if (props[name] && is_own(props, name)) { - if (props[name].basic || props[name].setter) - warning("Duplicate member '{a}'.", nexttoken, i); - } else { - props[name] = {}; - } - - props[name].setter = true; - props[name].setterToken = token; - } - - function saveGetter(name) { - if (props[name] && is_own(props, name)) { - if (props[name].basic || props[name].getter) - warning("Duplicate member '{a}'.", nexttoken, i); - } else { - props[name] = {}; - } - - props[name].getter = true; - props[name].getterToken = token; - } - - b = token.line !== nexttoken.line; - if (b) { - indent += option.indent; - if (nexttoken.from === indent + option.indent) { - indent += option.indent; - } - } - for (;;) { - if (nexttoken.id === "}") { - break; - } - if (b) { - indentation(); - } - if (nexttoken.value === "get" && peek().id !== ":") { - advance("get"); - if (!option.es5) { - error("get/set are ES5 features."); - } - i = property_name(); - if (!i) { - error("Missing property name."); - } - saveGetter(i); - t = nexttoken; - adjacent(token, nexttoken); - f = doFunction(); - p = f["(params)"]; - if (p) { - warning("Unexpected parameter '{a}' in get {b} function.", t, p[0], i); - } - adjacent(token, nexttoken); - } else if (nexttoken.value === "set" && peek().id !== ":") { - advance("set"); - if (!option.es5) { - error("get/set are ES5 features."); - } - i = property_name(); - if (!i) { - error("Missing property name."); - } - saveSetter(i, nexttoken); - t = nexttoken; - adjacent(token, nexttoken); - f = doFunction(); - p = f["(params)"]; - if (!p || p.length !== 1) { - warning("Expected a single parameter in set {a} function.", t, i); - } - } else { - i = property_name(); - saveProperty(i, nexttoken); - if (typeof i !== "string") { - break; - } - advance(":"); - nonadjacent(token, nexttoken); - expression(10); - } - - countMember(i); - if (nexttoken.id === ",") { - comma(); - if (nexttoken.id === ",") { - warning("Extra comma.", token); - } else if (nexttoken.id === "}" && !option.es5) { - warning("Extra comma.", token); - } - } else { - break; - } - } - if (b) { - indent -= option.indent; - indentation(); - } - advance("}", this); - - // Check for lonely setters if in the ES5 mode. - if (option.es5) { - for (var name in props) { - if (is_own(props, name) && props[name].setter && !props[name].getter) { - warning("Setter is defined without getter.", props[name].setterToken); - } - } - } - return this; - }; - x.fud = function () { - error("Expected to see a statement and instead saw a block.", token); - }; - }(delim("{"))); - -// This Function is called when esnext option is set to true -// it adds the `const` statement to JSHINT - - useESNextSyntax = function () { - var conststatement = stmt("const", function (prefix) { - var id, name, value; - - this.first = []; - for (;;) { - nonadjacent(token, nexttoken); - id = identifier(); - if (funct[id] === "const") { - warning("const '" + id + "' has already been declared"); - } - if (funct["(global)"] && predefined[id] === false) { - warning("Redefinition of '{a}'.", token, id); - } - addlabel(id, "const"); - if (prefix) { - break; - } - name = token; - this.first.push(token); - - if (nexttoken.id !== "=") { - warning("const " + - "'{a}' is initialized to 'undefined'.", token, id); - } - - if (nexttoken.id === "=") { - nonadjacent(token, nexttoken); - advance("="); - nonadjacent(token, nexttoken); - if (nexttoken.id === "undefined") { - warning("It is not necessary to initialize " + - "'{a}' to 'undefined'.", token, id); - } - if (peek(0).id === "=" && nexttoken.identifier) { - error("Constant {a} was not declared correctly.", - nexttoken, nexttoken.value); - } - value = expression(0); - name.first = value; - } - - if (nexttoken.id !== ",") { - break; - } - comma(); - } - return this; - }); - conststatement.exps = true; - }; - - var varstatement = stmt("var", function (prefix) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var id, name, value; - - if (funct["(onevar)"] && option.onevar) { - warning("Too many var statements."); - } else if (!funct["(global)"]) { - funct["(onevar)"] = true; - } - - this.first = []; - - for (;;) { - nonadjacent(token, nexttoken); - id = identifier(); - - if (option.esnext && funct[id] === "const") { - warning("const '" + id + "' has already been declared"); - } - - if (funct["(global)"] && predefined[id] === false) { - warning("Redefinition of '{a}'.", token, id); - } - - addlabel(id, "unused", token); - - if (prefix) { - break; - } - - name = token; - this.first.push(token); - - if (nexttoken.id === "=") { - nonadjacent(token, nexttoken); - advance("="); - nonadjacent(token, nexttoken); - if (nexttoken.id === "undefined") { - warning("It is not necessary to initialize '{a}' to 'undefined'.", token, id); - } - if (peek(0).id === "=" && nexttoken.identifier) { - error("Variable {a} was not declared correctly.", - nexttoken, nexttoken.value); - } - value = expression(0); - name.first = value; - } - if (nexttoken.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - - blockstmt("function", function () { - if (inblock) { - warning("Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", token); - - } - var i = identifier(); - if (option.esnext && funct[i] === "const") { - warning("const '" + i + "' has already been declared"); - } - adjacent(token, nexttoken); - addlabel(i, "unction", token); - - doFunction(i, { statement: true }); - if (nexttoken.id === "(" && nexttoken.line === token.line) { - error( -"Function declarations are not invocable. Wrap the whole function invocation in parens."); - } - return this; - }); - - prefix("function", function () { - var i = optionalidentifier(); - if (i) { - adjacent(token, nexttoken); - } else { - nonadjacent(token, nexttoken); - } - doFunction(i); - if (!option.loopfunc && funct["(loopage)"]) { - warning("Don't make functions within a loop."); - } - return this; - }); - - blockstmt("if", function () { - var t = nexttoken; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - if (nexttoken.id === "else") { - nonadjacent(token, nexttoken); - advance("else"); - if (nexttoken.id === "if" || nexttoken.id === "switch") { - statement(true); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function () { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - nonadjacent(token, nexttoken); - advance("("); - - scope = Object.create(oldScope); - - e = nexttoken.value; - if (nexttoken.type !== "(identifier)") { - e = null; - warning("Expected an identifier and instead saw '{a}'.", nexttoken, e); - } - - advance(); - advance(")"); - - funct = { - "(name)" : "(catch)", - "(line)" : nexttoken.line, - "(character)": nexttoken.character, - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(scope)" : scope, - "(statement)": false, - "(metrics)" : createMetrics(nexttoken), - "(catch)" : true, - "(tokens)" : {} - }; - - if (e) { - addlabel(e, "exception"); - } - - token.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = token.line; - funct["(lastcharacter)"] = token.character; - funct = funct["(context)"]; - } - - block(false); - - if (nexttoken.id === "catch") { - increaseComplexityCount(); - doCatch(); - b = true; - } - - if (nexttoken.id === "finally") { - advance("finally"); - block(false); - return; - } else if (!b) { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "catch", nexttoken.value); - } - - return this; - }); - - blockstmt("while", function () { - var t = nexttoken; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function () { - var t = nexttoken; - if (directive["use strict"]) { - error("'with' is not allowed in strict mode.", token); - } else if (!option.withstmt) { - warning("Don't use 'with'.", token); - } - - advance("("); - nonadjacent(this, t); - nospace(); - expression(0); - advance(")", t); - nospace(prevtoken, token); - block(true, true); - - return this; - }); - - blockstmt("switch", function () { - var t = nexttoken, - g = false; - funct["(breakage)"] += 1; - advance("("); - nonadjacent(this, t); - nospace(); - this.condition = expression(20); - advance(")", t); - nospace(prevtoken, token); - nonadjacent(token, nexttoken); - t = nexttoken; - advance("{"); - nonadjacent(token, nexttoken); - indent += option.indent; - this.cases = []; - for (;;) { - switch (nexttoken.id) { - case "case": - switch (funct["(verb)"]) { - case "break": - case "case": - case "continue": - case "return": - case "switch": - case "throw": - break; - default: - // You can tell JSHint that you don't use break intentionally by - // adding a comment /* falls through */ on a line just before - // the next `case`. - if (!ft.test(lines[nexttoken.line - 2])) { - warning( - "Expected a 'break' statement before 'case'.", - token); - } - } - indentation(-option.indent); - advance("case"); - this.cases.push(expression(20)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "break": - case "continue": - case "return": - case "throw": - break; - default: - if (!ft.test(lines[nexttoken.line - 2])) { - warning( - "Expected a 'break' statement before 'default'.", - token); - } - } - indentation(-option.indent); - advance("default"); - g = true; - advance(":"); - break; - case "}": - indent -= option.indent; - indentation(); - advance("}", t); - if (this.cases.length === 1 || this.condition.id === "true" || - this.condition.id === "false") { - if (!option.onecase) - warning("This 'switch' should be an 'if'.", this); - } - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("Missing '{a}'.", nexttoken, "}"); - return; - default: - if (g) { - switch (token.id) { - case ",": - error("Each value should have its own case label."); - return; - case ":": - g = false; - statements(); - break; - default: - error("Missing ':' on a case clause.", token); - return; - } - } else { - if (token.id === ":") { - advance(":"); - error("Unexpected '{a}'.", token, ":"); - statements(); - } else { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, "case", nexttoken.value); - return; - } - } - } - } - }).labelled = true; - - stmt("debugger", function () { - if (!option.debug) { - warning("All 'debugger' statements should be removed."); - } - return this; - }).exps = true; - - (function () { - var x = stmt("do", function () { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true); - advance("while"); - var t = nexttoken; - nonadjacent(token, t); - advance("("); - nospace(); - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - advance(")", t); - nospace(prevtoken, token); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function () { - var s, t = nexttoken; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - nonadjacent(this, t); - nospace(); - if (peek(nexttoken.id === "var" ? 1 : 0).id === "in") { - if (nexttoken.id === "var") { - advance("var"); - varstatement.fud.call(varstatement, true); - } else { - switch (funct[nexttoken.value]) { - case "unused": - funct[nexttoken.value] = "var"; - break; - case "var": - break; - default: - warning("Bad for in variable '{a}'.", - nexttoken, nexttoken.value); - } - advance(); - } - advance("in"); - expression(20); - advance(")", t); - s = block(true, true); - if (option.forin && s && (s.length > 1 || typeof s[0] !== "object" || - s[0].value !== "if")) { - warning("The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", this); - } - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - } else { - if (nexttoken.id !== ";") { - if (nexttoken.id === "var") { - advance("var"); - varstatement.fud.call(varstatement); - } else { - for (;;) { - expression(0, "for"); - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(token); - advance(";"); - if (nexttoken.id !== ";") { - expression(20); - if (nexttoken.id === "=") { - if (!option.boss) - warning("Expected a conditional expression and instead saw an assignment."); - advance("="); - expression(20); - } - } - nolinebreak(token); - advance(";"); - if (nexttoken.id === ";") { - error("Expected '{a}' and instead saw '{b}'.", - nexttoken, ")", ";"); - } - if (nexttoken.id !== ")") { - for (;;) { - expression(0, "for"); - if (nexttoken.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - nospace(prevtoken, token); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - } - }).labelled = true; - - - stmt("break", function () { - var v = nexttoken.value; - - if (funct["(breakage)"] === 0) - warning("Unexpected '{a}'.", nexttoken, this.value); - - if (!option.asi) - nolinebreak(this); - - if (nexttoken.id !== ";") { - if (token.line === nexttoken.line) { - if (funct[v] !== "label") { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - this.first = nexttoken; - advance(); - } - } - reachable("break"); - return this; - }).exps = true; - - - stmt("continue", function () { - var v = nexttoken.value; - - if (funct["(breakage)"] === 0) - warning("Unexpected '{a}'.", nexttoken, this.value); - - if (!option.asi) - nolinebreak(this); - - if (nexttoken.id !== ";") { - if (token.line === nexttoken.line) { - if (funct[v] !== "label") { - warning("'{a}' is not a statement label.", nexttoken, v); - } else if (scope[v] !== funct) { - warning("'{a}' is out of scope.", nexttoken, v); - } - this.first = nexttoken; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("Unexpected '{a}'.", nexttoken, this.value); - } - reachable("continue"); - return this; - }).exps = true; - - - stmt("return", function () { - if (this.line === nexttoken.line) { - if (nexttoken.id === "(regexp)") - warning("Wrap the /regexp/ literal in parens to disambiguate the slash operator."); - - if (nexttoken.id !== ";" && !nexttoken.reach) { - nonadjacent(token, nexttoken); - if (peek().value === "=" && !option.boss) { - warningAt("Did you mean to return a conditional instead of an assignment?", - token.line, token.character + 1); - } - this.first = expression(0); - } - } else if (!option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - reachable("return"); - return this; - }).exps = true; - - - stmt("throw", function () { - nolinebreak(this); - nonadjacent(token, nexttoken); - this.first = expression(20); - reachable("throw"); - return this; - }).exps = true; - -// Superfluous reserved words - - reserve("class"); - reserve("const"); - reserve("enum"); - reserve("export"); - reserve("extends"); - reserve("import"); - reserve("super"); - - reserve("let"); - reserve("yield"); - reserve("implements"); - reserve("interface"); - reserve("package"); - reserve("private"); - reserve("protected"); - reserve("public"); - reserve("static"); - - -// Parse JSON - - function jsonValue() { - - function jsonObject() { - var o = {}, t = nexttoken; - advance("{"); - if (nexttoken.id !== "}") { - for (;;) { - if (nexttoken.id === "(end)") { - error("Missing '}' to match '{' from line {a}.", - nexttoken, t.line); - } else if (nexttoken.id === "}") { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ",") { - error("Unexpected comma.", nexttoken); - } else if (nexttoken.id !== "(string)") { - warning("Expected a string and instead saw {a}.", - nexttoken, nexttoken.value); - } - if (o[nexttoken.value] === true) { - warning("Duplicate key '{a}'.", - nexttoken, nexttoken.value); - } else if ((nexttoken.value === "__proto__" && - !option.proto) || (nexttoken.value === "__iterator__" && - !option.iterator)) { - warning("The '{a}' key may produce unexpected results.", - nexttoken, nexttoken.value); - } else { - o[nexttoken.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (nexttoken.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = nexttoken; - advance("["); - if (nexttoken.id !== "]") { - for (;;) { - if (nexttoken.id === "(end)") { - error("Missing ']' to match '[' from line {a}.", - nexttoken, t.line); - } else if (nexttoken.id === "]") { - warning("Unexpected comma.", token); - break; - } else if (nexttoken.id === ",") { - error("Unexpected comma.", nexttoken); - } - jsonValue(); - if (nexttoken.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (nexttoken.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - if (token.character !== nexttoken.from) { - warning("Unexpected space after '-'.", token); - } - adjacent(token, nexttoken); - advance("(number)"); - break; - default: - error("Expected a JSON value.", nexttoken); - } - } - - - // The actual JSHINT function itself. - var itself = function (s, o, g) { - var a, i, k, x; - var optionKeys; - var newOptionObj = {}; - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(standard); - declared = Object.create(null); - combine(predefined, g || {}); - - if (o) { - a = o.predef; - if (a) { - if (!Array.isArray(a) && typeof a === "object") { - a = Object.keys(a); - } - a.forEach(function (item) { - var slice; - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - } else { - predefined[item] = true; - } - }); - } - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - - if (optionKeys[x] === "indent") - newOptionObj.white = true; - } - } - - option = newOptionObj; - - option.indent = option.indent || 4; - option.maxerr = option.maxerr || 50; - - tab = ""; - for (i = 0; i < option.indent; i += 1) { - tab += " "; - } - indent = 1; - global = Object.create(predefined); - scope = global; - funct = { - "(global)": true, - "(name)": "(global)", - "(scope)": scope, - "(breakage)": 0, - "(loopage)": 0, - "(tokens)": {}, - "(metrics)": createMetrics(nexttoken) - }; - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - jsonmode = false; - warnings = 0; - lines = []; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("Input is neither a string nor an array of strings.", 0); - return false; - } - - if (isString(s) && /^\s*$/g.test(s)) { - errorAt("Input is an empty string.", 0); - return false; - } - - if (s.length === 0) { - errorAt("Input is an empty array.", 0); - return false; - } - - lex.init(s); - - prereg = true; - directive = {}; - - prevtoken = token = nexttoken = syntax["(begin)"]; - - // Check options - for (var name in o) { - if (is_own(o, name)) { - checkOption(name, token); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - quotmark = undefined; - - try { - advance(); - switch (nexttoken.id) { - case "{": - case "[": - option.laxbreak = true; - jsonmode = true; - jsonValue(); - break; - default: - directives(); - if (directive["use strict"] && !option.globalstrict) { - warning("Use the function form of \"use strict\".", prevtoken); - } - - statements(); - } - advance((nexttoken && nexttoken.value !== ".") ? "(end)" : undefined); - - var markDefined = function (name, context) { - do { - if (typeof context[name] === "string") { - // JSHINT marks unused variables as 'unused' and - // unused function declaration as 'unction'. This - // code changes such instances back 'var' and - // 'closure' so that the code in JSHINT.data() - // doesn't think they're unused. - - if (context[name] === "unused") - context[name] = "var"; - else if (context[name] === "unction") - context[name] = "closure"; - - return true; - } - - context = context["(context)"]; - } while (context); - - return false; - }; - - var clearImplied = function (name, line) { - if (!implied[name]) - return; - - var newImplied = []; - for (var i = 0; i < implied[name].length; i += 1) { - if (implied[name][i] !== line) - newImplied.push(implied[name][i]); - } - - if (newImplied.length === 0) - delete implied[name]; - else - implied[name] = newImplied; - }; - - var warnUnused = function (name, token) { - var line = token.line; - var chr = token.character; - - if (option.unused) - warningAt("'{a}' is defined but never used.", line, chr, name); - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function (func, key) { - var type = func[key]; - var token = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - warnUnused(key, token); - }; - - // Check queued 'x is not defined' instances to see if they're still undefined. - for (i = 0; i < JSHINT.undefs.length; i += 1) { - k = JSHINT.undefs[i].slice(0); - - if (markDefined(k[2].value, k[0])) { - clearImplied(k[2].value, k[2].line); - } else { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function (func) { - for (var key in func) { - if (is_own(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type; - - while (param) { - type = func[param]; - - // 'undefined' is a special case for (function (window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type !== "unused" && type !== "unction") - return; - - warnUnused(param, func["(tokens)"][param]); - param = params.pop(); - } - }); - - for (var key in declared) { - if (is_own(declared, key) && !is_own(global, key)) { - warnUnused(key, declared[key]); - } - } - } catch (e) { - if (e) { - var nt = nexttoken || {}; - JSHINT.errors.push({ - raw : e.raw, - reason : e.message, - line : e.line || nt.line, - character : e.character || nt.from - }, null); - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Data summary. - itself.data = function () { - var data = { - functions: [], - options: option - }; - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (jsonmode) { - data.json = true; - } - - for (n in implied) { - if (is_own(implied, n)) { - implieds.push({ - name: n, - line: implied[n] - }); - } - } - - if (implieds.length > 0) { - data.implieds = implieds; - } - - if (urls.length > 0) { - data.urls = urls; - } - - globals = Object.keys(scope); - if (globals.length > 0) { - data.globals = globals; - } - - for (i = 1; i < functions.length; i += 1) { - f = functions[i]; - fu = {}; - - for (j = 0; j < functionicity.length; j += 1) { - fu[functionicity[j]] = []; - } - - for (j = 0; j < functionicity.length; j += 1) { - if (fu[functionicity[j]].length === 0) { - delete fu[functionicity[j]]; - } - } - - fu.name = f["(name)"]; - fu.param = f["(params)"]; - fu.line = f["(line)"]; - fu.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -}