-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebkit-test.js
executable file
·1 lines (1 loc) · 175 KB
/
webkit-test.js
1
var Tokenizer=function(a){this.inp=a,this.pos=0,this.line=0,this.column=0,this.cache={},this.tokens=0,this.errorStack=[],this.regexWhiteSpace=Tokenizer.regexWhiteSpace,this.regexLineTerminator=Tokenizer.regexLineTerminator,this.regexAsciiIdentifier=Tokenizer.regexAsciiIdentifier,this.regexHex=Tokenizer.regexHex,this.regexUnicodeEscape=Tokenizer.regexUnicodeEscape,this.regexIdentifierStop=Tokenizer.regexIdentifierStop,this.regexPunctuators=Tokenizer.regexPunctuators,this.Unicode=window.Unicode,this.errorEscape=null};Tokenizer.escape=function(a){return a.replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\s/g,"\\s").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},Tokenizer.prototype.storeCurrentAndFetchNextToken=function(a,b,c,d){var e=!a,f=this.pos,g=this.inp,h=!1;do{if(!d){c[c.length]=b;if(this.errorEscape){b=this.errorEscape,this.errorEscape=null;return b}}d=!1;if(f>=g.length){b={start:g.length,stop:g.length,name:12};break}var b=null,i=f,j=g[f];if(this.regexWhiteSpace.test(j))++f,b={start:i,stop:f,name:9,line:this.line,col:this.column,isWhite:!0},++this.column;else if(this.regexLineTerminator.test(j))b={start:f,stop:++f,name:10,line:this.line,col:this.column,isWhite:!0},h=!0,++this.line,this.column=0,b.hasNewline=1;else if(j=="/"&&g[f+1]=="/")f=g.indexOf("\n",f),f==-1&&(f=g.length),b={start:i,stop:f,name:7,line:this.line,col:this.column,isComment:!0,isWhite:!0},this.column=b.stop;else if(j=="/"&&g[f+1]=="*"){var k=g.indexOf("*/",f);if(k==-1)k=g.indexOf("\n",f),k<0?f+=2:f=k,b={start:i,stop:f,name:14,value:g.substring(i,f),line:this.line,col:this.column,isComment:!0,isWhite:!0,tokenError:!0,error:Tokenizer.Error.UnterminatedMultiLineComment},this.errorStack.push(b);else{f=k+2,b={start:i,stop:f,name:8,value:g.substring(i,f),line:this.line,col:this.column,isComment:!0,isWhite:!0};var l=0,m=0;while(l<(l=b.value.indexOf("\n",l+1)))++m;m?(h=!0,b.hasNewline=m,this.line+=m,this.column=0):this.column=b.stop}}else if(j=="'"){var m=0;do{while(f<g.length&&g[++f]=="\\")g[f+1]=="\n"&&++m,++f;if(this.regexLineTerminator.test(g[f])){b={start:i,stop:f,name:14,value:g.substring(i,f),isString:!0,tokenError:!0,error:Tokenizer.Error.UnterminatedDoubleStringNewline},this.errorStack.push(b);break}}while(f<g.length&&g[f]!="'");b||(g[f]!="'"?(b={start:i,stop:f,name:14,value:g.substring(i,f),isString:!0,tokenError:!0,error:Tokenizer.Error.UnterminatedDoubleStringOther},this.errorStack.push(b)):(++f,b={start:i,stop:f,name:5,isString:!0},m?(b.hasNewline=m,this.line+=m,this.column=0):this.column+=f-i))}else if(j=='"'){var m=!1;do{while(f<g.length&&g[++f]=="\\")g[f+1]=="\n"&&++m,++f;if(this.regexLineTerminator.test(g[f])){b={start:i,stop:f,name:14,value:g.substring(i,f),isString:!0,tokenError:!0,error:Tokenizer.Error.UnterminatedSingleStringNewline},this.errorStack.push(b);break}}while(f<g.length&&g[f]!='"');b||(g[f]!='"'?(b={start:i,stop:f,name:14,value:g.substring(i,f),isString:!0,tokenError:!0,error:Tokenizer.Error.UnterminatedSingleStringOther},this.errorStack.push(b)):(++f,b={start:i,stop:f,name:6,isString:!0},m?(b.hasNewline=m,this.line+=m,this.column=0):this.column+=f-i))}else if(j>="0"&&j<="9"||j=="."&&g[f+1]>="0"&&g[f+1]<="9"){++f;if(j!="0"||g[f]!="x"&&g[f]!="X"){var n=j=="0"&&g[f]>="0"&&g[f]<="9";if(j!="."){while(f<g.length&&g[f]>="0"&&g[f]<="9")++f;g[f]=="."&&++f}while(f<g.length&&g[f]>="0"&&g[f]<="9")++f;if(g[f]=="e"||g[f]=="E"){(g[++f]=="+"||g[f]=="-")&&++f;var o=f;while(f<g.length&&g[f]>="0"&&g[f]<="9")++f;if(o==f)throw Tokenizer.Error.NumberExponentRequiresDigits}n?(b={start:i,stop:f,name:14,isNumber:!0,isOctal:!0,tokenError:!0,error:Tokenizer.Error.IllegalOctalEscape},this.errorStack.push(b)):b={start:i,stop:f,name:4,isNumber:!0}}else{while(++f<g.length&&this.regexHex.test(g[f]));b={start:i,stop:f,name:3,isNumber:!0}}}else if(e&&j=="/"){var p=!1;while(++f<g.length){j=g[f];if(j=="\\"&&g[f+1]!="\n")++f;else if(j=="[")while(++f<g.length&&g[f]!="\n"&&g[f]!="]");else{if(j=="\n"){b={start:i,stop:f,name:14,tokenError:!0,error:Tokenizer.Error.UnterminatedRegularExpressionNewline},this.errorStack.push(b);break}if(j=="/"){p=!0;break}}}if(!p||b)b||(b={start:i,stop:f,name:14,tokenError:!0,error:Tokenizer.Error.UnterminatedRegularExpressionOther},this.errorStack.push(b));else{++f;while(f<g.length&&this.regexAsciiIdentifier.test(g[f]))++f;b={start:i,stop:f,name:1}}}else{var q=this.regexPunctuators.exec(g.substring(f,f+4));if(q)b={start:f,stop:f+=q[1].length,name:11,value:q[1]};else{var p=!1;while(f<g.length){var r=g[f];if(this.regexAsciiIdentifier.test(r))++f;else if(this.regexUnicodeEscape.test(g.substring(f,f+6)))f+=6;else{if(!this.Unicode)break;if(this.regexIdentifierStop.test(r))break;var s=this.Unicode;if(!(s.Lu.test(r)||s.Ll.test(r)||s.Lt.test(r)||s.Lm.test(r)||s.Lo.test(r)||s.Nl.test(r)||s.Mn.test(r)||s.Mc.test(r)||s.Nd.test(r)||s.Pc.test(r)||s.sp.test(r)))break}p=!0}p?b={start:i,stop:f,name:2,value:g.substring(i,f)}:g[f]=="`"?(b={start:i,stop:f,name:14,tokenError:!0,error:Tokenizer.Error.BacktickNotSupported},this.errorStack.push(b)):(b={start:i,stop:f,name:14,tokenError:!0,error:Tokenizer.Error.Unknown,value:r},this.errorStack.push(b),++f)}}++this.tokens}while(c&&b&&b.isWhite);this.pos=f,h&&(b.newline=!0);return b},Tokenizer.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},Tokenizer.regexWhiteSpace=/[ \t\u000B\u000C\u00A0\uFFFF]/,Tokenizer.regexLineTerminator=/[\u000A\u000D\u2028\u2029]/,Tokenizer.regexAsciiIdentifier=/[a-zA-Z0-9\$_]/,Tokenizer.regexHex=/[0-9A-Fa-f]/,Tokenizer.regexUnicodeEscape=/\\u[0-9A-Fa-f]{4}/,Tokenizer.regexIdentifierStop=/[\>\=\!\|\<\+\-\&\*\%\^\/\{\}\(\)\[\]\.\;\,\~\?\:\ \t\n\\\'\"]/,Tokenizer.regexPunctuators=/^(>>>=|===|!==|>>>|<<=|>>=|<=|>=|==|!=|\+\+|--|<<|>>|\&\&|\|\||\+=|-=|\*=|%=|\&=|\|=|\^=|\/=|\{|\}|\(|\)|\[|\]|\.|;|,|<|>|\+|-|\*|%|\||\&|\||\^|!|~|\?|:|=|\/)/,Tokenizer.Unidocde=window.Unicode,Tokenizer.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 log=function(){window.console&&console.log&&console.log.apply(console,Array.prototype.slice.call(arguments,0))},Parser=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=Parser.regexLhsStart,this.regexStartKeyOrReserved=Parser.regexStartKeyOrReserved,this.regexIsKeywordOrReserved=Parser.regexIsKeywordOrReserved,this.regexAssignments=Parser.regexAssignments,this.regexNonAssignmentExpressionOperators=Parser.regexNonAssignmentExpressionOperators,this.regexUnaryKeywords=Parser.regexUnaryKeywords,this.regexUnaryOperators=Parser.regexUnaryOperators,this.regexLiteralKeywords=Parser.regexLiteralKeywords,this.ast=!0};Parser.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 if(a&&a.name!=12){if(a.name!=14){var c=new Parser.Error("UnexpectedToken",a);this.errorStack.push(c),this.stack.push({start:a.start,stop:a.start,name:14,error:c})}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,this.stack),b=!0}while(a&&a.name==14);b&&a&&a.name!=12&&(a=this.parse(a));return a},eatSemiColon:function(a,b){if(a.value==";")a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);else if(a.name!=12&&(a.semi||!a.newline&&a.value!="}")&&(!a.newline||a.value!="++"&&a.value!="--")){var c=new Parser.Error("NoASI",a);this.errorStack.push(c),b.push({start:a.start,stop:a.start,name:14,error:c,value:";"})}else b[b.length]={start:a.start,stop:a.start,name:13};a.semi=!0;return a},eatExpressions:function(a,b,c,d,e,f){if(this.ast){var g=c;c=[],c.desc="expressions",g[g.length]=c;var h=0}var i=!0;do{var j=!1;if(!i){b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var k=new Parser.Error("ExpectedAnotherExpressionComma",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}}if(this.ast){++h;var l=c;c=[],c.desc="expression",l[l.length]=c}var m=!0;while(m){if(this.ast){var n=c;c=[],c.desc="sub-expression",n[n.length]=c}var o=!1;while(!f&&(b.isUnaryOp=this.regexUnaryKeywords.test(b.value)||b.name==11&&this.regexUnaryOperators.test(b.value))){b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var k=new Parser.Error("ExpectedAnotherExpressionRhs",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}o=!0}o&&(a=!1);var p=!1;if(b.value=="("){if(this.ast){var q=c;c=[],c.desc="grouped",q[q.length]=c;var r=b;b.isGroupStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var k=new Parser.Error("GroupingShouldStartWithExpression",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var k=new Parser.Error("UnclosedGroupingOperator",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}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);var t=!0;while(t&&b.value!="]"){t=!1;if(!(b.name<=6||this.regexLhsStart.test(b.value))&&b.name!=14){var k=new Parser.Error("ArrayShouldStartWithExpression",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}b=this.eatExpressions(!1,b,c,!0);while(b.value==",")t=!0,b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}if(b.value!="]"){var k=new Parser.Error("UnclosedPropertyBracket",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"]"}}this.ast&&(b.twin=s,s.twin=b,b.isArrayLiteralStop=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);while(b.value=="++"||b.value=="--"){var k=new Parser.Error("InvalidPostfixOperandArray",b);this.errorStack.push(k),this.stack.push({start:b.start,stop:b.start,name:14,error:k,value:"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!="}"){if(!b.isNumber&&!b.isString&&b.name!=2){var k=new Parser.Error("IllegalPropertyNameToken",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}if(this.ast){var v=c;c=[],c.desc="objlit pair",c.isObjectLiteralPair=!0,v[v.length]=c}if(this.ast){var w=c;c=[],c.desc="objlit pair name",w[w.length]=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);if(!b.isNumber&&!b.isString&&b.name!=2){var k=new Parser.Error("IllegalGetterSetterNameToken",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var k=new Parser.Error("GetterSetterNameFollowedByOpenParen",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"("}}if(this.ast)var r=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!=")"){var k=new Parser.Error("GetterHasNoArguments",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}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);if(!b.isNumber&&!b.isString&&b.name!=2){var k=new Parser.Error("IllegalGetterSetterNameToken",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var k=new Parser.Error("GetterSetterNameFollowedByOpenParen",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"("}}if(this.ast)var r=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name!=2)if(b.value==")"){var k=new Parser.Error("SettersMustHaveArgument",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}else{var k=new Parser.Error("IllegalSetterArgumentNameToken",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!=")")if(b.value==","){var k=new Parser.Error("SettersOnlyGetOneArgument",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}else{var k=new Parser.Error("SetterHeaderShouldHaveClosingParen",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}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);if(b.value==","){b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value==","){var k=new Parser.Error("IllegalDoubleCommaInObjectLiteral",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:","}}}else if(b.value!="}"){var k=new Parser.Error("UnclosedObjectLiteral",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"}"}}}this.ast&&(b.twin=u,u.twin=b,b.isObjectLiteralStop=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);while(b.value=="++"||b.value=="--"){var k=new Parser.Error("InvalidPostfixOperandObject",b);this.errorStack.push(k),this.stack.push({start:b.start,stop:b.start,name:14,error:k,value:"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[y.length]=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);if(a&&b.value==":"){var k=new Parser.Error("LabelsMayNotBeReserved",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}if(b.name==2){b.meta="func expr name",b.varType=["Function"],b.functionStack=c,this.ast&&(this.scope[this.scope.length]={value:b.value});if(this.regexStartKeyOrReserved.test(b.value[0])&&this.regexIsKeywordOrReserved.test(b.value)){var k=new Parser.Error("FunctionNameMustNotBeReserved",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"error"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}b=this.eatFunctionParametersAndBody(b,c,!0);while(b.value=="++"||b.value=="--"){var k=new Parser.Error("InvalidPostfixOperandFunction",b);this.errorStack.push(k),this.stack.push({start:b.start,stop:b.start,name:14,error:k,value:"error"}),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}this.ast&&(c=y,this.scope=z)}else if(b.name<=6){var A=b;if(b.name==2){if(!this.regexLiteralKeywords.test(b.value)&&this.regexStartKeyOrReserved.test(b.value[0])&&this.regexIsKeywordOrReserved.test(b.value))if(f){var k=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}else if(b.value=="else"){var k=new Parser.Error("DidNotExpectElseHere");this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}else{var k=new Parser.Error("ExpressionMayNotStartWithKeyword",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}p=!0}else if(f){var k=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k}}this.ast&&(f||(b.meta="lead value")),b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c);if(a&&b.value==":"){if(A.name!=2){var k=new Parser.Error("LabelsMayOnlyBeIdentifiers",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}a[0]=!0,b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(delete A.meta,A.isLabel=!0,A.isLabelDeclaration=!0,this.statementLabels[this.statementLabels.length]=A.value,c.desc="labeled statement");var B=this.errorStack.length;b=this.eatStatement(!1,b,c),b.error&&b.error.msg==Parser.Errors.UnableToParseStatement.msg&&(b.error=new Parser.Error("LabelRequiresStatement"),this.errorStack[B]=b.error);return b}a=!1}else if(b.value!="}")if(b.name==14){do{if(b.tokenError){var k=new Parser.Error("TokenizerError",b);k.msg+=": "+b.error.msg,this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}while(b.name==14)}else{console.log("unknown token",b);var k=new Parser.Error("UnknownToken",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k}),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}while(b.value=="."||b.value=="["||b.value=="("){if(f){var k=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:";"}}if(b.value=="."){b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name!=2){var k=new Parser.Error("PropertyNamesMayOnlyBeIdentifiers",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}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);if(!(b.name<=6||this.regexLhsStart.test(b.value)))if(b.value=="]"){var k=new Parser.Error("SquareBracketsMayNotBeEmpty",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k}}else{var k=new Parser.Error("SquareBracketExpectsExpression",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k}}b=this.eatExpressions(!1,b,c);if(b.value!="]"){var k=new Parser.Error("UnclosedSquareBrackets",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:"]"}}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);if(b.value!=")"){var k=new Parser.Error("UnclosedCallParens",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:")"}}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}}if((b.value=="++"||b.value=="--")&&!b.newline){if(f){var k=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:";"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!0,b,c)}this.ast&&(c=n);do{var C=!1;if(!e&&b.value=="in"||b.value=="instanceof"||b.name==11&&(b.isAssignment=this.regexAssignments.test(b.value))||this.regexNonAssignmentExpressionOperators.test(b.value)){if(b.isAssignment)if(!p){var k=new Parser.Error("IllegalLhsForAssignment");this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}else if(j){var k=new Parser.Error("AssignmentNotAllowedAfterNonAssignmentInExpression");this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}if(f){var k=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:";"}}b.isAssignment||(j=!0);if(this.ast){b.isBinaryOperator=!0;var D=c;c=[],c.desc="operator-expression",c.isBinaryOperator=!0,c.sub=b.value,D.sub=b.value,c.isAssignment=b.isAssignment,D[D.length]=c}C=b.value=="?",b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=D);if(C){if(!(b.name<=6||this.regexLhsStart.test(b.value))){var k=new Parser.Error("InvalidCenterTernaryExpression",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}b=this.eatExpressions(!1,b,c,!0,e);if(b.value!=":")if(b.value==","){var k=new Parser.Error("TernarySecondExpressionCanNotContainComma",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:":"}}else{var k=new Parser.Error("UnfinishedTernaryOperator",b);this.errorStack.push(k),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:k,value:";"}}if(this.ast){var D=c;c=[],c.desc="operator-expression",c.sub=b.value,D.sub=b.value,c.isAssignment=b.isAssignment,D[D.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=D),b=this.eatExpressions(!1,b,c,!0,e)}}else m=!1}while(C);if(m&&!(b.name<=6||this.regexLhsStart.test(b.value))){var k=new Parser.Error("InvalidRhsExpression",b);this.errorStack.push(k),c.push({start:b.start,stop:b.start,name:14,error:k})}}this.ast&&(c=l),a=i=!1}while(!d&&b.value==",");this.ast&&(c.length||(g.length=g.length-1),g.numberOfExpressions=h,c.expressionCount=h);return b},eatFunctionDeclaration:function(a,b){if(this.ast){var c=b,d=this.scope,b=[];b.desc="func decl",b.isFunction=!0,c[c.length]=b,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);if(a.name!=2){var e=new Parser.Error("FunctionDeclarationsMustHaveName",a);this.errorStack.push(e),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:e,value:"error"}}if(this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)){var e=new Parser.Error("FunctionNameMayNotBeReserved",a);this.errorStack.push(e),b.push({start:a.start,stop:a.start,name:14,error:e})}this.ast&&(d[d.length]={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=d);return a},eatObjectLiteralColonAndBody:function(a,b){if(this.ast){var c=b;b=[],b.desc="objlit pair colon",c[c.length]=b}if(a.value!=":"){var d=new Parser.Error("ObjectLiteralExpectsColonAfterName",a);this.errorStack.push(d),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:d,value:":"}}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=c);var e=a;a=this.eatExpressions(!1,a,b,!0);if(a==e){var d=new Parser.Error("ObjectLiteralMissingPropertyValue");this.errorStack.push(d),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:d,value:"error"}}return a},eatFunctionParametersAndBody:function(a,b,c){if(this.ast)var d=a;if(a.value!="("){var e=new Parser.Error("ExpectingFunctionHeaderStart",a);this.errorStack.push(e),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:e,value:"("}}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(a.name==2){if(this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)){var e=new Parser.Error("FunctionArgumentsCanNotBeReserved",a);this.errorStack.push(e),b.push({start:a.start,stop:a.start,name:14,error:e})}this.ast&&(this.scope[this.scope.length]={value:a.value},a.meta="parameter"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);while(a.value==","){a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b);if(a.name!=2){var e=new Parser.Error("FunctionParametersMustBeIdentifiers",a);this.errorStack.push(e),b.push({start:a.start,stop:a.start,name:14,error:e})}if(this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)){var e=new Parser.Error("FunctionArgumentsCanNotBeReserved",a);this.errorStack.push(e),b.push({start:a.start,stop:a.start,name:14,error:e})}this.ast&&(this.scope[this.scope.length]={value:a.value},a.meta="parameter"),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b)}}this.ast&&(a.twin=d,d.twin=a);if(a.value!=")"){var e=new Parser.Error("ExpectedFunctionHeaderClose",a);this.errorStack.push(e),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:e,value:")"}}a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatFunctionBody(a,b,c);return a},eatFunctionBody:function(a,b,c){if(this.ast){var d=b,b=[];b.desc="func body",d[d.length]=b;var e=this.statementLabels;this.statementLabels=[],b.labels=this.statementLabels}if(a.value!="{"){var f=new Parser.Error("ExpectedFunctionBodyCurlyOpen",a);this.errorStack.push(f),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:f,value:"{"}}var g=a;a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),a=this.eatSourceElements(a,b);if(a.value!="}"){var f=new Parser.Error("ExpectedFunctionBodyCurlyClose",a);this.errorStack.push(f),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:f,value:"}"}}this.ast&&(a.twin=g,g.twin=a),a=this.tokenizer.storeCurrentAndFetchNextToken(c,a,b),this.ast&&(this.statementLabels=e);return a},eatVarDecl:function(a,b,c){if(this.ast){var d=b,b=[];b.desc="var decl",d[d.length]=b;var e=this.scope;while(e.catchScope)e=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[f.length]=b;var g=b;b=[],b.desc="sub-expression",g[g.length]=b}if(a.name==12){var h=new Parser.Error("IllegalTrailingComma",a);this.errorStack.push(h),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:h}}if(a.name!=2){var h=new Parser.Error("VarNamesMayOnlyBeIdentifiers",a);this.errorStack.push(h),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:h}}if(this.regexStartKeyOrReserved.test(a.value[0])&&this.regexIsKeywordOrReserved.test(a.value)){var h=new Parser.Error("VarNamesCanNotBeReserved",a);this.errorStack.push(h),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:h}}a.meta="var name",this.ast&&(e[e.length]={value:a.value}),a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=g);if(a.value=="="){this.ast&&(g=b,b=[],b.desc="operator-expression",b.sub="=",g[g.length]=b,b.isAssignment=!0),a.isInitialiser=!0,a=this.tokenizer.storeCurrentAndFetchNextToken(!1,a,b),this.ast&&(b=g);if(!(a.name<=6||this.regexLhsStart.test(a.value))){var h=new Parser.Error("VarInitialiserExpressionExpected",a);this.errorStack.push(h),this.tokenizer.errorEscape=a,a={start:a.start,stop:a.start,name:14,error:h,value:"error"}}a=this.eatExpressions(!1,a,b,!0,c)}this.ast&&(b=f)}while(a.value==",");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[d.length]=c;var e=this.statementLabels;this.statementLabels=[e],c.labels=this.statementLabels}if(b.name==2)if(b.value=="var"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="var",f[f.length]=c,c.sub="var"}b=this.eatVarDecl(b,c),b=this.eatSemiColon(b,c),this.ast&&(c=f)}else if(b.value=="if"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="if",c.hasElse=!1,f[f.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,h.twin=b,c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c);if(b&&b.value=="else"){if(this.ast){c.hasElse=!0;var i=c;c=[],c.desc="statement",c.sub="else",i[i.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c),this.ast&&(c=i)}this.ast&&(c=f)}else if(b.value=="do"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="do",c.isIteration=!0,f[f.length]=c,this.statementLabels[this.statementLabels.length]=""}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c);if(b.value!="while"){var g=new Parser.Error("DoShouldBeFollowedByWhile",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"while"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,h.twin=b,c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatSemiColon(b,c)}else if(b.value=="while"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="while",c.isIteration=!0,f[f.length]=c,this.statementLabels[this.statementLabels.length]=""}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,h.twin=b,c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c)}else if(b.value=="for"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="for",c.isIteration=!0,f[f.length]=c,this.statementLabels[this.statementLabels.length]=""}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0,b.forHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value=="var")b=this.eatVarDecl(b,c,!0);else if(b.value!=";"){if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}b=this.eatExpressions(!1,b,c,!1,!0)}if(b.value=="in")this.ast&&(c.forType="in",b.forFor=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatExpressions(!1,b,c);else{if(b.value!=";"){var g=new Parser.Error("ForHeaderShouldHaveSemisOrIn",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:";"}}this.ast&&(c.forType="each",b.forEachHeaderStart=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name<=6||this.regexLhsStart.test(b.value))b=this.eatExpressions(!1,b,c);if(b.value!=";"){var g=new Parser.Error("ExpectedSecondSemiOfForHeader",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:";"}}this.ast&&(b.forEachHeaderStop=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name<=6||this.regexLhsStart.test(b.value))b=this.eatExpressions(!1,b,c)}if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,b.forHeaderStop=!0,h.twin=b,b.forType=="in"&&c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c)}else if(b.value=="continue"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="continue",f[f.length]=c,b.restricted=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!b.newline&&b.value!=";"){if(this.ast){b.isLabel=!0,b.isLabelTarget=!0;var j=b}b=this.eatExpressions(!1,b,c,!0,!1,!0),this.ast&&(c.hasLabel=j!=b);if(b.value!=";"&&!b.newline){var g=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:";"}}}b=this.eatSemiColon(b,c)}else if(b.value=="break"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="break",f[f.length]=c,b.restricted=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!b.newline&&b.value!=";"){if(this.ast){b.isLabel=!0,b.isLabelTarget=!0;var k=b}b=this.eatExpressions(!1,b,c,!0,!1,!0),this.ast&&(c.hasLabel=k!=b);if(b.value!=";"&&b.value!="}"){var g=new Parser.Error("BreakOrContinueArgMustBeJustIdentifier");this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:";"}}}b=this.eatSemiColon(b,c)}else if(b.value=="return"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="return",f[f.length]=c,b.restricted=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),!b.newline&&b.value!=";"&&(b=this.eatExpressions(!1,b,c)),b=this.eatSemiColon(b,c)}else if(b.value=="throw"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="throw",f[f.length]=c,b.restricted=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.newline){var g=new Parser.Error("ThrowCannotHaveReturn",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:";"}}if(b.value==";"){var g=new Parser.Error("ThrowMustHaveArgument",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c)}else if(b.value=="switch"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="switch",f[f.length]=c,this.statementLabels[this.statementLabels.length]=""}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,h.twin=b,c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="{"){var g=new Parser.Error("SwitchBodyStartsWithCurly",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"{"}}var l=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);var m=!1,n=!1;while(b.value=="case"||!m&&b.value=="default"){n=!0;if(this.ast){var o=c;c=[],c.desc="switch clause header",o[o.length]=c}if(b.value=="case"){if(this.ast){c.sub="case";var p=c;c=[],c.desc="case",p[p.length]=c,b.isCase=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(this.ast){c=p;var q=c;c=[],c.desc="case arg",q[q.length]=c}b=this.eatExpressions(!1,b,c),this.ast&&(c=q)}else{if(this.ast){o.hasDefaultClause=!0,c.sub="default";var r=c;c=[],c.desc="case",r[r.length]=c,b.isDefault=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),m=!0,this.ast&&(c=r)}if(this.ast){var s=c;c=[],c.desc="colon",s[s.length]=c}if(b.value!=":"){var g=new Parser.Error("SwitchClausesEndWithColon",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:":"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(this.ast){c=o;var t=c;c=[],c.desc="switch clause body",t[t.length]=c}while(b.value!="default"&&b.value!="case"&&b.value!="}"&&b.name!=14)b=this.eatStatement(!0,b,c);this.ast&&(c=t)}if(!n&&b.value!="}"){var g=new Parser.Error("SwitchBodyMustStartWithClause",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g,value:"}"})}if(m&&b.value=="default"){var g=new Parser.Error("SwitchCannotHaveDoubleDefault",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}if(b.value!="}"){var g=new Parser.Error("SwitchBodyEndsWithCurly",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"}"}}this.ast&&(b.twin=l,l.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}else if(b.value=="try"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="try",f[f.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="{"){var g=new Parser.Error("MissingTryBlockCurlyOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"{"}}if(this.ast){var u=c;c=[],c.desc="statement",c.sub="tryblock",u[u.length]=c}var l=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!="}"&&(b=this.eatStatements(b,c));if(b.value!="}"){var g=new Parser.Error("MissingTryBlockCurlyClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"}"}}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=u,b.twin=l,l.twin=b);var v=!1;if(b.value=="catch"){v=!0;if(this.ast){var u=c;c=[],c.desc="statement",c.sub="catch",u[u.length]=c;var w=this.scope;this.scope=c.scope=[this.scope],this.scope.catchScope=!0,w.global?this.scope.push(w[0]):w.catchScope?(this.scope.push(w[1]),w[2]&&w[2].value=="arguments"&&this.scope.push(w[2])):this.scope.push(w[1],w[2])}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("CatchHeaderMissingOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}if(this.ast)var h=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.name!=2){var g=new Parser.Error("MissingCatchParameter",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}if(this.regexStartKeyOrReserved.test(b.value[0])&&this.regexIsKeywordOrReserved.test(b.value)){var g=new Parser.Error("CatchParameterNameMayNotBeReserved",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}this.ast&&(b.meta="var name",this.scope.push(b),b.isCatchVar=!0),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!=")"){var g=new Parser.Error("CatchHeaderMissingClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,h.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="{"){var g=new Parser.Error("MissingCatchBlockCurlyOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"{"}}var l=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!="}"&&(b=this.eatStatements(b,c));if(b.value!="}"){var g=new Parser.Error("MissingCatchBlockCurlyClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"}"}}this.ast&&(b.twin=l,l.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=u,this.scope=w)}if(b.value=="finally"){v=!0;if(this.ast){var u=c;c=[],c.desc="statement",c.sub="finally",u[u.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="{"){var g=new Parser.Error("MissingFinallyBlockCurlyOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"{"}}var l=b;b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value!="}"&&(b=this.eatStatements(b,c));if(b.value!="}"){var g=new Parser.Error("MissingFinallyBlockCurlyClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"}"}}this.ast&&(b.twin=l,l.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),this.ast&&(c=u)}if(!v){var g=new Parser.Error("TryMustHaveCatchOrFinally",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}}else if(b.value=="debugger"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="debugger",f[f.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatSemiColon(b,c)}else if(b.value=="with"){if(this.ast){var f=c;c=[],c.desc="statement",c.sub="with",f[f.length]=c}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(b.value!="("){var g=new Parser.Error("ExpectedStatementHeaderOpen",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"("}}if(this.ast){var h=b;b.statementHeaderStart=!0}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c);if(!(b.name<=6||this.regexLhsStart.test(b.value))){var g=new Parser.Error("StatementHeaderIsNotOptional",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"error"}}b=this.eatExpressions(!1,b,c);if(b.value!=")"){var g=new Parser.Error("ExpectedStatementHeaderClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:")"}}this.ast&&(b.twin=h,b.statementHeaderStop=!0,h.twin=b,c[c.length-1].desc=="expressions"&&(h.expressionArg=c[c.length-1])),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b=this.eatStatement(!1,b,c)}else if(b.value=="function"){var g=new Parser.Error("ExpressionStatementMayNotStartWithFunction",b);this.errorStack.push(g),c.push({start:b.start,stop:b.start,name:14,error:g})}else{if(this.ast){var f=c;c=[],c.desc="statement",c.sub="expression",f[f.length]=c}var x=[];b=this.eatExpressions(x,b,c),x.length?this.ast&&(c.sub="labeled"):(this.ast&&(c.sub="expression"),b=this.eatSemiColon(b,c))}else if(b.isString)b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c);else if(b.isNumber)b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c);else if(b.value=="("||b.value=="[")b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c);else if(b.value=="+"||b.value=="-"||b.value=="++"||b.value=="--"||b.value=="~"||b.value=="!")b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c);else if(b.name==1)b=this.eatExpressions(!1,b,c),b=this.eatSemiColon(b,c);else if(b.value==";")b.emptyStatement=!0,b=this.eatSemiColon(b,c);else if(b.value=="{"){if(this.ast){c.sub="block";var l=b}b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c),b.value=="}"?this.ast&&(c.isEmptyBlock=!0):b=this.eatStatements(b,c);if(b.value!="}"){var g=new Parser.Error("BlockCurlyClose",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g,value:"}"}}this.ast&&(b.twin=l,l.twin=b),b=this.tokenizer.storeCurrentAndFetchNextToken(!1,b,c)}else if(!a){var g=new Parser.Error("UnableToParseStatement",b);this.errorStack.push(g),this.tokenizer.errorEscape=b,b={start:b.start,stop:b.start,name:14,error:g}}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},0:0},Parser._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"]];for(var c=0;c<b.length;++c)a(c,b[c][0],b[c][1])},Parser.testSuite=function(){var a=function(){window.console&&console.log&&console.log.apply(console,Array.prototype.slice.call(arguments,0))},b=0,c=0,d=+(new Date);Parser._testSuite(function(a,d,e){var f=new Tokenizer(d),g=[];try{(new Parser(d,f,g)).parse(),++b}catch(h){++c}}),a("Parser test suite finished ("+(+(new Date)-d)+" ms). ok:"+b+", fail:"+c)},Parser.regexLhsStart=/[\+\-\~\!\(\{\[]/,Parser.regexStartKeyOrReserved=/[bcdefinrstvw]/,Parser.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$/,Parser.regexAssignments=/^[\+\-\*\%\&\|\^\/]?=$|^\<\<\=$|^\>{2,3}\=$/,Parser.regexNonAssignmentExpressionOperators=/^[\+\-\*\%\|\^\&\!\~\?\/]$|^[\<\>]\=?$|^[\=\!]\=\=?$|^\<\<|\>\>\>?$|^\&\&$|^\|\|$/,Parser.regexUnaryKeywords=/^delete$|^void$|^typeof$|^new$/,Parser.regexUnaryOperators=/[\+\-\~\!]/,Parser.regexLiteralKeywords=/^this$|^null$|^true$|^false$/,Parser.Error=function(a,b){this.msg=Parser.Errors[a].msg,this.match=b},Parser.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"},ExpressionStatementMayNotStartWithFunction:{msg:"expression 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}"},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"}},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 HL=function(a){this.enableJslint=!0,this.jslintSettings={"missing block good":!0,"missing block bad":!0,"weak comparison":!0,"++ / --":!0},this.enableMarkLayer=!0,this.enableScopeLookupDepth=!0,this.lookupWarningLimit=!0,this.showTypeAnnotation=!0,this.minifyVarNamesToo=!0,this.textarea=a,this.scopes=[],this.initUI(),this.computeFontSizes()};HL.prototype={lastInput:"",tree:null,scopes:null,fontSize:0,charsX:0,charsY:0,caret:null,caretCol:0,caretRow:0,caretStale:!0,caretVisible:!1,caretLayer:null,markLayer:null,syntaxLayer:null,baseLeftPadding:0,defaultLeftPadding:5,showLineNumbers:!0,lineNumberPadding:10,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$/,regexBuiltinBadConstructors:/^Object$|^Array$|^String$|^Number$|^Boolean$|^Function$|^RegExp$|^Error$/,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,initUI:function(){var a=this.textarea,b=a.getElementsByClassName("text-editor")[0],c=Array.prototype.slice.call(b.querySelectorAll(".webkit-line-content"),0).map(function(a){return a.textContent}).join("\n");a=document.createElement("textarea"),a.value=c;var d=a.style;d.position="absolute",d.top="0",d.left="0",d.fontFamily="Menlo, monospace",d.fontSize="11px",b.appendChild(a),a.setAttribute("wrap","off"),a.setAttribute("nowrap","true"),a.setAttribute("spellcheck","false"),a.setAttribute("autocapitalize","off"),a.setAttribute("autocorrect","off");var e=document.createElement("div");e.className="zeon-root";var f=this.parentNode=document.createElement("div");this.syntaxLayer=document.createElement("div"),this.markLayer=document.createElement("div"),this.caretLayer=document.createElement("div"),this.caret=document.createElement("span"),this.css(e,{padding:"0"});var g=["position","top","left","width","height","float","display","margin-left","margin-top","margin-right","margin-bottom","background-color"];this.copyCss(a,e,g),this.css(e,{border:"0",overflow:"visible"}),this.css(f,{position:"relative",overflow:"hidden",border:"1px solid black"}),this.copyCss(a,f,["width","height"]);var h={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"};this.css([a,this.caretLayer,this.syntaxLayer,this.markLayer],h);var i=["font-family","font-size","line-height","vertical-align","word-spacing","letter-spacing","text-align"];this.copyCss(a,[this.syntaxLayer,this.caretLayer],i),this.css([this.syntaxLayer,this.caretLayer],"overflow","hidden"),this.css([this.caretLayer,this.syntaxLayer],"background-color","transparent"),this.css([a,this.markLayer,this.syntaxLayer,this.caretLayer],"border","0"),this.css(a,{color:"transparent",outline:"none",overflow:"auto"}),this.css(this.caret,{position:"absolute",top:"0",left:"0",width:"1px",height:"15px",backgroundColor:"blue"}),this.updatePaddingLeft(),this.ruler=document.createElement("div"),this.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 i=["box-sizing","font-family","font-size","font-weight","line-height","vertical-align","white-space"];this.copyCss(a,this.ruler,i),this.enableMarkLayer||this.css(this.markLayer,"display","none"),a.parentNode.insertBefore(e,a),this.syntaxLayer.appendChild(this.markLayer),f.appendChild(this.syntaxLayer),this.caretLayer.appendChild(this.caret),f.appendChild(this.caretLayer),f.appendChild(a),e.appendChild(f),this.createNav(f),this.initMinifyButton(),this.initBeautifyButton(),this.initConfigButton(f),this.initTreeButton();var j=document.createElement("div");this.css(j,{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"}),j.innerHTML="Z";var k=document.createElement("div");this.css(k,{position:"absolute",right:"0px",bottom:"0px",width:"60px",height:"60px",overflow:"hidden"}),k.onclick=function(){this.css(this.nav,"display",this.css(this.nav,"display")=="none"?"block":"none")}.bind(this),k.appendChild(j),f.appendChild(k),this.menuParent=k,this.initTextareaEvents(),setInterval(this.update.bind(this,!1),20)},initTextareaEvents:function(){var a=this.textarea;a.onkeydown=function(b){if(b.keyCode==9){b.preventDefault();var c=a.value,d=b.shiftKey,e=a.selectionStart,f=a.selectionEnd;if(e!=f){e=c.lastIndexOf("\n",e)+1;var g=c[f-1]=="\n",h=c.substring(0,e),i=c.substring(f-(g?1:0)),j=c.substring(e,f);d?(j[0]=="\t"&&(j=j.substring(1)),j=j.split("\n\t").join("\n")):(j=j.split("\n"),g&&j.pop(),j="\t"+j.join("\n\t")),a.value=h+j+i,a.selectionStart=e,a.selectionEnd=e+j.length}else a.value=a.value.substring(0,e)+"\t"+a.value.substring(e),a.selectionEnd=a.selectionStart=e+1}this.caretStale=!0,this.startCaretBlink()}.bind(this),a.onkeyup=function(a){this.caretStale=!0,this.startCaretBlink(),this.onTextareaSizeChange()}.bind(this),a.onkeypress=function(b){if(b.keyCode==13){var c=a.value,d=a.selectionStart,e=a.selectionEnd,f=c.substring(0,d),g=c.substring(e),h="";if(f){var i=f.lastIndexOf("\n",d)+1;i<0&&(i=0);var j=i;while(f[j]&&Tokenizer.regexWhiteSpace.test(f[j]))++j;h=f.substring(i,j),g=h+g}a.value=f+"\n"+g,a.selectionStart=a.selectionEnd=d+h.length+1;return!1}}.bind(this),a.onclick=function(){this.caretStale=!0,this.startCaretBlink()}.bind(this),a.onscroll=function(){this.autoScroll()}.bind(this),a.onchange=function(){this.onTextareaSizeChange()}.bind(this)},onTextareaSizeChange:function(){this.menuParent&&(this.textarea.scrollHeight>this.textarea.clientHeight!=this.hasHorizontalBar&&(this.hasHorizontalBar=!this.hasHorizontalBar,this.css([this.menuParent,this.nav],"right",this.hasHorizontalBar?"16px":"0")),this.textarea.scrollWidth>this.textarea.clientWidth!=this.hasVerticalBar&&(this.hasVerticalBar=!this.hasVerticalBar,this.css([this.menuParent,this.nav],"bottom",this.hasVerticalBar?"16px":"0")))},initMinifyButton:function(){var a=this.textarea;this.minifyButton=document.createElement("div"),this.css(this.minifyButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.minifyButton.innerHTML="Minify",this.minifyButton.onclick=function(){var b=a.selectionStart,c=a.selectionStop;a.value=this.minify(),a.selectionStart=b,a.selectionStop=c,a.focus()}.bind(this)},initBeautifyButton:function(){var a=this.textarea;this.beautifyButton=document.createElement("div"),this.css(this.beautifyButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.beautifyButton.innerHTML="Beautify",this.beautifyButton.onclick=function(){var b=a.selectionStart,c=a.selectionStop,d=this.SOURCE_ELS(this.tree);a.value=d.beautify(0),a.selectionStart=b,a.selectionStop=c,a.focus()}.bind(this)},initConfigButton:function(a){this.configButton=document.createElement("div"),this.css(this.configButton,{cursor:"pointer",backgroundColor:"white",color:"black",textDecoration:"underline",padding:"3px"}),this.configButton.innerHTML="Config",this.configButton.onclick=function(){if(!this.configPopup){var b=this.configPopup=document.createElement("div");this.css(b,{position:"absolute",top:"50px",left:"50px",zIndex:500,backgroundColor:"white",color:"black",fontSize:"12px",padding:"5px",border:"1px solid green",WebkitBorderRadius:"5px",borderRadius:"5px"});var c=document.createElement("div");c.innerHTML="<b>Config</b><br/><br/>",b.appendChild(c),this.createOption("toggle jslint",function(){this.enableJslint=!this.enableJslint,this.update(!0);return this.enableJslint}.bind(this),this.enableJslint),this.createLintOption("missing block good"),this.createLintOption("missing block bad"),this.createLintOption("weak comparison"),this.createLintOption("++ / --"),this.createOption("toggle markers",function(){this.enableMarkLayer=!this.enableMarkLayer,this.css(this.markLayer,"display",this.enableMarkLayer?"block":"none");return this.enableMarkLayer}.bind(this),this.enableMarkLayer),this.createOption("toggle scope depth",function(){this.enableScopeLookupDepth=!this.enableScopeLookupDepth,this.update(!0);return this.enableScopeLookupDepth}.bind(this),this.enableScopeLookupDepth),this.createOption("toggle ruler",function(){this.showLineNumbers=!this.showLineNumbers,this.showLineNumbers?this.css(this.ruler,"display","block"):this.css(this.ruler,"display","none"),this.updatePaddingLeft();return this.showLineNumbers}.bind(this),this.showLineNumbers),this.createOption("toggle type annotations",function(){this.showTypeAnnotation=!this.showTypeAnnotation,this.update(!0);return this.showTypeAnnotation}.bind(this),this.showTypeAnnotation),this.createOption("minify variable names",function(){return this.minifyVarNamesToo=!this.minifyVarNamesToo}.bind(this),this.minifyVarNamesToo),b.appendChild(document.createElement("br"));var d=document.createElement("div");this.css(d,"cursor","pointer"),d.innerHTML="close",d.onclick=function(){a.removeChild(b),this.configPopup=null}.bind(this),b.appendChild(d),a.appendChild(b)}}.bind(this)},createOption:function(a,b,c,d){var e=document.createElement("div");this.css(e,"cursor","pointer"),e.innerHTML=(d?" ":"")+'<input type="checkbox" '+(c?"checked ":"")+"/> "+a,e.onclick=function(){var a=b();e.getElementsByTagName("input")[0].checked=a},this.configPopup.appendChild(e)},createLintOption:function(a){this.createOption(a,function(){console.log(a,this.jslintSettings[a]),this.jslintSettings[a]=!this.jslintSettings[a],this.update();return this.jslintSettings[a]}.bind(this),this.jslintSettings[a],!0)},initTreeButton:function(){this.treeButton=document.createElement("div"),this.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.tree,b=function(a,c){var d=[];for(var e=0;e<a.length;++e)if(a[e]instanceof Array){var f=[];for(var g in a[e])a[e].hasOwnProperty(g)&&g!=+g+""&&!(a[e][g]instanceof Array)&&f.push(g+":"+this.noctrl(this.escape(a[e][g])));var h="\n"+Array(c+1).join("\t")+"[("+a[e].length+") "+f.join(", ");h+=b(a[e],c+1),h+="\n"+Array(c+1).join("\t")+"]",d.push(h)}else{var f=[];for(var g in a[e])a[e].hasOwnProperty(g)&&f.push(g+":"+this.noctrl(this.escape(a[e][g])));var h="\n"+Array(c+1).join("\t")+"{"+f.join(", ")+"}";d.push(h)}return d.join()}.bind(this);a.root=!0;var c=b([a],0),d=document.createElement("pre");this.css(d,{position:"absolute",zIndex:500,backgroundColor:"white",color:"black",padding:"5px",border:"1px solid black",fontSize:"12px"}),d.innerHTML=c;var e=document.createElement("div");this.css(e,"cursor","pointer"),e.innerHTML="Close",e.onclick=function(){document.body.removeChild(d)},d.insertBefore(e,d.firstChild),document.body.insertBefore(d,document.body.firstChild)}.bind(this)},updatePaddingLeft:function(){var a=this.defaultLeftPadding+(this.showLineNumbers?this.lineNumberPadding:0);this.css([this.syntaxLayer,this.caretLayer,this.textarea],"padding-left",a+"px"),this.css([this.markLayer],"margin-left",a+"px"),this.onTextareaSizeChange()},phase0:function(a){var b=this.SOURCE_ELS(a);this.struct=b},SOURCE_ELS:function(a){var b=[];b.type="SOURCE_ELS",b.isSOURCEELS=!0;for(var c=0;c<a.length;++c){var d=a[c];if(d instanceof Array)if(d.desc=="func decl")b.push(this.FUNCDECL(d));else if(d.desc=="statement")b.push(this.STATEMENT(d));else if(d.desc=="statement-parent")b.push(this.SOURCE_ELS(d)[0]);else if(d.desc=="var decl")b.push(this.VAR(d[0]));else if(d.desc=="expressions")b.push(this.EXPRESSIONS(d));else throw console.log(["array error",a]),"unknown type here: "+d.desc;else if(d.value==";")b.push(this.EMPTY());else if(d.value!="{"&&d.value!="}"&&d.name!=13&&!d.isWhite)throw console.log(["non array error",d,a]),"unknown token here: "+d}b.beautify=function(a){a|=0;var b=this.map(function(b,c){return(c?a.tabs():"")+b.beautify(a)+(b.isEXPRESSIONS?";":"")+"\n"});return b.join("")};return b},FUNCDECL:function(a){var b={type:"FUNCDECL",isFUNCDECL:!0,args:[]};for(var c=0;c<a.length;++c){var d=a[c];if(c==0)b.firstToken=d;else if(d.name==2&&!b.headerStart)b.name=d;else if(d.value=="(")b.headerStart=d;else if(d.name==2)b.args.push(d);else if(d.desc=="func body"){b.bodyStart=d,b.body=this.SOURCE_ELS(d);break}}b.beautify=function(a){return"function "+b.name.value+"("+b.args.map(function(a){return a.value}).join(",")+") {\n"+(a+1).tabs()+b.body.beautify(a+1)+a.tabs()+"}"};return b},FUNCEXPR:function(a){var b={type:"FUNCEXPR",isFUNCEXPR:!0,args:[]};for(var c=0;c<a.length;++c){var d=a[c];if(c==0)b.firstToken=d;else if(d.name==2&&!b.headerStart)b.name=d;else if(d.value=="(")b.headerStart=d;else if(d.name==2)b.args.push(d);else if(d.desc=="func body"){b.bodyStart=d,b.body=this.SOURCE_ELS(d);break}}b.beautify=function(a){return"function"+(b.name?" "+b.name.value:"")+"("+b.args.map(function(a){return a.value}).join(",")+"){\n"+(a+1).tabs()+b.body.beautify(a+1)+a.tabs()+"}"};return b},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);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);throw console.log(["statement?",a]),"unknown statement: "+a.sub}},IF:function(a){var b={type:"IF",isIF:!0,firstToken:a[0],hasElse:!1};for(var c=0;c<a.length;++c){var d=a[c];if(d.statementHeaderStart)b.headerStart=d;else if(d.desc=="expressions")b.condition=this.EXPRESSIONS(d);else if(d.desc=="statement-parent"&&!b.hasElse)b.ifStatement=this.STATEMENT(d);else if(d.sub=="else"){b.hasElse=!0;for(var e=0;e<d.length;++e){var f=d[e];f.value=="else"?b.elseToken=f:f.desc=="statement-parent"&&(b.elseStatement=this.STATEMENT(f))}}}b.beautify=function(a){return"if ("+b.condition.beautify(a)+") "+b.ifStatement.beautify(a)+(b.hasElse?"\n"+a.tabs()+"else "+b.elseStatement.beautify(a):"")};return b},DEBUGGER:function(a){return{type:"DEBUGGER",isDEBUGGER:!0,firstToken:a[0],beautify:function(){return"debugger;"}}},WHILE:function(a){var b={type:"WHILE",isWHILE:!0,firstToken:a[0]};for(var c=0;c<a.length;++c){var d=a[c];if(d.statementHeaderStart)b.headerStart=d;else if(d.desc=="expressions")b.condition=this.EXPRESSIONS(d);else if(d.desc=="statement-parent"){b.statement=this.STATEMENT(d);break}}b.beautify=function(a){return"while ("+b.condition.beautify(a)+") "+b.statement.beautify(a)};return b},FOR_IN:function(a){var b={type:"FOR_IN",isFORIN:!0,firstToken:a[0],left:null,op:null,right:null};for(var c=0;c<a.length;++c){var d=a[c];if(d.statementHeaderStart)b.headerStart=d;else if(d.desc=="expressions"&&!b.left)b.left=this.EXPRESSIONS(d);else if(d.desc=="var decl"&&!b.left)b.left=this.VAR(d);else if(d.desc=="expressions"&&!b.right)b.right=this.EXPRESSIONS(d);else if(d.value=="in")b.op=d;else if(d.desc=="statement-parent"){b.statement=this.STATEMENT(d);break}}b.beautify=function(a){return"for ("+b.left.beautify(a,!0)+" in "+b.right.beautify(a)+") "+b.statement.beautify(a)};return b},FOR_EACH:function(a){var b={type:"FOR_EACH",firstToken:a[0],isFOREACH:!0,left:null,one:null,mid:null,two:null,right:null},c=0;for(var d=0;d<a.length;++d){var e=a[d];if(e.statementHeaderStart)b.headerStart=e;else if(e.desc=="expressions")c==0?b.left=this.EXPRESSIONS(e):c==1?b.mid=this.EXPRESSIONS(e):c==2&&(b.right=this.EXPRESSIONS(e));else if(e.desc=="var decl")b.left=this.VAR(e);else if(e.value==";")++c,c==1?b.one=e:c==2&&(b.two=e);else if(e.desc=="statement-parent"){b.statement=this.STATEMENT(e);break}}b.beautify=function(a){return"for ("+(b.left?b.left.beautify(a)+(b.left.isEXPRESSIONS?";":""):";")+(b.mid?" "+b.mid.beautify(a):"")+";"+(b.right?" "+b.right.beautify(a):"")+") "+b.statement.beautify(a)};return b},BLOCK:function(a){var b=[],c={type:"BLOCK",isBLOCK:!0,firstToken:a[0],statements:b};for(var d=0;d<a.length;++d)a[d].value=="{"?c.curlyOpen=a[d]:a[d].value=="}"?c.curlyClose=a[d]:a[d].desc=="statement-parent"&&b.push(this.STATEMENT(a[d][0]));c.beautify=function(a){a|=0;var c="{\n";++a,c+=b.map(function(b){return a.tabs()+b.beautify(a)+(b.isEXPRESSIONS?";":"")+"\n"}).join(""),--a,c+=a.tabs()+"}";return c};return c},VAR:function(a){var b={type:"VAR",isVAR:!0,firstToken:a[0],decls:[]};for(var c=0;c<a.length;++c){var d=a[c];d.desc=="single var decl"&&b.decls.push(this.VAR_DECL(d))}b.beautify=function(a,c){return"var "+b.decls.map(function(b){return b.beautify(a)}).join(", ")+(c?"":";")};return b},VAR_DECL:function(a){var b={type:"VAR_DECL",isVARDECL:!0,initializer:null};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):"")};return b},EMPTY:function(a){return{type:"EMPTY",isEMPTY:!0,firstToken:a,beautify:function(){return";"}}},LABEL:function(a){a=a[0][0][0];var b={type:"LABEL",isLABEL:!0,name:a[0]};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)};return b},TRY:function(a){var b={type:"TRY",isTRY:!0,firstToken:a[0],catchKeyword:null,catchBlock:null,finallyKeyword:null,finallyBlock:null};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};return b},SWITCH:function(a){var b={type:"SWITCH",isSWITCH:!0,firstToken:a[0],clauses:[]},c=null;for(var d=0;d<a.length;++d){var e=a[d];e.desc=="expressions"?b.condition=this.EXPRESSIONS(e):e.value=="("?b.headerStart=e:e.desc=="switch clause header"?c=e:e.desc=="switch clause body"&&b.clauses.push(this.CLAUSE(c,e))}b.beautify=function(a){var c="switch ("+b.condition.beautify(a)+") {\n";++a;for(var d=0;d<b.clauses.length;++d)c+=b.clauses[d].beautify(a);--a,c+="\n"+a.tabs()+"}";return c};return b},CLAUSE:function(a,b){var c={type:"CLAUSE",isCLAUSE:!0,clauseType:a.sub=="case"?"case":"default",firstToken:a[0][0],condition:null,statements:null};c.clauseType=="case"?(c.condition=this.EXPRESSIONS(a[1][0]),c.colon=a[2][0]):c.colon=a[1][0],b.length&&(c.statements=this.SOURCE_ELS(b)),c.beautify=function(a){var b=a.tabs();c.clauseType=="case"?b+="case "+c.condition.beautify(a)+":\n":b+="default:\n",c.statements&&(b+=(++a).tabs()+c.statements.beautify(a));return b};return c},DO:function(a){var b={type:"DO",isDO:!0,firstToken:a[0]};for(var c=0;c<a.length;++c)a[c].desc=="statement-parent"?b.statement=this.STATEMENT(a[c]):a[c].desc=="expressions"?b.expression=this.EXPRESSION(a[c]):a[c].value=="while"&&(b.whileToken=a[c]);b.beautify=function(a){return"do "+b.statement.beautify(a)+" while ("+b.expression.beautify(a)+");"};return b},RETURN:function(a){var b={type:"RETURN",isRETURN:!0,firstToken:a[0]};for(var c=0;c<a.length;++c)if(a[c].desc=="expressions"){b.arg=this.EXPRESSIONS(a[c]);break}b.beautify=function(a){return"return"+(b.arg?" "+b.arg.beautify(a):"")+";"};return b},BREAK:function(a){var b={type:"BREAK",isBREAK:!0,firstToken:a[0]};for(var c=0;c<a.length;++c)if(a[c].desc=="expressions"){b.arg=this.EXPRESSIONS(a[c]);break}b.beautify=function(a){return"break"+(b.arg?" "+b.arg.beautify(a):"")+";"};return b},CONTINUE:function(a){var b={type:"CONTINUE",isCONTINUE:!0,firstToken:a[0]};for(var c=0;c<a.length;++c)if(a[c].desc=="expressions"){b.arg=this.EXPRESSIONS(a[c]);break}b.beautify=function(a){return"continue"+(b.arg?" "+b.arg.beautify(a):"")};return b},THROW:function(a){var b={type:"THROW",isTHROW:!0,firstToken:a[0]};for(var c=0;c<a.length;++c)if(a[c].desc=="expressions"){b.arg=this.EXPRESSIONS(a[c]);break}b.beautify=function(a){return"throw "+b.arg.beautify(a)+";"};return b},EXPRESSIONS:function(a){var b=[];b.type="EXPRESSIONS",b.isEXPRESSIONS=!0;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(", ")};return b},EXPRESSION:function(a){var b={type:"EXPRESSION",isEXPRESSION:!0,isTriple:!1};b.beautify=function(a){return b.lhs.beautify(a)+(b.isTriple?" "+b.op+" "+b.rhs.beautify(a):"")};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());if(!c.length)return d;while(c.length>1){var e=c.shift();if(!e)throw"wtf?";if(e.value==".")d=this.DOT(d,e,c.shift());else if(e.value=="[")d=this.DYNPROP(d,e,c.shift(),c.shift());else if(e.value=="(")c[0].value==")"?d=this.CALL(d,e,null,c.shift()):d=this.CALL(d,e,c.shift(),c.shift());else throw"unknown infix"}var f={type:"SUBEXPRESSION",lead:d};f.beautify=function(a){return f.lead.beautify(a)};return f},LEAD:function(a){var b={type:"LEAD",isLEAD:!0,token:a};b.beautify=function(a){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)};d.beautify=function(a){return d.lhs.beautify(a)+"."+d.rhs.beautify(a)};return d},DYNPROP:function(a,b,c,d){var e={type:"DYNPROP",isDYNPROP:!0,lhs:a,leftBracket:b,expression:this.EXPRESSIONS(c),rightBracket:d};e.beautify=function(b){return a.beautify(b)+"["+e.expression.beautify(b)+"]"};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};e.beautify=function(a){return e.lhs.beautify(a)+"("+(e.expression?e.expression.beautify(a):"")+")"};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))};c.beautify=function(a){return c.op.value+" "+c.rhs.beautify(a)};return c},GROUP:function(a){var b={type:"GROUP",isGROUP:!0,leftParen:a[0]};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)+")"};return b},OBJLIT:function(a){var b=[],c={type:"OBJLIT",isOBJLIT:!0,pairs:b};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(", ")+"}"};return c},OBJLITPAIR:function(a){var b={type:"OBJLITPAIR",isOBJLITPAIR:!0};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)};return b},ARRLIT:function(a){var b=[],c={type:"ARRLIT",isARRLIT:!0,elements:b},d;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(", ")+"]"};return c},ELISION:function(a){return{type:"ELISION",isELISION:!0,beautify:function(){return""}}},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]},css:function(a,b,c){if(a instanceof Array)return a.map(function(a){return this.css(a,b,c)},this);if(b instanceof Object)for(var d in b)this.css(a,d,b[d]);else{if(!c){var f=document.defaultView.getComputedStyle(a,null);return f.getPropertyValue(b)}var e=b.replace(/-./g,function(a){return a.substring(1).toUpperCase()});a.style[e]=c}},copyCss:function(a,b,c){if(b instanceof Array)for(var d=0;d<b.length;++d)this.copyCss(a,b[d],c);else if(c instanceof Array)for(var d=0;d<c.length;++d)this.copyCss(a,b,c[d]);else if(a instanceof Array)for(var d=0;d<a.length;++d)this.copyCss(a[d],b,c);else{var e=c.replace(/-./g,function(a){return a.substring(1).toUpperCase()}),f=c.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()});b.style[e]=this.css(a,f)}},getSize:function(a){return{w:parseInt(this.css(a,"width"),10),h:parseInt(this.css(a,"height"),10)}},getSizef:function(a){return{w:parseFloat(this.css(a,"width")),h:parseFloat(this.css(a,"height"))}},escape:function(a){if(typeof a!="string")return a;return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},noctrl:function(a){if(typeof a!="string")return a;return a.replace(/\n/g,"\u21b5").replace(/\t/g,"\\t")},computeFontSizes:function(){this.fontSize=this.getFontSize(),this.charsX=this.getSize(this.textarea).w/this.fontSize.w,this.charsY=this.getSize(this.textarea).h/this.fontSize.h},getFontSize:function(){var a=document.createElement("span"),b=["box-sizing","white-space","font-family","font-size","font-weight","line-height","vertical-align","word-spacing","letter-spacing","text-align"];this.copyCss(this.textarea,a,b),a.style.position="absolute",a.style.width="auto",a.style.height="auto",document.body.appendChild(a);var c=this.getSizef(a);a.innerHTML="x";var d=this.getSizef(a);document.body.removeChild(a);return{w:d.w-c.w,h:d.h-c.h}},getViewportRange:function(){var a={x:Math.floor(this.textarea.scrollLeft/this.fontSize.w),y:Math.floor(this.textarea.scrollTop/this.fontSize.h)},b={x:Math.ceil(this.textarea.scrollLeft/this.fontSize.w+this.charsX),y:Math.ceil(this.textarea.scrollTop/this.fontSize.h+this.charsY)},c={from:a,to:b};return c},matchToColRow:function(a){var b=this.lines[a.startLineId].start,c=Math.min(this.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}},countOccurrence:function(a,b,c,d){if(c==d)return 0;var e=c||0;d=d||a.length;var f=0;while((e=a.indexOf(b,e)+1)&&e<=d)++f;return f},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"},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},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},autoScroll:function(){this.syntaxLayer.scrollLeft=this.textarea.scrollLeft,this.syntaxLayer.scrollTop=Math.floor(this.textarea.scrollTop),this.updateCaretPos()},startProcess:function(a){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:[]};var b=this.globalScope=a.scope;this.addEcmaBuiltIns(b),this.processTree(this.tree),this.lastMatch&&(this.currentLine.stop=this.lastMatch.stop,delete this.currentLine)},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"]})},processTree:function(a){this.phase1(a),this.phase2(a),this.phase3(a)},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(!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,f,g,h,i){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&&!Parser.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 j=a.start;while((j=this.lastInput.indexOf("\n",j))>=0&&j<a.stop)++j,this.currentLine.stop=j,this.currentLine=[],this.currentLine.lineId=this.lines.length,this.currentLine.coveredBytoken=a,this.lines.push(this.currentLine),this.currentLine.start=j}},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=="["?(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,f){var g=this.linearTreeNoWhite;a.isFunction&&a.stops==0&&g[a.nextTreeId]&&g[a.nextTreeId].value=="function"&&(g[a.nextTreeId].varType||(g[a.nextTreeId].varType=[]),g[a.nextTreeId].varType.push("undefined")),a.desc=="statement"&&g[a.nextTreeId]&&g[a.nextTreeId].value=="new"&&(g[a.nextTreeId].jslint="new statement"),a.lastJsdoc&&this.processJsdoc(a);if(this.enableJslint&&a.isGroupStart&&a[0].value=="("){var h=g[a[0].linearNoWhitePosition+1];h&&h.value=="function"&&a[a.length-1].value==")"&&g[a[a.length-1].linearNoWhitePosition-1].value=="}"&&(a[0].jslint="function wrapped")}this.phase2(a,b,c,d,e,f),a.desc=="expression"&&Parser.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 i=0;while(a[++i]&&a[i].isWhite);if(a[i].desc=="expressions"){var j=this.getType(a[i]),k=d[0];k.varType||(k.varType=[]),typeof j=="string"?k.varType.push(j):j?j.value=="new"?j.targetExpression&&j.targetExpression.constructorName?k.varType.push(j.targetExpression.constructorName):k.varType.push("new-object-instance(todo)"):j.isObjectLiteralStart?k.varType.push("Object"):j.isArrayLiteralStart?k.varType.push("Array"):j.isFunction?k.varType.push("Function"):j instanceof Array&&j.forEach(function(a){typeof a=="string"&&k.varType.push(a)}):k.varType.push("unknown-type")}}if(d&&a.sub=="throw"&&!a[0].unreachableCode){var i=0;while(a[++i]&&a[i].isWhite);var k=d[0];k.throws||(k.throws=[]);var l=this.getType(a[i]);typeof l=="string"?k.throws.push(l):l?l.value=="new"?l.targetExpression&&l.targetExpression.constructorName?k.throws.push(l.targetExpression.constructorName):k.throws.push("new-object-instance(todo)"):l.isObjectLiteralStart?k.throws.push("Object"):l.isArrayLiteralStart?k.throws.push("Array"):l.isFunction?k.throws.push("Function"):l instanceof Array?l.forEach(function(a){typeof a=="string"&&k.throws.push(a)}):k.throws.push("unknown-type"):k.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)},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)},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.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.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.linearNoWhitePosition&&this.regexBuiltinBadConstructors.test(a.value)&&g[a.linearNoWhitePosition-1].value=="new")a.jslint="bad constructor";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)throw"no tracking obejct?";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}}}},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=Parser;this.markLayer.innerHTML="";var b=this.lines,c=[],d=[];d.push("font-family:"+this.css(this.textarea,"font-family").replace(/"/g,"'")+";"),d.push("font-size:"+this.css(this.textarea,"font-size")+";"),d.push("font-weight:"+this.css(this.textarea,"font-weight")+";"),d.push("line-height:"+this.css(this.textarea,"line-height")+";");for(var e=0;e<b.length;++e)for(var f=0;f<b[e].length;++f){var g=b[e][f];if(g.name==13){var h=this.linearTreeNoWhite[g.linearNoWhitePosition-1]||g;this.showAsiMark(h)}else if(g.name==14){var h=this.linearTreeNoWhite[g.linearNoWhitePosition-1]||g;this.showErrorMark(h),g.tokenError&&c.push('<span style="'+this.syntaxColorSettings.error+d.join("")+'">'+g.value+"</span>")}else{var i=[],j=["color:black;"].concat(d);g.leadValue&&j.push(this.syntaxColorSettings.leadValue);if(g.varNameDecl){if(g.wasAlreadyDeclared){var k={color:"black",backgroundColor:"orange"};this.showCharacter("vv",g,k)}if(!g.trackingObject.used&&(g.meta!="parameter"&&!g.isCatchVar||g.value!="_")){var k={color:"black",backgroundColor:"orange",textDecoration:"line-through"};this.showCharacter("u",g,k),j.push(this.syntaxColorSettings.unusedVar),this.collects.unused.push(g)}}else g.isLabel?(j.push(this.syntaxColorSettings.label),g.labelNotFound?this.showCharacter("L",g,{color:"black",backgroundColor:"red",color:"white"}):g.duplicateLabel&&this.showCharacter("ll",g,{color:"black",backgroundColor:"red",color:"white"})):g.scopeLookupDepth===0?j.push(this.syntaxColorSettings.undefinedVar):g.scopeLookupDepth>0?j.push(this.syntaxColorSettings["lookupDepthx"+(g.scopeLookupDepth>9?"x":g.scopeLookupDepth)]):g.scopeLookupDepth<0&&!g.trackingObject.isEcma&&!g.trackingObject.isBrowser&&j.push(this.syntaxColorSettings.undefinedVar);g.propOverwritten&&(j.push(this.syntaxColorSettings.duplicateProperty),this.showCharacter("2x",g,k));if(g.isDevRelic){var k={color:"white",backgroundColor:"black"};this.showCharacter("d",g,k,12),j.push(this.syntaxColorSettings.relic)}if(g.scopeLookupDepth&&this.enableScopeLookupDepth&&(g.scopeLookupDepth<0||g.scopeLookupDepth>this.lookupWarningLimit)){var k={color:"black",backgroundColor:"yellow"};g.scopeLookupDepth<0&&(k={color:"black",backgroundColor:"orange",textDecoration:"line-through"}),this.showCharacter(Math.abs(g.scopeLookupDepth),g,k)}if(g.prematureUsage&&!g.trackingObject.isFuncDecl){var k={color:"black",backgroundColor:"yellow"};this.showCharacter("P",g,k,12),j.push(this.syntaxColorSettings.prematureUsage)}g.emptyStatement&&this.showCharacter("ε",g,{color:"black",backgroundColor:"orange"}),g.trackingObject&&(g.trackingObject.isEcma?j.push(this.syntaxColorSettings.ecma):g.trackingObject.isBrowser&&j.push(this.syntaxColorSettings.browser)),g.duplicatePropertyDecl&&this.showCharacter("℘",g,{color:"black",backgroundColor:"orange"}),g.badPrefixOperand&&this.showCharacter("!",g,{color:"white",backgroundColor:"red"}),g.unreachableCode&&this.showCharacter("\u2620",g,{color:"black",border:"0",fontSize:"18px"},-8,10),g.jslint&&this.enableJslint&&this.showJslintWarnings(g),g.isDirective&&this.showCharacter("D",g,{color:"white",backgroundColor:"green"}),(g.trackingObject&&(g.meta=="func decl name"||g.meta=="var name")&&g.trackingObject.isConstructor||g.value=="function"&&g.isConstructor)&&this.showCharacter("*",g,{color:"white",backgroundColor:"green",lineHeight:"10px"}),this.annotateType(g),g.name==2&&a.regexIsKeywordOrReserved.test(g.value)?j.push(this.syntaxColorSettings.keyword):g.name==1?j.push(this.syntaxColorSettings.regex):g.name==2?j.push(this.syntaxColorSettings.identifier):g.name==3?j.push(this.syntaxColorSettings.hex):g.name==4?j.push(this.syntaxColorSettings.dec):g.name==5?j.push(this.syntaxColorSettings.singleString):g.name==6?j.push(this.syntaxColorSettings.doubleString):g.name==7?j.push(this.syntaxColorSettings.singleComment):g.name==8?j.push(this.syntaxColorSettings.multiComment):g.name==9?j.push(this.syntaxColorSettings.whitespace):g.name==10?j.push(this.syntaxColorSettings.lineTerminator):g.name==11&&j.push(this.syntaxColorSettings.punctuator);if(g.name==8&&g.jsdoc){c.push('<span style="'+j.join("")+'" '+i.join(" ")+">"+g.jsdoc.map(function(a){if(a instanceof Array){var b=this.escape(a[1]);b+='<span style="'+this.syntaxColorSettings.jsdocPragma+'">@'+this.escape(a[3])+"</span>";if(a[3]!="param"&&a[3]!="var")return b+this.escape(a[4]||"")+this.escape(a[5]||"");b+=this.escape(a[4]||"");b+=typeof a[6]=="string"?'<span style="'+this.syntaxColorSettings.jsdocFirstParam+'">'+this.escape(a[6])+"</span>":"";b+=this.escape(a[7]||"");b+=typeof a[8]=="string"?'<span style="'+this.syntaxColorSettings.jsdocSecondParam+'">'+this.escape(a[8])+"</span>":"";b+=this.escape(a[9]||"");b+=typeof a[10]=="string"?'<span style="'+this.syntaxColorSettings.jsdocRest+'">'+this.escape(a[10])+"</span>":"";return b}return this.escape(a)},this).join("\n")+"</span>")}else{c.push('<span style="'+j.join("")+'" '+i.join(" ")+">"+this.escape(g.value)+"</span>")}}}return c.join("")},showJslintWarnings:function(a){a.jslint&&this.collects.jslints.push(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"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.showTypeAnnotation){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.getUniqueItems(b);if(b.indexOf("Array")>=0||b.indexOf("Function")>=0)b=b.filter(function(a){return a!="Object"});var c=4;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.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:"3px",border:"1px solid black"},g=this.tabMagic(this.lastInput,this.lines[a.startLineId].start,a.start),i=a.startLineId;this.showMark(g,i,f,0,17)}},this)}}},addLineNumbers:function(){var a=[];for(var b=0;b<this.lines.length;++b)a[b]=b+1;this.lineNumberPadding=(this.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(){this.css(this.syntaxLayer,{display:"none"});var a;while(a=this.syntaxLayer.firstChild)this.syntaxLayer.removeChild(a);var b=+(new Date),c=this.lastInput,d=this.getOutput()+'\n\n\n\n<span style="color:transparent;">secret anti-cropper</span>';this.debug("output time: "+(+(new Date)-b)+" ms");var b=+(new Date),e=this.lastMatch?this.lastMatch.stop:0;e!=c.length&&(d+='<span style="color:red; background-color: #ccc;">'+c.substring(e)+"</span>"),this.syntaxLayer.innerHTML=d,this.syntaxLayer.insertBefore(this.markLayer,this.syntaxLayer.firstChild),this.addLineNumbers(),this.debug("display time: "+(+(new Date)-b)+" ms"),this.css(this.syntaxLayer,{display:"block"})},computeCaretPos:function(){if(!!this.lines){if(this.lines.length==0)return;this.caretStale=!1;var a=this.textarea.selectionStart,b=this.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.lines){this.caretStale=!1;if(this.lines.length==0)return;var a=this.textarea.selectionStart,b=this.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(e);if(e){var f=Math.max(e.start,this.lines[this.caretRow].start),g=Math.min(e.stop,this.lines[this.caretRow].stop),h=this.tabMagic(this.lastInput,this.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.linearTree[e.linearPosition-1].twin&&(c=this.linearTree[e.linearPosition-1],d=this.linearTree[e.linearPosition-1].twin);if(e.trackingObject&&e.trackingObject.properties){var j={backgroundColor:"rgb(255, 0, 255)",color:"white",zIndex:5},k="(to.props)<br/>";e.trackingObject.isConstructor&&(k+="Constructor: "+e.trackingObject.constructorName+"<br/>"),k+="Type(s):"+this.getUniqueItems(e.trackingObject.varType).join(",")+"<br/>",k+="Properties:<br/>"+this.getUniqueItems(Object.keys(e.trackingObject.properties)).join("<br/>");var l=this.tabMagic(this.lastInput,this.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/>";e.isConstructor&&(k+="Constructor: "+e.constructorName+"<br/>"),k+="Type(s):"+(e.trackingObject?this.getUniqueItems(e.trackingObject.varType).join(","):e.varType?this.getUniqueItems(e.varType).join(","):"Unknown")+"<br/>",k+="Properties:<br/>"+this.getUniqueItems(Object.keys(e.definedProperties)).join("<br/>");var l=this.tabMagic(this.lastInput,this.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/>";e.trackingObject.isConstructor&&(k+="Constructor: "+e.trackingObject.constructorName+"<br/>"),k+="Type(s):"+this.getUniqueItems(e.trackingObject.varType).join(",")+"<br/>",p&&(k+="From prototype:<br/>"+Object.keys(p).join("<br/>")+"<br/>");var l=this.tabMagic(this.lastInput,this.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.getUniqueItems(e.varType).join(","));var r="none";e.throws&&e.throws.length&&(r=this.getUniqueItems(e.throws).join(","));var k="Returns: "+q+"<br/>Throws: "+r+"<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.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/>";e.isConstructor&&(k+="Constructor: "+e.constructorName+"<br/>"),k+="Type(s):"+this.getUniqueItems(e.varType).join(",")+"<br/>";var l=this.tabMagic(this.lastInput,this.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.getType(e.expressionArg||e.twin.expressionArg);s instanceof Array&&(s=this.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/>",l=this.tabMagic(this.lastInput,this.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.lines[u.startLineId].start,u.start),m=u.startLineId;b[b.length]=this.showMark(l,m,j)}}e.name!=2}else this.linearTree[this.linearTree.length-1]&&this.linearTree[this.linearTree.length-1].twin&&(c=this.linearTree[this.linearTree.length-1].twin,d=this.linearTree[this.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.lines[c.startLineId]&&this.lines[d.startLineId]){var l=this.tabMagic(this.lastInput,this.lines[c.startLineId].start,c.start),m=c.startLineId;b[b.length]=this.showMark(l,m,j),l=this.tabMagic(this.lastInput,this.lines[d.startLineId].start,d.start),m=d.startLineId,b[b.length]=this.showMark(l,m,j)}}},showAsiMark:function(a){var b=this.matchToColRow(a),c=document.createElement("span"),d=this.colRowToXY(b.col,b.row),e={position:"absolute",left:-2+Math.floor(d.x)+"px",top:8+Math.floor(d.y)+"px",width:"2px",height:"8px",backgroundColor:"red"};e&&this.css(c,e),this.markLayer.appendChild(c);return c},showErrorMark:function(a){var b=this.matchToColRow(a),c=document.createElement("span"),d=this.colRowToXY(b.col,b.row),e={position:"absolute",left:-10+Math.floor(d.x)+"px",top:Math.floor(d.y)+"px",width:"20px",height:"20px",border:"1px solid red",WebkitBorderRadius:"10px",borderRadius:"10px"};e&&this.css(c,e),this.markLayer.appendChild(c);return c},showMark:function(a,b,c,d,e,f){typeof d!="number"&&(d=0),typeof e!="number"&&(e=0);var g=document.createElement("span");f!=null&&(g.innerHTML=f);var h=this.colRowToXY(a,b);this.css(g,{position:"absolute",left:d+Math.floor(h.x)+"px",top:e+Math.floor(h.y)+"px"}),c&&this.css(g,c),this.markLayer.appendChild(g);return g},showCharacter:function(a,b,c,d,e){typeof d!="number"&&(d=0),typeof e!="number"&&(e=0);var f=b.startLineId,g=this.tabMagic(this.lastInput,this.lines[b.startLineId].start,b.start),h=this.colRowToXY(g,f),i=document.createElement("span");i.innerHTML=a,this.css(i,{position:"absolute",left:-8+d+Math.floor(h.x)+"px",top:-3+e+Math.floor(h.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}),this.css(i,c),this.markLayer.appendChild(i)},update:function(a){var b=this.textarea.value;if(!!a||b!=this.lastInput){this.lastInput=b;var c=document.getElementById("dbg");c&&(c.innerHTML="");var d=!1,e=+(new Date),f=new Tokenizer(b);this.tree=[];var g=new Parser(b,f,this.tree);g.parse();var d=g.errorStack.length;d&&this.debug('<span style="color:red;">Ignored '+f.errorStack.length+" / "+g.errorStack.length+" errors. First:</span> "+g.errorStack[0].msg),this.debug("parse time: "+(+(new Date)-e)+" ms");var e=+(new Date);this.startProcess(this.tree),this.debug("post process time: "+(+(new Date)-e)+" ms"),this.lastMatch?this.lastMatch.stop==b.length?d?this.debug('<span style="color:red;">failed, incomplete script</span>. Line: '+f.line+", col: "+f.column):this.debug("success"):this.debug('<span style="color:red;">incomplete</span>',this.lastMatch.stop,"vs",b.length,". Line: "+f.line+", col: "+f.column):this.debug('<span style="color:red;">failed, no tokens parsed</span>'),this.refreshSyntaxHighlight(),this.onTextareaSizeChange(),this.startCaretBlink(),this.autoScroll(),this.updateNav()}},createNav:function(a){this.nav=document.createElement("div"),this.nav.className="zeon-nav",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.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"}),a.appendChild(this.nav),this.css(this.nav,"display","none");var b=document.createElement("a");this.css(b,{position:"absolute",top:"3px",right:"3px"}),b.href="http://zeonjs.com/",b.innerHTML="xxxxx",this.nav.appendChild(b);var c=document.createElement("div");this.css(c,{position:"absolute",top:"15px",left:"5px",right:"20px",textAlign:"center"}),a.appendChild(c),this.navMessage=document.createElement("span"),this.css(this.navMessage,{backgroundColor:"white",color:"red",fontWeight:900,border:"1px solid red",padding:"5px",display:"none",WebkitBorderRadius:"10px",borderRadius:"10px"}),c.appendChild(this.navMessage);var d=document.createElement("div");d.className="maximize",this.css(d,{position:"absolute",top:"2px",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"}),d.innerHTML="+",this.parentNode.appendChild(d);var e=null;d.onclick=function(){e?(this.css(this.parentNode,{position:"relative",width:"100%",height:"100%",backgroundColor:"transparent"}),e.appendChild(this.parentNode),e=null,d.innerHTML="+"):(e=this.parentNode.parentNode,this.css(this.parentNode,{position:"absolute",top:"1%",left:"1%",width:"98%",height:"98%",zIndex:"9000",backgroundColor:"white"}),d.innerHTML="-")}.bind(this);var f=this;this.nav.onclick=function(a){var b=a.target.parentNode.className,c=f.lastNavPos[b],d=a.target.className,e=a.target.parentNode.querySelector(".data");if(d=="prev"||d=="next"||d=="data"){d=="prev"?c<=0?f.lastNavPos[b]=Math.max(0,f.collects[b].length-1):--f.lastNavPos[b]:d=="next"&&(++f.lastNavPos[b],f.lastNavPos[b]>=f.collects[b].length&&(f.lastNavPos[b]=0)),e.innerHTML=f.lastNavPos[b];var g=f.collects[b][f.lastNavPos[b]];g&&(f.showCircleAtMatch(g,b),b=="errors"?(f.navMessage.innerHTML=g.error.msg,f.css(f.navMessage,"display","inline"),setTimeout(function(){f.css(f.navMessage,"display","none")},5e3)):b=="jslints"&&(f.navMessage.innerHTML=g.jslint,f.css(f.navMessage,"display","inline"),setTimeout(function(){f.css(f.navMessage,"display","none")},5e3)))}return!1}},showCircleAtMatch:function(a,b){this.lastFocusCircle&&this.lastFocusCircle.parentNode&&this.lastFocusCircle.parentNode.removeChild(this.lastFocusCircle);var c=this.matchToColRow(a),d=this.lastFocusCircle=document.createElement("span"),e=this.colRowToXY(c.col-(b!="asis"&&b!="errors"?a.value.length:0),c.row),f=-20+Math.floor(e.x),g=-12+Math.floor(e.y),h={position:"absolute",left:f+"px",top:g+"px",width:"40px",height:"40px",border:"3px solid blue",WebkitBorderRadius:"30px",borderRadius:"30px"};h&&this.css(d,h),this.markLayer.appendChild(d),this.textarea.scrollLeft=Math.max(0,f-200),this.textarea.scrollTop=Math.max(0,g-300);return d},createNavRow:function(a,b){this.lastNavPos[a]>=this.collects[a].length&&(this.lastNavPos[a]=Math.max(0,this.collects[a].length-1));return'<div class="'+a+'">'+'<span class="prev" style="cursor:pointer; margin-left:5px; user-select:none; -webkit-user-select:none;"><</span> '+'<span class="data" style="cursor:pointer; user-select:none; -webkit-user-select:none;">'+(this.collects[a].length?this.lastNavPos[a]+1:0)+"</span> "+'<span class="next" style="cursor:pointer; user-select:none; -webkit-user-select:none;">></span> '+b+": "+this.collects[a].length+"x"+"</div>"+""},updateNav:function(){this.nav.innerHTML='<div><a href="http://zeonjs.com/" target="_blank" style="float:right; font-family:monospace; color:black;">Zeon.js</a>Len: '+this.lastInput.length+"</div>"+"<div>Lines: "+this.lines.length+"</div>"+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")+"",this.css(this.navMessage,"display","none"),this.nav.appendChild(this.minifyButton),this.nav.appendChild(this.beautifyButton),this.nav.appendChild(this.configButton),this.nav.appendChild(this.treeButton)},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.minifyVarNamesToo){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("")},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...",a)},c.onerror=function(a){console.log("There was an error reading the file...",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},HL.start=function(a){var b=!1;Array.prototype.slice.call(document.getElementsByTagName("textarea"),0).forEach(function(c){var d=new HL(c);c.focus(),a&&(window.hl=d),b=d});return b},HL.start(!0)