From 14642e63b3c975a681aeef0ee48040dc3182e2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 18 Nov 2012 10:31:40 -0800 Subject: [PATCH] Use Acorn's exports mechanism for Esprima, so it works included inside Paper.js --- lib/esprima-min.js | 4 ++-- lib/esprima.js | 16 ++-------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/lib/esprima-min.js b/lib/esprima-min.js index 54e0eeff..ac0fd0a3 100644 --- a/lib/esprima-min.js +++ b/lib/esprima-min.js @@ -32,5 +32,5 @@ parseAssignmentExpression: true, parseBlock: true, parseExpression: true, parseFunctionDeclaration: true, parseFunctionExpression: true, parseFunctionSourceElements: true, parseVariableIdentifier: true, parseLeftHandSideExpression: true, -parseStatement: true, parseSourceElement: true */(function(e,t){"use strict";typeof define=="function"&&define.amd?define(["exports"],t):typeof exports!="undefined"?t(exports):t(e.esprima={})})(this,function(e){"use strict";function y(e,t){if(!e)throw new Error("ASSERT: "+t)}function b(e,t){return a.slice(e,t)}function w(e){return"0123456789".indexOf(e)>=0}function E(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function S(e){return"01234567".indexOf(e)>=0}function x(e){return e===" "||e===" "||e===" "||e==="\f"||e===" "||e.charCodeAt(0)>=5760&&" ᠎              ".indexOf(e)>=0}function T(e){return e==="\n"||e==="\r"||e==="\u2028"||e==="\u2029"}function N(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierStart.test(e)}function C(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierPart.test(e)}function k(e){return["class","enum","export","extends","import","super"].indexOf(e)>=0}function L(e){return["implements","interface","package","private","protected","public","static","yield","let"].indexOf(e)>=0}function A(e){return e==="eval"||e==="arguments"}function O(e){if(f&&L(e))return!0;switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try"||e==="let";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="yield"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return!1}}function M(){var e,t,n;t=!1,n=!1;while(l=p&&X({},s.UnexpectedToken,"ILLEGAL")):(e=a[l++],l>=p&&X({},s.UnexpectedToken,"ILLEGAL"),e==="*"&&(e=a[l],e==="/"&&(++l,t=!1)));else if(e==="/"){e=a[l+1];if(e==="/")l+=2,n=!0;else{if(e!=="*")break;l+=2,t=!0,l>=p&&X({},s.UnexpectedToken,"ILLEGAL")}}else if(x(e))++l;else{if(!T(e))break;++l,e==="\r"&&a[l]==="\n"&&++l,++c,h=l}}}function _(e){var t,n,r,i=0;n=e==="u"?4:2;for(t=0;t"&&r===">"&&i===">"&&o==="=")return l+=4,{type:t.Punctuator,value:">>>=",lineNumber:c,lineStart:h,range:[e,l]};if(n==="="&&r==="="&&i==="=")return l+=3,{type:t.Punctuator,value:"===",lineNumber:c,lineStart:h,range:[e,l]};if(n==="!"&&r==="="&&i==="=")return l+=3,{type:t.Punctuator,value:"!==",lineNumber:c,lineStart:h,range:[e,l]};if(n===">"&&r===">"&&i===">")return l+=3,{type:t.Punctuator,value:">>>",lineNumber:c,lineStart:h,range:[e,l]};if(n==="<"&&r==="<"&&i==="=")return l+=3,{type:t.Punctuator,value:"<<=",lineNumber:c,lineStart:h,range:[e,l]};if(n===">"&&r===">"&&i==="=")return l+=3,{type:t.Punctuator,value:">>=",lineNumber:c,lineStart:h,range:[e,l]};if(n===r&&"+-<>&|".indexOf(n)>=0&&"+-<>&|".indexOf(r)>=0)return l+=2,{type:t.Punctuator,value:n+r,lineNumber:c,lineStart:h,range:[e,l]};if("<>=!+-*%&|^/".indexOf(n)>=0)return++l,r==="="&&(++l,n+=r),{type:t.Punctuator,value:n,lineNumber:c,lineStart:h,range:[e,l]};X({},s.UnexpectedToken,"ILLEGAL")}function j(){var e,n,r;r=a[l],y(w(r)||r===".","Numeric literal must start with a decimal digit or a decimal point"),n=l,e="";if(r!=="."){e=a[l++],r=a[l];if(e==="0"){if(r==="x"||r==="X"){e+=a[l++];while(l=p&&(r=""),X({},s.UnexpectedToken,"ILLEGAL")}return l=0&&l=p?{type:t.EOF,lineNumber:c,lineStart:h,range:[l,l]}:(e=a[l],N(e)?H():e==="."?w(a[l+1])?j():B():e==="'"||e==='"'?F():w(e)?j():B())}function U(){var e;return e=v,l=e.range[1],c=e.lineNumber,h=e.lineStart,v=R(),l=e.range[1],c=e.lineNumber,h=e.lineStart,e}function z(){var e,t,n;e=l,t=c,n=h,v=R(),l=e,c=t,h=n}function W(){var e,t,n,r;return e=l,t=c,n=h,M(),r=c!==t,l=e,c=t,h=n,r}function X(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return r[t]||""});throw typeof e.lineNumber=="number"?(n=new Error("Line "+e.lineNumber+": "+i),n.index=e.range[0],n.lineNumber=e.lineNumber,n.column=e.range[0]-h+1):(n=new Error("Line "+c+": "+i),n.index=l,n.lineNumber=c,n.column=l-h+1),n}function V(){try{X.apply(null,arguments)}catch(e){if(!g.errors)throw e;g.errors.push(e)}}function $(e){e.type===t.EOF&&X(e,s.UnexpectedEOS),e.type===t.NumericLiteral&&X(e,s.UnexpectedNumber),e.type===t.StringLiteral&&X(e,s.UnexpectedString),e.type===t.Identifier&&X(e,s.UnexpectedIdentifier);if(e.type===t.Keyword){if(k(e.value))X(e,s.UnexpectedReserved);else if(f&&L(e.value)){V(e,s.StrictReservedWord);return}X(e,s.UnexpectedToken,e.value)}X(e,s.UnexpectedToken,e.value)}function J(e){var n=U();(n.type!==t.Punctuator||n.value!==e)&&$(n)}function K(e){var n=U();(n.type!==t.Keyword||n.value!==e)&&$(n)}function Q(e){return v.type===t.Punctuator&&v.value===e}function G(e){return v.type===t.Keyword&&v.value===e}function Y(){var e;return v.type!==t.Punctuator?!1:(e=v.value,e==="="||e==="*="||e==="/="||e==="%="||e==="+="||e==="-="||e==="<<="||e===">>="||e===">>>="||e==="&="||e==="^="||e==="|=")}function Z(){var e;if(a[l]===";"){U();return}e=c,M();if(c!==e)return;if(Q(";")){U();return}v.type!==t.EOF&&!Q("}")&&$(v)}function et(e){return e.type===r.Identifier||e.type===r.MemberExpression}function tt(){var e=[];J("[");while(!Q("]"))Q(",")?(U(),e.push(null)):(e.push(Et()),Q("]")||J(","));return J("]"),d.createArrayExpression(e)}function nt(e,t){var n,r;return n=f,r=Jt(),t&&f&&A(e[0].name)&&V(t,s.StrictParamName),f=n,d.createFunctionExpression(null,e,[],r)}function rt(){var e=U();return e.type===t.StringLiteral||e.type===t.NumericLiteral?(f&&e.octal&&V(e,s.StrictOctalLiteral),d.createLiteral(e)):d.createIdentifier(e.value)}function it(){var e,n,r,i,s;e=v;if(e.type===t.Identifier)return r=rt(),e.value==="get"&&!Q(":")?(n=rt(),J("("),J(")"),i=nt([]),d.createProperty("get",n,i)):e.value==="set"&&!Q(":")?(n=rt(),J("("),e=v,e.type!==t.Identifier&&$(U()),s=[Nt()],J(")"),i=nt(s,e),d.createProperty("set",n,i)):(J(":"),i=Et(),d.createProperty("init",r,i));if(e.type!==t.EOF&&e.type!==t.Punctuator)return n=rt(),J(":"),i=Et(),d.createProperty("init",n,i);$(e)}function st(){var e=[],t,n,o,u={},a=String;J("{");while(!Q("}"))t=it(),t.key.type===r.Identifier?n=t.key.name:n=a(t.key.value),o=t.kind==="init"?i.Data:t.kind==="get"?i.Get:i.Set,Object.prototype.hasOwnProperty.call(u,n)?(u[n]===i.Data?f&&o===i.Data?V({},s.StrictDuplicateProperty):o!==i.Data&&V({},s.AccessorDataProperty):o===i.Data?V({},s.AccessorDataProperty):u[n]&o&&V({},s.AccessorGetSet),u[n]|=o):u[n]=o,e.push(t),Q("}")||J(",");return J("}"),d.createObjectExpression(e)}function ot(){var e;return J("("),e=St(),J(")"),e}function ut(){var e,n;e=v.type;if(e===t.Identifier)return d.createIdentifier(U().value);if(e===t.StringLiteral||e===t.NumericLiteral)return f&&v.octal&&V(v,s.StrictOctalLiteral),d.createLiteral(U());if(e===t.Keyword){if(G("this"))return U(),d.createThisExpression();if(G("function"))return Gt()}return e===t.BooleanLiteral?(n=U(),n.value=n.value==="true",d.createLiteral(n)):e===t.NullLiteral?(n=U(),n.value=null,d.createLiteral(n)):Q("[")?tt():Q("{")?st():Q("(")?ot():Q("/")||Q("/=")?d.createLiteral(I()):$(U())}function at(){var e=[];J("(");if(!Q(")"))while(l":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11;break;default:}return r}function yt(e){var t=e.pop(),n=e.pop().value,r=e.pop();n==="||"||n==="&&"?e.push(d.createLogicalExpression(n,r,t)):e.push(d.createBinaryExpression(n,r,t))}function bt(){var e,t,n,r,i;r=m.allowIn,m.allowIn=!0,e=mt(),t=v,n=gt(t,r);if(n===0)return e;t.prec=n,U(),i=[e,t,mt()];while((n=gt(v,r))>0){while(i.length>2&&n<=i[i.length-2].prec)yt(i);t=U(),t.prec=n,i.push(t),i.push(mt())}while(i.length>1)yt(i);return m.allowIn=r,i[0]}function wt(){var e,t,n,r;return e=bt(),Q("?")&&(U(),t=m.allowIn,m.allowIn=!0,n=Et(),m.allowIn=t,J(":"),r=Et(),e=d.createConditionalExpression(e,n,r)),e}function Et(){var e,t,n;return e=v,t=wt(),Y()?(et(t)||X({},s.InvalidLHSInAssignment),f&&t.type===r.Identifier&&A(t.name)&&V(e,s.StrictLHSAssignment),e=U(),n=Et(),d.createAssignmentExpression(e.value,t,n)):t}function St(){var e=Et();if(Q(",")){e=d.createSequenceExpression([e]);while(l0&&g.comments[g.comments.length-1].range[1]>n)return;g.comments.push({type:e,value:t,range:[n,r],loc:i})}function nn(){var e,t,n,r,i,o;e="",i=!1,o=!1;while(l=p?(o=!1,e+=t,n.end={line:c,column:p-h},tn("Line",e,r,p,n)):e+=t;else if(i)T(t)?(t==="\r"&&a[l+1]==="\n"?(++l,e+="\r\n"):e+=t,++c,++l,h=l,l>=p&&X({},s.UnexpectedToken,"ILLEGAL")):(t=a[l++],l>=p&&X({},s.UnexpectedToken,"ILLEGAL"),e+=t,t==="*"&&(t=a[l],t==="/"&&(e=e.substr(0,e.length-1),i=!1,++l,n.end={line:c,column:l-h},tn("Block",e,r,l,n),e="")));else if(t==="/"){t=a[l+1];if(t==="/")n={start:{line:c,column:l-h}},r=l,l+=2,o=!0,l>=p&&(n.end={line:c,column:l-h},o=!1,tn("Line",e,r,l,n));else{if(t!=="*")break;r=l,l+=2,i=!0,n={start:{line:c,column:l-h-2}},l>=p&&X({},s.UnexpectedToken,"ILLEGAL")}}else if(x(t))++l;else{if(!T(t))break;++l,t==="\r"&&a[l]==="\n"&&++l,++c,h=l}}}function rn(){var e,t,n,r=[];for(e=0;e0&&(r=g.tokens[g.tokens.length-1],r.range[0]===e&&r.type==="Punctuator"&&(r.value==="/"||r.value==="/=")&&g.tokens.pop()),g.tokens.push({type:"RegularExpression",value:n.literal,range:[e,l],loc:t}),n}function un(){var e,t,n,r=[];for(e=0;e0?1:0,h=0,p=a.length,v=null,m={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},g={},typeof t!="undefined"&&(g.range=typeof t.range=="boolean"&&t.range,g.loc=typeof t.loc=="boolean"&&t.loc,typeof t.tokens=="boolean"&&t.tokens&&(g.tokens=[]),typeof t.comment=="boolean"&&t.comment&&(g.comments=[]),typeof t.tolerant=="boolean"&&t.tolerant&&(g.errors=[])),p>0&&typeof a[0]=="undefined"&&(e instanceof String&&(a=e.valueOf()),typeof a[0]=="undefined"&&(a=mn(e))),dn();try{n=en(),typeof g.comments!="undefined"&&(rn(),n.comments=g.comments),typeof g.tokens!="undefined"&&(un(),n.tokens=g.tokens),typeof g.errors!="undefined"&&(n.errors=g.errors);if(g.range||g.loc)n.body=hn(n.body)}catch(i){throw i}finally{vn(),g={}}return n}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g;t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},n={},n[t.BooleanLiteral]="Boolean",n[t.EOF]="",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",r={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},i={Data:1,Get:2,Set:4},s={UnexpectedToken:"Unexpected token %0" -,UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},o={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},typeof "esprima"[0]=="undefined"&&(b=function(t,n){return a.slice(t,n).join("")}),u={name:"SyntaxTree",createArrayExpression:function(e){return{type:r.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:r.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:r.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:r.BlockStatement,body:e}},createBreakStatement:function(e){return{type:r.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:r.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:r.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:r.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:r.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:r.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:r.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:r.EmptyStatement}},createExpressionStatement:function(e){return{type:r.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,i){return{type:r.ForStatement,init:e,test:t,update:n,body:i}},createForInStatement:function(e,t,n){return{type:r.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,i){return{type:r.FunctionDeclaration,id:e,params:t,defaults:n,body:i,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,i){return{type:r.FunctionExpression,id:e,params:t,defaults:n,body:i,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:r.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:r.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:r.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:r.Literal,value:e.value,raw:b(e.range[0],e.range[1])}},createLogicalExpression:function(e,t,n){return{type:r.LogicalExpression,operator:e,left:t,right:n}},createMemberExpression:function(e,t,n){return{type:r.MemberExpression,computed:e==="[",object:t,property:n}},createNewExpression:function(e,t){return{type:r.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:r.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:r.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:r.Program,body:e}},createProperty:function(e,t,n){return{type:r.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:r.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:r.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:r.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:r.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:r.ThisExpression}},createThrowStatement:function(e){return{type:r.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,i){return{type:r.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:i}},createUnaryExpression:function(e,t){return e==="++"||e==="--"?{type:r.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:r.UnaryExpression,operator:e,argument:t}},createVariableDeclaration:function(e,t){return{type:r.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:r.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:r.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:r.WithStatement,object:e,body:t}}},e.version="1.1.0-dev",e.parse=yn,e.Syntax=function(){var e,t={};typeof Object.create=="function"&&(t=Object.create(null));for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return typeof Object.freeze=="function"&&Object.freeze(t),t}()}); \ No newline at end of file +parseStatement: true, parseSourceElement: true */(function(e){"use strict";function y(e,t){if(!e)throw new Error("ASSERT: "+t)}function b(e,t){return a.slice(e,t)}function w(e){return"0123456789".indexOf(e)>=0}function E(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function S(e){return"01234567".indexOf(e)>=0}function x(e){return e===" "||e===" "||e===" "||e==="\f"||e===" "||e.charCodeAt(0)>=5760&&" ᠎              ".indexOf(e)>=0}function T(e){return e==="\n"||e==="\r"||e==="\u2028"||e==="\u2029"}function N(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierStart.test(e)}function C(e){return e==="$"||e==="_"||e==="\\"||e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e.charCodeAt(0)>=128&&o.NonAsciiIdentifierPart.test(e)}function k(e){return["class","enum","export","extends","import","super"].indexOf(e)>=0}function L(e){return["implements","interface","package","private","protected","public","static","yield","let"].indexOf(e)>=0}function A(e){return e==="eval"||e==="arguments"}function O(e){if(f&&L(e))return!0;switch(e.length){case 2:return e==="if"||e==="in"||e==="do";case 3:return e==="var"||e==="for"||e==="new"||e==="try"||e==="let";case 4:return e==="this"||e==="else"||e==="case"||e==="void"||e==="with"||e==="enum";case 5:return e==="while"||e==="break"||e==="catch"||e==="throw"||e==="const"||e==="yield"||e==="class"||e==="super";case 6:return e==="return"||e==="typeof"||e==="delete"||e==="switch"||e==="export"||e==="import";case 7:return e==="default"||e==="finally"||e==="extends";case 8:return e==="function"||e==="continue"||e==="debugger";case 10:return e==="instanceof";default:return!1}}function M(){var e,t,n;t=!1,n=!1;while(l=p&&X({},s.UnexpectedToken,"ILLEGAL")):(e=a[l++],l>=p&&X({},s.UnexpectedToken,"ILLEGAL"),e==="*"&&(e=a[l],e==="/"&&(++l,t=!1)));else if(e==="/"){e=a[l+1];if(e==="/")l+=2,n=!0;else{if(e!=="*")break;l+=2,t=!0,l>=p&&X({},s.UnexpectedToken,"ILLEGAL")}}else if(x(e))++l;else{if(!T(e))break;++l,e==="\r"&&a[l]==="\n"&&++l,++c,h=l}}}function _(e){var t,n,r,i=0;n=e==="u"?4:2;for(t=0;t"&&r===">"&&i===">"&&o==="=")return l+=4,{type:t.Punctuator,value:">>>=",lineNumber:c,lineStart:h,range:[e,l]};if(n==="="&&r==="="&&i==="=")return l+=3,{type:t.Punctuator,value:"===",lineNumber:c,lineStart:h,range:[e,l]};if(n==="!"&&r==="="&&i==="=")return l+=3,{type:t.Punctuator,value:"!==",lineNumber:c,lineStart:h,range:[e,l]};if(n===">"&&r===">"&&i===">")return l+=3,{type:t.Punctuator,value:">>>",lineNumber:c,lineStart:h,range:[e,l]};if(n==="<"&&r==="<"&&i==="=")return l+=3,{type:t.Punctuator,value:"<<=",lineNumber:c,lineStart:h,range:[e,l]};if(n===">"&&r===">"&&i==="=")return l+=3,{type:t.Punctuator,value:">>=",lineNumber:c,lineStart:h,range:[e,l]};if(n===r&&"+-<>&|".indexOf(n)>=0&&"+-<>&|".indexOf(r)>=0)return l+=2,{type:t.Punctuator,value:n+r,lineNumber:c,lineStart:h,range:[e,l]};if("<>=!+-*%&|^/".indexOf(n)>=0)return++l,r==="="&&(++l,n+=r),{type:t.Punctuator,value:n,lineNumber:c,lineStart:h,range:[e,l]};X({},s.UnexpectedToken,"ILLEGAL")}function j(){var e,n,r;r=a[l],y(w(r)||r===".","Numeric literal must start with a decimal digit or a decimal point"),n=l,e="";if(r!=="."){e=a[l++],r=a[l];if(e==="0"){if(r==="x"||r==="X"){e+=a[l++];while(l=p&&(r=""),X({},s.UnexpectedToken,"ILLEGAL")}return l=0&&l=p?{type:t.EOF,lineNumber:c,lineStart:h,range:[l,l]}:(e=a[l],N(e)?H():e==="."?w(a[l+1])?j():B():e==="'"||e==='"'?F():w(e)?j():B())}function U(){var e;return e=v,l=e.range[1],c=e.lineNumber,h=e.lineStart,v=R(),l=e.range[1],c=e.lineNumber,h=e.lineStart,e}function z(){var e,t,n;e=l,t=c,n=h,v=R(),l=e,c=t,h=n}function W(){var e,t,n,r;return e=l,t=c,n=h,M(),r=c!==t,l=e,c=t,h=n,r}function X(e,t){var n,r=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,function(e,t){return r[t]||""});throw typeof e.lineNumber=="number"?(n=new Error("Line "+e.lineNumber+": "+i),n.index=e.range[0],n.lineNumber=e.lineNumber,n.column=e.range[0]-h+1):(n=new Error("Line "+c+": "+i),n.index=l,n.lineNumber=c,n.column=l-h+1),n}function V(){try{X.apply(null,arguments)}catch(e){if(!g.errors)throw e;g.errors.push(e)}}function $(e){e.type===t.EOF&&X(e,s.UnexpectedEOS),e.type===t.NumericLiteral&&X(e,s.UnexpectedNumber),e.type===t.StringLiteral&&X(e,s.UnexpectedString),e.type===t.Identifier&&X(e,s.UnexpectedIdentifier);if(e.type===t.Keyword){if(k(e.value))X(e,s.UnexpectedReserved);else if(f&&L(e.value)){V(e,s.StrictReservedWord);return}X(e,s.UnexpectedToken,e.value)}X(e,s.UnexpectedToken,e.value)}function J(e){var n=U();(n.type!==t.Punctuator||n.value!==e)&&$(n)}function K(e){var n=U();(n.type!==t.Keyword||n.value!==e)&&$(n)}function Q(e){return v.type===t.Punctuator&&v.value===e}function G(e){return v.type===t.Keyword&&v.value===e}function Y(){var e;return v.type!==t.Punctuator?!1:(e=v.value,e==="="||e==="*="||e==="/="||e==="%="||e==="+="||e==="-="||e==="<<="||e===">>="||e===">>>="||e==="&="||e==="^="||e==="|=")}function Z(){var e;if(a[l]===";"){U();return}e=c,M();if(c!==e)return;if(Q(";")){U();return}v.type!==t.EOF&&!Q("}")&&$(v)}function et(e){return e.type===r.Identifier||e.type===r.MemberExpression}function tt(){var e=[];J("[");while(!Q("]"))Q(",")?(U(),e.push(null)):(e.push(Et()),Q("]")||J(","));return J("]"),d.createArrayExpression(e)}function nt(e,t){var n,r;return n=f,r=Jt(),t&&f&&A(e[0].name)&&V(t,s.StrictParamName),f=n,d.createFunctionExpression(null,e,[],r)}function rt(){var e=U();return e.type===t.StringLiteral||e.type===t.NumericLiteral?(f&&e.octal&&V(e,s.StrictOctalLiteral),d.createLiteral(e)):d.createIdentifier(e.value)}function it(){var e,n,r,i,s;e=v;if(e.type===t.Identifier)return r=rt(),e.value==="get"&&!Q(":")?(n=rt(),J("("),J(")"),i=nt([]),d.createProperty("get",n,i)):e.value==="set"&&!Q(":")?(n=rt(),J("("),e=v,e.type!==t.Identifier&&$(U()),s=[Nt()],J(")"),i=nt(s,e),d.createProperty("set",n,i)):(J(":"),i=Et(),d.createProperty("init",r,i));if(e.type!==t.EOF&&e.type!==t.Punctuator)return n=rt(),J(":"),i=Et(),d.createProperty("init",n,i);$(e)}function st(){var e=[],t,n,o,u={},a=String;J("{");while(!Q("}"))t=it(),t.key.type===r.Identifier?n=t.key.name:n=a(t.key.value),o=t.kind==="init"?i.Data:t.kind==="get"?i.Get:i.Set,Object.prototype.hasOwnProperty.call(u,n)?(u[n]===i.Data?f&&o===i.Data?V({},s.StrictDuplicateProperty):o!==i.Data&&V({},s.AccessorDataProperty):o===i.Data?V({},s.AccessorDataProperty):u[n]&o&&V({},s.AccessorGetSet),u[n]|=o):u[n]=o,e.push(t),Q("}")||J(",");return J("}"),d.createObjectExpression(e)}function ot(){var e;return J("("),e=St(),J(")"),e}function ut(){var e,n;e=v.type;if(e===t.Identifier)return d.createIdentifier(U().value);if(e===t.StringLiteral||e===t.NumericLiteral)return f&&v.octal&&V(v,s.StrictOctalLiteral),d.createLiteral(U());if(e===t.Keyword){if(G("this"))return U(),d.createThisExpression();if(G("function"))return Gt()}return e===t.BooleanLiteral?(n=U(),n.value=n.value==="true",d.createLiteral(n)):e===t.NullLiteral?(n=U(),n.value=null,d.createLiteral(n)):Q("[")?tt():Q("{")?st():Q("(")?ot():Q("/")||Q("/=")?d.createLiteral(I()):$(U())}function at(){var e=[];J("(");if(!Q(")"))while(l":case"<=":case">=":case"instanceof":r=7;break;case"in":r=n?7:0;break;case"<<":case">>":case">>>":r=8;break;case"+":case"-":r=9;break;case"*":case"/":case"%":r=11;break;default:}return r}function yt(e){var t=e.pop(),n=e.pop().value,r=e.pop();n==="||"||n==="&&"?e.push(d.createLogicalExpression(n,r,t)):e.push(d.createBinaryExpression(n,r,t))}function bt(){var e,t,n,r,i;r=m.allowIn,m.allowIn=!0,e=mt(),t=v,n=gt(t,r);if(n===0)return e;t.prec=n,U(),i=[e,t,mt()];while((n=gt(v,r))>0){while(i.length>2&&n<=i[i.length-2].prec)yt(i);t=U(),t.prec=n,i.push(t),i.push(mt())}while(i.length>1)yt(i);return m.allowIn=r,i[0]}function wt(){var e,t,n,r;return e=bt(),Q("?")&&(U(),t=m.allowIn,m.allowIn=!0,n=Et(),m.allowIn=t,J(":"),r=Et(),e=d.createConditionalExpression(e,n,r)),e}function Et(){var e,t,n;return e=v,t=wt(),Y()?(et(t)||X({},s.InvalidLHSInAssignment),f&&t.type===r.Identifier&&A(t.name)&&V(e,s.StrictLHSAssignment),e=U(),n=Et(),d.createAssignmentExpression(e.value,t,n)):t}function St(){var e=Et();if(Q(",")){e=d.createSequenceExpression([e]);while(l0&&g.comments[g.comments.length-1].range[1]>n)return;g.comments.push({type:e,value:t,range:[n,r],loc:i})}function nn(){var e,t,n,r,i,o;e="",i=!1,o=!1;while(l=p?(o=!1,e+=t,n.end={line:c,column:p-h},tn("Line",e,r,p,n)):e+=t;else if(i)T(t)?(t==="\r"&&a[l+1]==="\n"?(++l,e+="\r\n"):e+=t,++c,++l,h=l,l>=p&&X({},s.UnexpectedToken,"ILLEGAL")):(t=a[l++],l>=p&&X({},s.UnexpectedToken,"ILLEGAL"),e+=t,t==="*"&&(t=a[l],t==="/"&&(e=e.substr(0,e.length-1),i=!1,++l,n.end={line:c,column:l-h},tn("Block",e,r,l,n),e="")));else if(t==="/"){t=a[l+1];if(t==="/")n={start:{line:c,column:l-h}},r=l,l+=2,o=!0,l>=p&&(n.end={line:c,column:l-h},o=!1,tn("Line",e,r,l,n));else{if(t!=="*")break;r=l,l+=2,i=!0,n={start:{line:c,column:l-h-2}},l>=p&&X({},s.UnexpectedToken,"ILLEGAL")}}else if(x(t))++l;else{if(!T(t))break;++l,t==="\r"&&a[l]==="\n"&&++l,++c,h=l}}}function rn(){var e,t,n,r=[];for(e=0;e0&&(r=g.tokens[g.tokens.length-1],r.range[0]===e&&r.type==="Punctuator"&&(r.value==="/"||r.value==="/=")&&g.tokens.pop()),g.tokens.push({type:"RegularExpression",value:n.literal,range:[e,l],loc:t}),n}function un(){var e,t,n,r=[];for(e=0;e0?1:0,h=0,p=a.length,v=null,m={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},g={},typeof t!="undefined"&&(g.range=typeof t.range=="boolean"&&t.range,g.loc=typeof t.loc=="boolean"&&t.loc,typeof t.tokens=="boolean"&&t.tokens&&(g.tokens=[]),typeof t.comment=="boolean"&&t.comment&&(g.comments=[]),typeof t.tolerant=="boolean"&&t.tolerant&&(g.errors=[])),p>0&&typeof a[0]=="undefined"&&(e instanceof String&&(a=e.valueOf()),typeof a[0]=="undefined"&&(a=mn(e))),dn();try{n=en(),typeof g.comments!="undefined"&&(rn(),n.comments=g.comments),typeof g.tokens!="undefined"&&(un(),n.tokens=g.tokens),typeof g.errors!="undefined"&&(n.errors=g.errors);if(g.range||g.loc)n.body=hn(n.body)}catch(i){throw i}finally{vn(),g={}}return n}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g;t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},n={},n[t.BooleanLiteral]="Boolean",n[t.EOF]="",n[t.Identifier]="Identifier",n[t.Keyword]="Keyword",n[t.NullLiteral]="Null",n[t.NumericLiteral]="Numeric",n[t.Punctuator]="Punctuator",n[t.StringLiteral]="String",r={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},i={Data:1,Get:2,Set:4},s={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved +:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},o={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},typeof "esprima"[0]=="undefined"&&(b=function(t,n){return a.slice(t,n).join("")}),u={name:"SyntaxTree",createArrayExpression:function(e){return{type:r.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,n){return{type:r.AssignmentExpression,operator:e,left:t,right:n}},createBinaryExpression:function(e,t,n){return{type:r.BinaryExpression,operator:e,left:t,right:n}},createBlockStatement:function(e){return{type:r.BlockStatement,body:e}},createBreakStatement:function(e){return{type:r.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:r.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:r.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,n){return{type:r.ConditionalExpression,test:e,consequent:t,alternate:n}},createContinueStatement:function(e){return{type:r.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:r.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:r.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:r.EmptyStatement}},createExpressionStatement:function(e){return{type:r.ExpressionStatement,expression:e}},createForStatement:function(e,t,n,i){return{type:r.ForStatement,init:e,test:t,update:n,body:i}},createForInStatement:function(e,t,n){return{type:r.ForInStatement,left:e,right:t,body:n,each:!1}},createFunctionDeclaration:function(e,t,n,i){return{type:r.FunctionDeclaration,id:e,params:t,defaults:n,body:i,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,n,i){return{type:r.FunctionExpression,id:e,params:t,defaults:n,body:i,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:r.Identifier,name:e}},createIfStatement:function(e,t,n){return{type:r.IfStatement,test:e,consequent:t,alternate:n}},createLabeledStatement:function(e,t){return{type:r.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:r.Literal,value:e.value,raw:b(e.range[0],e.range[1])}},createLogicalExpression:function(e,t,n){return{type:r.LogicalExpression,operator:e,left:t,right:n}},createMemberExpression:function(e,t,n){return{type:r.MemberExpression,computed:e==="[",object:t,property:n}},createNewExpression:function(e,t){return{type:r.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:r.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:r.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:r.Program,body:e}},createProperty:function(e,t,n){return{type:r.Property,key:t,value:n,kind:e}},createReturnStatement:function(e){return{type:r.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:r.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:r.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:r.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:r.ThisExpression}},createThrowStatement:function(e){return{type:r.ThrowStatement,argument:e}},createTryStatement:function(e,t,n,i){return{type:r.TryStatement,block:e,guardedHandlers:t,handlers:n,finalizer:i}},createUnaryExpression:function(e,t){return e==="++"||e==="--"?{type:r.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:r.UnaryExpression,operator:e,argument:t}},createVariableDeclaration:function(e,t){return{type:r.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:r.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:r.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:r.WithStatement,object:e,body:t}}},e.version="1.1.0-dev",e.parse=yn,e.Syntax=function(){var e,t={};typeof Object.create=="function"&&(t=Object.create(null));for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return typeof Object.freeze=="function"&&Object.freeze(t),t}()})(typeof exports=="undefined"?window.esprima={}:exports); \ No newline at end of file diff --git a/lib/esprima.js b/lib/esprima.js index 0340b1e2..5f89d2f4 100644 --- a/lib/esprima.js +++ b/lib/esprima.js @@ -37,19 +37,7 @@ parseFunctionSourceElements: true, parseVariableIdentifier: true, parseLeftHandSideExpression: true, parseStatement: true, parseSourceElement: true */ -(function (root, factory) { - 'use strict'; - - // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, - // Rhino, and plain browser loading. - if (typeof define === 'function' && define.amd) { - define(['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { - factory((root.esprima = {})); - } -}(this, function (exports) { +(function (exports) { 'use strict'; var Token, @@ -3805,5 +3793,5 @@ parseStatement: true, parseSourceElement: true */ return types; }()); -})); +})(typeof exports === "undefined" ? (window.esprima = {}) : exports); /* vim: set sw=4 ts=4 et tw=80 : */