-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbookmarklet-zeon.js
executable file
·1 lines (1 loc) · 187 KB
/
bookmarklet-zeon.js
1
new function(){var a=function(a,b){return this.generate(a,b)};a.getFunstatPlate=function(){return"new function(){var map={};window.mapping=function(g){map[g]=(map[g]|0)+1;};var f=document.createElement('div');f.style.position='absolute';f.style.top='0';f.style.right='0';setInterval(function(){var h='';for(var i in map)if(map.hasOwnProperty(i))h+=i+': '+map[i]+'<br/>';f.innerHTML=h;},1000);document.body.appendChild(f);};"},a.getHeatString=function(a){return"callme("+a.listId+")"},a.getHeatPlate=function(){return"new function(){var map=[]; var f = null; var els=[];window.callme=function(index){ if (!map[index]) map[index] = 0; map[index]++; }; if(f) document.body.removeChild(f); f=document.createElement('div');f.style.position='absolute';f.style.top='0';f.style.right='0';setInterval(function(){ els.forEach(function(o){ if (o) o.parentElement.removeChild(o); }); els = []; var max = Math.max.apply(null, map.filter(function(o){ return o; })); f.innerHTML=map.map(function(n,i){ els[els.length] = zeon.showCharacter('', zeon.linearTreeNoWhite[i], {zIndex: 50000, opacity: (n/max), width: Math.floor(zeon.linearTreeNoWhite[i].len*zeon.fontSize.w)+'px', height: '15px', paddingTop:'5px', backgroundColor:'red'}, 7); return i+': '+n+'<br/>'; }).join('');},1000); f.style.display = 'none'; document.body.appendChild(f);};"},a.prototype={precedence:{"*":1,"/":1,"%":1,"+":2,"-":2,"<<":3,">>":3,">>>":3,"<":4,"<=":4,">":4,">=":4,"in":4,"instanceof":4,"==":5,"!=":5,"===":5,"!===":5,"&":6,"^":7,"|":8,"&&":9,"||":10,"?":11,":":11,"=":12,"<<=":12,">>=":12,">>>=":12,"+=":12,"-=":12,"*=":12,"/=":12,"%=":12,"&=":12,"^=":12,"|=":12,",":13},root:null,list:null,generate:function(a,b){this.list=b,this.root=this.SOURCE_ELS(a);return this.root},copyMeta:function(a,b){b.listId=a.linearNoWhitePosition||a.nextTreeId||0;var c=this.list[b.listId];b.row=c.startLineId,b.col=c.startLinePosition,b.len=c.len},SOURCE_ELS:function(b){var c=[];this.copyMeta(b,c),c.type="SOURCE_ELS",c.isSOURCEELS=!0;for(var d=0;d<b.length;++d){var e=b[d];if(e instanceof Array)if(e.desc=="func decl")c.push(this.FUNCDECL(e));else if(e.desc=="statement")c.push(this.STATEMENT(e));else if(e.desc=="statement-parent"&&e.sub=="block"){var f=this.BLOCK(e);c.push(f)}else if(e.desc=="statement-parent"){var f=this.SOURCE_ELS(e);c.push(f[0])}else if(e.desc=="var decl")c.push(this.VAR(e[0]));else if(e.desc=="expressions")c.push(this.EXPRESSIONS(e));else throw console.log(["array error",b,e]),"unknown type here: "+e.desc;else if(e.value==";")c.push(this.EMPTY(e));else if(e.value!="{"&&e.value!="}"&&e.name!=13&&!e.isWhite)throw console.log(["non array error",e,b]),"unknown token here: "+e}c.beautify=function(a){a|=0;var b=c.map(function(b,c){return(c?a.tabs():"")+b.beautify(a)+(b.isEXPRESSIONS?";":"")+"\n"});return b.join("")},c.minify=function(){return c.map(function(a){return a.minify()+(a.isEXPRESSIONS?";":"")}).join("")},c.funstat=function(){return c.map(function(a){if(a.isEXPRESSIONS)return'(mapping("exprs"),('+a.funstat()+"));";return a.funstat()}).join("")},c.heatmap=function(){return c.map(function(b){if(b.isEXPRESSIONS)return"("+a.getHeatString(b)+",("+b.heatmap()+"));";return b.heatmap()}).join("")};return c},FUNCDECL:function(b){var c={type:"FUNCDECL",isFUNCDECL:!0,args:[]};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(d==0)c.firstToken=e;else if(e.name==2&&!c.headerStart)c.name=e;else if(e.value=="(")c.headerStart=e;else if(e.name==2)c.args.push(e);else if(e.desc=="func body"){c.bodyStart=e,c.body=this.SOURCE_ELS(e);break}}c.beautify=function(a){return"function "+c.name.value+"("+c.args.map(function(a){return a.value}).join(", ")+") {\n"+(a+1).tabs()+c.body.beautify(a+1)+a.tabs()+"}"},c.minify=function(){return"function "+c.name.value+"("+c.args.map(function(a){return a.value}).join(",")+"){"+c.body.minify()+"}"},c.funstat=function(){return"function "+c.name.value+"("+c.args.map(function(a){return a.value}).join(",")+"){"+'mapping("funcdecl");'+c.body.funstat()+"}"},c.heatmap=function(){return"function "+c.name.value+"("+c.args.map(function(a){return a.value}).join(",")+"){"+a.getHeatString(c)+";"+c.body.heatmap()+"}"};return c},FUNCEXPR:function(b){var c={type:"FUNCEXPR",isFUNCEXPR:!0,args:[]};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(d==0)c.firstToken=e;else if(e.name==2&&!c.headerStart)c.name=e;else if(e.value=="(")c.headerStart=e;else if(e.name==2)c.args.push(e);else if(e.desc=="func body"){c.bodyStart=e,c.body=this.SOURCE_ELS(e);break}}c.beautify=function(a){return"function"+(c.name?" "+c.name.value:"")+"("+c.args.map(function(a){return a.value}).join(", ")+"){\n"+(a+1).tabs()+c.body.beautify(a+1)+a.tabs()+"}"},c.minify=function(a){return"function"+(c.name?" "+c.name.value:"")+"("+c.args.map(function(a){return a.value}).join(",")+"){"+c.body.minify()+"}"},c.funstat=function(a){return"function"+(c.name?" "+c.name.value:"")+"("+c.args.map(function(a){return a.value}).join(",")+"){"+'mapping("funcexpr");'+c.body.funstat()+"}"},c.heatmap=function(b){return"function"+(c.name?" "+c.name.value:"")+"("+c.args.map(function(a){return a.value}).join(",")+"){"+a.getHeatString(c)+";"+c.body.heatmap()+"}"};return c},STATEMENT:function(a){switch(a.sub){case"if":return this.IF(a);case"debugger":return this.DEBUGGER(a);case"while":return this.WHILE(a);case"for":if(a.forType=="in")return this.FOR_IN(a);return this.FOR_EACH(a);case"labeled":return this.LABEL(a);case"expression":return this.EXPRESSIONS(a[0]);case"try":return this.TRY(a);case"switch":return this.SWITCH(a);case"do":return this.DO(a);case"var":return this.VAR(a[0]);case"return":return this.RETURN(a);case"break":return this.BREAK(a);case"continue":return this.CONTINUE(a);case"throw":return this.THROW(a);case"block":return this.BLOCK(a);case"with":return this.WITH(a);default:if(a.desc=="statement-parent")return this.STATEMENT(a[0]);if(a.desc=="expressions")return this.EXPRESSIONS(a);if(a.emptyStatement)return this.EMPTY(a);if(a.name==14)return this.VOID(a);throw console.log(["unknown statement error stack:",a]),"unknown statement: "+a.sub}},IF:function(b){var c={type:"IF",isIF:!0,firstToken:b[0],hasElse:!1};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(e.statementHeaderStart)c.headerStart=e;else if(e.desc=="expressions")c.condition=this.EXPRESSIONS(e);else if(e.desc=="statement-parent"&&!c.hasElse)c.ifStatement=this.STATEMENT(e);else if(e.sub=="else"){c.hasElse=!0;for(var f=0;f<e.length;++f){var g=e[f];g.value=="else"?c.elseToken=g:g.desc=="statement-parent"&&(c.elseStatement=this.STATEMENT(g))}}}c.beautify=function(a){return"if ("+c.condition.beautify(a)+") "+c.ifStatement.beautify(a)+(c.hasElse?"\n"+a.tabs()+"else "+c.elseStatement.beautify(a):"")},c.minify=function(){return"if("+c.condition.minify()+")"+c.ifStatement.minify()+(c.hasElse?"else "+c.elseStatement.minify():"")},c.funstat=function(){return'if(mapping("if"),('+c.condition.funstat()+"))"+c.ifStatement.funstat()+(c.hasElse?'else {mapping("if");'+c.elseStatement.funstat()+"}":"")},c.heatmap=function(){return"if("+a.getHeatString(c)+",("+c.condition.heatmap()+"))"+c.ifStatement.heatmap()+(c.hasElse?"else {"+a.getHeatString(c)+";"+c.elseStatement.heatmap()+"}":"")};return c},DEBUGGER:function(b){var c={type:"DEBUGGER",isDEBUGGER:!0,firstToken:b[0],beautify:function(){return"debugger;"},minify:function(){return"debugger;"},funstat:function(){return'{mapping("debugger");debugger;}'},heatmap:function(){return"{"+a.getHeatString(c)+";debugger;}"}};this.copyMeta(b,c);return c},WHILE:function(b){var c={type:"WHILE",isWHILE:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(e.statementHeaderStart)c.headerStart=e;else if(e.desc=="expressions")c.condition=this.EXPRESSIONS(e);else if(e.desc=="statement-parent"){c.statement=this.STATEMENT(e);break}}c.beautify=function(a){return"while ("+c.condition.beautify(a)+") "+c.statement.beautify(a)},c.minify=function(){return"while("+c.condition.minify()+")"+c.statement.minify()},c.funstat=function(){return'while(mapping("while"),('+c.condition.funstat()+"))"+c.statement.funstat()},c.heatmap=function(){return"while("+a.getHeatString(c)+",("+c.condition.heatmap()+"))"+c.statement.heatmap()};return c},FOR_IN:function(b){var c={type:"FOR_IN",isFORIN:!0,firstToken:b[0],left:null,op:null,right:null};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(e.statementHeaderStart)c.headerStart=e;else if(e.desc=="expressions"&&!c.left)c.left=this.EXPRESSIONS(e);else if(e.desc=="var decl"&&!c.left)c.left=this.VAR(e);else if(e.desc=="expressions"&&!c.right)c.right=this.EXPRESSIONS(e);else if(e.value=="in")c.op=e;else if(e.desc=="statement-parent"){c.statement=this.STATEMENT(e);break}}c.beautify=function(a){return"for ("+c.left.beautify(a,!0)+" in "+c.right.beautify(a)+") "+c.statement.beautify(a)},c.minify=function(){return"for("+c.left.minify(!0)+" in "+c.right.minify()+")"+c.statement.minify()},c.funstat=function(){return"for("+c.left.funstat(!0)+" in "+c.right.funstat()+'){mapping("forin");'+c.statement.funstat()+"}"},c.heatmap=function(){return"for("+c.left.heatmap(!0)+" in "+c.right.heatmap()+"){"+a.getHeatString(c)+";"+c.statement.heatmap()+"}"};return c},FOR_EACH:function(b){var c={type:"FOR_EACH",firstToken:b[0],isFOREACH:!0,left:null,one:null,mid:null,two:null,right:null};this.copyMeta(b,c);var d=0;for(var e=0;e<b.length;++e){var f=b[e];if(f.statementHeaderStart)c.headerStart=f;else if(f.desc=="expressions")d==0?c.left=this.EXPRESSIONS(f):d==1?c.mid=this.EXPRESSIONS(f):d==2&&(c.right=this.EXPRESSIONS(f));else if(f.desc=="var decl")c.left=this.VAR(f);else if(f.value==";")++d,d==1?c.one=f:d==2&&(c.two=f);else if(f.desc=="statement-parent"){c.statement=this.STATEMENT(f);break}}c.beautify=function(a){return"for ("+(c.left?c.left.beautify(a,!0):"")+";"+(c.mid?" "+c.mid.beautify(a):"")+";"+(c.right?" "+c.right.beautify(a):"")+") "+c.statement.beautify(a)},c.minify=function(){return"for("+(c.left?c.left.minify(!0):"")+";"+(c.mid?c.mid.minify():"")+";"+(c.right?c.right.minify():"")+")"+c.statement.minify()},c.funstat=function(){return"for("+(c.left?c.left.funstat(!0):"")+";"+(c.mid?c.mid.funstat():"")+";"+(c.right?c.right.funstat():"")+"){"+'mapping("foreach");'+c.statement.funstat()+"}"},c.heatmap=function(){return"for("+(c.left?c.left.heatmap(!0):"")+";"+(c.mid?c.mid.heatmap():"")+";"+(c.right?c.right.heatmap():"")+"){"+a.getHeatString(c)+";"+c.statement.heatmap()+"}"};return c},BLOCK:function(b){var c=[],d={type:"BLOCK",isBLOCK:!0,firstToken:b[0],statements:c};this.copyMeta(b,d);for(var e=0;e<b.length;++e){var f=b[e];f.value=="{"?d.curlyOpen=f:f.value=="}"?d.curlyClose=f:f.desc=="statement-parent"&&f.sub=="block"?c.push(this.BLOCK(f)):f.desc=="statement-parent"&&c.push(this.STATEMENT(f[0]))}d.beautify=function(a){a|=0;var b="{\n";++a,b+=c.map(function(b){return a.tabs()+b.beautify(a)+(b.isEXPRESSIONS?";":"")+"\n"}).join(""),--a,b+=a.tabs()+"}";return b},d.minify=function(){var a="{";a+=c.map(function(a){return a.minify()+(a.isEXPRESSIONS?";":"")}).join(""),a+="}";return a},d.funstat=function(){var a='{mapping("block");';a+=c.map(function(a){if(a.isEXPRESSIONS)return'mapping("exprs"),('+a.funstat()+");";return a.funstat()}).join(""),a+="}";return a},d.heatmap=function(){var b="{"+a.getHeatString(d)+";";b+=c.map(function(b){if(b.isEXPRESSIONS)return a.getHeatString(b)+",("+b.heatmap()+");";return b.heatmap()}).join(""),b+="}";return b};return d},VAR:function(b){var c={type:"VAR",isVAR:!0,firstToken:b[0],decls:[]};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];e.desc=="single var decl"&&c.decls.push(this.VAR_DECL(e))}c.beautify=function(a,b){return"var "+c.decls.map(function(b){return b.beautify(a)}).join(", ")+(b?"":";")},c.minify=function(a){return"var "+c.decls.map(function(a){return a.minify()}).join(",")+(a?"":";")},c.funstat=function(a){if(a)return"var "+c.decls.map(function(a){return a.funstat()}).join(",");return'{mapping("var"); var '+c.decls.map(function(a){return a.funstat()}).join(",")+";}"},c.heatmap=function(b){if(b)return"var "+c.decls.map(function(a){return a.heatmap()}).join(",");return"{"+a.getHeatString(c)+"; var "+c.decls.map(function(a){return a.heatmap()}).join(",")+";}"};return c},VAR_DECL:function(a){var b={type:"VAR_DECL",isVARDECL:!0,initializer:null};this.copyMeta(a,b);for(var c=0;c<a.length;++c){var d=a[c];d.desc=="sub-expression"?b.name=this.SUBEXPRESSION(d):d.desc=="expressions"&&(b.initializer=this.EXPRESSIONS(d)[0])}b.beautify=function(a){return b.name.beautify()+(b.initializer?" = "+b.initializer.beautify(a):"")},b.minify=function(){return b.name.minify()+(b.initializer?"="+b.initializer.minify():"")},b.funstat=function(){return b.name.funstat()+(b.initializer?"="+b.initializer.funstat():"")},b.heatmap=function(){return b.name.heatmap()+(b.initializer?"="+b.initializer.heatmap():"")};return b},EMPTY:function(b){var c={type:"EMPTY",isEMPTY:!0,firstToken:b,beautify:function(){return";"},minify:function(){return";"},funstat:function(){return'mapping("empty");'},heatmap:function(){return a.getHeatString(c)+";"}};this.copyMeta(b,c);return c},VOID:function(a){var b={type:"VOID",isVOID:!0,firstToken:a,beautify:function(){return""},minify:function(){return""},funstat:function(){return""},heatmap:function(){return""}};this.copyMeta(a,b);return b},LABEL:function(a){a=a[0][0][0];var b={type:"LABEL",isLABEL:!0,name:a[0]};this.copyMeta(a,b);for(var c=0;c<a.length;++c)if(a[c].desc=="statement-parent"){b.statement=this.STATEMENT(a[c]);break}b.beautify=function(a){return b.name.value+":\n"+a.tabs()+b.statement.beautify(a)},b.minify=function(){return b.name.value+":"+b.statement.minify()},b.funstat=function(){return b.name.value+":"+b.statement.funstat()},b.heatmap=function(){return b.name.value+":"+b.statement.heatmap()};return b},TRY:function(a){var b={type:"TRY",isTRY:!0,firstToken:a[0],catchKeyword:null,catchBlock:null,finallyKeyword:null,finallyBlock:null};this.copyMeta(a,b);for(var c=0;c<a.length;++c)a[c].sub=="tryblock"?b.tryBlock=this.BLOCK(a[c]):a[c].sub=="catch"?(b.catchKeyword=a[c].sub[0],b.catchBlock=this.BLOCK(a[c].slice(0))):a[c].sub=="finally"&&(b.finallyKeyword=a[c].sub[0],b.finallyBlock=this.BLOCK(a[c].slice(0)));b.beautify=function(a){var c="try "+b.tryBlock.beautify(a);b.catchBlock&&(c+=" catch("+b.catchKeyword.value+") "+b.catchBlock.beautify(a)),b.finallyBlock&&(c+=" finally "+b.finallyBlock.beautify(a));return c},b.minify=function(){var a="try"+b.tryBlock.minify();b.catchBlock&&(a+="catch("+b.catchKeyword.value+")"+b.catchBlock.minify()),b.finallyBlock&&(a+="finally"+b.finallyBlock.minify());return a},b.funstat=function(){var a="try"+b.tryBlock.funstat();b.catchBlock&&(a+="catch("+b.catchKeyword.value+")"+b.catchBlock.funstat()),b.finallyBlock&&(a+="finally"+b.finallyBlock.funstat());return a},b.heatmap=function(){var a="try"+b.tryBlock.heatmap();b.catchBlock&&(a+="catch("+b.catchKeyword.value+")"+b.catchBlock.heatmap()),b.finallyBlock&&(a+="finally"+b.finallyBlock.heatmap());return a};return b},SWITCH:function(b){var c={type:"SWITCH",isSWITCH:!0,firstToken:b[0],clauses:[]};this.copyMeta(b,c);var d=null;for(var e=0;e<b.length;++e){var f=b[e];f.desc=="expressions"?c.condition=this.EXPRESSIONS(f):f.value=="("?c.headerStart=f:f.desc=="switch clause header"?d=f:f.desc=="switch clause body"&&c.clauses.push(this.CLAUSE(d,f))}c.beautify=function(a){var b="switch ("+c.condition.beautify(a)+") {\n";++a;for(var d=0;d<c.clauses.length;++d)b+=c.clauses[d].beautify(a);--a,b+="\n"+a.tabs()+"}";return b},c.minify=function(){var a="switch("+c.condition.minify()+"){";for(var b=0;b<c.clauses.length;++b)a+=c.clauses[b].minify();a+="}";return a},c.funstat=function(){var a='switch(mapping("switch"),('+c.condition.funstat()+")){";for(var b=0;b<c.clauses.length;++b)a+=c.clauses[b].funstat();a+="}";return a},c.heatmap=function(){var b="switch("+a.getHeatString(c)+",("+c.condition.heatmap()+")){";for(var d=0;d<c.clauses.length;++d)b+=c.clauses[d].heatmap();b+="}";return b};return c},CLAUSE:function(b,c){var d={type:"CLAUSE",isCLAUSE:!0,clauseType:b.sub=="case"?"case":"default",firstToken:b[0][0],condition:null,statements:null};this.copyMeta(b,d),d.clauseType=="case"?(d.condition=this.EXPRESSIONS(b[1][0]),d.colon=b[2][0]):d.colon=b[1][0],c.length&&(d.statements=this.SOURCE_ELS(c)),d.beautify=function(a){var b=a.tabs();d.clauseType=="case"?b+="case "+d.condition.beautify(a)+":\n":b+="default:\n",d.statements&&(b+=(++a).tabs()+d.statements.beautify(a));return b},d.minify=function(a){var b="";d.clauseType=="case"?b+="case "+d.condition.minify()+":":b+="default:",d.statements&&(b+=d.statements.minify());return b},d.funstat=function(a){var b="";d.clauseType=="case"?b+="case "+d.condition.funstat()+":":b+="default:",b+='mapping("clause");',d.statements&&(b+=d.statements.funstat());return b},d.heatmap=function(b){var c="";d.clauseType=="case"?c+="case "+d.condition.heatmap()+":":c+="default:",c+=a.getHeatString(d)+";",d.statements&&(c+=d.statements.heatmap());return c};return d},DO:function(b){var c={type:"DO",isDO:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d)b[d].desc=="statement-parent"?c.statement=this.STATEMENT(b[d]):b[d].desc=="expressions"?c.expression=this.EXPRESSION(b[d]):b[d].value=="while"&&(c.whileToken=b[d]);c.beautify=function(a){return"do "+c.statement.beautify(a)+" while ("+c.expression.beautify(a)+");"},c.minify=function(){return"do"+c.statement.minify()+"while("+c.expression.minify()+");"},c.funstat=function(){return'do{mapping("do");'+c.statement.funstat()+"}while("+c.expression.funstat()+");"},c.heatmap=function(){return"do{"+a.getHeatString(c)+";"+c.statement.heatmap()+"}while("+c.expression.heatmap()+");"};return c},RETURN:function(b){var c={type:"RETURN",isRETURN:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d)if(b[d].desc=="expressions"){c.arg=this.EXPRESSIONS(b[d]);break}c.beautify=function(a){return"return"+(c.arg?" "+c.arg.beautify(a):"")+";"},c.minify=function(){return"return"+(c.arg?" "+c.arg.minify():"")+";"},c.funstat=function(){if(c.arg)return'return mapping("return"),('+c.arg.funstat()+");";return'return mapping("return"),undefined;'},c.heatmap=function(){if(c.arg)return"return "+a.getHeatString(c)+",("+c.arg.heatmap()+");";return"return "+a.getHeatString(c)+",undefined;"};return c},BREAK:function(b){var c={type:"BREAK",isBREAK:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d)if(b[d].desc=="expressions"){c.arg=this.IDENTIFIER(b[d]);break}c.beautify=function(a){return"break"+(c.arg?" "+c.arg.beautify(a):"")+";"},c.minify=function(){return"break"+(c.arg?" "+c.arg.minify():"")+";"},c.funstat=function(){return'{mapping("break");break'+(c.arg?" "+c.arg.funstat():"")+";}"},c.heatmap=function(){return"{"+a.getHeatString(c)+";break"+(c.arg?" "+c.arg.heatmap():"")+";}"};return c},CONTINUE:function(b){var c={type:"CONTINUE",isCONTINUE:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d)if(b[d].desc=="expressions"){c.arg=this.IDENTIFIER(b[d]);break}c.beautify=function(a){return"continue"+(c.arg?" "+c.arg.beautify(a):"")},c.minify=function(){return"continue"+(c.arg?" "+c.arg.minify():"")},c.funstat=function(){return'{mapping("continue");continue'+(c.arg?" "+c.arg.funstat():"")+";}"},c.heatmap=function(){return"{"+a.getHeatString(c)+";continue"+(c.arg?" "+c.arg.heatmap():"")+";}"};return c},IDENTIFIER:function(a){var b={type:"IDENTIFIER",isIDENTIFIER:!0,firstToken:a[0],beautify:function(){return this.value},minify:function(){return this.value},funstat:function(){return this.value},heatmap:function(){return this.value}};b.value=a.filter(function(a){return a.desc=="expression"})[0].filter(function(a){return a.desc=="sub-expression"})[0].filter(function(a){return a.isLabel})[0].value,this.copyMeta(a,b);return b},THROW:function(b){var c={type:"THROW",isTHROW:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d)if(b[d].desc=="expressions"){c.arg=this.EXPRESSIONS(b[d]);break}c.beautify=function(a){return"throw "+c.arg.beautify(a)+";"},c.minify=function(){return"throw "+c.arg.minify()+";"},c.funstat=function(){return'{mapping("throw");throw '+c.arg.funstat()+";}"},c.heatmap=function(){return"{"+a.getHeatString(c)+";throw"+" "+c.arg.heatmap()+";}"};return c},WITH:function(b){var c={type:"WITH",isWITH:!0,firstToken:b[0]};this.copyMeta(b,c);for(var d=0;d<b.length;++d){var e=b[d];if(e.statementHeaderStart)c.headerStart=e;else if(e.desc=="expressions")c.condition=this.EXPRESSIONS(e);else if(e.desc=="statement-parent"){c.statement=this.STATEMENT(e);break}}c.beautify=function(a){return"with ("+c.condition.beautify(a)+") "+c.statement.beautify(a)},c.minify=function(){return"with("+c.condition.minify()+")"+c.statement.minify()},c.funstat=function(){return'with(mapping("with"),('+c.condition.funstat()+"))"+c.statement.funstat()},c.heatmap=function(){return"with("+a.getHeatString(c)+",("+c.condition.heatmap()+"))"+c.statement.heatmap()};return c},EXPRESSIONS:function(a){var b=[];b.type="EXPRESSIONS",b.isEXPRESSIONS=!0,this.copyMeta(a,b);for(var c=0;c<a.length;++c)a[c].desc=="expression"&&b.push(this.EXPRESSION(a[c]));b.beautify=function(a){return b.map(function(b){return b.beautify(a)}).join(", ")},b.minify=function(){return b.map(function(a){return a.minify()}).join(",")},b.funstat=function(){return b.map(function(a){return a.funstat()}).join(",")},b.heatmap=function(){return b.map(function(a){return a.heatmap()}).join(",")};return b},EXPRESSION:function(a){var b={type:"EXPRESSION",isEXPRESSION:!0,isTriple:!1};this.copyMeta(a,b),b.beautify=function(a){return b.lhs.beautify(a)+(b.isTriple?" "+b.op+" "+b.rhs.beautify(a):"")},b.minify=function(){return b.lhs.minify()+(b.isTriple?" "+b.op+" "+b.rhs.minify():"")},b.funstat=function(){return b.lhs.funstat()+(b.isTriple?" "+b.op+" "+b.rhs.funstat():"")},b.heatmap=function(){return b.lhs.heatmap()+(b.isTriple?" "+b.op+" "+b.rhs.heatmap():"")};if(a.isEXPRESSION)b.lhs=a;else if(a.desc=="sub-expression")b.lhs=this.SUBEXPRESSION(a);else{var c=[];for(var d=0;d<a.length;++d)if(a[d].isEXPRESSION||a[d].desc=="sub-expression"||a[d].desc=="operator-expression"||a[d].desc=="expression"||a[d].desc=="expressions")c.push(a[d]);else if(!a[d].isWhite)throw console.log(["weird contents",a,d,a[d]]),"weiiiird";if(c.length==0)throw"empty? no way";if(c.length==1)if(a[0].desc=="sub-expression")b.lhs=this.SUBEXPRESSION(a[0]);else if(a[0].desc=="expression")b.lhs=this.EXPRESSION(a[0]);else throw console.log(["no subexpr?",a[0],a]),"expected sub expr here";else{if(c.length%2!=1)throw"number of expression parts should be uneven, shouldnt it?";while(c.length>3){var e=1,f=this.precedence[c[1].sub],g=3;while(g<c.length-1){var h=this.precedence[c[g].sub];if(h<f||h==f&&(a[g].isAssignment||a[g].sub=="?"||a[g].sub==":"))f=h,e=g;g+=2}var i=this.EXPRESSION([c[e-1],c[e],c[e+1]]);c.splice(e-1,3,i)}b.lhs=this.EXPRESSION(c[0]),b.op=c[1][0].value,b.rhs=this.EXPRESSION(c[2]),b.isTriple=!0}}return b},SUBEXPRESSION:function(a){if(a.isDOT||a.isDYNPROP||a.isCALL)return a;if(a.sub=="object literal")return this.OBJLIT(a);if(a.sub=="array literal")return this.ARRLIT(a);var b=0;while(a[b]&&a[b].isWhite)++b;if(!a[b])return null;if(a[b].isFunction)return this.FUNCEXPR(a[b]);if(a[b].desc=="grouped")return this.GROUP(a[b]);if(a[b].meta!="lead value"&&a[b].meta!="var name")return this.UNARY(a);var c=[];for(;b<a.length;++b)a[b].isWhite||c.push(a[b]);var d=this.LEAD(c.shift()),e=null;if(!c.length)return d;while(c.length>=1){var f=c.shift();if(!f)throw"wtf?";if(f.value==".")d=this.DOT(d,f,c.shift());else if(f.value=="[")d=this.DYNPROP(d,f,c.shift(),c.shift());else if(f.value=="(")c[0].value==")"?d=this.CALL(d,f,null,c.shift()):d=this.CALL(d,f,c.shift(),c.shift());else if(f.value=="++"||f.value=="--")e=f;else throw"unknown infix/postfix"}var g={type:"SUBEXPRESSION",lead:d,postfix:e};this.copyMeta(a,g),g.beautify=function(a){return g.lead.beautify(a)+(g.postfix?g.postfix.value:"")},g.minify=function(){return g.lead.minify()+(g.postfix?g.postfix.value:"")},g.funstat=function(){return g.lead.funstat()+(g.postfix?g.postfix.value:"")},g.heatmap=function(){return g.lead.heatmap()+(g.postfix?g.postfix.value:"")};return g},LEAD:function(a){var b={type:"LEAD",isLEAD:!0,token:a};this.copyMeta(a,b),b.beautify=function(a){return b.token.value},b.minify=function(){return b.token.value},b.funstat=function(){return b.token.value},b.heatmap=function(){return b.token.value};return b},DOT:function(a,b,c){var d={type:"DOT",isDOT:!0,lhs:a,dot:b,rhs:this.LEAD(c)};this.copyMeta(a,d),d.beautify=function(a){return d.lhs.beautify(a)+"."+d.rhs.beautify(a)},d.minify=function(){return d.lhs.minify()+"."+d.rhs.minify()},d.funstat=function(){return d.lhs.funstat()+"."+d.rhs.funstat()},d.heatmap=function(){return d.lhs.heatmap()+"."+d.rhs.heatmap()};return d},DYNPROP:function(a,b,c,d){var e={type:"DYNPROP",isDYNPROP:!0,lhs:a,leftBracket:b,expression:this.EXPRESSIONS(c),rightBracket:d};this.copyMeta(a,e),e.beautify=function(b){return a.beautify(b)+"["+e.expression.beautify(b)+"]"},e.minify=function(){return a.minify()+"["+e.expression.minify()+"]"},e.funstat=function(){return a.funstat()+"["+e.expression.funstat()+"]"},e.heatmap=function(){return a.heatmap()+"["+e.expression.heatmap()+"]"};return e},CALL:function(a,b,c,d){var e={type:"CALL",isCALL:!0,lhs:a,leftParen:b,expression:c&&this.EXPRESSIONS(c),rightParen:d};this.copyMeta(a,e),e.beautify=function(a){return e.lhs.beautify(a)+"("+(e.expression?e.expression.beautify(a):"")+")"},e.minify=function(){return e.lhs.minify()+"("+(e.expression?e.expression.minify():"")+")"},e.funstat=function(){return e.lhs.funstat()+"("+(e.expression?e.expression.funstat():"")+")"},e.heatmap=function(){return e.lhs.heatmap()+"("+(e.expression?e.expression.heatmap():"")+")"};return e},UNARY:function(a){var b=0;while(a[b]&&a[b].isWhite)++b;var c={type:"UNARY",isUNARY:!0,op:a[b],rhs:this.SUBEXPRESSION(a.slice(b+1))};this.copyMeta(a,c),c.beautify=function(a){return c.op.value+" "+c.rhs.beautify(a)},c.minify=function(){return c.op.value+" "+c.rhs.minify()},c.funstat=function(){return c.op.value+" "+c.rhs.funstat()},c.heatmap=function(){return c.op.value+" "+c.rhs.heatmap()};return c},GROUP:function(a){var b={type:"GROUP",isGROUP:!0,leftParen:a[0]};this.copyMeta(a,b);for(var c=0;c<a.length;++c)if(a[c].value=="(")b.leftParen=a[c];else if(a[c].desc=="expressions")b.expressions=this.EXPRESSIONS(a[c]);else{if(a[c].value==")"){b.rightParen=a[c];break}if(!a[c].isWhite)throw"unknown type"}b.beautify=function(a){return"("+b.expressions.beautify(a)+")"},b.minify=function(){return"("+b.expressions.minify()+")"},b.funstat=function(){return"("+b.expressions.funstat()+")"},b.heatmap=function(){return"("+b.expressions.heatmap()+")"};return b},OBJLIT:function(a){var b=[],c={type:"OBJLIT",isOBJLIT:!0,pairs:b};this.copyMeta(a,c);for(var d=0;d<a.length;++d)a[d].isObjectLiteralPair&&b.push(this.OBJLITPAIR(a[d]));c.beautify=function(a){return"{"+b.map(function(b){return b.beautify(a)}).join(", ")+"}"},c.minify=function(){return"{"+b.map(function(a){return a.minify()}).join(",")+"}"},c.funstat=function(){return"{"+b.map(function(a){return a.funstat()}).join(",")+"}"},c.heatmap=function(){return"{"+b.map(function(a){return a.heatmap()}).join(",")+"}"};return c},OBJLITPAIR:function(a){var b={type:"OBJLITPAIR",isOBJLITPAIR:!0};this.copyMeta(a,b);for(var c=0;c<a.length;++c)a[c].desc=="objlit pair name"?b.name=a[c][0]:a[c].desc=="expressions"&&(b.value=this.EXPRESSIONS(a[c])[0]);b.beautify=function(a){return b.name.value+":"+b.value.beautify(a)},b.minify=function(){return b.name.value+":"+b.value.minify()},b.funstat=function(){return b.name.value+":"+b.value.funstat()},b.heatmap=function(){return b.name.value+":"+b.value.heatmap()};return b},ARRLIT:function(a){var b=[],c={type:"ARRLIT",isARRLIT:!0,elements:b},d;this.copyMeta(a,c);for(var e=0;e<a.length;++e)a[e].value==","&&d&&d.value==","&&b.push(this.ELISION(a[e])),a[e].desc=="expressions"&&b.push(this.EXPRESSIONS(a[e])[0]),d=a[e];c.beautify=function(a){return"["+b.map(function(b){return b.beautify(a)}).join(", ")+"]"},c.minify=function(){return"["+b.map(function(a){return a.minify()}).join(",")+"]"},c.funstat=function(){return"["+b.map(function(a){return a.funstat()}).join(",")+"]"},c.heatmap=function(){return"["+b.map(function(a){return a.heatmap()}).join(",")+"]"};return c},ELISION:function(a){var b={type:"ELISION",isELISION:!0,beautify:function(){return""},minify:function(){return""},heatmap:function(){return""},funstat:function(){return""}};this.copyMeta(a,b);return b},0:0},Function.prototype.bind||(Function.prototype.bind=function(a){var b=[].slice,c=b.call(arguments,1),d=this,e=function(){},f=function(){return d.apply(this instanceof e?this:a||{},c.concat(b.call(arguments)))};e.prototype=d.prototype,f.prototype=new e;return f}),Number.prototype.tabs||(Number.prototype.tabs=function(){if(!Number.tabcache[this]){var a="";for(var b=0;b<this;++b)a+="\t";Number.tabcache[this]=a}return Number.tabcache[this]},Number.tabcache={});var b=function(a){this.config={"enable jslint":!0,"enable markers":!0,"enable scope depth":!0,"warn if scope depth exceeds":1,"enable ruler":!0,"enable type annotations":!0,"minify variable names too":!0,"enable caret popup":!0,"jslint | missing block good":!0,"jslint | missing block bad":!0,"jslint | weak comparison":!0,"jslint | ++ / --":!0},this.jslintSettings={"missing block good":!0,"missing block bad":!0,"weak comparison":!0,"++ / --":!0},this.textarea=a,this.initUI(),this.computeFontSizes(),this.updateTimer=setInterval(this.update.bind(this,!1),20)};b.css=function(a,c,d){if(a instanceof Array)return a.map(function(a){return b.css(a,c,d)},this);if(c instanceof Object)for(var e in c)b.css(a,e,c[e]);else{if(!d){var g=document.defaultView.getComputedStyle(a,null);return g.getPropertyValue(c)}var f=c.replace(/-./g,function(a){return a.substring(1).toUpperCase()});a.style[f]=d}},b.copyCss=function(a,c,d){if(c instanceof Array)for(var e=0;e<c.length;++e)b.copyCss(a,c[e],d);else if(d instanceof Array)for(var e=0;e<d.length;++e)b.copyCss(a,c,d[e]);else if(a instanceof Array)for(var e=0;e<a.length;++e)b.copyCss(a[e],c,d);else{var f=d.replace(/-./g,function(a){return a.substring(1).toUpperCase()}),g=d.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});c.style[f]=b.css(a,g)}},b.getSize=function(a){return{w:parseInt(b.css(a,"width"),10),h:parseInt(b.css(a,"height"),10)}},b.getSizef=function(a){return{w:parseFloat(b.css(a,"width")),h:parseFloat(b.css(a,"height"))}},b.escape=function(a){if(typeof a!="string")return a;return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},b.noctrl=function(a){if(typeof a!="string")return a;return a.replace(/\n/g,"\u21b5").replace(/\t/g,"\\t")},b.zeonify=function(a,c){var d=new b(a);a.focus(),c&&(window.gui=d);return d},b.start=function(a,c){var d=!1;c?d=b.zeonify(c,a):Array.prototype.slice.call(document.getElementsByTagName("textarea"),0).forEach(function(c){d=b.zeonify(c,a)});return d},b.webkit=function(a){var b=document.getElementsByClassName("text-editor")[0],c=Array.prototype.slice.call(document.querySelectorAll(".webkit-line-content",b),0).map(function(a){return a.textContent}).join("\n");textarea=document.createElement("textarea"),textarea.value=c;var e=textarea.style;e.position="absolute",e.top="0",e.left="0",e.fontFamily="Menlo, monospace",e.fontSize="11px",e.paddingTop="4px",textarea.setAttribute("rows",60),textarea.setAttribute("cols",150),b.appendChild(textarea);return d.start(a)},b.files=function(a,b,c){console.log("Zeon.files",a.slice(0));var e=a.map(function(a){return"\n; //! "+(a.src||"inline script")+" !//\n"+a.data}).join("");textarea=document.createElement("textarea"),textarea.value=e;var f=textarea.style;f.position="absolute",f.top="0",f.left="0",f.fontFamily="Menlo, monospace",f.fontSize="11px",b?b.parentElement.insertBefore(textarea,b):document.body.appendChild(textarea);var g=d.start(c);return g},b.prototype={config:null,fontSize:0,charsX:0,charsY:0,caret:null,caretCol:0,caretRow:0,caretStale:!0,caretVisible:!1,rootContainer:null,layerContainer:null,textarea:null,caretLayer:null,markLayer:null,syntaxLayer:null,ruler:null,baseLeftPadding:0,defaultLeftPadding:5,showLineNumbers:!0,lineNumberPadding:10,guiNav:null,navMessage:null,caretTimer:null,updateTimer:null,_originalWrapAttr:null,_originalNoWrapAttr:null,_originalSpellcheckAttr:null,_originalAutocapitalizeAttr:null,_originalAutoCorrectAttr:null,removed:!1,update:function(a){var c=this.textarea.value;if(!!a||c!=this.lastInput){this.lastInput=c;var e=document.getElementById("dbg");e&&(e.innerHTML="");var f=!1;this.zeon=new d(c),this.parse(),this.process(),this.refreshSyntaxHighlight(),this.onTextareaSizeChange(),this.startCaretBlink(),this.autoScroll(),this.guiNav.updateNav(),b.css(this.navMessage,"display","none")}},parse:function(a){this.input=a;var b=+(new Date);this.zeon.parse(a),this.debug("parse time: "+(+(new Date)-b)+" ms"),this.zeon.parser.errorStack.length&&this.debug('<span style="color:red;">Ignored '+this.zeon.tokenizer.errorStack.length+" / "+this.zeon.parser.errorStack.length+" errors. First:</span> "+this.zeon.parser.errorStack[0].msg)},process:function(){var a=+(new Date);this.zeon.startProcess(),this.debug("post process time: "+(+(new Date)-a)+" ms");var b=this.zeon.lastMatch;b?this.debug("Parsed completely"):this.debug('<span style="color:red;">failed, no tokens parsed</span>')},initUI:function(){var a=this.textarea;this.initTextareaAttributes(a),this.createLayers(),this.initContainer(),this.initLayerContainer(),this.initLayers(),this.initLineNumberBar(),this.guiNav=new b.Nav(this),this.addTopMessage(),this.updatePaddingLeft(),this.config["enable markers"]||b.css(this.markLayer,"display","none"),this.addLayersToDom(),this.createTestButton(),this.initTextareaEvents()},initTextareaAttributes:function(a){this._originalWrapAttr=a.getAttribute("wrap"),a.setAttribute("wrap","off"),this._originalNoWrapAttr=a.getAttribute("nowrap"),a.setAttribute("nowrap","true"),this._originalSpellcheckAttr=a.getAttribute("spellcheck"),a.setAttribute("spellcheck","false"),this._originalAutocapitalizeAttr=a.getAttribute("autocapitalize"),a.setAttribute("autocapitalize","off"),this._originalAutoCorrectAttr=a.getAttribute("autocorrect"),a.setAttribute("autocorrect","off")},createLayers:function(){this.rootContainer=document.createElement("div"),this.rootContainer.className="zeon-root-container",this.layerContainer=document.createElement("div"),this.layerContainer.className="zeon-layer-container",this.syntaxLayer=document.createElement("div"),this.syntaxLayer.className="zeon-syntax-layer",this.markLayer=document.createElement("div"),this.markLayer.className="zeon-mark-layer",this.caretLayer=document.createElement("div"),this.caretLayer.className="zeon-caret-layer",this.caret=document.createElement("span"),this.caret.className="zeon-caret"},initContainer:function(){b.css(this.rootContainer,{padding:"0"});var a=["position","top","left","width","height","float","display","margin-left","margin-top","margin-right","margin-bottom","background-color"];b.copyCss(this.textarea,this.rootContainer,a),b.css(this.rootContainer,{border:"0",overflow:"visible"})},initLayerContainer:function(){b.css(this.layerContainer,{position:"relative",overflow:"hidden",border:"1px solid black"}),b.copyCss(this.textarea,this.layerContainer,["width","height"])},initLayers:function(){var a={position:"absolute",left:"0",top:"0",width:"100%",height:"100%",whiteSpace:"pre",wordWrap:"normal",cssFloat:"none",margin:"0",padding:"0",backgroundColor:"transparent",resize:"none",MozBoxSizing:"border-box",WebkitBoxSizing:"border-box",boxSizing:"border-box"};b.css([this.textarea,this.caretLayer,this.syntaxLayer,this.markLayer],a);var c=["font-family","font-size","line-height","vertical-align","word-spacing","letter-spacing","text-align"];b.copyCss(this.textarea,this.syntaxLayer,c),b.css([this.syntaxLayer,this.caretLayer],{overflow:"hidden",backgroundColor:"transparent"}),b.css([this.textarea,this.markLayer,this.syntaxLayer,this.caretLayer],"border","0"),b.css(this.textarea,{color:"transparent",outline:"none",overflow:"auto"}),b.css(this.caret,{position:"absolute",top:"0",left:"0",width:"1px",height:"15px",backgroundColor:"blue"})},initLineNumberBar:function(){this.ruler=document.createElement("div"),this.ruler.className="zeon-line-number-bar",b.css(this.ruler,{position:"absolute",top:"0",left:"0",minHeight:"100%",color:"black",backgroundColor:"#ccc",fontSize:"12px",whiteSpace:"pre",textAlign:"right",padding:"0 3px 0 2px"});var a=["box-sizing","font-family","font-size","font-weight","line-height","vertical-align","white-space"];b.copyCss(this.textarea,this.ruler,a)},addTopMessage:function(){var a=document.createElement("div");b.css(a,{position:"absolute",top:"15px",left:"5px",right:"20px",textAlign:"center",zIndex:11}),this.layerContainer.appendChild(a),this.navMessage=document.createElement("span"),b.css(this.navMessage,{backgroundColor:"white",color:"red",fontWeight:900,border:"1px solid red",padding:"5px",display:"none",WebkitBorderRadius:"10px",borderRadius:"10px"}),a.appendChild(this.navMessage)},updatePaddingLeft:function(){var a=this.defaultLeftPadding+(this.showLineNumbers?this.lineNumberPadding:0);b.css([this.syntaxLayer,this.caretLayer,this.textarea],"padding-left",a+"px"),b.css([this.markLayer],"margin-left",a+"px"),this.onTextareaSizeChange()},addLayersToDom:function(){var a=this.textarea.parentNode;a.insertBefore(this.rootContainer,this.textarea);var b=this.layerContainer;b.appendChild(this.markLayer),b.appendChild(this.syntaxLayer),b.appendChild(this.caretLayer),b.appendChild(this.textarea),this.caretLayer.appendChild(this.caret),this.rootContainer.appendChild(this.layerContainer),a.appendChild(this.rootContainer)},createTestButton:function(){return;var c=document.createElement("div")},initTextareaEvents:function(){var a=this.textarea;a.onkeydown=this.onTextareaKeyDown.bind(this),a.onkeyup=this.onTextareaKeyUp.bind(this),a.onkeypress=this.onTextareaKeyPress.bind(this),a.onclick=this.onTextareaClick.bind(this),a.onscroll=this.autoScroll.bind(this),a.onchange=this.onTextareaSizeChange.bind(this)},onTextareaKeyDown:function(a){if(a.keyCode==9){a.preventDefault();var b=textarea.value,c=a.shiftKey,d=textarea.selectionStart,e=textarea.selectionEnd;if(d!=e){d=b.lastIndexOf("\n",d)+1;var f=b[e-1]=="\n",g=b.substring(0,d),h=b.substring(e-(f?1:0)),i=b.substring(d,e);c?(i[0]=="\t"&&(i=i.substring(1)),i=i.split("\n\t").join("\n")):(i=i.split("\n"),f&&i.pop(),i="\t"+i.join("\n\t")),textarea.value=g+i+h,textarea.selectionStart=d,textarea.selectionEnd=d+i.length}else textarea.value=textarea.value.substring(0,d)+"\t"+textarea.value.substring(d),textarea.selectionEnd=textarea.selectionStart=d+1}this.caretStale=!0,this.startCaretBlink()},onTextareaKeyUp:function(a){this.caretStale=!0,this.startCaretBlink(),this.onTextareaSizeChange()},onTextareaKeyPress:function(a){var b=this.textarea;if(a.keyCode==13){var d=b.value,e=b.selectionStart,f=b.selectionEnd,g=d.substring(0,e),h=d.substring(f),i="";if(g){var j=g.lastIndexOf("\n",e)+1;j<0&&(j=0);var k=j;while(g[k]&&c.regexWhiteSpace.test(g[k]))++k;i=g.substring(j,k),h=i+h}b.value=g+"\n"+h,b.selectionStart=b.selectionEnd=e+i.length+1;return!1}},onTextareaClick:function(){this.caretStale=!0,this.startCaretBlink()},onTextareaSizeChange:function(){this.guiNav.resize()},autoScroll:function(){this.syntaxLayer.scrollLeft=this.textarea.scrollLeft,this.syntaxLayer.scrollTop=Math.floor(this.textarea.scrollTop),this.updateCaretPos()},remove:function(){this.removed=!0,b.copyCss(this.rootContainer,this.textarea,["color","background-color","position","top","left","width","height","display","margin-left","margin-top","margin-right","margin-bottom"]),b.css(this.textarea,{border:"1px solid black",padding:"3px"}),this.rootContainer.parentNode.replaceChild(this.textarea,this.rootContainer),this.textarea.onclick=null,this.textarea.onscroll=null,this.textarea.onmousedown=null,this.textarea.onmousemove=null,this.textarea.onmouseup=null,this.textarea.onkeydown=null,this.textarea.onkeyup=null,this.textarea.onkeypress=null,this.textarea.onchange=null,this.textarea.ondragenter=null,this.textarea.ondragover=null,this.textarea.ondragleave=null,this.textarea.ondrop=null,this.resetTextareaAttributes(),clearInterval(this.caretTimer),clearInterval(this.updateTimer),this.guiNav=null},resetTextareaAttributes:function(a){this.textarea.setAttribute("wrap",this._originalWrapAttr),this.textarea.setAttribute("nowrap",this._originalNoWrapAttr),this.textarea.setAttribute("spellcheck",this._originalSpellcheckAttr),this.textarea.setAttribute("autocapitalize",this._originalAutocapitalizeAttr),this.textarea.setAttribute("autocorrect",this._originalAutoCorrectAttr)},resize:function(a,c){b.css([this.layerContainer,this.syntaxLayer,this.markLayer,this.caretLayer,this.rootContainer],{width:a+"px",height:c+"px"});return this},setPaddingTop:function(a){b.css([this.textarea,this.caretLayer,this.syntaxLayer,this.markLayer],"paddingTop",a+"px");return this},debug:function(){var a=document.getElementById("dbg");if(a){var b=document.createElement("div");b.innerHTML=Array.prototype.slice.call(arguments).join(", "),a.appendChild(b)}return arguments[0]},output:function(){var a=document.getElementById("out");if(a){var b=document.createElement("div");b.innerHTML=Array.prototype.slice.call(arguments).join(", "),a.appendChild(b)}return arguments[0]},computeFontSizes:function(){this.fontSize=this.getFontSize(),this.charsX=b.getSize(this.textarea).w/this.fontSize.w,this.charsY=b.getSize(this.textarea).h/this.fontSize.h},getFontSize:function(){var a=document.createElement("span"),c=["box-sizing","white-space","font-family","font-size","font-weight","line-height","vertical-align","word-spacing","letter-spacing","text-align"];b.copyCss(this.textarea,a,c),b.css(a,{position:"absolute",width:"auto",height:"auto"}),document.body.appendChild(a);var d=b.getSizef(a);a.innerHTML="x";var e=b.getSizef(a);document.body.removeChild(a);return{w:e.w-d.w,h:e.h-d.h}},matchToColRow:function(a){var b=this.zeon.lines[a.startLineId].start,c=Math.min(this.zeon.lines[a.startLineId].stop,a.stop),d=this.tabMagic(this.lastInput,b,c);return{col:d,row:a.startLineId}},colRowToXY:function(a,b){return{x:a*this.fontSize.w,y:b*this.fontSize.h}},tabMagic:function(a,b,c,d){var e=b,f=d||0;while(e<c)a[e]=="\t"?f+=8-f%8:++f,++e;return f},syntaxColorSettings:{regex:"color:green;",identifier:"color:black;",keyword:"color:blue;",hex:"color:green;",dec:"color:green;",singleString:"color:green;",doubleString:"color:green;",singleComment:"color:#c1ad3e;",multiComment:"color:grey;",whitespace:"border-bottom:1px solid #eee;",lineTerminator:"background-color:lightblue;",punctuator:"color:orange;",label:"",error:"background-color:red;color:white;",varDecl:"",undefinedVar:"text-decoration:line-through;",unusedVar:"text-decoration:line-through;",prematureUsage:"text-decoration:line-through;",duplicateProperty:"text-decoration:line-through;",leadValue:"text-decoration:underline;",ecma:"text-decoration:none;color: pink;",browser:"text-decoration:none;color:orange;",relic:"",lookupDepth1:"text-decoration:none;",lookupDepth2:"background-color:rgba(255,255,0, 0.1);text-decoration:none;",lookupDepth3:"background-color:rgba(255,255,0, 0.2);text-decoration:none;",lookupDepth4:"background-color:rgba(255,255,0, 0.3);text-decoration:none;",lookupDepth5:"background-color:rgba(255,255,0, 0.4);text-decoration:none;",lookupDepth6:"background-color:rgba(255,255,0, 0.5);text-decoration:none;",lookupDepth7:"background-color:rgba(255,255,0, 0.6);text-decoration:none;",lookupDepth8:"background-color:rgba(255,255,0, 0.7);text-decoration:none;",lookupDepth9:"background-color:rgba(255,255,0, 0.8);text-decoration:none;",lookupDepthx:"background-color:rgba(255,255,0, 0.9);text-decoration:none;",jsdocPragma:"color: black; background-color: #eee;",jsdocParam:"color: black;",jsdocFirstParam:"border-bottom: 1px solid black;",jsdocSecondParam:"border-bottom: 1px dashed black;",jsdocRest:"color: #555;"},getOutput:function(){var a=f;this.markLayer.innerHTML="";var c=this.zeon.lines,d=[],e=[];e.push("font-family:"+b.css(this.textarea,"font-family").replace(/"/g,"'")+";"),e.push("font-size:"+b.css(this.textarea,"font-size")+";"),e.push("font-weight:"+b.css(this.textarea,"font-weight")+";"),e.push("line-height:"+b.css(this.textarea,"line-height")+";");for(var g=0;g<c.length;++g)for(var h=0;h<c[g].length;++h){var i=c[g][h];if(i.name==13){var j=this.zeon.linearTreeNoWhite[i.linearNoWhitePosition-1]||i;this.showAsiMark(j)}else if(i.name==14){var j=this.zeon.linearTreeNoWhite[i.linearNoWhitePosition-1]||i;this.showErrorMark(j),i.tokenError&&d.push('<span style="'+this.syntaxColorSettings.error+e.join("")+'">'+i.value+"</span>")}else{var k=[],l=["color:black;"].concat(e);i.leadValue&&l.push(this.syntaxColorSettings.leadValue);if(i.varNameDecl){if(i.wasAlreadyDeclared){var m={color:"black",backgroundColor:"orange"};this.showCharacter("vv",i,m)}if(i.unused){var m={color:"black",backgroundColor:"orange",textDecoration:"line-through"};this.showCharacter("u",i,m),l.push(this.syntaxColorSettings.unusedVar)}}else i.isLabel?(l.push(this.syntaxColorSettings.label),i.labelNotFound?this.showCharacter("L",i,{color:"black",backgroundColor:"red",color:"white"}):i.duplicateLabel&&this.showCharacter("ll",i,{color:"black",backgroundColor:"red",color:"white"})):i.scopeLookupDepth===0?l.push(this.syntaxColorSettings.undefinedVar):i.scopeLookupDepth>0?l.push(this.syntaxColorSettings["lookupDepthx"+(i.scopeLookupDepth>9?"x":i.scopeLookupDepth)]):i.scopeLookupDepth<0&&!i.trackingObject.isEcma&&!i.trackingObject.isBrowser&&l.push(this.syntaxColorSettings.undefinedVar);i.propOverwritten&&(l.push(this.syntaxColorSettings.duplicateProperty),this.showCharacter("2x",i,m));if(i.isDevRelic){var m={color:"white",backgroundColor:"black"};this.showCharacter("d",i,m,12),l.push(this.syntaxColorSettings.relic)}if(i.scopeLookupDepth&&this.config["enable scope depth"]&&(i.scopeLookupDepth<0||i.scopeLookupDepth>this.config["warn if scope depth exceeds"])){var m={color:"black",backgroundColor:"yellow"};i.scopeLookupDepth<0&&(m={color:"black",backgroundColor:"orange",textDecoration:"line-through"}),this.showCharacter(Math.abs(i.scopeLookupDepth),i,m)}if(i.prematureUsage&&!i.trackingObject.isFuncDecl){var m={color:"black",backgroundColor:"yellow"};this.showCharacter("P",i,m,12),l.push(this.syntaxColorSettings.prematureUsage)}i.emptyStatement&&this.showCharacter("ε",i,{color:"black",backgroundColor:"orange"}),i.trackingObject&&(i.trackingObject.isEcma?l.push(this.syntaxColorSettings.ecma):i.trackingObject.isBrowser&&l.push(this.syntaxColorSettings.browser)),i.duplicatePropertyDecl&&this.showCharacter("℘",i,{color:"black",backgroundColor:"orange"}),i.badPrefixOperand&&this.showCharacter("!",i,{color:"white",backgroundColor:"red"}),i.unreachableCode&&this.showCharacter("\u2620",i,{color:"black",border:"0",fontSize:"18px"},-8,10),i.jslint&&this.config["enable jslint"]&&this.showJslintWarnings(i),i.isDirective&&this.showCharacter("D",i,{color:"white",backgroundColor:"green"}),(i.trackingObject&&(i.meta=="func decl name"||i.meta=="var name")&&i.trackingObject.isConstructor||i.value=="function"&&i.isConstructor)&&this.showCharacter("*",i,{color:"white",backgroundColor:"green",lineHeight:"10px"}),this.annotateType(i),i.name==2&&a.regexIsKeywordOrReserved.test(i.value)?l.push(this.syntaxColorSettings.keyword):i.name==1?l.push(this.syntaxColorSettings.regex):i.name==2?l.push(this.syntaxColorSettings.identifier):i.name==3?l.push(this.syntaxColorSettings.hex):i.name==4?l.push(this.syntaxColorSettings.dec):i.name==5?l.push(this.syntaxColorSettings.singleString):i.name==6?l.push(this.syntaxColorSettings.doubleString):i.name==7?l.push(this.syntaxColorSettings.singleComment):i.name==8?l.push(this.syntaxColorSettings.multiComment):i.name==9?l.push(this.syntaxColorSettings.whitespace):i.name==10?l.push(this.syntaxColorSettings.lineTerminator):i.name==11&&l.push(this.syntaxColorSettings.punctuator);var n="";k.length&&(n=" "+k.join(" "));var o="";l.length&&(o=' style="'+l.join("")+'"');if(i.name==8&&i.jsdoc){d.push("<span"+o+n+">"+i.jsdoc.map(function(a){if(a instanceof Array){var c=b.escape(a[1]);c+='<span style="'+this.syntaxColorSettings.jsdocPragma+'">@'+b.escape(a[3])+"</span>";if(a[3]!="param"&&a[3]!="var")return c+b.escape(a[4]||"")+b.escape(a[5]||"");c+=b.escape(a[4]||"");c+=typeof a[6]=="string"?'<span style="'+this.syntaxColorSettings.jsdocFirstParam+'">'+b.escape(a[6])+"</span>":"";c+=b.escape(a[7]||"");c+=typeof a[8]=="string"?'<span style="'+this.syntaxColorSettings.jsdocSecondParam+'">'+b.escape(a[8])+"</span>":"";c+=b.escape(a[9]||"");c+=typeof a[10]=="string"?'<span style="'+this.syntaxColorSettings.jsdocRest+'">'+b.escape(a[10])+"</span>":"";return c}return b.escape(a)},this).join("\n")+"</span>")}else{d.push("<span"+o+n+">"+b.escape(i.value)+"</span>")}}}return d.join("")},showJslintWarnings:function(a){switch(a.jslint){case"missing block good":this.showCharacter("{",a,{color:"black",backgroundColor:"yellow"});break;case"missing block bad":this.showCharacter("{",a,{color:"white",backgroundColor:"red"});break;case"assignment in header":this.showCharacter("≡",a,{color:"white",backgroundColor:"red"});break;case"weak comparison":a.isTypeofOperator||this.showCharacter("=",a,{color:"black",backgroundColor:"yellow"});break;case"dangling underscore":this.showCharacter("_",a,{color:"black",backgroundColor:"yellow"},10);break;case"dot and not can be confusing":this.showCharacter("r",a,{color:"black",backgroundColor:"yellow"},10);break;case"inc dec operator":this.showCharacter("±",a,{color:"black",backgroundColor:"yellow"},8);break;case"binary operator":this.showCharacter("b",a,{color:"black",backgroundColor:"yellow"});break;case"use dot access":this.showCharacter(".",a,{color:"white",backgroundColor:"red"});break;case"flow statement":this.showCharacter("f",a,{color:"white",backgroundColor:"red"});break;case"trailing decimal":case"leading decimal":this.showCharacter(".",a,{color:"black",backgroundColor:"yellow"});break;case"regex confusion":this.showCharacter("/",a,{color:"black",backgroundColor:"yellow"});break;case"number dot":this.showCharacter(".",a,{color:"white",backgroundColor:"red"});break;case"assignment bad":case"assignment this":this.showCharacter("≠",a,{color:"white",backgroundColor:"red"});break;case"bad string escapement":case"bad regex escapement":this.showCharacter("\\",a,{color:"black",backgroundColor:"yellow"});break;case"avoid hex":this.showCharacter("H",a,{color:"black",backgroundColor:"yellow"});break;case"caller callee":this.showCharacter("!",a,{color:"black",backgroundColor:"yellow"},10);break;case"octal escape":this.showCharacter("8",a,{color:"white",backgroundColor:"red"});break;case"00":this.showCharacter("0",a,{color:"black",backgroundColor:"yellow"});break;case"regexp call":this.showCharacter("r",a,{color:"white",backgroundColor:"red"});break;case"confusing plusses":this.showCharacter("+",a,{color:"black",backgroundColor:"yellow"});break;case"confusing minusses":this.showCharacter("-",a,{color:"black",backgroundColor:"yellow"});break;case"double bang":this.showCharacter("!",a,{color:"black",backgroundColor:"yellow"});break;case"control char":case"unsafe char":this.showCharacter("c",a,{color:"black",backgroundColor:"yellow"},10);break;case"catch var assignment":this.showCharacter("e",a,{color:"white",backgroundColor:"red"});break;case"bad constructor":this.showCharacter("c",a,{color:"black",backgroundColor:"yellow"},10);break;case"very bad constructor":this.showCharacter("c",a,{color:"white",backgroundColor:"red"},10);break;case"Function is eval":this.showCharacter("e",a,{color:"black",backgroundColor:"yellow"},15);break;case"function wrapped":this.showCharacter("f",a,{color:"black",backgroundColor:"yellow"});break;case"document.write":this.showCharacter("w",a,{color:"white",backgroundColor:"red"});break;case"iteration function":this.showCharacter("i",a,{color:"black",backgroundColor:"orange"});break;case"multiple case clause":this.showCharacter("c",a,{color:"black",backgroundColor:"yellow"});break;case"empty block":this.showCharacter("ε",a,{color:"black",backgroundColor:"yellow"});break;case"eval":this.showCharacter("e",a,{color:"white",backgroundColor:"red"},15);break;case"empty regex char class":this.showCharacter("[]",a,{color:"black",backgroundColor:"yellow"});break;case"fell through case":this.showCharacter("!",a,{color:"black",backgroundColor:"yellow"});break;case"extra comma":this.showCharacter(",",a,{color:"black",backgroundColor:"yellow"});break;case"double new":this.showCharacter("N",a,{color:"white",backgroundColor:"red",textDecoration:"line-through"});break;case"double delete":this.showCharacter("D",a,{color:"white",backgroundColor:"red",textDecoration:"line-through"});break;case"undefined":this.showCharacter("u",a,{color:"black",backgroundColor:"yellow"},10);break;case"duplicate objlit prop":this.showCharacter("d",a,{color:"white",backgroundColor:"red"});break;case"single expr parens":this.showCharacter("(",a,{color:"black",backgroundColor:"yellow",textDecoration:"line-through"});break;case"comma screws ref":this.showCharacter("(",a,{color:"white",backgroundColor:"red",textDecoration:"line-through"});break;case"timer eval":this.showCharacter("e",a,{color:"black",backgroundColor:"yellow"},10);break;case"group vars":this.showCharacter("\u21d1",a,{color:"black",backgroundColor:"yellow"});break;case"func decl at top":this.showCharacter("\u21d1",a,{color:"black",backgroundColor:"yellow"});break;case"is label":this.showCharacter("L",a,{color:"black",backgroundColor:"yellow"});break;case"math call":this.showCharacter("!",a,{color:"white",backgroundColor:"red"});break;case"new wants parens":this.showCharacter("(",a,{color:"black",backgroundColor:"yellow"});break;case"missing radix":this.showCharacter("r",a,{color:"black",backgroundColor:"yellow"},10);break;case"nested comment":this.showCharacter("*",a,{color:"black",backgroundColor:"yellow"},10);break;case"new statement":this.showCharacter("n",a,{color:"black",backgroundColor:"yellow"});break;case"no delete vars":this.showCharacter("v",a,{color:"black",backgroundColor:"yellow"});break;case"cant delete that":this.showCharacter("v",a,{color:"white",backgroundColor:"red"});break;case"cant delete with comma":this.showCharacter(",",a,{color:"white",backgroundColor:"red"});break;case"stupid key":this.showCharacter("☣",a,{fontSize:"30px",border:"0",color:"red"},3,10);break;case"empty switch":case"quasi empty switch":case"empty clause":this.showCharacter("ε",a,{color:"black",backgroundColor:"yellow"});break;case"clause should break":this.showCharacter("b",a,{color:"black",backgroundColor:"yellow"});break;case"switch is an if":this.showCharacter("i",a,{color:"black",backgroundColor:"yellow"});break;case"unwrapped for-in":this.showCharacter("!",a,{color:"black",backgroundColor:"yellow"});break;case"in out of for":this.showCharacter("f",a,{color:"black",backgroundColor:"yellow"});break;case"use {}":this.showCharacter("{}",a,{color:"black",backgroundColor:"yellow"},10);break;case"use []":this.showCharacter("[]",a,{color:"black",backgroundColor:"yellow"},10);break;case"double block":this.showCharacter("{",a,{color:"black",backgroundColor:"yellow"});break;case"useless block":this.showCharacter("{",a,{color:"black",backgroundColor:"yellow"});break;case"use capital namespacing":this.showCharacter("C",a,{color:"black",backgroundColor:"yellow"});break;case"called as function":this.showCharacter("f",a,{color:"black",backgroundColor:"yellow"});break;case"bad asi pattern":this.showCharacter(";",a,{color:"black",backgroundColor:"yellow"});break;case"unlikely typeof result":this.showCharacter("t",a,{color:"black",backgroundColor:"yellow"});break;case"weird typeof op":this.showCharacter("?",a,{color:"black",backgroundColor:"yellow"});break;case"typeof always string":this.showCharacter("s",a,{color:"black",backgroundColor:"yellow"});break;default:"unknown jslint warning: "+a.jslint}},annotateType:function(a){if(!!this.config["enable type annotations"]){if(a.isWhite||a.name==11)return;var b=!1;a.varType?b=a.varType:a.trackingObject&&a.trackingObject.varType&&(b=a.trackingObject.varType);if(b){b=this.zeon.getUniqueItems(b);if(b.indexOf("Array")>=0||b.indexOf("Function")>=0)b=b.filter(function(a){return a!="Object"});var c=2;b.length==2?c=2:b.length!=1&&(c=1),b.forEach(function(b,d){var e=!1;b=="string"?e="green":b=="number"?e="blue":b=="regexp"?e="orange":b=="boolean"?e="cyan":b=="undefined"||b=="null"?e="grey":b=="Array"?e="purple":b=="Function"&&(e="pink");if(e){var f={width:Math.floor(a.len*this.fontSize.w)+"px",height:c+"px",backgroundColor:e},g=this.tabMagic(this.lastInput,this.zeon.lines[a.startLineId].start,a.start),i=a.startLineId;this.showMark(g,i,f,0,15+d*c)}else if(b=="Object"){var f={width:Math.floor(a.len*this.fontSize.w)+"px",height:"0px",borderTop:"2px dotted black"},g=this.tabMagic(this.lastInput,this.zeon.lines[a.startLineId].start,a.start),i=a.startLineId;this.showMark(g,i,f,0,15)}},this)}}},addLineNumbers:function(){var a=[1];for(var b=1;b<this.zeon.lines.length;++b)a[b]=b+1;this.lineNumberPadding=(this.zeon.lines.length-1).toString().length*6+10,this.ruler.innerHTML=a.join("\n"),this.syntaxLayer.insertBefore(this.ruler,this.syntaxLayer.firstChild),this.updatePaddingLeft()},refreshSyntaxHighlight:function(){b.css(this.syntaxLayer,{display:"none"});var a;while(a=this.markLayer.firstChild)this.markLayer.removeChild(a);while(a=this.syntaxLayer.firstChild)this.syntaxLayer.removeChild(a);var c=+(new Date),d=this.lastInput,e=this.getOutput()+'\n\n\n\n\n\n\n\n<span style="color:transparent;">you found the secret message!</span>';this.debug("output generation time: "+(+(new Date)-c)+" ms");var c=+(new Date);this.syntaxLayer.innerHTML=e,this.syntaxLayer.insertBefore(this.markLayer,this.syntaxLayer.firstChild),this.addLineNumbers(),this.debug("display time: "+(+(new Date)-c)+" ms"),b.css(this.syntaxLayer,{display:"block"})},computeCaretPos:function(){if(!!this.zeon&&!!this.zeon.lines){if(this.zeon.lines.length==0)return;this.caretStale=!1;var a=this.textarea.selectionStart,b=this.zeon.lines;for(var c=0;c<b.length-1;++c)if(b[c].stop>a)break;c==b.length&&--c;var d=b[c],e=this.tabMagic(this.lastInput,d.start,a);if(d.coveredByMatch&&d.coveredByMatch.stop>a)this.caretToken=d.coveredByMatch;else{for(var f=0;f<d.length;++f)if(d[f].stop>a)break;this.caretToken=d[f]}var g=e!=this.caretCol||c!=this.caretRow;this.caretCol=e,this.caretRow=c,g&&this.caretPosChanged()}},computeCaretPos_alt:function(){if(!!this.zeon.lines){this.caretStale=!1;if(this.zeon.lines.length==0)return;var a=this.textarea.selectionStart,b=this.zeon.lines;for(var c=0;c<b.length-1;++c)if(b[c].stop>a)break;c==b.length&&--c;var d=b[c],e=0,f;if(d.length){e=Math.min(d.length-1,Math.floor((a-d.start)/(d.stop-d.start)*d.length));var g=d[e],h=g.stop<=a?1:-1;while(d[e+h]&&!(d[e].start<=a&&d[e].stop>a))e+=h;f=d[e]}var i;if(!(e==0&&d.coveredByMatch&&d.coveredByMatch.stop>a)){if(f.start==a)i=f.col;else if(!f.tabs)i=f.col+(a-f.start);else{var j=0;while(j<f.tabs.length-1&&f.tabs[j].pos<a)++j;i=f.tabs[j].col+(a-f.tabs[j].pos)}a==f.stop&&(i=f.col+f.cols)}this.caretToken=f;var k=i!=this.caretCol||c!=this.caretRow;this.caretCol=i,this.caretRow=c,k&&this.caretPosChanged()}},updateCaretPos:function(){this.caretStale&&this.computeCaretPos();var a=this.colRowToXY(this.caretCol,this.caretRow);this.caret.style.left=Math.floor(a.x-this.textarea.scrollLeft)+this.defaultLeftPadding+(this.showLineNumbers?this.lineNumberPadding:0)+"px",this.caret.style.top=Math.floor(a.y-this.textarea.scrollTop)+"px"},startCaretBlink:function(){clearInterval(this.caretTimer),this.caretStale&&(this.computeCaretPos(),this.updateCaretPos()),this.caret.style.display="block",this.caretVisible=!0,this.caretTimer=setInterval(function(){this.caretVisible?(this.caret.style.display="none",this.caretVisible=!1):(this.caretStale&&(this.computeCaretPos(),this.updateCaretPos()),this.caret.style.display="block",this.caretVisible=!0)}.bind(this),500)},caretPosChanged:function(){if(this.caretMarkTrash)for(var a=0;a<this.caretMarkTrash.length;++a)this.caretMarkTrash[a].parentNode&&this.caretMarkTrash[a].parentNode.removeChild(this.caretMarkTrash[a]);var b=this.caretMarkTrash=[],c,d,e=this.caretToken;e&&console.log("caret:",e);if(e){var f=Math.max(e.start,this.zeon.lines[this.caretRow].start),g=Math.min(e.stop,this.zeon.lines[this.caretRow].stop),h=this.tabMagic(this.lastInput,this.zeon.lines[this.caretRow].start,f),i=this.tabMagic(this.lastInput,f,g,h),j={width:Math.floor((i-h)*this.fontSize.w)+"px",height:Math.floor(this.fontSize.h)+"px",backgroundColor:"rgba(0, 255, 0, 0.2)"};b[b.length]=this.showMark(h,this.caretRow,j),e.twin?(c=e,d=e.twin):e.linearPosition&&this.textarea.selectionStart==e.start&&this.zeon.linearTree[e.linearPosition-1].twin&&(c=this.zeon.linearTree[e.linearPosition-1],d=this.zeon.linearTree[e.linearPosition-1].twin);if(!!this.config["enable caret popup"])if(e.trackingObject&&e.trackingObject.properties){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},k="(to.props)<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>",e.trackingObject.isConstructor&&(k+="Constructor: "+e.trackingObject.constructorName+"<br/>"),k+="Type(s):"+this.zeon.getUniqueItems(e.trackingObject.varType).join(",")+"<br/>",k+="Properties:<br/>"+this.zeon.getUniqueItems(Object.keys(e.trackingObject.properties)).join("<br/>");var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}else if(e.definedProperties){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},k="(defprops)<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>",e.isConstructor&&(k+="Constructor: "+e.constructorName+"<br/>"),k+="Type(s):"+(e.trackingObject?this.zeon.getUniqueItems(e.trackingObject.varType).join(","):e.varType?this.zeon.getUniqueItems(e.varType).join(","):"Unknown")+"<br/>",k+="Properties:<br/>"+this.zeon.getUniqueItems(Object.keys(e.definedProperties)).join("<br/>");var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}else if(e.trackingObject&&e.trackingObject.varType&&e.trackingObject.varType.length){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},n=e.targetPrototype||e.trackingObject&&e.trackingObject.targetPrototype,o=n&&(n.functionStack||n.trackingObject&&n.trackingObject.functionStack);o&&(o=o[0]);var p=o&&o.prototypeProperties,k="(to.types)<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>",e.trackingObject.isConstructor&&(k+="Constructor: "+e.trackingObject.constructorName+"<br/>"),k+="Type(s):"+this.zeon.getUniqueItems(e.trackingObject.varType).join(",")+"<br/>",p&&(k+="From prototype:<br/>"+Object.keys(p).join("<br/>")+"<br/>");var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}else if(e.value=="function"){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},q="undefined";e.varType&&e.varType.length&&(q=this.zeon.getUniqueItems(e.varType).join(","));var r="none";e.throws&&e.throws.length&&(r=this.zeon.getUniqueItems(e.throws).join(","));var k="Returns: "+q+"<br/>Throws: "+r+"<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>",e.isConstructor&&(k+="Constructor: "+e.constructorName+"<br/>"),e.prototypeProperties&&(k+="Prototype:<br/>"+Object.keys(e.prototypeProperties).join("<br/>"));var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}else if(e.varType&&e.varType.length){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},k="(match.types)<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>",e.isConstructor&&(k+="Constructor: "+e.constructorName+"<br/>"),k+="Type(s):"+this.zeon.getUniqueItems(e.varType).join(",")+"<br/>";var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}else if(e.expressionArg||e.twin&&e.twin.expressionArg){var s=this.zeon.getType(e.expressionArg||e.twin.expressionArg);s instanceof Array&&(s=this.zeon.getUniqueItems(s)),typeof s!="string"&&(s?s.value=="new"?s.targetExpression&&s.targetExpression.constructorName?s=s.targetExpression.constructorName:s="new-object-instance(todo)":s.isObjectLiteralStart?s="Object":s.isArrayLiteralStart?s="Array":s.isFunction?s="Function":s instanceof Array||(s="unknown-type"):s="unknown-type");var j={backgroundColor:"rgb(100, 0, 255)",color:"white",zIndex:5},k="Result type(s) of group:<br/>"+(s||"<Unknown>")+"<br/>";k+="pos:"+e.start+",line:"+e.startLineId+",col:"+e.startLinePosition+",tree:"+e.linearNoWhitePosition+"<br/>";var l=this.tabMagic(this.lastInput,this.zeon.lines[e.startLineId].start,e.start),m=e.startLineId;b[b.length]=this.showMark(l,m,j,0,15,k)}if(e.trackingObject&&e.trackingObject.refs){var t=e.trackingObject.refs;for(var a=0;a<t.length;++a){var u=t[a],j={width:Math.floor((u.stop-u.start)*this.fontSize.w)+"px",height:Math.floor(this.fontSize.h)+"px",backgroundColor:"rgba(0, 255, 255, 0.2)"},l=this.tabMagic(this.lastInput,this.zeon.lines[u.startLineId].start,u.start),m=u.startLineId;b[b.length]=this.showMark(l,m,j)}}e.name!=2}else this.zeon.linearTree[this.zeon.linearTree.length-1]&&this.zeon.linearTree[this.zeon.linearTree.length-1].twin&&(c=this.zeon.linearTree[this.zeon.linearTree.length-1].twin,d=this.zeon.linearTree[this.zeon.linearTree.length-1]);if(c&&d){var j={width:Math.floor(this.fontSize.w)+"px",height:Math.floor(this.fontSize.h)+"px",backgroundColor:"rgba(0, 0, 255, 0.2)"};if(this.zeon.lines[c.startLineId]&&this.zeon.lines[d.startLineId]){var l=this.tabMagic(this.lastInput,this.zeon.lines[c.startLineId].start,c.start),m=c.startLineId;b[b.length]=this.showMark(l,m,j),l=this.tabMagic(this.lastInput,this.zeon.lines[d.startLineId].start,d.start),m=d.startLineId,b[b.length]=this.showMark(l,m,j)}}},showAsiMark:function(a){var c=this.matchToColRow(a),d=document.createElement("span"),e=this.colRowToXY(c.col,c.row),f={position:"absolute",left:-2+Math.floor(e.x)+"px",top:8+Math.floor(e.y)+"px",width:"2px",height:"8px",backgroundColor:"red"};f&&b.css(d,f),this.markLayer.appendChild(d);return d},showErrorMark:function(a){var c=this.matchToColRow(a),d=document.createElement("span"),e=this.colRowToXY(c.col,c.row),f={position:"absolute",left:-10+Math.floor(e.x)+"px",top:Math.floor(e.y)+"px",width:"20px",height:"20px",border:"1px solid red",WebkitBorderRadius:"10px",borderRadius:"10px"};f&&b.css(d,f),this.markLayer.appendChild(d);return d},showMark:function(a,c,d,e,f,g){typeof e!="number"&&(e=0),typeof f!="number"&&(f=0);var h=document.createElement("span");g!=null&&(h.innerHTML=g);var i=this.colRowToXY(a,c);b.css(h,{position:"absolute",left:e+Math.floor(i.x)+"px",top:f+Math.floor(i.y)+"px"}),d&&b.css(h,d),this.markLayer.appendChild(h);return h},showCharacter:function(a,c,d,e,f){typeof e!="number"&&(e=0),typeof f!="number"&&(f=0);var g=c.startLineId,h=this.tabMagic(this.lastInput,this.zeon.lines[c.startLineId].start,c.start),i=this.colRowToXY(h,g),j=document.createElement("span");j.innerHTML=a,b.css(j,{position:"absolute",left:-8+e+Math.floor(i.x)+"px",top:-3+f+Math.floor(i.y)+"px",border:"1px solid black",WebkitBorderRadius:"10px",borderRadius:"10px",margin:0,width:"10px",height:"10px",lineHeight:"8px",textAlign:"center",fontSize:"10px",fontWeight:900,opacity:.4}),b.css(j,d),this.markLayer.appendChild(j);return j},showCircleAtMatch:function(a,c){this.lastFocusCircle&&this.lastFocusCircle.parentNode&&this.lastFocusCircle.parentNode.removeChild(this.lastFocusCircle);var d=this.matchToColRow(a),e=this.lastFocusCircle=document.createElement("span"),f=this.colRowToXY(d.col-(c!="asis"&&c!="errors"?a.value.length:0),d.row),g=-20+Math.floor(f.x),h=-12+Math.floor(f.y),i={position:"absolute",left:g+"px",top:h+"px",width:"40px",height:"40px",border:"3px solid blue",WebkitBorderRadius:"30px",borderRadius:"30px"};i&&b.css(e,i),this.markLayer.appendChild(e),this.textarea.scrollLeft=Math.max(0,g-200),this.textarea.scrollTop=Math.max(0,h-300);return e},enableDnD:function(){if(window.File&&window.FileReader&&window.FileList){var a=this.textarea,b=this.syntaxLayer,c=function(a){a.stopPropagation(),a.preventDefault()},d=function(a){for(var b=0;b<a.length;++b)g(a[b])},e=document.createElement("style");e.type="text/css";var f="\n\t\t\t\t/* pulsy! and a bgcolor as fallback for non-webkit */\n\t\t\t\t@-webkit-keyframes zeon-pulse {\n\t\t\t\t\t0% { background: white; }\n\t\t\t\t\t100% { background: #6af; }\n\t\t\t\t}\n\t\t\t\t.zeon-active-drop-target {\n\t\t\t\t\t-webkit-animation-name: zeon-pulse;\n\t\t\t\t\t-webkit-animation-duration: 0.7s;\n\t\t\t\t\t-webkit-animation-iteration-count: infinite;\n\t\t\t\t\t-webkit-animation-direction: alternate;\n\t\t\t\t\t-webkit-animation-timing-function: in-and-out;\n\t\t\t\t\tbackground: #6af;\n\t\t\t\t}\n\t\t\t";e.styleSheet?e.styleSheet.cssText=f:e.innerHTML=f,document.head.appendChild(e);var g=function(b){var c=new FileReader;c.onload=function(d){var e=a.value;a.value=e+(e?"\n\n":"")+";// #################################\n"+" // ## Start of file: "+b.name+"\n"+" // #################################\n\n"+c.result},c.onabort=function(a){console.log("The file read was aborted... (maybe you're in a local file on chrome?)",a)},c.onerror=function(a){console.log("There was an error reading the file... (maybe you're in a local file on chrome?)",a)},c.readAsText(b)};this.textarea.ondragenter=function(a){c(a),b.className+=" zeon-active-drop-target"},this.textarea.ondragover=function(a){c(a)},this.textarea.ondragleave=function(a){c(a),b.className=b.className.replace(/ ?zeon-active-drop-target/g,"")},this.textarea.ondrop=function(a){c(a),b.className=b.className.replace(/ ?zeon-active-drop-target/g,"");var e=a.dataTransfer.files;if(e)d(e);else try{var f=a.dataTransfer.getData("Text");this.value+=f}catch(g){}}}},0:0};var c=function(a){this.inp=a,this.pos=0,this.line=0,this.column=0,this.cache={},this.tokens=0,this.errorStack=[],this.regexWhiteSpace=c.regexWhiteSpace,this.regexLineTerminator=c.regexLineTerminator,this.regexAsciiIdentifier=c.regexAsciiIdentifier,this.regexHex=c.regexHex,this.regexUnicodeEscape=c.regexUnicodeEscape,this.regexIdentifierStop=c.regexIdentifierStop,this.regexPunctuators=c.regexPunctuators,this.Unicode=window.Unicode,this.errorEscape=null};c.escape=function(a){return a.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\s/g,"\\s").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},c.prototype.storeCurrentAndFetchNextToken=function(a,b,d,e){var f=!a,g=this.pos,h=this.inp,i=!1;do{if(!e){d.push(b);if(this.errorEscape){b=this.errorEscape,this.errorEscape=null;return b}}e=!1;if(g>=h.length){b={start:h.length,stop:h.length,name:12};break}var b=null,j=g,k=h[g];if(this.regexWhiteSpace.test(k))++g,b={start:j,stop:g,name:9,line:this.line,col:this.column,isWhite:!0},++this.column;else if(this.regexLineTerminator.test(k))b={start:g,stop:++g,name:10,line:this.line,col:this.column,isWhite:!0},i=!0,++this.line,this.column=0,b.hasNewline=1;else if(k=="/"&&h[g+1]=="/")g=h.indexOf("\n",g),g==-1&&(g=h.length),b={start:j,stop:g,name:7,line:this.line,col:this.column,isComment:!0,isWhite:!0},this.column=b.stop;else if(k=="/"&&h[g+1]=="*"){var l=h.indexOf("*/",g);if(l==-1)l=h.indexOf("\n",g),l<0?g+=2:g=l,b={start:j,stop:g,name:14,value:h.substring(j,g),line:this.line,col:this.column,isComment:!0,isWhite:!0,tokenError:!0,error:c.Error.UnterminatedMultiLineComment},this.errorStack.push(b);else{g=l+2,b={start:j,stop:g,name:8,value:h.substring(j,g),line:this.line,col:this.column,isComment:!0,isWhite:!0};var m=0,n=0;while(m<(m=b.value.indexOf("\n",m+1)))++n;n?(i=!0,b.hasNewline=n,this.line+=n,this.column=0):this.column=b.stop}}else if(k=="'"){var n=0;do{while(g<h.length&&h[++g]=="\\")h[g+1]=="\n"&&++n,++g;if(this.regexLineTerminator.test(h[g])){b={start:j,stop:g,name:14,value:h.substring(j,g),isString:!0,tokenError:!0,error:c.Error.UnterminatedDoubleStringNewline},this.errorStack.push(b);break}}while(g<h.length&&h[g]!="'");b||(h[g]!="'"?(b={start:j,stop:g,name:14,value:h.substring(j,g),isString:!0,tokenError:!0,error:c.Error.UnterminatedDoubleStringOther},this.errorStack.push(b)):(++g,b={start:j,stop:g,name:5,isString:!0},n?(b.hasNewline=n,this.line+=n,this.column=0):this.column+=g-j))}else if(k=='"'){var n=!1;do{while(g<h.length&&h[++g]=="\\")h[g+1]=="\n"&&++n,++g;if(this.regexLineTerminator.test(h[g])){b={start:j,stop:g,name:14,value:h.substring(j,g),isString:!0,tokenError:!0,error:c.Error.UnterminatedSingleStringNewline},this.errorStack.push(b);break}}while(g<h.length&&h[g]!='"');b||(h[g]!='"'?(b={start:j,stop:g,name:14,value:h.substring(j,g),isString:!0,tokenError:!0,error:c.Error.UnterminatedSingleStringOther},this.errorStack.push(b)):(++g,b={start:j,stop:g,name:6,isString:!0},n?(b.hasNewline=n,this.line+=n,this.column=0):this.column+=g-j))}else if(k>="0"&&k<="9"||k=="."&&h[g+1]>="0"&&h[g+1]<="9"){++g;if(k!="0"||h[g]!="x"&&h[g]!="X"){var o=k=="0"&&h[g]>="0"&&h[g]<="9";if(k!="."){while(g<h.length&&h[g]>="0"&&h[g]<="9")++g;h[g]=="."&&++g}while(g<h.length&&h[g]>="0"&&h[g]<="9")++g;if(h[g]=="e"||h[g]=="E"){(h[++g]=="+"||h[g]=="-")&&++g;var p=g;while(g<h.length&&h[g]>="0"&&h[g]<="9")++g;if(p==g)throw c.Error.NumberExponentRequiresDigits}o?(b={start:j,stop:g,name:14,isNumber:!0,isOctal:!0,tokenError:!0,error:c.Error.IllegalOctalEscape},this.errorStack.push(b)):b={start:j,stop:g,name:4,isNumber:!0}}else{while(++g<h.length&&this.regexHex.test(h[g]));b={start:j,stop:g,name:3,isNumber:!0}}}else if(f&&k=="/"){var q=!1;while(++g<h.length){k=h[g];if(k=="\\"&&h[g+1]!="\n")++g;else if(k=="[")while(++g<h.length&&h[g]!="\n"&&h[g]!="]");else{if(k=="\n"){b={start:j,stop:g,name:14,tokenError:!0,error:c.Error.UnterminatedRegularExpressionNewline},this.errorStack.push(b);break}if(k=="/"){q=!0;break}}}if(!q||b)b||(b={start:j,stop:g,name:14,tokenError:!0,error:c.Error.UnterminatedRegularExpressionOther},this.errorStack.push(b));else{++g;while(g<h.length&&this.regexAsciiIdentifier.test(h[g]))++g;b={start:j,stop:g,name:1}}}else{var r=this.regexPunctuators.exec(h.substring(g,g+4));if(r)b={start:g,stop:g+=r[1].length,name:11,value:r[1]};else{var q=!1;while(g<h.length){var s=h[g];if(this.regexAsciiIdentifier.test(s))++g;else if(this.regexUnicodeEscape.test(h.substring(g,g+6)))g+=6;else{if(!this.Unicode)break;if(this.regexIdentifierStop.test(s))break;var t=this.Unicode;if(!(t.Lu.test(s)||t.Ll.test(s)||t.Lt.test(s)||t.Lm.test(s)||t.Lo.test(s)||t.Nl.test(s)||t.Mn.test(s)||t.Mc.test(s)||t.Nd.test(s)||t.Pc.test(s)||t.sp.test(s)))break}q=!0}q?b={start:j,stop:g,name:2,value:h.substring(j,g)}:h[g]=="`"?(b={start:j,stop:g,name:14,tokenError:!0,error:c.Error.BacktickNotSupported},this.errorStack.push(b)):(b={start:j,stop:g,name:14,tokenError:!0,error:c.Error.Unknown,value:s},this.errorStack.push(b),++g)}}++this.tokens}while(d&&b&&b.isWhite);this.pos=g,i&&(b.newline=!0);return b},c.prototype.tokens=function(a){a=a||[];var b=0,c,d=[];while((c=this.storeCurrentAndFetchNextToken(!a[b++],!1,!1,!0))&&c.name!=12)d.push(c);return d},c.regexWhiteSpace=/[ \t\u000B\u000C\u00A0\uFFFF]/,c.regexLineTerminator=/[\u000A\u000D\u2028\u2029]/,c.regexAsciiIdentifier=/[a-zA-Z0-9\$_]/,c.regexHex=/[0-9A-Fa-f]/,c.regexUnicodeEscape=/\\u[0-9A-Fa-f]{4}/,c.regexIdentifierStop=/[\>\=\!\|\<\+\-\&\*\%\^\/\{\}\(\)\[\]\.\;\,\~\?\:\ \t\n\\\'\"]/,c.regexPunctuators=/^(>>>=|===|!==|>>>|<<=|>>=|<=|>=|==|!=|\+\+|--|<<|>>|\&\&|\|\||\+=|-=|\*=|%=|\&=|\|=|\^=|\/=|\{|\}|\(|\)|\[|\]|\.|;|,|<|>|\+|-|\*|%|\||\&|\||\^|!|~|\?|:|=|\/)/,c.Unidocde=window.Unicode,c.Error={UnterminatedSingleStringNewline:{msg:"Newlines are not allowed in string literals"},UnterminatedSingleStringOther:{msg:"Unterminated single string"},UnterminatedDoubleStringNewline:{msg:"Newlines are not allowed in string literals"},UnterminatedDoubleStringOther:{msg:"Unterminated double string"},UnterminatedRegularExpressionNewline:{msg:"Newlines are not allowed in regular expressions"},UnterminatedRegularExpressionOther:{msg:"Unterminated regular expression"},UnterminatedMultiLineComment:{msg:"Unterminated multi line comment"},UnexpectedIdentifier:{msg:"Unexpected identifier"},IllegalOctalEscape:{msg:"Octal escapes are not valid"},Unknown:{msg:"Unknown input"},NumberExponentRequiresDigits:{msg:"Numbers with exponents require at least one digit after the `e`"},BacktickNotSupported:{msg:"The backtick is not used in js, maybe you copy/pasted from a fancy site/doc?"}};var d=function(a){this.scopes=[],this.lastInput=a,this.config={minifyVariableNamesToo:!0}};d.prototype={config:null,lastInput:"",tree:null,root:null,scopes:null,regexEcma:/^Object$|^Array$|^String$|^Number$|^Boolean$|^Date$|^Function$|^RegExp$|^Error$|^arguments$|^Math$|^JSON$|^parseInt$|^parseFloat$|^isFinite$|^isNaN$|^undefined$|^eval$|^true$|^false$|^null$/,regexBrowser:/^document$|^window$|^setTimeout$|^setInterval$|^clearInterval$|^clearTimeout$|^console$|^navigator$|^Image$|^alert$|^confirm$|^XMLHttpRequest$/,regexDevSigns:/^console$|^log$|^debug$|^alert$|^foo$|^bar$|^boo$/,regexBuiltinObjects:/^Object$|^Array$|^String$|^Number$|^Boolean$|^Date$|^Function$|^RegExp$|^Error$|^Math$|^JSON$/,regexBuiltinBadConstructors:/^Object$|^Array$|^String$|^Number$|^Boolean$|^Function$|^RegExp$|^Error$|^Math$|^JSON$/,regexBinaryOps:/^\&$|^\|$|^\^$|^\~$|^<<$|^>>$|^>>>$/,regexControlChars:/[\u0000-\u001F]/,regexEscapement:/(?:^|[^\\])\\[^'"\\bfnrtv]/,regexBoolOps:/^<=$|^>=$|^<$|^>$|^==$|^!=$|^===$|^\!==$|^in$|^instanceof$/,regexNumberOps:/^\*=?$|^\/=?$|^%=?$|^-=?$|^<<=?$|^>>>=?$|^\&=?$|^\|=?$|^\^=?$/,regexUnsafeCharacters:/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,regexJsDoc:/^(\s*\*?\s*)(\@)([a-zA-Z0-9]+)(?:(\s+)(([^\s]+)(?:(\s+)([^\s]+)(?:(\s+)(.+))?)?))?/,precedence:{"*":1,"/":1,"%":1,"+":2,"-":2,"<<":3,">>":3,">>>":3,"<":4,"<=":4,">":4,">=":4,"in":4,"instanceof":4,"==":5,"!=":5,"===":5,"!===":5,"&":6,"^":7,"|":8,"&&":9,"||":10,"?":11,":":11,"=":12,"<<=":12,">>=":12,">>>=":12,"+=":12,"-=":12,"*=":12,"/=":12,"%=":12,"&=":12,"^=":12,"|=":12,",":13},currentLine:null,lines:null,lastMatch:null,linearTree:null,linearTreeNoWhite:null,implicitGlobals:null,asis:null,IS_CONTINUE:1,IS_BREAK:2,IS_LABELED_BREAK:3,IS_RETURN:4,IS_THROW:5,PHASE_DIRECTIVE:0,PHASE_VAR:1,PHASE_FUNC:2,PHASE_REST:3,findInScope:function(a,b,c){c||(c=1);var d;for(var e=0;e<a.length;++e)if(a[e]instanceof Array)d=a[e];else if(a[e].value==b.value){if(a[e].implicit)return-c;return c}if(d)return this.findInScope(d,b,c+1);return-c},markVarAsDeclaredAndFixRefs:function(a,b,c){while(a.catchScope<0){if(!(a[0]instanceof Array))throw"catch scope should have upper scope as first kid";a=a[0]}a.catchScope>0&&(a.catchScope=-1);for(var d=0;d<a.length;++d){var e=a[d];e.isFuncDecl=!!c;if(!(e instanceof Array)){if(e.implicit)throw"the parser should have declared it";if(e.value==b.value){b.functionStack&&(e.functionStack=b.functionStack),e.isDeclared?e.isDoublyDeclared=b.wasAlreadyDeclared=!0:e.isDeclared=!0,b.trackingObject=e,e.refs||(e.refs=[]),e.refs.push(b),e.isCatchVar=b.isCatchVar;return}}}throw"Post processing error. The variable was declared but not found in this scope level."},fixRefsTothis:function(a,b){for(var c=0;c<a.length;++c){var d=a[c];if(!(d instanceof Array)&&d.value==b.value){b.trackingObject=d,d.refs||(d.refs=[]),d.refs.push(b);return}}throw"Post processing error. Every scope should contain `this`."},markVarUsageFixRefsAndCheckPremature:function(a,b){var c;for(var d=0;d<a.length;++d){var e=a[d];if(e instanceof Array)c=e;else if(e.value==b.value){b.trackingObject=e,b.functionStack&&(e.functionStack=b.functionStack),e.refs||(e.refs=[]),e.refs.push(b),e.used=!0,!e.isDeclared&&!e.implicit&&!e.isFuncDecl&&(b.prematureUsage=!0);return}}if(c)return this.markVarUsageFixRefsAndCheckPremature(c,b);console.log("error:",b);throw"any variable, declared or undeclared, should be logged into the scope at this point"},getUniqueItems:function(a){var b=[];if(!a)return[];for(var c=0;c<a.length;++c)b.indexOf(a[c])<0&&b.push(a[c]);return b},uniqueInline:function(a){for(var b=0;b<a.length-1;++b){var c=a.length;while(--c>b)a[b]==a[c]&&a.splice(c,1)}},uniqueNamesByValue:function(a){var b=[];for(var c=0;c<a.length;++c){var d=!1;for(var e=0;e<b.length;++e)if(b[e].value==a[c].value){d=!0;break}d||b.push(a[c])}return b},processScope:function(a){this.scopes.push(a);for(var b=0;b<a.length-1;++b)if(a[b]instanceof Array)a.upper=a[b];else{var c=a.length;while(--c>b)a[b].value==a[c].value&&a.splice(c,1)}},findLabel:function(a,b,c){var d=0;for(var e=0;e<b.length;++e){b[e]instanceof Array?d+=this.findLabel(a,b[e]):b[e]==a&&++d;if(!c&&d)break;if(c&&d==2)break}return d},toTokenStream:function(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];f instanceof Array?this.toTokenStream(f,b,c,d):(b&&!f.value&&(f.value=b.substring(f.start,f.stop)),d&&(f.linearPosition=d.length,d.push(f)),c&&f.name!=7&&f.name!=9&&f.name!=8&&f.name!=10&&(f.linearNoWhitePosition=c.length,c.push(f)))}return c||d},parse:function(){this.tokenizer=new c(this.lastInput),this.tree=[],this.parser=new f(this.lastInput,this.tokenizer,this.tree),this.parser.parse()},startProcess:function(){this.reset();var a=this.globalScope=this.tree.scope;this.addEcmaBuiltIns(a),this.phase1(this.tree),this.phase2(this.tree),this.phase3(this.tree),this.lastMatch&&(this.currentLine.stop=this.lastMatch.stop,delete this.currentLine)},reset:function(){this.currentLine=[],this.currentLine.lineId=0,this.currentLine.start=0,this.lines=[this.currentLine],this.lastMatch=null,this.linearTree=[],this.linearTreeNoWhite=[],this.collects={errors:[],jslints:[],implicitGlobals:[],knownGlobals:[],asis:[],prematures:[],unused:[],empties:[],jsdocs:[],objlits:[],arrlits:[],deadLines:[]}},addEcmaBuiltIns:function(a){a.push({isEcma:!0,isDeclared:!0,value:"NaN",varType:["number"]}),a.push({isEcma:!0,isDeclared:!0,value:"Infinity",varType:["number"]}),a.push({isEcma:!0,isDeclared:!0,value:"undefined",varType:["undefined"]}),a.push({isEcma:!0,isDeclared:!0,value:"eval",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"parseInt",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"parseFloat",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"isNaN",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"isFinite",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"decodeURI",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"decodeURIComponent",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"encodeURI",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,value:"encodeURIComponent",varType:["Function"]}),a.push({constructorName:"String",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},valueOf:{refs:[],value:"valueOf",varType:["Function"]},charAt:{refs:[],value:"charAt",varType:["Function"]},charCodeAt:{refs:[],value:"charCodeAt",varType:["Function"]},concat:{refs:[],value:"concat",varType:["Function"]},indexOf:{refs:[],value:"indexOf",varType:["Function"]},lastIndexOf:{refs:[],value:"lastIndexOf",varType:["Function"]},localeCompare:{refs:[],value:"localeCompare",varType:["Function"]},match:{refs:[],value:"match",varType:["Function"]},replace:{refs:[],value:"replace",varType:["Function"]},search:{refs:[],value:"search",varType:["Function"]},slice:{refs:[],value:"slice",varType:["Function"]},splice:{refs:[],value:"splice",varType:["Function"]},substring:{refs:[],value:"substring",varType:["Function"]},toLowerCase:{refs:[],value:"toLowerCase",varType:["Function"]},toLocaleLowerCase:{refs:[],value:"toLocaleLowerCase",varType:["Function"]},toUpperCase:{refs:[],value:"toUpperCase",varType:["Function"]},toLocaleUpperCase:{refs:[],value:"toLocaleUpperCase",varType:["Function"]},trim:{refs:[],value:"trim",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},fromCharCode:{refs:[],value:"fromCharCode",varType:["Function"]},length:{refs:[],value:"length",varType:["number"]}},refs:[],used:!0,value:"String",varType:["Function"]}),a.push({constructorName:"Number",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},valueOf:{refs:[],value:"valueOf",varType:["Function"]},toLocaleString:{refs:[],value:"toLocaleString",varType:["Function"]},toFixed:{refs:[],value:"toFixed",varType:["Function"]},toExponential:{refs:[],value:"toExponential",varType:["Function"]},toPrecision:{refs:[],value:"toPrecision",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},MIN_VALUE:{refs:[],value:"MIN_VALUE",varType:["number"]},MAX_VALUE:{refs:[],value:"MAX_VALUE",varType:["number"]},NaN:{refs:[],value:"NaN",varType:["number"]},POSITIVE_INFINITY:{refs:[],value:"POSITIVE_INFINITY",varType:["number"]},NEGATIVE_INFINITY:{refs:[],value:"NEGATIVE_INFINITY",varType:["number"]}},refs:[],used:!0,value:"Number",varType:["Function"]}),a.push({constructorName:"Boolean",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},valueOf:{refs:[],value:"valueOf",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]}},refs:[],used:!0,value:"Boolean",varType:["Function"]}),a.push({constructorName:"Function",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},apply:{refs:[],value:"apply",varType:["Function"]},call:{refs:[],value:"call",varType:["Function"]},bind:{refs:[],value:"bind",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]}},refs:[],used:!0,value:"Function",varType:["Function"]}),a.push({constructorName:"Array",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},toLocaleString:{refs:[],value:"toLocaleString",varType:["Function"]},concat:{refs:[],value:"concat",varType:["Function"]},join:{refs:[],value:"join",varType:["Function"]},pop:{refs:[],value:"pop",varType:["Function"]},push:{refs:[],value:"push",varType:["Function"]},reverse:{refs:[],value:"reverse",varType:["Function"]},shift:{refs:[],value:"shift",varType:["Function"]},slice:{refs:[],value:"slice",varType:["Function"]},sort:{refs:[],value:"sort",varType:["Function"]},splice:{refs:[],value:"splice",varType:["Function"]},unshift:{refs:[],value:"unshift",varType:["Function"]},indexOf:{refs:[],value:"indexOf",varType:["Function"]},lastIndexOf:{refs:[],value:"lastIndexOf",varType:["Function"]},every:{refs:[],value:"every",varType:["Function"]},some:{refs:[],value:"some",varType:["Function"]},forEach:{refs:[],value:"forEach",varType:["Function"]},map:{refs:[],value:"map",varType:["Function"]},filter:{refs:[],value:"filter",varType:["Function"]},reduce:{refs:[],value:"reduce",varType:["Function"]},reduceRight:{refs:[],value:"reduceRight",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},isArray:{refs:[],value:"isArray",varType:["Function"]},length:{refs:[],value:"length",varType:["number"]}},refs:[],used:!0,value:"Array",varType:["Function"]}),a.push({constructorName:"RegExp",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{exec:{refs:[],value:"exec",varType:["Function"]},test:{refs:[],value:"test",varType:["Function"]},toString:{refs:[],value:"toString",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},length:{refs:[],value:"length",varType:["number"]}},refs:[],used:!0,value:"RegExp",varType:["Function"]}),a.push({constructorName:"Date",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},toDateString:{refs:[],value:"toDateString",varType:["Function"]},toTimeString:{refs:[],value:"toTimeString",varType:["Function"]},toLocaleString:{refs:[],value:"toLocaleString",varType:["Function"]},toLocaleDateString:{refs:[],value:"toLocaleDateString",varType:["Function"]},toLocaleTimeString:{refs:[],value:"toLocaleTimeString",varType:["Function"]},valueOf:{refs:[],value:"valueOf",varType:["Function"]},getTime:{refs:[],value:"getTime",varType:["Function"]},getFullYear:{refs:[],value:"getFullYear",varType:["Function"]},getUTCFullYear:{refs:[],value:"getUTCFullYear",varType:["Function"]},getMonth:{refs:[],value:"getMonth",varType:["Function"]},getUTCMonth:{refs:[],value:"getUTCMonth",varType:["Function"]},getDate:{refs:[],value:"getDate",varType:["Function"]},getUTCDate:{refs:[],value:"getUTCDate",varType:["Function"]},getDay:{refs:[],value:"getDay",varType:["Function"]},getUTCDay:{refs:[],value:"getUTCDay",varType:["Function"]},getHours:{refs:[],value:"getHours",varType:["Function"]},getUTCHours:{refs:[],value:"getUTCHours",varType:["Function"]},getMinutes:{refs:[],value:"getMinutes",varType:["Function"]},getUTCMinutes:{refs:[],value:"getUTCMinutes",varType:["Function"]},getSeconds:{refs:[],value:"getSeconds",varType:["Function"]},getUTCSeconds:{refs:[],value:"getUTCSeconds",varType:["Function"]},getMilliseconds:{refs:[],value:"getMilliseconds",varType:["Function"]},getUTCMilliseconds:{refs:[],value:"getUTCMilliseconds",varType:["Function"]},getTimezoneOffset:{refs:[],value:"getTimezoneOffset",varType:["Function"]},setTime:{refs:[],value:"setTime",varType:["Function"]},setMilliseconds:{refs:[],value:"setMilliseconds",varType:["Function"]},setUTCMilliseconds:{refs:[],value:"setUTCMilliseconds",varType:["Function"]},setSeconds:{refs:[],value:"setSeconds",varType:["Function"]},setUTCSeconds:{refs:[],value:"setUTCSeconds",varType:["Function"]},setMinutes:{refs:[],value:"setMinutes",varType:["Function"]},setUTCMinutes:{refs:[],value:"setUTCMinutes",varType:["Function"]},setHours:{refs:[],value:"setHours",varType:["Function"]},setUTCHours:{refs:[],value:"setUTCHours",varType:["Function"]},setDate:{refs:[],value:"setDate",varType:["Function"]},setUTCDate:{refs:[],value:"setUTCDate",varType:["Function"]},setMonth:{refs:[],value:"setMonth",varType:["Function"]},setUTCMonth:{refs:[],value:"setUTCMonth",varType:["Function"]},setFullYear:{refs:[],value:"setFullYear",varType:["Function"]},setUTCFullYear:{refs:[],value:"setUTCFullYear",varType:["Function"]},toUTCString:{refs:[],value:"toUTCString",varType:["Function"]},toISOString:{refs:[],value:"toISOString",varType:["Function"]},toJSON:{refs:[],value:"toJSON",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},length:{refs:[],value:"length",varType:["number"]},parse:{refs:[],value:"parse",varType:["Function"]},UTC:{refs:[],value:"UTC",varType:["Function"]},now:{refs:[],value:"now",varType:["Function"]}},refs:[],used:!0,value:"Date",varType:["Function"]}),a.push({isEcma:!0,isDeclared:!0,properties:{E:{refs:[],value:"E",varType:["number"]},LN10:{refs:[],value:"LN10",varType:["number"]},LN2:{refs:[],value:"LN2",varType:["number"]},LOG2E:{refs:[],value:"LOG2E",varType:["number"]},LOG10E:{refs:[],value:"LOG10E",varType:["number"]},PI:{refs:[],value:"PI",varType:["number"]},SQRT1_2:{refs:[],value:"SQRT1_2",varType:["number"]},SQRT2:{refs:[],value:"SQRT2",varType:["number"]},abs:{refs:[],value:"abs",varType:["Function"]},acos:{refs:[],value:"acos",varType:["Function"]},asin:{refs:[],value:"asin",varType:["Function"]},atan:{refs:[],value:"atan",varType:["Function"]},atan2:{refs:[],value:"atan2",varType:["Function"]},ceil:{refs:[],value:"ceil",varType:["Function"]},cos:{refs:[],value:"cos",varType:["Function"]},exp:{refs:[],value:"exp",varType:["Function"]},floor:{refs:[],value:"floor",varType:["Function"]},log:{refs:[],value:"log",varType:["Function"]},max:{refs:[],value:"max",varType:["Function"]},min:{refs:[],value:"min",varType:["Function"]},pow:{refs:[],value:"pow",varType:["Function"]},random:{refs:[],value:"random",varType:["Function"]},round:{refs:[],value:"round",varType:["Function"]},sin:{refs:[],value:"sin",varType:["Function"]},sqrt:{refs:[],value:"sqrt",varType:["Function"]},tan:{refs:[],value:"tan",varType:["Function"]}},refs:[],used:!0,value:"Math",varType:["Object"]}),a.push({constructorName:"JSON",isEcma:!0,isDeclared:!0,properties:{parse:{refs:[],value:"parse",varType:["Function"]},stringify:{refs:[],value:"stringify",varType:["Function"]}},refs:[],used:!0,value:"JSON",varType:["Object"]}),a.push({constructorName:"Object",isEcma:!0,isDeclared:!0,properties:{prototype:{properties:{toString:{refs:[],value:"toString",varType:["Function"]},toLocaleString:{refs:[],value:"toLocaleString",varType:["Function"]},valueOf:{refs:[],value:"valueOf",varType:["Function"]},hasOwnProperty:{refs:[],value:"hasOwnProperty",varType:["Function"]},isPrototypeOf:{refs:[],value:"isPrototypeOf",varType:["Function"]},propertyIsEnumerable:{refs:[],value:"propertyIsEnumerable",varType:["Function"]}},refs:[],value:"prototype",varType:["Object"]},getPrototypeOf:{refs:[],value:"getPrototypeOf",varType:["Function"]},create:{refs:[],value:"create",varType:["Function"]},defineProperty:{refs:[],value:"defineProperty",varType:["Function"]},defineProperties:{refs:[],value:"defineProperties",varType:["Function"]},seal:{refs:[],value:"seal",varType:["Function"]},freeze:{refs:[],value:"freeze",varType:["Function"]},preventExtensions:{refs:[],value:"preventExtensions",varType:["Function"]},isSealed:{refs:[],value:"isSealed",varType:["Function"]},isFrozen:{refs:[],value:"isFrozen",varType:["Function"]},isExtensible:{refs:[],value:"isExtensible",varType:["Function"]},keys:{refs:[],value:"keys",varType:["Function"]}},refs:[],used:!0,value:"Object",varType:["Function"]})},phase1:function(a,b,c,d,e,f,g,h){h||(h=0),a.scope&&(b=a.scope,this.processScope(b)),a.labels&&(c=a.labels),a.isIteration?g=!0:a.sub=="switch"?(f=!0,a.stops=0,a.maxStops=null):a.isFunction&&(d=!1,f=!1,g=!1,e=!0,h=0);var i;this.disambiguateOperators(a),a.sub=="switch"&&(a.cases=0,a.hasDefault=!1),a.sub=="block"&&(a.statements=0),a.forEach(function(j,k){if(j instanceof Array){if(j.sub=="case"||j.sub=="default")j.sub=="case"?++a.cases:a.hasDefault=!0,i&&(i.stops=0,a.maxStops=0,i[0][0].jslint="clause should break"),i=j,i.hasStatements=0,a[k+1]&&(a[k+1].desc!="switch clause body"||a[k+1].length==0)&&(j[0][0].jslint="empty clause");var l=this.linearTreeNoWhite.length;j.nextTreeId=l,a.sub=="block"&&j.desc=="statement-parent"&&++a.statements,this.phase1Stack(j,a,k,b,c,d,e,f,g);if(a.root||a.isFunction)switch(h){case this.PHASE_DIRECTIVE:if(j[0].expressionCount==1){var m=this.linearTreeNoWhite[j.nextTreeId],n=this.linearTreeNoWhite[j.nextTreeId+1];if(m.isString&&n&&(n.value==";"||n.name==13)){m.isDirective=!0;break}}h=this.PHASE_VAR;case this.PHASE_VAR:if(j[0].sub=="var"){h=this.PHASE_FUNC;break}h=this.PHASE_FUNC;case this.PHASE_FUNC:if(j.isFunction)break;h=this.PHASE_REST;case this.PHASE_REST:j[0].sub=="var"?this.linearTreeNoWhite[j.nextTreeId].jslint="group vars":j.isFunction&&(this.linearTreeNoWhite[j.nextTreeId].jslint="func decl at top")}a.stops&&a.sub!="object literal"&&(a.stops!=this.IS_THROW||a.sub!="try")&&(this.linearTreeNoWhite[l].unreachableCode=!0,this.collects.deadLines.push(this.linearTreeNoWhite[l]));if(j.sub=="catch")a.stops=0,j[0].unreachableCode=!1;else if(!a.stops)if(a.sub=="if")j.desc=="statement-parent"?a.ifStops=j.stops:j.sub=="else"&&(a.elseStops=j.stops);else{j.sub=="if"&&(!j.ifStops||!j.hasElse||!j.elseStops?a.stops=0:j.ifStops==j.elseStops?j.stops=j.ifStops:j.ifStops==this.IS_THROW?j.stops=j.elseStops:j.elseStops==this.IS_THROW?j.stops=j.ifStops:j.ifStops==this.IS_RETURN?j.stops=j.elseStops:j.elseStops==this.IS_RETURN?j.stops=j.ifStops:j.ifStops==this.IS_LABELED_BREAK?j.stops=j.elseStops:j.elseStops==this.IS_LABELED_BREAK?j.stops=j.ifStops:j.stops=this.IS_CONTINUE);if(!((j.stops==this.IS_BREAK||j.stops==this.IS_CONTINUE)&&(j.isIteration||j.sub=="switch")||j.stops==this.IS_LABELED_BREAK&&(j.isFunction||j.sub=="labeled")||j.stops==this.IS_RETURN&&j.isFunction||j.stops==this.IS_THROW&&(j.sub=="try"||j.isFunction))){a.sub!="switch"&&(a.stops=j.stops);if(i&&j.stops){i.stops=j.stops;if(a.maxStops==null||a.maxStops>j.stops)a.maxStops=j.stops;i=null}}}}else j.statementHeaderStart&&a.forType!="each"?d=!0:j.statementHeaderStop?d=!1:j.forEachHeaderStart?d=!0:j.forEachHeaderStop&&(d=!1),this.phase1Token(j,a,k,b,c,d,e,f,g)},this),i&&(i.stops=0,a.maxStops=0,i[0][0].jslint="clause should break");if(a.sub=="switch"){var j=this.linearTreeNoWhite[a.nextTreeId];a.maxStops!=null?(a.stops=a.maxStops,a.cases==0?j.jslint="quasi empty switch":a.cases==1&&(j.jslint="switch is an if")):this.linearTreeNoWhite[a.nextTreeId]&&(j.jslint="empty switch")}},phase1Stack:function(a,b,c,d,e,f,g,h,i){this.lastJsdoc&&(a.isFunction||a.desc=="var decl")&&(a.lastJsdoc=this.lastJsdoc,this.lastJsdoc=null),this.enableJslint&&(i&&a.isFunction&&(a[0].jslint="iteration function"),a.isEmptyBlock&&(a[0].jslint="empty block")),a.desc=="grouped"&&a.numberOfExpressions==1&&(a.jslint="useless parens"),this.phase1(a,d,e,f,g,h,i),a.hasObjectLiteral&&this.collectObjectLiteralProperties(a),a.stops||(a.sub=="return"?a.stops=this.IS_RETURN:a.sub=="throw"?a.stops=this.IS_THROW:a.sub=="break"?a.hasLabel?a.stops=this.IS_LABELED_BREAK:a.stops=this.IS_BREAK:a.sub=="continue"?a.stops=this.IS_CONTINUE:a.stops=0)},phase1Token:function(a,b,c,d,e,g,h,i,j){this.lastMatch=a,a.len=a.stop-a.start,a.value||(a.value=this.lastInput.substring(a.start,a.stop)),a.linearPosition=this.linearTree.length,this.linearTree.push(a),a.isWhite||(a.linearNoWhitePosition=this.linearTreeNoWhite.length,this.linearTreeNoWhite.push(a)),a.startLineId=this.currentLine.lineId,a.startLineIndex=this.currentLine.length,a.startLinePosition=a.start-this.currentLine.start,a.name==13?this.collects.asis.push(this.linearTreeNoWhite[a.linearNoWhitePosition-1]):a.emptyStatement?this.collects.empties.push(a):a.name==8&&a.value[2]=="*"&&this.sliceMultilineComment(a),a.name==14&&this.collects.errors.push(a),a.isObjectLiteralStart&&this.collects.objlits.push(a),a.isArrayLiteralStart&&this.collects.arrlits.push(a),a.value=="new"&&this.processNew(b,c);if(a.meta){a.leadValue=a.meta=="lead value";if(a.name==2){a.varNameDecl=a.meta=="var name"||a.meta=="func decl name"||a.meta=="func expr name"||a.meta=="parameter";if(a.varNameDecl||a.leadValue&&!f.regexLiteralKeywords.test(a.value)||a.value=="this"){a.varNameDecl?this.processVarCreate(a,d):this.processLeadValue(a,d);if(!a.trackingObject)throw"wtf no tracking object?";a.trackingObject.checkedKeywords||this.checkKnownKeywords(a),a.trackingObject.implicit&&(a.trackingObject.isEcma||a.trackingObject.isBrowser?this.collects.knownGlobals.push(a):this.collects.implicitGlobals.push(a)),a.isConstructor&&(a.trackingObject.isConstructor=!0,a.trackingObject.constructorName=a.constructorName),a.functionStack&&(a.trackingObject.functionStack=a.functionStack),a.trackingObject.functionStack&&a.isConstructor&&(a.trackingObject.functionStack[0].isConstructor=!0,a.trackingObject.functionStack[0].constructorName=a.constructorName)}a.value=="this"&&this.fixRefsTothis(d,a)}}else a.name==2&&(a.checkedKeywords||this.checkKnownKeywords(a,!0));(a.isObjectLiteralStart||a.isArrayLiteralStart||a.leadValue)&&this.trackProperties(a,b,c),this.currentLine.push(a);if(a.hasNewline){var k=a.start;while((k=this.lastInput.indexOf("\n",k))>=0&&k<a.stop)++k,this.currentLine.stop=k,this.currentLine=[],this.currentLine.lineId=this.lines.length,this.currentLine.coveredBytoken=a,this.lines.push(this.currentLine),this.currentLine.start=k}},checkKnownKeywords:function(a,b){if(b)var c=a;else var c=a.trackingObject;c.isEcma==null&&(c.isEcma=this.regexEcma.test(a.value)),c.isBrowser==null&&(c.isBrowser=this.regexBrowser.test(a.value)),c.isDefRelic==null&&(c.isDefRelic=this.regexDevSigns.test(a.value))},processVarCreate:function(a,b){var c=a.meta=="func decl name";c&&(b=b[0]),this.markVarAsDeclaredAndFixRefs(b,a,c)},processLeadValue:function(a,b){a.scopeLookupDepth=this.findInScope(b,a);if(a.scopeLookupDepth<0){var c={value:a.value,implicit:!0,isDeclared:!1};this.globalScope.push(c)}this.markVarUsageFixRefsAndCheckPremature(b,a),a.prematureUsage&&!a.trackingObject.isFuncDecl&&this.collects.prematures.push(a)},sliceMultilineComment:function(a){var b=a.value.split("\n");a.jsdoc=b.map(function(a){var b=this.regexJsDoc.exec(a);if(b)return b;return a},this),this.lastJsdoc=a},collectObjectLiteralProperties:function(a){var b=a.definedProperties={};for(var c=0;c<a.length;++c)if(a[c].isObjectLiteralStart)a[c].definedProperties=b;else if(a[c].isObjectLiteralPair){var d=0,e=2,f=a[c][d][0];if(a[c][d].isWhite)continue;({}).hasOwnProperty.call(b,f.value)&&(b[f.value].propOverwritten=!0,f.jslint="duplicate objlit prop"),b[f.value]=f,f.assignedPropExpression=a[c][e]&&a[c][e][0]}},disambiguateOperators:function(a){if(a.desc=="expression")while(a.length%2==1&&a.length>3&&a[1].isBinaryOperator){var b=1,c=this.precedence[a[1].sub],d=3;while(d<a.length-1){var e=this.precedence[a[d].sub];if(e<c||e==c&&(a[d].isAssignment||a[d].sub=="?"||a[d].sub==":"))c=e,b=d;d+=2}var f=[a[b-1],a[b],a[b+1]];f.desc="expression",f.sub=a[b].sub,a.splice(b-1,3,f),a.sub=a[1].sub}else a.length==3&&a[1].isBinaryOperator&&(a.sub=a[1].value)},processNew:function(a,b){var c=a[b],d;while((d=a[++b])&&d.isWhite);if(!d||d.name==2){if(d.value[0]<"A"||d.value[0]>"Z")d.jslint="use capital namespacing";var e=d.value,f=d;while(d=a[++b])if(!d.isWhite)if(d.value=="."){while((d=a[++b])&&d.isWhite);if(d&&d.name!=2)return;e+="."+d.value,f=d;if(d.value[0]<"A"||d.value[0]>"Z")d.jslint="use capital namespacing"}else{if(d.value!="["){if(d.value=="(")break;c.jslint="new wants parens";break}while((d=a[++b])&&d.isWhite);if(d&&d.desc!="expressions")return;while((d=a[++b])&&d.isWhite);if(d&&d.value!="]")return;e+="[]",f=null}d||(c.jslint="new wants parens"),f?(f.isConstructor=!0,f.constructorName=e,f.functionStack&&(f.functionStack.isConstructor=!0,f.functionStack.constructorName=e),c.targetExpression=f):c.targetExpression=!1}},trackProperties:function(a,b,c){if(!a.isObjectLiteralStart&&!a.isArrayLiteralStart&&!a.leadValue)throw console.log("error:",a),"why?";if(!a.isString&&!a.isNumber&&a.name!=1){var d=a,e=d;if(a.isObjectLiteralStart||a.isArrayLiteralStart)while(b[++c]&&(b[c].isWhite||b[c].value!="}"&&b[c].value!="]"));var f,g;while((g=b[++c])&&g.isWhite);while(g&&g.value=="."){while((g=b[++c])&&g.isWhite);if(g){g.value=="__proto__"&&(g.value="__proTo__",g.jslint="stupid key"),g.isPropertyOf=d,e=g,f=d.trackingObject;if(f){f.properties||(f.properties={});var h=f.properties;({}).hasOwnProperty.call(h,g.value)?(h[g.value].refs.push(g),g.trackingObject=h[g.value]):(g.trackingObject={value:g.value,refs:[g]},h[g.value]=g.trackingObject),g.isConstructor&&(g.trackingObject.isConstructor=!0,g.trackingObject.constructorName=g.constructorName)}else g.trackingObject={value:g.value,refs:[g]};g.value=="call"||g.value=="apply"?this.setTypeToRef(d,"Function"):g.value=="prototype"?(d.isConstructor||(d.isConstructor=!0,d.constructorName=d.value),d.trackingObject.isConstructor||(d.trackingObject.isConstructor=!0,d.trackingObject.constructorName=d.value),this.setTypeToRef(d,"Function")):!a.isObjectLiteralStart&&!a.isArrayLiteralStart&&this.setTypeToRef(d,"Object")}d=g;while((g=b[++c])&&g.isWhite);}a.lastDotProperty=e,g&&(g.isObjectLiteralStart||g.isArrayLiteralStart)?a.leadValueTarget=!0:g&&g.value=="["?!d.isArrayLiteralStart&&!d.isObjectLiteralStart&&(this.setTypeToRef(d,"Object"),d.dynamicPropertyAccess=!0,a.leadValueTarget=!1,a.hasDynamicProperty=!0):g&&g.value=="("?(this.setTypeToRef(d,"Function"),d.hasCall=!0,d.callTarget=e,a.leadValueTarget=null,a.hasCallExpression=!0):!g||g.value!="++"&&g.value!="--"?d==a?a.leadValueTarget=!0:a.leadValueTarget=d:(a.hasPostfix=!0,d.postfixed=!0,a.leadValueTarget=!1,g.hasBeenAssigned=!0,this.setTypeToRef(d,"number"))}},phase2:function(a,b,c,d,e,f){a.labels&&(b=a.labels),a.isIteration?e=!0:a.sub=="switch"?f=!0:a.isFunction&&(c=!1,e=!1,d=a);var g=-1;a.forEach(function(h,i){a.sub=="block"&&h.sub=="block"&&a.statements==1?this.linearTreeNoWhite[a.nextTreeId].jslint="double block":(a.root||a.desc=="func body")&&h.sub=="block"&&(this.linearTreeNoWhite[h.nextTreeId].jslint="useless block"),h.statementHeaderStart&&a.forType!="each"?c=!0:h.statementHeaderStop?c=!1:h.forEachHeaderStart?c=!0:h.forEachHeaderStop&&(c=!1);if(h instanceof Array){if(a.sub=="for"&&a.forType=="in"&&h.desc=="statement-parent"){if(h.sub=="block"&&h.statements==1){var j=-1;while(h[++j].desc!="statement-parent");var k=h[j]}else var k=h;var l=this.linearTreeNoWhite,m=k.nextTreeId;if(!l[m+8]||l[m].value!="if"||l[++m].value!="("||l[++m].name!=2||l[++m].value!="."||l[++m].value!="hasOwnProperty"||l[++m].value!="("||l[++m].name!=2||l[++m].value!=")"||l[++m].value!=")")a[0].jslint="unwrapped for-in"}this.phase2Stack(h,b,c,d,e,f);if(h.hasTypeof&&a[i+2]){var n=this.linearTreeNoWhite[a[i+1].nextTreeId];if(n&&n.name==11)switch(n.value){case"===":case"!==":n.jslint="typeof always string";case"==":case"!=":n.isTypeofOperator=!0;var o=this.linearTreeNoWhite[a[i+2].nextTreeId];if(o&&o.isString)switch(o.value.substring(1,o.value.length-1)){case"boolean":case"string":case"number":case"undefined":case"object":case"function":break;default:o.jslint="unlikely typeof result"}break;default:n.jslint="weird typeof op"}}}else this.phase2Token(h,a,i,b,c,d,e,f),h.value=="delete"&&(g=i)},this);if(g>=0){var h=g;while(a[++h]&&a[h].isWhite);a[h]&&(a[h].leadValue&&a[h].leadValueTarget===!0?a[g].jslint="no delete vars":a[h].leadValue&&!a[h].leadValueTarget&&!a[h].hasDynamicProperty?a[g].jslint="cant delete that":a[h].desc=="grouped"&&a[h].numberOfExpressions>1&&(a[g].jslint="cant delete with comma"))}},phase2Stack:function(a,b,c,d,e,g){var h=this.linearTreeNoWhite;a.isFunction&&a.stops==0&&h[a.nextTreeId]&&h[a.nextTreeId].value=="function"&&(h[a.nextTreeId].varType||(h[a.nextTreeId].varType=[]),h[a.nextTreeId].varType.push("undefined")),a.desc=="statement"&&h[a.nextTreeId]&&h[a.nextTreeId].value=="new"&&(h[a.nextTreeId].jslint="new statement"),a.lastJsdoc&&this.processJsdoc(a);if(this.enableJslint&&a.isGroupStart&&a[0].value=="("){var i=h[a[0].linearNoWhitePosition+1];i&&i.value=="function"&&a[a.length-1].value==")"&&h[a[a.length-1].linearNoWhitePosition-1].value=="}"&&(a[0].jslint="function wrapped")}this.phase2(a,b,c,d,e,g),a.desc=="expression"&&f.regexAssignments.test(a.sub)?this.processAssignment(a):a.desc=="single var decl"&&a.length>2?this.processInitialiser(a):a.hasObjectLiteral&&!a.processedForTypes&&this.processObjectLiteralForTypes(a),(a.validatePrefixOperator||a.validatePostOperator)&&this.handlePrePostFixOperatorEdgeCase(a);if(d&&a.sub=="return"&&!a[0].unreachableCode){var j=0;while(a[++j]&&a[j].isWhite);if(a[j].desc=="expressions"){var k=this.getType(a[j]),l=d[0];l.varType||(l.varType=[]),typeof k=="string"?l.varType.push(k):k?k.value=="new"?k.targetExpression&&k.targetExpression.constructorName?l.varType.push(k.targetExpression.constructorName):l.varType.push("new-object-instance(todo)"):k.isObjectLiteralStart?l.varType.push("Object"):k.isArrayLiteralStart?l.varType.push("Array"):k.isFunction?l.varType.push("Function"):k instanceof Array&&k.forEach(function(a){typeof a=="string"&&l.varType.push(a)}):l.varType.push("unknown-type")}}if(d&&a.sub=="throw"&&!a[0].unreachableCode){var j=0;while(a[++j]&&a[j].isWhite);var l=d[0];l.throws||(l.throws=[]);var m=this.getType(a[j]);typeof m=="string"?l.throws.push(m):m?m.value=="new"?m.targetExpression&&m.targetExpression.constructorName?l.throws.push(m.targetExpression.constructorName):l.throws.push("new-object-instance(todo)"):m.isObjectLiteralStart?l.throws.push("Object"):m.isArrayLiteralStart?l.throws.push("Array"):m.isFunction?l.throws.push("Function"):m instanceof Array?m.forEach(function(a){typeof a=="string"&&l.throws.push(a)}):l.throws.push("unknown-type"):l.throws.push("unknown-type")}},phase2Token:function(a,b,c,d,e,f,g,h){if(a.value=="++"||a.value=="--")a.isUnaryOp?b.validatePrefixOperator=!0:a.hasBeenAssigned||(b.validatePostOperator=!0);if(a.value=="new"&&a.targetExpression){var i=a.targetExpression;i.varType||(i.varType=[]),i.varType.push("Function"),i.trackingObject&&(i.trackingObject.varType||(i.trackingObject.varType=[]),i.trackingObject.varType.push("Function"),i.trackingObject.isConstructor=!0,i.trackingObject.constructorName=i.constructorName)}a.value=="typeof"&&(b.hasTypeof=!0),a.varNameDecl&&!a.trackingObject.used&&(a.meta!="parameter"&&!a.isCatchVar||a.value!="_")&&(a.unused=!0,this.collects.unused.push(a))},handlePrePostFixOperatorEdgeCase:function(a){var b=!1,c=!1,d=null;for(var e=0;e<a.length;++e){if(a[e].value=="++"||a[e].value=="--"){if(a.validatePostOperator){c=this.getValidAssigneeLead(d);break}b=a[e]}else if(b&&!a[e].isWhite){a[e].isUnaryOp?c=!1:a[e].isWhite||(c=this.getValidAssigneeLead(a[e]));break}a[e].isWhite||(d=a[e])}if(c&&c.leadValueTarget&&c.leadValueTarget!==!0)c=c.leadValueTarget,this.setTypeToRef(c,"number");else if(c&&c.leadValueTarget)this.setTypeToRef(c,"number");else if(!c||c.leadValueTarget!==!1)b.badPrefixOperand=!0},getValidAssigneeLead:function(a){if(a.desc=="grouped"){var b=this.getExpressionsFromGroup(a);if(!b)return!1;return this.getValidAssigneeLead(b)}if(a.desc=="expressions")return this.isValidAssigneeExpressions(a);if(a.leadValue)return a;return!1},isValidAssigneeExpressions:function(a){if(a.expressionCount!=1)return!1;return this.isValidAssigneeExpression(a[0])},isValidAssigneeExpression:function(a){if(a.length!=1)return!1;return this.isValidAssigneeSubExpression(a[0])},isValidAssigneeSubExpression:function(a){if(!a.filter(function(a){return!a.isWhite}).length)return!1;if(a[0].leadValue||a[0].desc=="grouped")return this.getValidAssigneeLead(a[0]);return!1},getExpressionsFromGroup:function(a){if(a.numberOfExpressions!=1)return!1;for(var b=0;b<a.length;++b)if(a[b].desc=="expressions")return a[b];return!1},processJsdoc:function(a){var b=a.lastJsdoc;if(!!b){var c=b.jsdoc;if(a.isFunction){var d=c.filter(function(a){return a instanceof Array&&a[3]=="param"&&a[6]});d.length&&d.some(function(b){var c=a.filter(function(a){return a.meta=="parameter"});if(c.length){var d=b[6],e=b[8];e?d[0]=="{"&&d[d.length-1]=="}"?(d=d.substring(1,d.length-1),d=d.split("|"),d=d.map(function(a){if(a[a.length-2]=="["&&a[a.length-1]=="]")return"Array";return a},this)):(e=d,d=[]):(e=d,d=[]),e[0]=="["&&e[e.length-1]=="]"&&(e=e.substring(1,e.length-1)),e=e.split("=")[0],d=d.map(function(a){return a},this),e&&d&&d.length&&c.forEach(function(a){if(a.value==e){this.setTypeToRef(a,d),a.jsdocType=d.slice(0),a.trackingObject.jsdocType=d.slice(0);return!0}},this)}},this)}else{if(a.desc!="var decl")throw"Wtf";var e=c.filter(function(a){return a instanceof Array&&a[3]=="var"&&a[6]&&a[8]});if(e.length){var f=a.filter(function(a){return a.desc=="single var decl"});f.length&&f.forEach(function(a){var b=a[0][0];e.some(function(a){if(b&&b.value==a[6]){this.setTypeToRef(b,a[8]),b.jsdocType=a[8],b.trackingObject.jsdocType=a[8];return!0}})})}}}},processAssignment:function(a){var b=a[0];b=this.getValidAssigneeLead(b[0]);if(!b||!b.leadValueTarget){if(!b||b.leadValueTarget!==!1&&a[1]&&a[1][0])a[1][0].jslint="assignment bad"}else{b.leadValueTarget!==!0&&(b=b.leadValueTarget);var c=a[1][0],d=!1;c.value!="+="&&(d=this.getBinaryOperatorType(c.value));if(d)return this.setTypeToRef(b,d);var e=a[2];if(e.hasObjectLiteral)c.value=="="?this.assignObjectLiteral(b,e):c.value=="+="?this.setTypeToRef(b,"string"):this.setTypeToRef(b,"number");else{var f=this.getType(e);if(c.value=="="){d=f;if(d){if(d.isFunction){b.functionStack=d;if(b.trackingObject&&b.trackingObject.isConstructor){var g=d[0];g.isConstructor=!0,g.constructorName=b.trackingObject.constructorName}}this.setTypeToRef(b,d)}}else if(c.value=="+="){if(f instanceof Array){var h=!1,i=!1;f.forEach(function(a){h=h||a=="string",i=i||a=="number"}),h&&i?f=!0:h?f="string":i?f="number":f=!1}var j=!1;if(b.trackingObject&&b.trackingObject.varType){var h=!1,i=!1;b.trackingObject.varType.forEach(function(a){h=h||a=="string",i=i||a=="number"}),h&&i?j=!0:h?j="string":i?j="number":j=!1}!j&&!f?this.setTypeToRef(b,["string","number"]):j?f?j=="number"&&f=="number"?this.setTypeToRef(b,"number"):j=="string"||f=="string"?this.setTypeToRef(b,"string"):this.setTypeToRef(b,["string","number"]):this.setTypeToRef(b,"string"):this.setTypeToRef(b,f)}else this.setTypeToRef(b,"number")}}},processInitialiser:function(a){var b=a[0][0],c=a[2][0];if(c.hasObjectLiteral)throw"does tihs still happen?";if(c.desc=="expression"&&c[0].hasObjectLiteral)this.assignObjectLiteral(b,c[0]);else{var d=this.getType(c);d&&(d.isFunction&&(b.functionStack=d,b.trackingObject.functionStack=d,b.trackingObject.isConstructor&&(d[0].isConstructor=!0,d[0].constructorName=b.trackingObject.constructorName),d.lastJsdoc=a.varStack.lastJsdoc,this.processJsdoc(d)),this.setTypeToRef(b,d))}},assignObjectLiteral:function(a,b){b.processedForTypes=!0;if(!b.definedProperties)throw"obj should have been processed";var c=b.definedProperties;a.trackingObject.properties||(a.trackingObject.properties={});var d=a.trackingObject.properties;for(var e in c){var f=c[e],g=f.assignedPropExpression;if(!g)continue;({}).hasOwnProperty.call(d,e)?d[e].refs.push(f):d[e]={value:e,refs:[f]},c[e].trackingObject=d[e];var h=this.getType(g);h&&this.setTypeToRef(f,h)}(!b.hasObjectLiteral||b[0].leadValueTarget===!0)&&this.setTypeToRef(a,"Object")},processObjectLiteralForTypes:function(a){a.processedForTypes=!0;if(!a.definedProperties)throw"obj should have been processed";var b=a.definedProperties;for(var c in b){var d=b[c],e=d.assignedPropExpression;if(!e)continue;var f=this.getType(e);f&&this.setTypeToRef(d,f,!0)}},phase3:function(a,b,c,d,e,f){a.labels&&(b=a.labels),a.isIteration?e=!0:a.sub=="switch"?f=!0:a.isFunction&&(c=!1,e=!1,d=a),a.forEach(function(g,h){g.statementHeaderStart&&a.forType!="each"?c=!0:g.statementHeaderStop?c=!1:g.forEachHeaderStart?c=!0:g.forEachHeaderStop&&(c=!1),g instanceof Array?this.phase3Stack(g,a,h,b,c,d,e,f):this.phase3Token(g,a,h,b,c,d,e,f)},this)},phase3Stack:function(a,b,c,d,e,f,g,h){this.phase3(a,d,e,f,g,h)},phase3Token:function(a,b,c,d,e,f,g,h){this.enableJslint&&a.name==2&&(this.confirmTimerNotEval(b,a,c),this.confirmRadixForParseInt(b,a,c));if(a.value=="prototype"&&a.isPropertyOf&&a.trackingObject.properties&&!a.trackingObject.processedForConstructor){var i=a.isPropertyOf.functionStack||a.isPropertyOf.trackingObject&&a.isPropertyOf.trackingObject.functionStack;if(i){var j=i[0];j.prototypeProperties||(j.prototypeProperties={});for(var k in a.trackingObject.properties)if(a.trackingObject.properties.hasOwnProperty(k)&&a.trackingObject.properties[k].varType&&k!="__proto__"){var l=a.trackingObject.properties[k];({}).hasOwnProperty.call(j.prototypeProperties,k)?j.prototypeProperties[k]=j.prototypeProperties[k].concat(l.varType):j.prototypeProperties[k]=l.varType.slice(0)}console.log("result funcKeyword.prototypeProperties",j.prototypeProperties)}a.trackingObject.processedForConstructor=!0}this.jslintStuff(a,e,d,g,f,h),a.jslint&&this.collects.jslints.push(a)},confirmTimerNotEval:function(a,b,c){if(b.leadValue&&b.lastDotProperty==b&&b.hasCallExpression&&(b.value=="setTimeout"||b.value=="setInterval")){var d=c;while(a[++d]&&a[d].isWhite);if(a[d]&&a[d++].isCallExpressionStart&&a[d]&&a[d][0]){var e=this.getType(a[d][0]);e=="string"&&(b.jslint="timer eval")}}},confirmRadixForParseInt:function(a,b,c){if(b.leadValue&&b.lastDotProperty==b&&b.hasCallExpression&&b.value=="parseInt"){var d=c;while(a[++d]&&a[d].isWhite);a[d]&&a[d++].isCallExpressionStart&&a[d]&&a[d].expressionCount<2&&(b.jslint="missing radix")}},jslintStuff:function(a,b,c,d,e,f){if(!!this.enableJslint){var g=this.linearTreeNoWhite;b&&a.value=="="&&(a.jslint="assignment in header");if(a.name==11)if(a.statementHeaderStop){var h=g[a.linearNoWhitePosition+1];h&&h.value!="{"&&(h.newline&&this.jslintSettings["missing block bad"]?a.jslint="missing block bad":!h.newline&&this.jslintSettings["missing block good"]&&(a.jslint="missing block good"))}else if(a.propertyAccessStart)g[a.linearNoWhitePosition+2]&&g[a.linearNoWhitePosition+1].isString&&g[a.linearNoWhitePosition+2].propertyAccessStop&&/^[a-zA-Z\$_][a-zA-Z0-9\$_]*$/g.test(g[a.linearNoWhitePosition+1].value.slice(1,-1))&&(a.jslint="use dot access");else if(a.value!="--"&&a.value!="++"||!this.jslintSettings["++ / --"]){if(this.regexBinaryOps.test(a.value))a.jslint="binary operator";else if(a.value=="=="||a.value=="!="&&this.jslintSettings["weak comparison"])a.jslint="weak comparison";else if(a.linearNoWhitePosition){var i=g[a.linearNoWhitePosition-1],j=g[a.linearNoWhitePosition+1];if(a.isCallExpressionStart)i.leadValue&&i.value=="Math"?a.jslint="math call":a.newline&&(a.jslint="bad asi pattern");else if(a.value==".")i.isNumber?a.jslint="number dot":i.leadValue&&j&&i.value=="document"&&(j.value=="write"||j.value=="writeln")&&(j.jslint="document.write");else if(a.isAssignment)a.value=="/="&&(a.jslint="regex confusion"),i.value=="this"?a.jslint="assignment this":i.trackingObject&&i.trackingObject.isCatchVar&&(a.jslint="catch var assignment");else if(a.value=="+"||a.value=="++"){if(i.value=="+"||i.value=="++")a.jslint="confusing plussesminusses"}else if(a.value=="-"||a.value=="--"){if(i.value=="-"||i.value=="--")a.jslint="confusing minusses"}else a.value==","&&i.value==","&&(a.jslint="extra comma")}}else a.jslint="inc dec operator";else if(a.isLabel)a.jslint="is label",a.isLabelDeclaration?this.findLabel(a.value,c,!0)==2&&(a.duplicateLabel=!0):a.labelNotFound||this.findLabel(a.value,c)||(a.labelNotFound=!0);else if(a.name==2){if(a.value[a.value.length-1]=="_"&&a.jslint!="stupid key"&&a.meta!="parameter"&&!a.isCatchVar)a.jslint="dangling underscore";else if(!d&&a.value=="continue")a.jslint="flow statement";else if(a.value=="break"&&!d&&!f&&(!g[a.linearNoWhitePosition+1]||!g[a.linearNoWhitePosition+1].isLabel))a.jslint="flow statement";else if(!e&&a.value=="return")a.jslint="flow statement";else if(a.value=="caller"||a.value=="callee")a.jslint="caller callee";else if(a.value=="undefined")a.jslint="undefined";else if(a.linearNoWhitePosition&&this.regexBuiltinBadConstructors.test(a.value)&&g[a.linearNoWhitePosition-1].value=="new")a.value=="Math"||a.value=="JSON"?a.jslint="very bad constructor":a.jslint="bad constructor";else if(a.isConstructor&&a.value!="function"&&g[a.linearNoWhitePosition+1]&&g[a.linearNoWhitePosition+1].value=="("&&!g[a.linearNoWhitePosition+1].parensBelongToNew)a.jslint="called as function";else if(a.trackingObject&&a.trackingObject.isConstructor&&g[a.linearNoWhitePosition+1]&&g[a.linearNoWhitePosition+1].value=="("&&!g[a.linearNoWhitePosition+1].parensBelongToNew)a.jslint="called as function";else if(a.value=="Function"&&a.leadValue&&g[a.linearNoWhitePosition+1]&&g[a.linearNoWhitePosition+1].value=="(")a.jslint="Function is eval";else if(a.linearNoWhitePosition&&a.value=="Object"&&a.leadValue&&g[a.linearNoWhitePosition-1].value=="new")a.jslint="use {}";else if(a.linearNoWhitePosition&&a.value=="Array"&&a.leadValue&&g[a.linearNoWhitePosition-1].value=="new")a.jslint="use []";else if(a.value=="new"&&a.linearNoWhitePosition&&g[a.linearNoWhitePosition-1].value=="new")a.jslint="double new";else if(a.value=="delete"&&a.linearNoWhitePosition&&g[a.linearNoWhitePosition-1].value=="delete")a.jslint="double delete";else if(a.value=="eval")a.jslint="eval";else if(a.value=="in"&&!a.forFor)a.jslint="in out of for";else if(a.value=="else"){var k=g[a.linearNoWhitePosition-1];if(k&&k.value!="."){var h=g[a.linearNoWhitePosition+1];h&&h.value!="{"&&h.value!="if"&&(h.newline?a.jslint="missing block bad":a.jslint="missing block good")}}}else a.isNumber?a.value[0]=="."?a.jslint="leading decimal":a.value[a.value.length-1]=="."?a.jslint="trailing decimal":a[0]=="0"&&a.length>1&&a[1]!="."&&a[1]!="e"?a.jslint="octal escape":a[0]=="0"&&a[1]=="0"?a.jslint="00":a.name==3&&(a.jslint="avoid hex"):a.name==1?a.value.indexOf(".")>=0||a.value.indexOf("[^")>=0?a.jslint="dot and not can be confusing":a.value.indexOf("[]")>=0?a.jslint="empty regex char class":g[a.linearNoWhitePosition+1]&&g[a.linearNoWhitePosition+1].value=="("?g[a.linearNoWhitePosition+1].jslint="regexp call":this.regexEscapement.test(a.value)?a.jslint="bad regex escapement":this.regexControlChars.test(a.value)?a.jslint="control char":this.regexUnsafeCharacters.test(a.value)&&(a.jslint="unsafe char"):a.isString?this.regexEscapement.test(a.value)?a.jslint="bad string escapement":this.regexControlChars.test(a.value)?a.jslint="control char":this.regexUnsafeCharacters.test(a.value)&&(a.jslint="unsafe char"):a.isComment&&a.value.indexOf("/*",1)>0&&(a.jslint="nested comment")}},getType:function(a){if(a.desc=="expressions")return this.getTypeExpressions(a);if(a.desc=="expression")return this.getTypeExpression(a);if(a.desc=="sub-expression")return this.getTypeSubExpression(a);if(a.name==14)return"unknown-type";throw console.log("error:",[a]),"what kind of stack is this"},getTypeExpressions:function(a){a.desc!="expressions"&&(console.log([a]),"bad stack");var b=a.length;while(b--)if(a[b].desc=="expression")return this.getTypeExpression(a[b]);throw"empty expressions?"},getTypeExpression:function(a){if(a.desc!="expression")throw"should be expr";if(a.length==1)return this.getType(a[0]);if(a.sub=="?")return this.getType(a[2]);if(a.length==3){if(a.desc!="expression")throw console.log(a),"expr struct check";var b=a[1][0].value,c=this.getBinaryOperatorType(b);if(typeof c=="string")return c;var d=a[0],e=a[2],f=this.getType(e);if(b=="=")return f;var g=this.getType(d);if(b=="+"||b=="+="){if(g=="number"&&f=="number")return"number";if(g=="string"||f=="string")return"string";!(g instanceof Array),!(f instanceof Array);return["string","number"]}if(!g)return f;if(!f)return g;return[].concat(g,f)}console.log("expr len check fail",[a]);return"unknown-type"},getBinaryOperatorType:function(a){if(a=="+"||a=="+=")return["number","string"];if(this.regexBoolOps.test(a))return"boolean";if(this.regexNumberOps.test(a))return"number";return!1},getTypeSubExpression:function(a){var b="unknown-type",c=0,d=!0;for(var e=0;e<a.length;++e){d&&(d=!0);var f=a[e];if(f.leadValue||f.isArrayLiteralStart||f.isObjectLiteralStart)d=!1;if(f.desc=="grouped")b=this.getTypeGroup(a[e]),d=!1;else if(f.desc=="sub-expression")b=this.getTypeSubExpression(f),d=!1;else if(f.desc=="expression")b=this.getTypeExpression(f),d=!1;else if(f.isFunction)b=f,d=!1;else if(f.value==".")b="unknown-type",d=!1;else{if(f.value=="["&&!f.isArrayLiteralStart)return"unknown-type";if(f.value=="("){if(c--==0)return"unknown-type";f.parensBelongToNew=!0}else if(f.value!=")")if(f.value=="++"||f.value=="--")b="number",d=!1;else if(d){if(f.name==14)return"unknown-type";if(f.isUnaryOp||f.value=="--"||f.value=="++")f.value=="!"||f.value=="delete"?b="boolean":f.value=="~"||f.value=="+"||f.value=="-"||f.value=="++"||f.value=="--"?b="number":f.value=="void"?b="undefined":f.value=="new"?(++c,f.targetExpression&&(b=f)):f.value=="typeof"&&(b="string");else if(!f.isWhite)throw console.log(["error",a,f]),"wtf?"}else{if(f.hasPostfix)b="number";else if(f.isNumber)b="number";else if(f.isString)b="string";else if(f.name==1)b="regexp";else if(f.value=="null")b="null";else if(f.value=="true"||f.value=="false")b="boolean";if(f.leadValueTarget)if(f.leadValueTarget!==!0)f=f.leadValueTarget;else if(f.isArrayLiteralStart)b=f;else if(f.isObjectLiteralStart){if(!f.definedProperties)throw"no props?";b=f}else f.trackingObject&&f.trackingObject.varType?f.trackingObject.properties?b=f.trackingObject.varType.concat(f):b=f.trackingObject.varType:f.trackingObject&&f.trackingObject.properties&&(b=f);else if(f.isArrayLiteralStart)b=f;else if(f.isObjectLiteralStart){if(!f.definedProperties)throw"no props?";b=f}}}}return b},getTypeGroup:function(a){var b=0;while(a[++b])if(!a[b].isWhite)return this.getTypeExpressions(a[b]);console.log("not found?");return"unknown-type"},setTypeToRef:function(a,b,c){a.varType||(a.varType=[]),this.addTypeToVarStack(a,b);if(!c){if(!a.trackingObject){console.error("no tracking obejct?"),console.trace();return}a.trackingObject.varType||(a.trackingObject.varType=[]),this.addTypeToVarStack(a.trackingObject,b,!0)}},addTypeToVarStack:function(a,b,c,d){var e=a.varType;if(typeof b=="string")e.indexOf(b)<0&&(b!="Object"||e.indexOf("Array")<0&&e.indexOf("Function")<0)&&e.push(b);else if(b.value=="new"){var f=b.targetExpression;if(f===!1)this.addTypeToVarStack(a,"unknown-new-object");else{if(!f)throw"why this new have no target expression?";if(!f.constructorName)throw"why is htere no constructor name?";this.addTypeToVarStack(a,f.constructorName),a.targetPrototype=f}}else if(b.isFunction)this.addTypeToVarStack(a,"Function");else if(b.isArrayLiteralStart)this.addTypeToVarStack(a,"Array");else if(b instanceof Array)b.forEach(function(b){this.addTypeToVarStack(a,b,c)},this);else{if(!b)throw"why updating false?";this.addTypeToVarStack(a,"Object",!1,!0);if(c){var g=b.definedProperties;for(var h in g)if(g.hasOwnProperty(h)){a.properties||(a.properties={});var i=a.properties;({}).hasOwnProperty.call(i,h)?i[h].refs.push(g[h]):i[h]={value:h,refs:[g[h]],varType:g[h].varType},g[h].trackingObject=i[h],g[h].isPropertyOf=a}}}},minify:function(){var a=this.linearTree;if(a.length==0)return"";a=a.filter(function(a){return a.name!=7&&a.name!=9&&(a.name!=8||!!a.hasNewline)});var b=a.length;while(b--)a[b].hasNewline&&!a[b].isString&&(b==0||!a[b-1].restricted)&&a.splice(b,1);for(var c=0;c<this.scopes.length;++c){this.scopes[c].varNames=[];for(var d=0;d<this.scopes[c].length;++d){var e=this.scopes[c][d];if(!e.isDeclared||e.isEcma||e.isBrowser)e.minified=!0,this.scopes[c].varNames.push(e.value)}}if(this.config.minifyVariableNamesToo){var f=function(){var a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",b=a+"0123456789",c=[-1];return function(){++c[0];var d="";for(var e=0;e<c.length;++e)c[e]||(c[e]=0),c[e]>=a.length&&(c[e]=0,++c[e+1]),d+=(e?b:a)[c[e]];return d}}();for(var c=0;c<this.scopes.length;++c){var g=this.scopes[c];for(var d=0;d<g.length;++d){var e=g[d];if(!e.minified&&!(e instanceof Array)){do{var h=f(),i=!1,j=g;while(!(i=j.varNames.indexOf(h)>=0)&&(j=j.upper));}while(i);e.originalName=e.value,e.value=h,e.minified=!0,g.varNames.push(h),e.refs.forEach(function(a){a.value=h})}}}}var k=a.slice(0),b=k.length;while(--b){var l=k[b-1],m=k[b];m.name==13&&(m.value=";");var n=l.name==2&&(m.name==2||m.isNumber);n=n||l.isNumber&&m.value=="."&&l.value.indexOf(".")<0,n=n||l.value=="+"&&(m.value=="+"||m.value=="++"),n=n||l.value=="-"&&(m.value=="-"||m.value=="--"),m.isString?k[b]=k[b].value.replace(/\\\n/g,""):k[b]=m.value,n&&k.splice(b,0," ")}k[b]=k[b].value;return k.join("")},0:0};var e=function(){window.console&&console.log&&console.log.apply(console,Array.prototype.slice.call(arguments,0))},f=function(a,b,c){this.input=a,this.tokenizer=b,this.stack=c,this.stack.root=!0,this.scope=c.scope=[{value:"this",isDeclared:!0,isEcma:!0}],this.scope.global=!0,this.statementLabels=[],this.errorStack=[],c.scope=this.scope,c.labels=this.statementLabels,this.regexLhsStart=f.regexLhsStart,this.regexStartKeyOrReserved=f.regexStartKeyOrReserved,this.regexIsKeywordOrReserved=f.regexIsKeywordOrReserved,this.regexAssignments=f.regexAssignments,this.regexNonAssignmentExpressionOperators=f.regexNonAssignmentExpressionOperators,this.regexUnaryKeywords=f.regexUnaryKeywords,this.regexUnaryOperators=f.regexUnaryOperators,this.regexLiteralKeywords=f.regexLiteralKeywords,this.ast=!0};f.prototype={parse:function(a){a?a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,this.stack):a=this.tokenizer.storeCurrentAndFetchNextToken(!1,null,this.stack,!0),a=this.eatSourceElements(a,this.stack);var b=!1;do a&&a.name!=12&&(a.name!=14&&(a=this.failsafe("UnexpectedToken",a,this.stack,!1,!0)),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,this.stack),b=!0);while(a&&a.name==14);b&&a&&a.name!=12&&(a=this.parse(a)),this.tokenizer.errorEscape&&(this.stack.push(this.tokenizer.errorEscape),this.tokenizer.errorEscape=null);return a},eatSemiColon:function(a,b){a.value==";"?a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b):a.name!=12&&(a.semi||!a.newline&&a.value!="}")&&(!a.newline||a.value!="++"&&a.value!="--")?this.failignore("NoASI",a,b,";"):b.push({start:a.start,stop:a.start,name:13}),a.semi=!0;return a},eatExpressions:function(a,b,c,d,e,g){if(this.ast){var h=c;c=[],c.desc="expressions",h.push(c);var i=0}var j=!0;do{var k=!1;j||(b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name<=6||this.regexLhsStart.test(b.value)||(b=this.failsafe("ExpectedAnotherExpressionComma",b,c,"error")));if(this.ast){++i;var l=c;c=[],c.desc="expression",l.push(c)}var m=!0;while(m){if(this.ast){var n=c;c=[],c.desc="sub-expression",n.push(c)}var o=!1;while(!g&&(b.isUnaryOp=this.regexUnaryKeywords.test(b.value)||b.name==11&&this.regexUnaryOperators.test(b.value)))b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name<=6||this.regexLhsStart.test(b.value)||(b=this.failsafe("ExpectedAnotherExpressionRhs",b,c,"error")),o=!0;o&&(a=!1);var p=!1;if(b.value=="("){if(this.ast){var q=c;c=[],c.desc="grouped",q.push(c);var r=b;b.isGroupStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name<=6||this.regexLhsStart.test(b.value)||(b=this.failsafe("GroupingShouldStartWithExpression",b,c,"error")),b=this.eatExpressions(!1,b,c),b.value!=")"&&(b=this.failsafe("UnclosedGroupingOperator",b,c,")")),this.ast&&(b.twin=r,r.twin=b,b.isGroupStop=!0,c[c.length-1].desc=="expressions"&&(r.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c),this.ast&&(c=q),p=!0}else if(b.value=="["){if(this.ast){c.sub="array literal",c.hasArrayLiteral;var s=b;b.isArrayLiteralStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);while(b.value==",")b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);var t=!0;while(t&&b.value!="]"){t=!1,!(b.name<=6||this.regexLhsStart.test(b.value))&&b.name!=14&&(b=this.failsafe("ArrayShouldStartWithExpression",b,c,"error")),b=this.eatExpressions(!1,b,c,!0);while(b.value==",")t=!0,b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}b.value!="]"&&(b=this.failsafe("UnclosedPropertyBracket",b,c,"]")),this.ast&&(b.twin=s,s.twin=b,b.isArrayLiteralStop=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);while(b.value=="++"||b.value=="--")this.failignore("InvalidPostfixOperandArray",b,c,"error"),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}else if(b.value=="{"){this.ast&&(c.sub="object literal",c.hasObjectLiteral=!0,b.isObjectLiteralStart=!0);var u=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);while(b.value!="}"){!b.isNumber&&!b.isString&&b.name!=2&&(b=this.failsafe("IllegalPropertyNameToken",b,c,"error"));if(this.ast){var v=c;c=[],c.desc="objlit pair",c.isObjectLiteralPair=!0,v.push(c)}if(this.ast){var w=c;c=[],c.desc="objlit pair name",w.push(c),w.sub="data"}var x=b.value;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=w);if(x=="get")if(b.value==":")b=this.eatObjectLiteralColonAndBody(b,c);else{this.ast&&(w.sub="getter",w.isAccessor=!0),!b.isNumber&&!b.isString&&b.name!=2&&(b=this.failsafe("IllegalGetterSetterNameToken",b,c,"error",!0)),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!="("&&(b=this.failsafe("GetterSetterNameFollowedByOpenParen",b,c,"("));if(this.ast)var r=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!=")"&&(b=this.failsafe("GetterHasNoArguments",b,c,")")),this.ast&&(b.twin=r,r.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatFunctionBody(b,c)}else if(x=="set")if(b.value==":")b=this.eatObjectLiteralColonAndBody(b,c);else{this.ast&&(w.sub="setter",w.isAccessor=!0),!b.isNumber&&!b.isString&&b.name!=2&&(b=this.failsafe("IllegalGetterSetterNameToken",b,c,"error")),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!="("&&(b=this.failsafe("GetterSetterNameFollowedByOpenParen",b,c,"("));if(this.ast)var r=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name!=2&&(b.value==")"?b=this.failsafe("SettersMustHaveArgument",b,c,")"):b=this.failsafe("IllegalSetterArgumentNameToken",b,c,")")),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!=")"&&(b.value==","?b=this.failsafe("SettersOnlyGetOneArgument",b,c,")"):b=this.failsafe("SetterHeaderShouldHaveClosingParen",b,c,")")),this.ast&&(b.twin=r,r.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatFunctionBody(b,c)}else b=this.eatObjectLiteralColonAndBody(b,c);this.ast&&(c=v),b.value==","?(b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value==","&&(b=this.failsafe("IllegalDoubleCommaInObjectLiteral",b,c,","))):b.value!="}"&&(b=this.failsafe("UnclosedObjectLiteral",b,c,"}"))}this.ast&&(b.twin=u,u.twin=b,b.isObjectLiteralStop=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);while(b.value=="++"||b.value=="--")this.failignore("InvalidPostfixOperandObject",b,c,"error"),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}else if(b.value=="function"){if(this.ast){var y=c;c=[],c.desc="func expr",c.isFunction=!0,y.push(c);var z=this.scope;c.scope=this.scope=[this.scope,{value:"this",isDeclared:!0,isEcma:!0},{value:"arguments",isDeclared:!0,isEcma:!0,varType:["Object"]}]}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),a&&b.value==":"&&(b=this.failsafe("LabelsMayNotBeReserved",b,c,"error")),b.name==2&&(b.meta="func expr name",b.varType=["Function"],b.functionStack=c,this.ast&&this.scope.push({value:b.value}),this.regexStartKeyOrReserved.test(b.value[0])&&this.regexIsKeywordOrReserved.test(b.value)&&(b=this.failsafe("FunctionNameMustNotBeReserved",b,c,"error")),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)),b=this.eatFunctionParametersAndBody(b,c,!0);while(b.value=="++"||b.value=="--")this.failignore("InvalidPostfixOperandFunction",b,c,"error"),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);this.ast&&(c=y,this.scope=z)}else if(b.name<=6){var A=b;b.name==2?(!this.regexLiteralKeywords.test(b.value)&&this.regexStartKeyOrReserved.test(b.value[0])&&this.regexIsKeywordOrReserved.test(b.value)&&(g?this.failignore("BreakOrContinueArgMustBeJustIdentifier",b,c):b.value=="else"?this.failignore("DidNotExpectElseHere",b,c):this.failignore("DidNotExpectElseHere",b,c)),p=!0):g&&(b=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",b,c)),this.ast&&(g||(b.meta="lead value")),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);if(a&&b.value==":"){A.name!=2&&this.failignore("LabelsMayOnlyBeIdentifiers",b,c),a[0]=!0,b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(delete A.meta,A.isLabel=!0,A.isLabelDeclaration=!0,this.statementLabels.push(A.value),c.desc="labeled statement");var B=this.errorStack.length;b=this.eatStatement(!1,b,c),b.error&&b.error.msg==f.Errors.UnableToParseStatement.msg&&(b.error=new f.Error("LabelRequiresStatement"),this.errorStack[B]=b.error);return b}a=!1}else if(b.value!="}")if(b.name==14){do{if(b.tokenError){var C=new f.Error("TokenizerError",b);C.msg+=": "+b.error.msg,this.errorStack.push(C),c.push({start:b.start,stop:b.start,name:14,error:C})}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}while(b.name==14)}else{if(b.name==12)return b;console.log(["unknown token",b,c]),this.failignore("UnknownToken",b,c),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}while(b.value=="."||b.value=="["||b.value=="("){g&&(b=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",b,c,";"));if(b.value==".")b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name!=2&&this.failignore("PropertyNamesMayOnlyBeIdentifiers",b,c),this.ast&&(b.isPropertyName=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c),p=!0;else if(b.value=="["){if(this.ast){var s=b;b.propertyAccessStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.name<=6||this.regexLhsStart.test(b.value)||(b.value=="]"?b=this.failsafe("SquareBracketsMayNotBeEmpty",b,c):b=this.failsafe("SquareBracketExpectsExpression",b,c)),b=this.eatExpressions(!1,b,c),b.value!="]"&&(b=this.failsafe("UnclosedSquareBrackets",b,c,"]")),this.ast&&(b.twin=s,b.propertyAccessStop=!0,s.twin=b,c[c.length-1].desc=="expressions"&&(s.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c),p=!0}else if(b.value=="("){if(this.ast){var r=b;b.isCallExpressionStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name<=6||this.regexLhsStart.test(b.value))b=this.eatExpressions(!1,b,c);b.value!=")"&&(b=this.failsafe("UnclosedCallParens",b,c,")")),this.ast&&(b.twin=r,r.twin=b,b.isCallExpressionStop=!0,c[c.length-1].desc=="expressions"&&(r.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c),p=!1}}(b.value=="++"||b.value=="--")&&!b.newline&&(g&&(b=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",b,c,";")),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c)),this.ast&&(c=n);do{var D=!1;if(!e&&b.value=="in"||b.value=="instanceof"||b.name==11&&(b.isAssignment=this.regexAssignments.test(b.value))||this.regexNonAssignmentExpressionOperators.test(b.value)){b.isAssignment&&(p?k&&this.failignore("AssignmentNotAllowedAfterNonAssignmentInExpression",b,c):this.failignore("IllegalLhsForAssignment",b,c)),g&&(b=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",b,c,";")),b.isAssignment||(k=!0);if(this.ast){b.isBinaryOperator=!0;var E=c;c=[],c.desc="operator-expression",c.isBinaryOperator=!0,c.sub=b.value,E.sub=b.value,c.isAssignment=b.isAssignment,E.push(c)}D=b.value=="?",b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=E);if(D){b.name<=6||this.regexLhsStart.test(b.value)||this.failignore("InvalidCenterTernaryExpression",b,c),b=this.eatExpressions(!1,b,c,!0,e),b.value!=":"&&(b.value==","?b=this.failsafe("TernarySecondExpressionCanNotContainComma",b,c,":"):b=this.failsafe("UnfinishedTernaryOperator",b,c,";"));if(this.ast){var E=c;c=[],c.desc="operator-expression",c.sub=b.value,E.sub=b.value,c.isAssignment=b.isAssignment,E.push(c)}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=E),b=this.eatExpressions(!1,b,c,!0,e)}}else m=!1}while(D);m&&!(b.name<=6||this.regexLhsStart.test(b.value))&&this.failignore("InvalidRhsExpression",b,c)}this.ast&&(c=l),a=j=!1}while(!d&&b.value==",");this.ast&&(c.length||(h.length=h.length-1),h.numberOfExpressions=i,c.expressionCount=i);return b},eatFunctionDeclaration:function(a,b){if(this.ast){b.push(b=[]);var c=this.scope;b.desc="func decl",b.isFunction=!0,b.scope=this.scope=[this.scope,{value:"this",isDeclared:!0,isEcma:!0},{value:"arguments",isDeclared:!0,isEcma:!0,varType:["Object"]}]}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name!=2&&(a=this.failsafe("FunctionDeclarationsMustHaveName",a,b,"error")),this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)&&this.failignore("FunctionNameMayNotBeReserved",a,b),this.ast&&(c.push({value:a.value}),a.meta="func decl name",a.varType=["Function"],a.functionStack=b),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatFunctionParametersAndBody(a,b,!1),this.ast&&(this.scope=c);return a},eatObjectLiteralColonAndBody:function(a,b){if(this.ast){var c=b;b=[],b.desc="objlit pair colon",c.push(b)}a.value!=":"&&(a=this.failsafe("ObjectLiteralExpectsColonAfterName",a,b,":")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=c);var d=a;a=this.eatExpressions(!1,a,b,!0),a==d&&(a=this.failsafe("ObjectLiteralMissingPropertyValue",a,b,"error"));return a},eatFunctionParametersAndBody:function(a,b,c){if(this.ast)var d=a;a.value!="("&&(a=this.failsafe("ExpectingFunctionHeaderStart",a,b,"(")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(a.name==2){this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)&&this.failignore("FunctionArgumentsCanNotBeReserved",a,b),this.ast&&(this.scope.push({value:a.value}),a.meta="parameter"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);while(a.value==",")a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name!=2?this.failignore("FunctionParametersMustBeIdentifiers",a,b):this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)&&this.failignore("FunctionArgumentsCanNotBeReserved",a,b),this.ast&&(this.scope.push({value:a.value}),a.meta="parameter"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b)}this.ast&&(a.twin=d,d.twin=a),a.value!=")"&&(a=this.failsafe("ExpectedFunctionHeaderClose",a,b,")")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatFunctionBody(a,b,c);return a},eatFunctionBody:function(a,b,c){if(this.ast){b.push(b=[]),b.desc="func body";var d=this.statementLabels;this.statementLabels=[],b.labels=this.statementLabels}a.value!="{"&&(a=this.failsafe("ExpectedFunctionBodyCurlyOpen",a,b,"{"));var e=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatSourceElements(a,b),a.value!="}"&&(a=this.failsafe("ExpectedFunctionBodyCurlyClose",a,b,"}")),this.ast&&(a.twin=e,e.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(c,a,b),this.ast&&(this.statementLabels=d);return a},eatVar:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="var"),a=this.eatVarDecl(a,b),a=this.eatSemiColon(a,b);return a},eatVarDecl:function(a,b,c){if(this.ast){b.push(b=[]),b.desc="var decl";var d=this.scope;while(d.catchScope)d=d[0]}var e=!0;do{a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(this.ast){var f=b,b=[];b.desc="single var decl",b.varStack=f,f.push(b);var g=b;b=[],b.desc="sub-expression",g.push(b)}a.name==12?e?a=this.failsafe("VarKeywordMissingName",a,b):a=this.failsafe("IllegalTrailingComma",a,b):a.name!=2?a=this.failsafe("VarNamesMayOnlyBeIdentifiers",a,b):this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)&&(a=this.failsafe("VarNamesCanNotBeReserved",a,b)),this.ast&&(a.meta="var name",d.push({value:a.value})),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=g),a.value=="="&&(this.ast&&(g=b,b=[],b.desc="operator-expression",b.sub="=",g.push(b),b.isAssignment=!0),a.isInitialiser=!0,a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=g),a.name<=6||this.regexLhsStart.test(a.value)||(a=this.failsafe("VarInitialiserExpressionExpected",a,b,"error")),a=this.eatExpressions(!1,a,b,!0,c)),this.ast&&(b=f),e=!1}while(a.value==",");return a},eatIf:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="if",b.hasElse=!1),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name<=6||this.regexLhsStart.test(a.value)||(a=this.failsafe("StatementHeaderIsNotOptional",a,b,"error")),a=this.eatExpressions(!1,a,b),a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,c.twin=a,b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b),a&&a.value=="else"&&(a=this.eatElse(a,b));return a},eatElse:function(a,b){this.ast&&(b.hasElse=!0,b.push(b=[]),b.desc="statement",b.sub="else"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b);return a},eatDo:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="do",b.isIteration=!0,this.statementLabels.push("")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b),a.value!="while"&&(a=this.failsafe("DoShouldBeFollowedByWhile",a,b,"while")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name<=6||this.regexLhsStart.test(a.value)||(a=this.failsafe("StatementHeaderIsNotOptional",a,b,"error")),a=this.eatExpressions(!1,a,b),a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,c.twin=a,b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatSemiColon(a,b);return a},eatWhile:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="while",b.isIteration=!0,this.statementLabels.push("")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name<=6||this.regexLhsStart.test(a.value)||(a=this.failsafe("StatementHeaderIsNotOptional",a,b,"error")),a=this.eatExpressions(!1,a,b),a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,c.twin=a,b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b);return a},eatFor:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="for",b.isIteration=!0,this.statementLabels.push("")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0,a.forHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value=="var"?a=this.eatVarDecl(a,b,!0):a.value!=";"&&(a.name<=6||this.regexLhsStart.test(a.value)||this.failignore("StatementHeaderIsNotOptional",a,b),a=this.eatExpressions(!1,a,b,!1,!0));if(a.value=="in")this.ast&&(b.forType="in",a.forFor=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatExpressions(!1,a,b);else{a.value!=";"&&(a=this.failsafe("ForHeaderShouldHaveSemisOrIn",a,b,";")),this.ast&&(b.forType="each",a.forEachHeaderStart=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(a.name<=6||this.regexLhsStart.test(a.value))a=this.eatExpressions(!1,a,b);a.value!=";"&&(a=this.failsafe("ExpectedSecondSemiOfForHeader",a,b,";")),this.ast&&(a.forEachHeaderStop=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(a.name<=6||this.regexLhsStart.test(a.value))a=this.eatExpressions(!1,a,b)}a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,a.forHeaderStop=!0,c.twin=a,a.forType=="in"&&b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b);return a},eatContinue:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="continue",a.restricted=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(!a.newline&&a.value!=";"&&a.name!=12&&a.value!="}"){if(this.ast){a.isLabel=!0,a.isLabelTarget=!0;var c=a}a=this.eatExpressions(!1,a,b,!0,!1,!0),this.ast&&(b.hasLabel=c!=a),a.value!=";"&&!a.newline&&a.name!=12&&a.value!="}"&&(a=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",a,b,";"))}a=this.eatSemiColon(a,b);return a},eatBreak:function(a,b){if(this.ast){var c=b;b=[],b.desc="statement",b.sub="break",c.push(b),a.restricted=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(!a.newline&&a.value!=";"&&a.name!=12&&a.value!="}"){if(this.ast){a.isLabel=!0,a.isLabelTarget=!0;var d=a}a=this.eatExpressions(!1,a,b,!0,!1,!0),this.ast&&(b.hasLabel=d!=a),a.value!=";"&&!a.newline&&a.name!=12&&a.value!="}"&&(a=this.failsafe("BreakOrContinueArgMustBeJustIdentifier",a,b,";"))}a=this.eatSemiColon(a,b);return a},eatReturn:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="return",a.restricted=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),!a.newline&&a.value!=";"&&a.name!=12&&a.value!="}"&&(a=this.eatExpressions(!1,a,b)),a=this.eatSemiColon(a,b);return a},eatThrow:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="throw",a.restricted=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.newline&&(a=this.failsafe("ThrowCannotHaveReturn",a,b,";")),a.value==";"&&(a=this.failsafe("ThrowMustHaveArgument",a,b,"error")),a=this.eatExpressions(!1,a,b),a=this.eatSemiColon(a,b);return a},eatSwitch:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="switch",this.statementLabels.push("")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name<=6||this.regexLhsStart.test(a.value)||this.failignore("StatementHeaderIsNotOptional",a,b),a=this.eatExpressions(!1,a,b),a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,c.twin=a,b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="{"&&(a=this.failsafe("SwitchBodyStartsWithCurly",a,b,"{"));var d=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);var e=!1;while(a.value=="case"||!b.parsedSwitchDefault&&a.value=="default")e=!0,a=this.eatSwitchClause(a,b);!e&&a.value!="}"&&(a=this.failsafe("SwitchBodyMustStartWithClause",a,b,"}")),b.parsedSwitchDefault&&a.value=="default"&&this.failignore("SwitchCannotHaveDoubleDefault",a,b),a.value!="}"&&(a=this.failsafe("SwitchBodyEndsWithCurly",a,b,"}")),this.ast&&(a.twin=d,d.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);return a},eatSwitchClause:function(a,b){a=this.eatSwitchHeader(a,b),a=this.eatSwitchBody(a,b);return a},eatSwitchHeader:function(a,b){if(this.ast){var c=b;b.push(b=[]),b.desc="switch clause header"}a.value=="case"?a=this.eatSwitchCaseHead(a,b):(this.ast&&(c.hasDefaultClause=!0),a=this.eatSwitchDefaultHead(a,b)),this.ast&&(b.push(b=[]),b.desc="colon"),a.value!=":"&&(a=this.failsafe("SwitchClausesEndWithColon",a,b,":")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);return a},eatSwitchBody:function(a,b){this.ast&&(b.push(b=[]),b.desc="switch clause body");while(a.value!="default"&&a.value!="case"&&a.value!="}"&&a.name!=14&&a.name!=12)a=this.eatStatement(!0,a,b);return a},eatSwitchCaseHead:function(a,b){if(this.ast){b.sub="case";var c=b;b.push(b=[]),b.desc="case",a.isCase=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(c.push(b=[]),b.desc="case arg"),a=this.eatExpressions(!1,a,b);return a},eatSwitchDefaultHead:function(a,b){this.ast&&(b.sub="default",b.push(b=[]),b.desc="case",a.isDefault=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);return a},eatTryCatchFinally:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="try"),a=this.eatTry(a,b),a.value=="catch"&&(a=this.eatCatch(a,b)),a.value=="finally"&&(a=this.eatFinally(a,b)),b.tryHasCatchOrFinally||this.failignore("TryMustHaveCatchOrFinally",a,b);return a},eatTry:function(a,b){a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="{"&&(a=this.failsafe("MissingTryBlockCurlyOpen",a,b,"{")),this.ast&&(b.push(b=[]),b.desc="statement",b.sub="tryblock");var c=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="}"&&(a=this.eatStatements(a,b)),a.value!="}"&&(a=this.failsafe("MissingTryBlockCurlyClose",a,b,"}")),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(a.twin=c,c.twin=a);return a},eatCatch:function(a,b){b.tryHasCatchOrFinally=!0;if(this.ast){b.push(b=[]),b.desc="statement",b.sub="catch";var c=this.scope;this.scope=b.scope=[this.scope],this.scope.catchScope=!0,c.global?this.scope.push(c[0]):c.catchScope?(this.scope.push(c[1]),c[2]&&c[2].value=="arguments"&&this.scope.push(c[2])):this.scope.push(c[1],c[2])}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("CatchHeaderMissingOpen",a,b,")"));if(this.ast)var d=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name!=2&&(a=this.failsafe("MissingCatchParameter",a,b,"error")),this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)&&this.failignore("CatchParameterNameMayNotBeReserved",a,b),this.ast&&(a.meta="var name",this.scope.push(a),a.isCatchVar=!0),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!=")"&&(a=this.failsafe("CatchHeaderMissingClose",a,b,")")),this.ast&&(a.twin=d,d.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="{"&&(a=this.failsafe("MissingCatchBlockCurlyOpen",a,b,"{"));var e=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="}"&&(a=this.eatStatements(a,b)),a.value!="}"&&(a=this.failsafe("MissingCatchBlockCurlyClose",a,b,"}")),this.ast&&(a.twin=e,e.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(this.scope=c);return a},eatFinally:function(a,b){b.tryHasCatchOrFinally=!0,this.ast&&(b.push(b=[]),b.desc="statement",b.sub="finally"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="{"&&(a=this.failsafe("MissingFinallyBlockCurlyOpen",a,b,"{"));var c=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="}"&&(a=this.eatStatements(a,b)),a.value!="}"&&(a=this.failsafe("MissingFinallyBlockCurlyClose",a,b,"}")),this.ast&&(a.twin=c,c.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);return a},eatDebugger:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="debugger"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatSemiColon(a,b);return a},eatWith:function(a,b){this.ast&&(b.push(b=[]),b.desc="statement",b.sub="with"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value!="("&&(a=this.failsafe("ExpectedStatementHeaderOpen",a,b,"("));if(this.ast){var c=a;a.statementHeaderStart=!0}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.name<=6||this.regexLhsStart.test(a.value)||(a=this.failsafe("StatementHeaderIsNotOptional",a,b)),a=this.eatExpressions(!1,a,b),a.value!=")"&&(a=this.failsafe("ExpectedStatementHeaderClose",a,b,")")),this.ast&&(a.twin=c,a.statementHeaderStop=!0,c.twin=a,b[b.length-1].desc=="expressions"&&(c.expressionArg=b[b.length-1])),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatStatement(!1,a,b);return a},eatFunction:function(a,b){var c=new f.Error;this.errorStack.push(c),console.log(a),b.push({start:a.stop,stop:a.stop,name:14,error:c}),a=this.eatFunctionDeclaration(a,b);return a},eatLabelOrExpression:function(a,b){if(this.ast){var c=b;b=[],b.desc="statement",b.sub="expression",c.push(b)}var d=[];a=this.eatExpressions(d,a,b),d.length?this.ast&&(b.sub="labeled"):(this.ast&&(b.sub="expression"),a=this.eatSemiColon(a,b));return a},eatBlock:function(a,b){if(this.ast){b.sub="block";var c=a}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a.value=="}"?this.ast&&(b.isEmptyBlock=!0):a=this.eatStatements(a,b),a.value!="}"&&(a=this.failsafe("BlockCurlyClose",a,b,"}")),this.ast&&(a.twin=c,c.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);return a},eatStatements:function(a,b){while(a!=(a=this.eatStatement(!0,a,b)));return a},eatStatement:function(a,b,c){if(!b&&a)return b;if(this.ast){var d=c;c=[],c.desc="statement-parent",d.push(c);var e=this.statementLabels;this.statementLabels=[e],c.labels=this.statementLabels}if(b.name==2)switch(b.value){case"var":b=this.eatVar(b,c);break;case"if":b=this.eatIf(b,c);break;case"do":b=this.eatDo(b,c);break;case"while":b=this.eatWhile(b,c);break;case"for":b=this.eatFor(b,c);break;case"continue":b=this.eatContinue(b,c);break;case"break":b=this.eatBreak(b,c);break;case"return":b=this.eatReturn(b,c);break;case"throw":b=this.eatThrow(b,c);break;case"switch":b=this.eatSwitch(b,c);break;case"try":b=this.eatTryCatchFinally(b,c);break;case"debugger":b=this.eatDebugger(b,c);break;case"with":b=this.eatWith(b,c);break;case"function":this.failignore("StatementMayNotStartWithFunction",b,c,"function"),b=this.eatFunctionDeclaration(b,c);break;default:b=this.eatLabelOrExpression(b,c)}else b.value=="{"?b=this.eatBlock(b,c):b.isString||b.isNumber||b.name==1||this.regexLhsStart.test(b.value)?(b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c)):b.value==";"?(b.emptyStatement=!0,b=this.eatSemiColon(b,c)):a||(b=this.failsafe("UnableToParseStatement",b,c));this.ast&&(c.length||(d.length=d.length-1),this.statementLabels=e);return b},eatSourceElements:function(a,b){while(a!=c){var c=a;a.value=="function"?a=this.eatFunctionDeclaration(a,b):a=this.eatStatement(!0,a,b)}return a},failsafe:function(a,b,c,d,e){d||(d="");var g=new f.Error(a,b);this.errorStack.push(g),e||(this.tokenizer.errorEscape&&this.stack.push(this.tokenizer.errorEscape),this.tokenizer.errorEscape=b),b={start:b.start,stop:b.start,len:d.length,name:14,error:g,value:d};return b},failignore:function(a,b,c,d){d||(d="");var e=new f.Error(a,b);this.errorStack.push(e),c.push({start:b.start,stop:b.start,name:14,error:e,value:d})},0:0},f._testSuite=function(a){var b=[["var abc;","Regular variable statement w/o assignment"],["var abc = 5;","Regular variable statement with assignment"],["/* */;","Multiline comment"],["/** **/;","Double star multiline comment"],["var f = function(){;};","Function expression in var assignment"],["hi; // moo\n;","single line comment"],["var varwithfunction;","Dont match keywords as substrings"],["a + b;","addition"],["'a';","single string literal"],["'a\\n';","single string literal with escaped return"],['"a";',"double string literal"],['"a\\n";',"double string literal with escaped return"],['"var";',"string is a keyword"],['"variable";',"string starts with a keyword"],['"somevariable";',"string contains a keyword"],['"somevar";',"string ends with a keyword"],["500;","int literal"],["500.;","float literal w/o decimals"],["500.432;","float literal with decimals"],[".432432;","float literal w/o int"],["(a,b,c);","parens and comma"],["[1,2,abc];","array literal"],["var o = {a:1};","object literal unquoted key"],['var o = {"b":2};',"object literal quoted key"],["var o = {c:c};","object literal keyname is identifier"],['var o = {a:1,"b":2,c:c};',"object literal combinations"],["var x;\nvar y;","two lines"],["var x;\nfunction n(){; }","function def"],["var x;\nfunction n(abc){; }","function def with arg"],["var x;\nfunction n(abc, def){ ;}","function def with args"],['function n(){ "hello"; }',"function def with body"],["/a/;","regex literal"],["/a/b;","regex literal with flag"],["/a/ / /b/;","regex div regex"],["a/b/c;","triple division looks like regex"],["+function(){/regex/;};","regex at start of function body"],["//foo!@#^&$1234\nbar;","single line comment"],["/* abcd!@#@$* { } && null*/;","single line multi line comment"],["/*foo\nbar*/;","multi line comment"],["/*x*x*/;","multi line comment with *"],["/**/;","empty comment"],["x;","1 identifier"],["_x;","2 identifier"],["xyz;","3 identifier"],["$x;","4 identifier"],["x$;","5 identifier"],["_;","6 identifier"],["x5;","7 identifier"],["x_y;","8 identifier"],["x+5;","9 identifier"],["xyz123;","10 identifier"],["x1y1z1;","11 identifier"],["foo\\u00D8bar;","12 identifier unicode escape"],["5;","1 number"],["5.5;","2 number"],["0;","3 number"],["0.0;","4 number"],["0.001;","5 number"],["1.e2;","6 number"],["1.e-2;","7 number"],["1.E2;","8 number"],["1.E-2;","9 number"],[".5;","10 number"],[".5e3;","11 number"],[".5e-3;","12 number"],["0.5e3;","13 number"],["55;","14 number"],["123;","15 number"],["55.55;","16 number"],["55.55e10;","17 number"],["123.456;","18 number"],["1+e;","20 number"],["0x01;","22 number"],["0XCAFE;","23 number"],["0x12345678;","24 number"],["0x1234ABCD;","25 number"],["0x0001;","26 number"],['"foo";',"1 string"],["'foo';","2 string"],['"x";',"3 string"],["'';","4 string"],['"foo\\tbar";',"5 string"],['"!@#$%^&*()_+{}[]";',"6 string"],['"/*test*/";',"7 string"],['"//test";',"8 string"],['"\\\\";',"9 string"],['"\\u0001";',"10 string"],['"\\uFEFF";',"11 string"],['"\\u10002";',"12 string"],['"\\x55";',"13 string"],['"\\x55a";',"14 string"],['"a\\\\nb";',"15 string"],['";"',"16 string: semi in a string"],['"a\\\nb";',"17 string: line terminator escape"],["null;","null"],["true;","true"],["false;","false"],["/a/;","1 regex"],["/abc/;","2 regex"],["/abc[a-z]*def/g;","3 regex"],["/\\b/;","4 regex"],["/[a-zA-Z]/;","5 regex"],["/foo(.*)/g;","another regexp"],["[];","1 array"],["[ ];","2 array"],["[1];","3 array"],["[1,2];","4 array"],["[1,2,,];","5 array"],["[1,2,3];","6 array"],["[1,2,3,,,];","7 array"],["{};","1 object"],["({x:5});","2 object"],["({x:5,y:6});","3 object"],["({x:5,});","4 object"],["({if:5});","5 object"],["({ get x() {42;} });","6 object"],["({ set y(a) {1;} });","7 object"],["o.m;","1 member expression"],["o['m'];","2 member expression"],["o['n']['m'];","3 member expression"],["o.n.m;","4 member expression"],["o.if;","5 member expression"],["f();","1 call/invoke expression"],["f(x);","2 call/invoke expression"],["f(x,y);","3 call/invoke expression"],["o.m();","4 call/invoke expression"],["o['m'];","5 call/invoke expression"],["o.m(x);","6 call/invoke expression"],["o['m'](x);","7 call/invoke expression"],["o.m(x,y);","8 call/invoke expression"],["o['m'](x,y);","9 call/invoke expression"],["f(x)(y);","10 call/invoke expression"],["f().x;","11 call/invoke expression"],["eval('x');","1 eval"],["(eval)('x');","2 eval"],["(1,eval)('x');","3 eval"],["eval(x,y);","4 eval"],["new f();","1 new expression"],["new o;","2 new expression"],["new o.m;","3 new expression"],["new o.m(x);","4 new expression"],["new o.m(x,y);","5 new expression"],["++x;","1 pre/postfix"],["x++;","2 pre/postfix"],["--x;","3 pre/postfix"],["x--;","4 pre/postfix"],["x ++;","5 pre/postfix"],["x /* comment */ ++;","6 pre/postfix"],["++ /* comment */ x;","7 pre/postfix"],["delete x;","1 unary operator"],["void x;","2 unary operator"],["+ x;","3 unary operator"],["-x;","4 unary operator"],["~x;","5 unary operator"],["!x;","6 unary operator"],["new Date++;","new date ++"],["+x++;"," + x ++"],["1 * 2;","1 expression expressions"],["1 / 2;","2 expression expressions"],["1 % 2;","3 expression expressions"],["1 + 2;","4 expression expressions"],["1 - 2;","5 expression expressions"],["1 << 2;","6 expression expressions"],["1 >>> 2;","7 expression expressions"],["1 >> 2;","8 expression expressions"],["1 * 2 + 3;","9 expression expressions"],["(1+2)*3;","10 expression expressions"],["1*(2+3);","11 expression expressions"],["x<y;","12 expression expressions"],["x>y;","13 expression expressions"],["x<=y;","14 expression expressions"],["x>=y;","15 expression expressions"],["x instanceof y;","16 expression expressions"],["x in y;","17 expression expressions"],["x&y;","18 expression expressions"],["x^y;","19 expression expressions"],["x|y;","20 expression expressions"],["x+y<z;","21 expression expressions"],["x<y+z;","22 expression expressions"],["x+y+z;","23 expression expressions"],["x+y<z;","24 expression expressions"],["x<y+z;","25 expression expressions"],["x&y|z;","26 expression expressions"],["x&&y;","27 expression expressions"],["x||y;","28 expression expressions"],["x&&y||z;","29 expression expressions"],["x||y&&z;","30 expression expressions"],["x<y?z:w;","31 expression expressions"],["x >>>= y;","1 assignment"],["x <<= y;","2 assignment"],["x = y;","3 assignment"],["x += y;","4 assignment"],["x /= y;","5 assignment"],["x, y;","comma"],["{};","1 block"],["{x;};","2 block"],["{x;y;};","3 block"],["var x;","1 var"],["var x,y;","2 var"],["var x=1,y=2;","3 var"],["var x,y=2;","4 var"],[";","1 empty"],["\n;","2 empty"],["x;","1 expression statement"],["5;","2 expression statement"],["1+2;","3 expression statement"],["if (c) x; else y;","1 if statement"],["if (c) x;","2 if statement"],["if (c) {} else {};","3 if statement"],["if (c1) if (c2) s1; else s2;","4 if statement"],["do s; while (e);","1 while statement"],["do { s; } while (e);","2 while statement"],["while (e) s;","3 while statement"],["while (e) { s; };","4 while statement"],["for (;;) ;","1 for statement"],["for (;c;x++) x;","2 for statement"],["for (i;i<len;++i){};","3 for statement"],["for (var i=0;i<len;++i) {};","4 for statement"],["for (var i=0,j=0;;){};","5 for statement"],["for ((x in b); c; u) {};","7 for statement"],["for (x in a);","8 for statement"],["for (var x in a){};","9 for statement"],["for (var x=5 in a) {};","10 for statement"],["for (var x = a in b in c) {};","11 for statement"],["for (var x=function(){a+b;}; a<b; ++i) some;","11 for statement, testing for parsingForHeader reset with the function"],["for (var x=function(){for (x=0; x<15; ++x) alert(foo); }; a<b; ++i) some;","11 for statement, testing for parsingForHeader reset with the function"],["continue;","1 flow statement"],["continue label;","2 flow statement"],["break;","3 flow statement"],["break somewhere;","4 flow statement"],["continue /* comment */ ;","5 flow statement"],["continue \n;","6 flow statement"],["return;","7 flow statement"],["return 0;","8 flow statement"],["return 0 + \n 1;","9 flow statement"],["with (e) s;","with statement"],["switch (e) { case x: s; };","1 switch statement"],["switch (e) { case x: s1;s2; default: s3; case y: s4; };","2 switch statement"],["switch (e) { default: s1; case x: s2; case y: s3; };","3 switch statement"],["switch (e) { default: s; };","4 switch statement"],["switch (e) { case x: s1; case y: s2; };","5 switch statement"],["foo : x;"," flow statement"],["throw x;","1 throw statement"],["throw x\n;","2 throw statement"],["try { s1; } catch (e) { s2; };","1 trycatchfinally statement"],["try { s1; } finally { s2; };","2 trycatchfinally statement"],["try { s1; } catch (e) { s2; } finally { s3; };","3 trycatchfinally statement"],["debugger;","debuger statement"],["function f(x) { e; return x; };","1 function declaration"],["function f() { x; y; };","2 function declaration"],["function f(x,y) { var z; return x; };","3 function declaration"],["(function f(x) { return x; });","1 function expression"],["(function empty() {;});","2 function expression"],["(function empty() {;});","3 function expression"],["(function (x) {; });","4 function expression"],["var x; function f(){;}; null;","1 program"],[";;","2 program"],["{ x; y; z; }","3 program"],["function f(){ function g(){;}};","4 program"],["x;\n/*foo*/\n\t;","5 program"],["continue \n foo;","1 asi"],["break \n foo;","2 asi"],["return\nfoo;","3 asi"],["var x; { 1 \n 2 } 3","4 asi"],["ab \t /* hi */\ncd","5 asi"],["ab/*\n*/cd","6 asi (multi line multilinecomment counts as eol)"],["continue /* wtf \n busta */ foo;","7 asi illegal with multi line comment"],["function f() { s }","8 asi"],["function f() { return }","9 asi"],["\"use strict\"; 'bla'\n; foo;","1 directive"],["(function() { \"use strict\"; 'bla';\n foo; });","2 directive"],['"use\\n strict";',"3 directive"],['foo; "use strict";',"4 directive"],['"use strict"; var o = { eval: 42};',"8.7.2-3-1-s: the use of eval as property name is allowed"],["({foo:0,foo:1});","Duplicate property name allowed in not strict mode"],["function foo(a,a){}","Duplicate parameter name allowed in not strict mode"],["(function foo(eval){})","Eval allowed as parameter name in non strict mode"],["(function foo(arguments){})","Arguments allowed as parameter name in non strict mode"],["","1 Empty program"],["// test","2 Empty program"],["//test\n","3 Empty program"],["\n// test","4 Empty program"],["\n// test\n","5 Empty program"],["/* */","6 Empty program"],["/*\ns,fd\n*/","7 Empty program"],["/*\ns,fd\n*/\n","8 Empty program"],[" \t","9 Empty program"],[" /*\nsmeh*/\t\n ","10 Empty program"],["a ","1 Trailing whitespace"],["a /* something */","2 Trailing whitespace"],["a\n\t// hah","3 Trailing whitespace"],["/abc/de//f","4 Trailing whitespace"],["/abc/de/*f*/\n\t","5 Trailing whitespace"],["for (x;function(){ a\nb };z) x;","for header with function body forcing ASI"],["c=function(){return;return};","resetting noAsi after literal"],["d\nd()","asi exception causing token overflow"],["for(;;){x=function(){}}","function expression in a for header"],["for(var k;;){}",'parser failing due to ASI accepting the incorrect "for" rule'],["({get foo(){ }})","getter with empty function body"],["\nreturnr","eol causes return statement to ignore local search requirement"],[" / /","1 whitespace before regex causes regex to fail?"],["/ // / /","2 whitespace before regex causes regex to fail?"],["/ / / / /","3 whitespace before regex causes regex to fail?"],["\n\t// Used for trimming whitespace\n\ttrimLeft = /^\\s+/;\n\ttrimRight = /\\s+$/;\t\n","turned out this didnt crash (the test below did), but whatever."],["/[\\/]/;","escaped forward slash inside class group (would choke on fwd slash)"],["/[/]/;","also broke but is valid in es5 (not es3)"],["({get:5});","get property name thats not a getter"],["({set:5});","set property name thats not a setter"],['l !== "px" && (d.style(h, c, (k || 1) + l), j = (k || 1) / f.cur() * j, d.style(h, c, j + l)), i[1] && (k = (i[1] === "-=" ? -1 : 1) * k + j), f.custom(j, k, l)',"this choked regex/div at some point"],["(/'/g, '\\\\\\'') + \"'\";","the sequence of escaped characters confused the tokenizer"],["/abc//no_comment","one of the few cases where the double forward slash is actually not a comment"],["a: b; c;","label giving ASI a hard time, somehow"],["var x; function f(){ x; function g(){}}","function declaraton inside function body"],["if (x) { break }","apply asi after break, nowhere else"],["x.hasOwnProperty()","caused a problem with post processing (some obj had that property overwritten, hell broke lose)"],["(x) = 5","assigning to the result of the grouping operator is ok. and like this, it will actually work too"],["(x,x) = 5","on the parser level, this is fine. but the interpreter will kick your ass for it as the comma causes a fetch, screwing up your ref for assignment"],["switch(x){case 1:}","check for single clause and no body"],["while (x) { ++a\t}","++ and -- are exceptions in the parser eatStatement function"],["{break}","asi test for }"],["{continue}","asi test for }"],["{return}","asi test for }"],["{continue a}","asi test for }"],["{continue b}","asi test for }"],["{return c}","asi test for }"]];for(var c=0;c<b.length;++c)a(c,b[c][0],b[c][1])},f.testSuite=function(){var a=0,b=0,d=+(new Date);f._testSuite(function(d,e,g){var h=new c(e),i=[];try{(new f(e,h,i)).parse(),++a}catch(j){++b}}),document.getElementsByTagName("div")[0].innerHTML="Ze parser test suite finished ("+(+(new Date)-d)+" ms). ok:"+a+", fail:"+b},f.regexLhsStart=/[\+\-\~\!\(\{\[]/,f.regexStartKeyOrReserved=/[bcdefinrstvw]/,f.regexIsKeywordOrReserved=/^break$|^catch$|^continue$|^debugger$|^default$|^delete$|^do$|^else$|^finally$|^for$|^function$|^if$|^in$|^instanceof$|^new$|^return$|^switch$|^case$|^this$|^true$|^false$|^null$|^throw$|^try$|^typeof$|^var$|^void$|^while$|^with$|^class$|^const$|^enum$|^export$|^extends$|^import$|^super$/,f.regexAssignments=/^[\+\-\*\%\&\|\^\/]?=$|^\<\<\=$|^\>{2,3}\=$/,f.regexNonAssignmentExpressionOperators=/^[\+\-\*\%\|\^\&\!\~\?\/]$|^[\<\>]\=?$|^[\=\!]\=\=?$|^\<\<|\>\>\>?$|^\&\&$|^\|\|$/,f.regexUnaryKeywords=/^delete$|^void$|^typeof$|^new$/,f.regexUnaryOperators=/[\+\-\~\!]/,f.regexLiteralKeywords=/^this$|^null$|^true$|^false$/,f.Error=function(a,b){this.msg=f.Errors[a].msg,this.match=b},f.Errors={NoASI:{msg:"Expected semi-colon, was unable to apply ASI"},ExpectedAnotherExpressionComma:{msg:"expecting another (left hand sided) expression after the comma"},ExpectedAnotherExpressionRhs:{msg:"expected a rhs expression"},UnclosedGroupingOperator:{msg:"Unclosed grouping operator"},GroupingShouldStartWithExpression:{msg:"The grouping operator (`(`) should start with a left hand sided expression"},ArrayShouldStartWithExpression:{msg:"The array literal (`[`) should start with a left hand sided expression"},UnclosedPropertyBracket:{msg:"Property bracket was not closed after expression (expecting `]`)"},IllegalPropertyNameToken:{msg:"Object literal property names can only be assigned as strings, numbers or identifiers"},IllegalGetterSetterNameToken:{msg:"Name of a getter/setter can only be assigned as strings, numbers or identifiers"},GetterSetterNameFollowedByOpenParen:{msg:"The name of the getter/setter should immediately be followed by the opening parenthesis `(`"},GetterHasNoArguments:{msg:"The opening parenthesis `(` of the getter should be immediately followed by the closing parenthesis `)`, the getter cannot have an argument"},IllegalSetterArgumentNameToken:{msg:"Expecting the name of the argument of a setter, can only be assigned as strings, numbers or identifiers"},SettersOnlyGetOneArgument:{msg:"Setters have one and only one argument, missing the closing parenthesis `)`"},SetterHeaderShouldHaveClosingParen:{msg:"After the first argument of a setter should come a closing parenthesis `)`"},SettersMustHaveArgument:{msg:"Setters must have exactly one argument defined"},UnclosedObjectLiteral:{msg:"Expected to find a comma `,` for the next expression or a closing curly brace `}` to end the object literal"},FunctionNameMustNotBeReserved:{msg:"Function name may not be a keyword or a reserved word"},ExpressionMayNotStartWithKeyword:{msg:"Expressions may not start with keywords or reserved words that are not in this list: [this, null, true, false, void, typeof, delete, new]"},LabelsMayOnlyBeIdentifiers:{msg:"Label names may only be defined as an identifier"},LabelsMayNotBeReserved:{msg:"Labels may not be a keyword or a reserved word"},UnknownToken:{msg:"Unknown token encountered, dont know how to proceed"},PropertyNamesMayOnlyBeIdentifiers:{msg:"The tokens of property names accessed through the dot operator may only be identifiers"},SquareBracketExpectsExpression:{msg:"The square bracket property access expects an expression"},SquareBracketsMayNotBeEmpty:{msg:"Square brackets may never be empty, expecting an expression"},UnclosedSquareBrackets:{msg:"Unclosed square bracket encountered, was expecting `]` after the expression"},UnclosedCallParens:{msg:"Unclosed call parenthesis, expecting `)` after the optional expression"},InvalidCenterTernaryExpression:{msg:"Center expression of ternary operator should be a regular expression (but may not contain the comma operator directly)"},UnfinishedTernaryOperator:{msg:"Encountered a ternary operator start (`?`) but did not find the required colon (`:`) after the center expression"},TernarySecondExpressionCanNotContainComma:{msg:'The second and third expressions of the ternary operator can/may not "directly" contain a comma operator'},InvalidRhsExpression:{msg:"Expected a right hand side expression after the operator (which should also be a valid lhs) but did not find one"},FunctionDeclarationsMustHaveName:{msg:"Function declaration must have name"},FunctionNameMayNotBeReserved:{msg:"Function name may not be a keyword or reserved word"},ExpectingFunctionHeaderStart:{msg:"Expected the opening parenthesis of the function header"},FunctionArgumentsCanNotBeReserved:{msg:"Function arguments may not be keywords or reserved words"},FunctionParametersMustBeIdentifiers:{msg:"Function arguments must be identifiers"},ExpectedFunctionHeaderClose:{msg:"Expected the closing parenthesis `)` of the function header"},ExpectedFunctionBodyCurlyOpen:{msg:"Expected the opening curly brace `{` for the function body"},ExpectedFunctionBodyCurlyClose:{msg:"Expected the closing curly brace `}` for the function body"},VarNamesMayOnlyBeIdentifiers:{msg:"Missing variable name, must be a proper identifier"},VarNamesCanNotBeReserved:{msg:"Variable names may not be keywords or reserved words"},VarInitialiserExpressionExpected:{msg:"The initialiser of the variable statement should be an expression without comma"},ExpectedStatementHeaderOpen:{msg:"Expected opening parenthesis `(` for statement header"},StatementHeaderIsNotOptional:{msg:"Statement header must not be empty"},ExpectedStatementHeaderClose:{msg:"Expected closing parenthesis `)` for statement header"},DoShouldBeFollowedByWhile:{msg:"The do-while statement requires the `while` keyword after the expression"},ExpectedSecondSemiOfForHeader:{msg:"Expected the second semi-colon of the for-each header"},ForHeaderShouldHaveSemisOrIn:{msg:"The for-header should contain at least the `in` operator or two semi-colons (`;`)"},SwitchBodyStartsWithCurly:{msg:"The body of a switch statement starts with a curly brace `{`"},SwitchClausesEndWithColon:{msg:"Switch clauses (`case` and `default`) end with a colon (`:`)"},SwitchCannotHaveDoubleDefault:{msg:"Switches cannot have more than one `default` clause"},SwitchBodyEndsWithCurly:{msg:"The body of a switch statement ends with a curly brace `}`"},MissingTryBlockCurlyOpen:{msg:"Missing the opening curly brace (`{`) for the block of the try statement"},MissingTryBlockCurlyClose:{msg:"Missing the closing curly brace (`}`) for the block of the try statement"},CatchHeaderMissingOpen:{msg:"Missing the opening parenthesis of the catch header"},MissingCatchParameter:{msg:"Catch clauses should have exactly one argument which will be bound to the error object being thrown"},CatchParameterNameMayNotBeReserved:{msg:"Catch clause parameter may not be a keyword or reserved word"},CatchHeaderMissingClose:{msg:"Missing the closing parenthesis of the catch header"},MissingCatchBlockCurlyOpen:{msg:"Missing the opening curly brace (`{`) for the block of the catch statement"},MissingCatchBlockCurlyClose:{msg:"Missing the closing curly brace (`}`) for the block of the catch statement"},MissingFinallyBlockCurlyOpen:{msg:"Missing the opening curly brace (`{`) for the block of the finally statement"},MissingFinallyBlockCurlyClose:{msg:"Missing the closing curly brace (`}`) for the block of the finally statement"},StatementMayNotStartWithFunction:{msg:"statements may not start with function..."},BlockCurlyClose:{msg:"Expected the closing curly (`}`) for a block statement"},BlockCurlyOpen:{msg:"Expected the closing curly (`}`) for a block statement"},UnableToParseStatement:{msg:"Was unable to find a statement when it was requested"},IllegalDoubleCommaInObjectLiteral:{msg:"A double comma in object literals is not allowed"},ObjectLiteralExpectsColonAfterName:{msg:"After every property name (identifier, string or number) a colon (`:`) should follow"},ThrowMustHaveArgument:{msg:"The expression argument for throw is not optional"},ThrowCannotHaveReturn:{msg:"There may not be a return between throw and the start of its expression argument"},SwitchBodyMustStartWithClause:{msg:"The body of a switch clause must start with at a case or default clause (but may be empty, which would be silly)"},BreakOrContinueArgMustBeJustIdentifier:{msg:"The argument to a break or continue statement must be exactly and only an identifier (an existing label)"},AssignmentNotAllowedAfterNonAssignmentInExpression:{msg:"An assignment is not allowed if it is preceeded by a non-expression operator in the same expression-level"},IllegalLhsForAssignment:{msg:"Illegal left hand side for assignment (you cannot assign to things like string literals, number literals or function calls}"},VarKeywordMissingName:{msg:"Var keyword should be followed by a variable name"},IllegalTrailingComma:{msg:"Illegal trailing comma found"},ObjectLiteralMissingPropertyValue:{msg:"Missing object literal property value"},TokenizerError:{msg:"Tokenizer encountered unexpected input"},LabelRequiresStatement:{msg:"Saw a label without the (required) statement following"},DidNotExpectElseHere:{msg:"Did not expect an else here. To what if should it belong? Maybe you put a ; after the if-block? (if(x){};else{})"},UnexpectedToken:{msg:"Found an unexpected token and have no idea why"},InvalidPostfixOperandArray:{msg:"You cannot apply ++ or -- to an array"},InvalidPostfixOperandObject:{msg:"You cannot apply ++ or -- to an object"},InvalidPostfixOperandFunction:{msg:"You cannot apply ++ or -- to a function"},TryMustHaveCatchOrFinally:{msg:"The try statement must have a catch or finally block"}},b.Config=function(a){this.gui=a,this.createContainer(),this.addHeader(),this.addJslintOption(),this.addMarkerOption(),this.addScopeOption(),this.addRulerOption(),this.addAnnotationOption(),this.addMinVarOption(),this.createOption("enable caret popup"),this.addCloseButton()},b.Config.prototype={container:null,gui:null,createContainer:function(){this.container=document.createElement("div"),b.css(this.container,{position:"absolute",top:"50px",left:"50px",zIndex:500,backgroundColor:"white",color:"black",fontSize:"12px",padding:"5px",border:"1px solid green",WebkitBorderRadius:"5px",borderRadius:"5px"}),this.gui.layerContainer.appendChild(this.container)},addHeader:function(){var a=document.createElement("div");a.innerHTML="<b>Config</b><br/><br/>",this.container.appendChild(a)},addJslintOption:function(){this.createOption("enable jslint",function(){this.gui.update(!0)}),this.createLintOption("jslint | missing block good"),this.createLintOption("jslint | missing block bad"),this.createLintOption("jslint | weak comparison"),this.createLintOption("jslint | ++ / --")},createLintOption:function(a){this.createOption(a,function(){this.gui.update(!0)},!0)},addMarkerOption:function(){this.createOption("enable markers",function(a){b.css(this.gui.markLayer,"display",a?"block":"none")})},addScopeOption:function(){this.createOption("enable scope depth",function(){this.gui.update(!0)})},addRulerOption:function(){this.createOption("enable ruler",function(a){b.css(this.gui.ruler,"display",a?"block":"none"),this.gui.updatePaddingLeft()})},addAnnotationOption:function(){this.createOption("enable type annotations",function(){this.gui.update(!0)})},addMinVarOption:function(){this.createOption("minify variable names too",function(a){this.gui.zeon.config.minifyVariableNamesToo=a})},createOption:function(a,c,d){var e=this.gui.config,f=document.createElement("div");b.css(f,"cursor","pointer"),f.innerHTML=(d?" ":"")+'<input type="checkbox" '+(e[a]?"checked ":"")+"/> "+a,f.onclick=function(){e[a]=!e[a],c&&c.call(this,e[a]),f.getElementsByTagName("input")[0].checked=e[a]}.bind(this),this.container.appendChild(f)},addCloseButton:function(){this.container.appendChild(document.createElement("br"));var a=document.createElement("div");b.css(a,"cursor","pointer"),a.innerHTML="close",a.onclick=this.close.bind(this),this.container.appendChild(a)},close:function(){this.container.parentNode.removeChild(this.container),this.gui.configPopup=!1,this.gui=null},0:0},b.Nav=function(a){this.gui=a,this.lastNavPos={errors:0,jslints:0,asis:0,implicitGlobals:0,knownGlobals:0,prematures:0,unused:0,empties:0,deadLines:0,jsdocs:0,objlits:0,arrlits:0},this.createNavContainer(),this.addNavHeader(),this.addNavMaxButton(),this.addNavCaretInfo(),this.addNavigators(),this.addMinifyButton(),this.addBeautifyButton(),this.addConfigButton(),this.addTreeButton(),this.addRemoveButton(),this.createZButton()},b.Nav.prototype={gui:null,nav:null,z:null,configPopup:null,navMessageTimer:null,lastNavPos:null,hasHorizontalBar:null,hasVerticalBar:null,createNavContainer:function(){this.nav=document.createElement("div"),this.nav.className="zeon-nav",b.css(this.nav,{position:"absolute",bottom:"20px",right:"20px",border:"1px solid black",borderRight:"0px",borderBottom:"0px",backgroundColor:"white",color:"black",fontSize:"13px",padding:"5px",WebkitBorderRadius:"10px 0 0 0",borderRadius:"10px 0 0 0",WebkitBoxShadow:"-1px -1px 3px #ccc",boxShadow:"-1px -1px 3px #ccc",display:"none",fontFamily:"Verdana",userSelect:"none",webkitUserSelect:"none",zIndex:9}),this.gui.layerContainer.appendChild(this.nav),this.nav.onclick=this.onNavClick.bind(this)},onNavClick:function(a){var c=a.target.parentNode.className,d=this.lastNavPos[c],e=a.target.className,f=a.target.parentNode.querySelector(".data");if(e=="prev"||e=="next"||e=="data"){e=="prev"?d<=0?this.lastNavPos[c]=Math.max(0,this.gui.zeon.collects[c].length-1):--this.lastNavPos[c]:e=="next"&&(++this.lastNavPos[c],this.lastNavPos[c]>=this.gui.zeon.collects[c].length&&(this.lastNavPos[c]=0)),this.updateNav();var g=this.gui.zeon.collects[c][this.lastNavPos[c]];if(g){var h=this.gui.navMessage;this.gui.showCircleAtMatch(g,c),c=="errors"?(h.innerHTML=g.error.msg,b.css(h,"display","inline"),clearTimeout(this.navMessageTimer),this.navMessageTimer=setTimeout(function(){b.css(h,"display","none")},5e3)):c=="jslints"&&(h.innerHTML=g.jslint,b.css(h,"display","inline"),clearTimeout(this.navMessageTimer),this.navMessageTimer=setTimeout(function(){b.css(h,"display","none")},5e3))}}if(a.target.nodeName!="A")return!1},addNavHeader:function(){this.nav.innerHTML='<a href="http://zeonjs.com/" target="_blank" style="float:right; font-family:monospace; color:black;">Zeon.js</a>'},addNavMaxButton:function(){var a=document.createElement("div");a.className="maximize",b.css(a,{position:"absolute",bottom:"55px",right:"2px",margin:"0",padding:"0 3px 1px 3px",cursor:"pointer",fontWeight:"bold",fontSize:"12px",border:"1px solid black",WebkitBorderRadius:"2px",borderRadius:"2px",color:"black",backgroundColor:"white"}),a.innerHTML="+",this.nav.appendChild(a),a.onclick=function(){var c=this.gui.layerContainer;c.parentNode==this.gui.rootContainer?(b.css(c,{position:"absolute",top:"1%",left:"1%",width:"98%",height:"98%",zIndex:"9000",backgroundColor:"white"}),a.innerHTML="-",document.body.appendChild(c)):(b.css(c,{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"}),a.innerHTML="+",this.gui.rootContainer.appendChild(c))}.bind(this)},addNavCaretInfo:function(){this.navInputLen=document.createElement("div"),this.nav.appendChild(this.navInputLen),this.navInputLines=document.createElement("div"),this.nav.appendChild(this.navInputLines)},addNavigators:function(){this.navs=document.createElement("div"),this.nav.appendChild(this.navs)},addMinifyButton:function(){var a=this.textarea;this.minifyButton=document.createElement("div"),b.css(this.minifyButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.minifyButton.innerHTML="Minify",this.minifyButton.onclick=function(){var a=this.gui.textarea,b=a.selectionStart,c=a.selectionStop;a.value=this.gui.zeon.minify(),a.selectionStart=b,a.selectionStop=c,a.focus()}.bind(this),this.nav.appendChild(this.minifyButton)},addBeautifyButton:function(){var c=this.textarea;this.beautifyButton=document.createElement("div"),b.css(this.beautifyButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.beautifyButton.innerHTML="Beautify",this.beautifyButton.onclick=function(){var b=this.gui.textarea,c=b.selectionStart,d=b.selectionStop;if(this.gui.zeon.linearTreeNoWhite.length){var e=new a(this.gui.zeon.tree,this.gui.zeon.linearTreeNoWhite);b.value=e.beautify(0),b.selectionStart=c,b.selectionStop=d,b.focus()}}.bind(this),this.nav.appendChild(this.beautifyButton)},addConfigButton:function(){this.configButton=document.createElement("div"),b.css(this.configButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.configButton.innerHTML="Config",this.configButton.onclick=function(){this.configPopup||(this.configPopup=!0,new b.Config(this.gui))}.bind(this),this.nav.appendChild(this.configButton)},addTreeButton:function(){this.treeButton=document.createElement("div"),b.css(this.treeButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.treeButton.innerHTML="Show tree",this.treeButton.onclick=function(){var a=this.zeon.tree,c=function(a,d){var e=[];for(var f=0;f<a.length;++f)if(a[f]instanceof Array){var g=[];for(var h in a[f])a[f].hasOwnProperty(h)&&h!=+h+""&&!(a[f][h]instanceof Array)&&g.push(h+":"+b.noctrl(b.escape(a[f][h])));var i="\n"+Array(d+1).join("\t")+"[("+a[f].length+") "+g.join(", ");i+=c(a[f],d+1),i+="\n"+Array(d+1).join("\t")+"]",e.push(i)}else{var g=[];for(var h in a[f])a[f].hasOwnProperty(h)&&g.push(h+":"+b.noctrl(b.escape(a[f][h])));var i="\n"+Array(d+1).join("\t")+"{"+g.join(", ")+"}";e.push(i)}return e.join()}.bind(this);a.root=!0;var d=c([a],0),e=document.createElement("pre");b.css(e,{position:"absolute",zIndex:500,backgroundColor:"white",color:"black",padding:"5px",border:"1px solid black",fontSize:"12px"}),e.innerHTML=d;var f=document.createElement("div");b.css(f,"cursor","pointer"),f.innerHTML="Close",f.onclick=function(){document.body.removeChild(e)},e.insertBefore(f,e.firstChild),document.body.insertBefore(e,document.body.firstChild)}.bind(this),this.nav.appendChild(this.treeButton)},addRemoveButton:function(){this.removeButton=document.createElement("div"),b.css(this.treeButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.treeButton.innerHTML="Remove Zeon",this.treeButton.onclick=function(){this.gui.remove()}.bind(this),this.nav.appendChild(this.treeButton)},createZButton:function(){var a=document.createElement("div");b.css(a,{width:"200px",height:"200px",position:"absolute",top:0,left:0,WebkitBorderRadius:"100px",borderRadius:"100px",backgroundColor:"#eee",textIndent:"32px",lineHeight:"80px",fontWeight:"800",fontSize:"30px",fontFamily:'"Courier New"',cursor:"pointer",WebkitBoxShadow:"-1px -1px 5px black",boxShadow:"-1px -1px 5px black",textShadow:"#ef928f 1px 1px 0.5px",userSelect:"none",webkitUserSelect:"none",zIndex:10}),a.innerHTML="Z";var c=document.createElement("div");b.css(c,{position:"absolute",right:"0px",bottom:"0px",width:"60px",height:"60px",overflow:"hidden"}),c.onclick=function(){b.css(this.nav,"display",b.css(this.nav,"display")=="none"?"block":"none")}.bind(this),c.appendChild(a),this.gui.layerContainer.appendChild(c),this.z=c},resize:function(){if(this.z){var a=this.gui.textarea;a.scrollHeight>a.clientHeight!=this.hasHorizontalBar&&(this.hasHorizontalBar=!this.hasHorizontalBar,b.css([this.z,this.nav],"right",this.hasHorizontalBar?"16px":"0")),a.scrollWidth>a.clientWidth!=this.hasVerticalBar&&(this.hasVerticalBar=!this.hasVerticalBar,b.css([this.z,this.nav],"bottom",this.hasVerticalBar?"16px":"0"))}},updateNav:function(){var a=this.gui.lastInput||"";this.navInputLen.innerHTML="<div>Len: "+a.length+"</div>";var b=this.gui&&this.gui.zeon&&this.gui.zeon.lines||[];this.navInputLines.innerHTML="<div>Lines: "+b.length+"</div>",this.setNavs(this.createNavRow("errors","Errors"),this.createNavRow("jslints","Lints"),this.createNavRow("asis","ASI"),this.createNavRow("implicitGlobals","Unknown globals"),this.createNavRow("knownGlobals","Known globals"),this.createNavRow("prematures","Prematured"),this.createNavRow("unused","Unused vars"),this.createNavRow("empties","Empty statement"),this.createNavRow("deadLines","Dead statements"),this.createNavRow("jsdocs","JSDocs"),this.createNavRow("objlits","Object literals"),this.createNavRow("arrlits","Array literals")),clearTimeout(this.navMessageTimer)},createNavRow:function(a,c){if(!this.gui.zeon)return document.createElement("div");var d=this.gui.zeon.collects,e=d[a].length;this.lastNavPos[a]>=e&&(this.lastNavPos[a]=Math.max(0,e-1));var f=document.createElement("pre");f.className=a,b.css(f,"margin","0 0 0 5px"),f.innerHTML=(e>1?'<span class="prev" style="cursor:pointer;"><</span>':" ")+" "+(e?'<span class="data" style="cursor:pointer;">'+(this.lastNavPos[a]<10?" ":"")+(e?this.lastNavPos[a]+1:0)+"</span>":" ")+" "+(e>1?'<span class="next" style="cursor:pointer;">></span>':" ")+" "+'<span style="font-family: Verdana;">'+c+": "+"<b>"+e+"x</b>"+"</span>"+"";return f},setNavs:function(a){this.navs.innerHTML="";for(var b=0;b<arguments.length;++b)this.navs.appendChild(arguments[b])},0:0},b.start().setPaddingTop(4)}