Comparing version 1.1.0 to 1.1.2
@@ -1,3 +0,2 @@ | ||
!function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){t.exports=i(14)},function(t,e){function i(t,e){var i=r.contextFrame;i.style.height="100%",i.style.width="100%",t.appendChild(i),(e||n.noop).call(i)}function s(){return r.contextFrame}var n,r,o;n={now:Date.now||function(){return(new Date).getTime()},isString:function(t){return"string"==typeof t},isUndefined:function(t){return void 0===t},isDefined:function(t){return!n.isUndefined(t)},isNumber:function(t){return"number"==typeof t},isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},isElement:function(t){return!(!t||1!==t.nodeType)},isFunction:function(t){return"function"==typeof t},isArray:function(t){return"[object Array]"==={}.toString.call(t)},last:function(t){return t[t.length-1]},noop:function(){},forEach:function(t,e,i){e=e.bind(i);var s,n;if(this.isArray(t))for(s=0,n=t.length;n>s;s+=1)e(t[s],s,t);else{var r=Object.keys(t);for(s=0,n=r.length;n>s;s+=1)e(t[r[s]],r[s],t)}return t},document:function(){return r.contextFrame?r.contextFrame.contentWindow.document:document},countDOM:function(t){return n.document().querySelectorAll(t).length},getInnerHTML:function(t){var e=n.document().querySelector(t);return e?e[e.value?"value":"innerHTML"]:"Error:No such HTMLElement."}},r={contextFrame:document.createElement("iframe"),defaultNextLoopDelay:3e3,readyTimeout:3e3,defaultClock:10,bootExceptionHandle:n.noop,triggerCallback:n.noop,runCallback:n.noop,runExceptionHandle:n.noop,successCallback:n.noop,readyCallback:n.noop,nextLoopCallback:n.noop,consoleFn:n.noop},o=function(t){return n.isString(t)?r[t]:n.isObject(t)?void n.forEach(t,function(t,e){this[e]=t},r):void 0},o.setContextFrame=function(t){trigger.setupIframe(t),r.contextFrame=t},t.exports={_:n,settings:r,setup:o,init:i,getLemoncaseFrame:s}},function(t,e){function i(t,e){return new n(t,{beforeExpr:!0,binop:e})}function s(t,e){e=e||{},e.keyword=t,h[t]=a["_"+t]=new n(t,e)}var n=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.macro=!!e.macro},r={beforeExpr:!0},o={macro:!0},a={num:new n("num"),regexp:new n("regexp"),string:new n("string"),name:new n("name"),eof:new n("eof"),objectAt:new n("objectStore"),dict:new n("dictionaryIndex"),bracketL:new n("[",r),bracketR:new n("]"),braceL:new n("{",r),braceR:new n("}"),parenL:new n("(",r),parenR:new n(")"),comma:new n(",",r),semi:new n(";",r),colon:new n(":",r),tagNumL:new n("<#",r),tagAtL:new n("<@",r),tagR:new n("/>"),eq:new n("=",{beforeExpr:!0,isAssign:!0}),assign:new n("_=",{beforeExpr:!0,isAssign:!0}),incDec:new n("++/--",{prefix:!0,postfix:!0}),prefix:new n("prefix",{beforeExpr:!0,prefix:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),equality:i("==/!=",6),relational:i("</>",7),plusMin:new n("+/-",{beforeExpr:!0,binop:9,prefix:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),match:i("~~",6)},h={};s("in"),s("by",r),s("click",r),s("input",r),s("rclick",r),s("dblclick",r),s("movein",r),s("moveout",r),s("scroll",r),s("select",r),s("#CLOCK",o),s("#TIMES",o),s("#INTERVAL",o),s("#SCREEN",o),s("wait",r),s("assert",r),s("log",r),s("console",r),s("var"),s("process"),s("return",r),s("jumpto"),s("refresh"),t.exports={TokenType:n,types:a,keywordTypes:h}},function(t,e){function i(t){return 65>t?36===t:91>t?!0:97>t?95===t:123>t}function s(t){return 48>t?36===t:58>t?!0:65>t?!1:91>t?!0:97>t?95===t:123>t}var n=["in","by"],r=["click","input","rclick","dblclick","movein","moveout","scroll","select","jumpto","refresh"],o=["#CLOCK","#TIMES","#INTERVAL","#SCREEN"],a=["wait","assert","log","console","var","process","return"].concat(n).concat(r).concat(o),h=new RegExp("^("+a.join("|")+")$");t.exports={keywordRegexp:h,isIdentifierStart:i,isIdentifierChar:s}},function(t,e){var i=function(t,e){function i(t,e){this.$case=e,this.$body=t.BODY,this.$line=t.LINE}if(!e){var n=s[t];if(!n)throw new Error("TYPE:"+t+" instruction is not existed.");return n}if(s[t])throw new Error("The instruction factory: TYPE="+t+" is existed.");return i.prototype.execute=e.operation,i.prototype.line=function(){return this.$line},i.prototype.body=function(t){return t?this.$body[t]:this.$body},i.prototype.assignCase=function(t){return this.$case=t,this},i.create=function(){return new i({BODY:e.bodyFactory.apply(null,arguments)})},i.$new=function(t,e){return new i(t,e)},s[t]=i,i},s=[];t.exports=i},function(t,e){var i=/\r\n?|\n|\u2028|\u2029/;t.exports={lineBreak:i,lineBreakG:new RegExp(i.source,"g"),isNewLine:function(t){return 10===t||13===t||8232===t||8233==t}}},function(t,e,i){function s(t,e,i,s){var n={process:{},config:{}},r=[];return a.forEach(t.DATA_KEYS,function(t,e){t&&r.push(e)}),a.forEach(t.DICTIONARY_KEYS,function(t,e){if(!i.isFieldDefined(e))throw new Error("The field: "+e+" is undefined in dictionary.")}),a.forEach(t.OBJECT_KEYS,function(t,i){if(!e.hasOwnProperty(i))throw new Error("The key: "+i+" is undefined in object.")}),a.forEach(t.PROCESSES,function(t,e){var i=n.process[e]=[];a.forEach(t.BODY.segment,function(t){i.push(u(t.TYPE).$new(t,s))})}),n.config.times=t.CONFIG.times,n.config.interval=t.CONFIG.interval,n.config.screen=t.CONFIG.screen,{eT:n,dK:r}}function n(t,e,i){if(!(this instanceof n))return new n(t);var r=s(t,e,i,this);this.$$executionTree=r.eT,this.$dictionary=i,this.$objectList=e,this.$$log=new c(r.dK),this.$$state="ready",this.$$coreId=null,this.$$activeTime=0,this.$$currentLoop=0,this.$$blockStack=[],this.$$scopeStack=[],this.$$instructionBuffer=void 0,this.$$tempInstruction=void 0,this.$$idleTask=a.noop,this.$loopData=null}var r=i(7).CALL,o=i(7).EXIT,a=i(1)._,h=i(1).settings,c=i(10),u=i(4),p=n.prototype;p.$$getConfig=function(t){return this.$$executionTree.config[t]},p.$$bootstrap=function(){var t=h.contextFrame.style,e=this.$$getConfig("screen");return this.$$currentLoop=0,this.hasDictionary()&&(this.$loopData=this.$dictionary.load(this.$$getConfig("times")).fetch()),e&&(t.height=e.height+"px",t.width=e.width+"px"),this.$setActiveTime().$setTempInstruction(u(r).create("main")).$$log.initialization(),this},p.$$exitCase=function(){return this.$setState("success").$$interrupt(),(h.successCallback||a.noop).call(this),this},p.$$interrupt=function(){return clearInterval(this.$$coreId),this},p.$$popInstruction=function(){var t=this.$$tempInstruction,e=this.$getCurrentBlock();return t?(this.$setTempInstruction(),t):e?(this.$$instructionBuffer=e.segment[e.counter++],this.$$instructionBuffer):u(o).create(!0).assignCase(this)},p.$$run=function(){try{this.$$popInstruction().execute(),h.runCallback.call(this)}catch(t){console.error(t),h.runExceptionHandle.call(this,t)}return this},p.$$core=function(){var t=this;return this.$$coreId=setInterval(function(){t["$$"+(a.now()>=t.$$activeTime?"run":"idleTask")]()},this.$$getConfig("clock")||h.defaultClock),this},t.exports={Case:n,$CP:p}},function(t,e,i){var s=i(4),n=i(1).settings,r=i(1)._,o=0,a=1,h=2,c=16,u=17,p=18,f=19,l=20,d=21,$=32,g=33,m=1,x=0;s(o,{operation:function(){var t=this.body("identifier");this.$case.$pushScope(t).$pushLog([o,t],this.line())},bodyFactory:function(t){return{identifier:t}}}),s(a,{operation:function(){this.$case.$pushLog([a]).$popScope()},bodyFactory:function(){return{}}}),s(h,{operation:function(){var t=this.body("isSuccess")?m:x,e=this.$case;e.$pushLog([h,t],this.line()).$markLog(t,e.getCurrentLoop()).$clearScope().$exitLoop()},bodyFactory:function(t){return{isSuccess:t}}}),s(c,{operation:function(){this.$case.$runExp(this.body("exp"))},bodyFactory:function(t){return{exp:t}}}),s(u,{operation:function(){var t=this.$case.$runExp(this.body("delay"));this.$case.$setActiveTime(t).$pushLog([u,t],this.line())},bodyFactory:function(t){return{delay:t}}}),s(p,{operation:function(){var t=this.$case.$runExp(this.body("object")),e={value:this.$case.$runExp(this.body("param"))},i=this.body("action"),o=r.document().querySelectorAll(t)[0];return o?(trigger(o).does(i,e),n.triggerCallback.call(this.$case,o),void this.$case.$pushLog([p,m,t,i,e],this.line())):(this.$case.$pushLog([p,x,t,i,e],this.line()).$setTempInstruction(s(h).create(!1).assignCase(this.$case)),void console.log("Can not find a DOM by cssPath: "+t))},bodyFactory:function(t,e,i){return{object:t,action:e,param:i}}}),s(f,{operation:function(){function t(){a.$runExp(i)&&a.$setIdleTask().$setTempInstruction().$setActiveTime().$pushLog([f,m],c.line()).$pushLogData(c.body("key"),r.now()-e)}var e=r.now(),i=this.body("exp"),o=this.body("timeout"),a=this.$case,c=this;a.$setTempInstruction(s(h).create(!1).assignCase(a)),o&&o>2*n.defaultClock&&a.$setActiveTime(o).$setIdleTask(t),a.$runExp(i)?(a.$setTempInstruction().$setActiveTime().$setIdleTask().$pushLog([f,m],this.line()),o&&a.$pushLogData(c.body("key"),0)):o||a.$pushLog([f,x],this.line())},bodyFactory:function(t,e,i){return{exp:t,timeout:e,key:i}}}),s(l,{operation:function(){var t=this.$case.$runExp(this.body("url"));n.contextFrame.src=t,this.$case.$pushLog([l,t],this.line())}}),s(d,{operation:function(){n.contextFrame.src=r.document().location.href,this.$case.$pushLog([d],this.line())}}),s($,{operation:function(){this.$case.$pushLog([$,this.$case.$runExp(this.body("msg"))])},bodyFactory:function(t){return{msg:t}}}),s(g,{operation:function(){var t=this.$case.$runExp(this.body("msg"));console.log(t),n.consoleFn(t)},bodyFactory:function(t){return{msg:t}}}),t.exports={CALL:o,RETURN:a,EXIT:h,EXPRESSION:c,WAIT:u,TRIGGER:p,ASSERT:f,JUMPTO:l,REFRESH:d,LOG:$,CONSOLE:g}},function(t,e,i){function s(t,e){for(var i=1,s=0;;){h.lastIndex=s;var n=h.exec(t);if(!(n&&n.index<e))return new c(i,e-s);++i,s=n.index+n[0].length}}function n(t,e,i){var s=t.split(h)[e.line-1],n=s.substr(0,e.column),c=a(n),u=r(c),p=o(i,c);return"\n"+s+"\n"+u+"\n"+p}function r(t){for(var e=-1,i=-1,s="";++e<t;)s+=" ";for(s+="↑\n";++i<t;)s+=" ";return s+="↑"}function o(t,e){if(t.length/2>e)return t;for(var i=-1,s=e-Math.floor(t.length/2),n="";++i<s;)n+=" ";return n+=t}function a(t){for(var e,i=0,s=-1,n=t.length;++s<n;)switch(e=t.charCodeAt(s)){case 9:i+=4;break;default:i+=1}return i}var h=i(5).lineBreakG,c=function(t,e){this.line=t,this.column=e};c.prototype.offset=function(t){return new c(this.line,this.column+t)},t.exports={getLineInfo:s,empowerErrMsg:n}},function(t,e,i){function s(t){return this instanceof s?(this.$options={},this.$$buffer=[],this.$assignment=[],this.$field=[],this.field(t.field),void this.assignment(t.assignment)):new s(t)}var n=i(1)._;s.prototype.field=function(t){return n.isArray(t)&&(this.$field=t),this.$options.field=this.$field,this.$field},s.prototype.assignment=function(t){return n.isArray(t)&&(this.$assignment=t),this.$options.assignment=this.$assignment,this.$assignment},s.prototype.load=function(t){var e,i=this.$assignment.length,s=this.getKeys(),r=(s.length,function(t){n.forEach(s,function(e,i){this[e.name]=t[i]},this)}),o=function(){n.forEach(s,function(t){this[t.name]=t.pattern.gen()},this)};for(this.$$buffer=[],e=0;i>e&&t>e;e+=1)this.$$buffer.push(new r(this.$assignment[e]));for(null;t>e;e+=1)this.$$buffer.push(new o);return this},s.prototype.getKeys=function(){var t=[];return n.forEach(this.$field,function(t){this.push({name:t.name,pattern:new RegExp(t.pattern)})},t),t},s.prototype.fetch=function(){return this.$$buffer.shift()},s.prototype.isFieldDefined=function(t){var e,i=this.$field.length;for(e=0;i>e;e+=1)if(this.$field[e].name===t)return!0;return!1},t.exports=s},function(t,e,i){var s=i(1)._,n=function(t){this.$$baseTime=0,this.$dataKeys=t||[],this.$marks=[],this.$logs=[],this.$datas={}};n.prototype.initialization=function(){return this.clear(),this.$$baseTime=s.now(),s.forEach(this.$dataKeys,function(t){this[t]=[]},this.$datas),this},n.prototype.getLength=function(t){return this["$"+t].length},n.prototype.log=function(t,e){return this.$logs.push([t,s.now()-this.$$baseTime,e||0]),this},n.prototype.data=function(t,e){return this.$datas[t].push(e),this},n.prototype.markLog=function(t,e){return this.$marks.push([t,e,this.getLength("logs")-1]),this},n.prototype.clear=function(){return this.$$baseTime=0,this.$marks.length=0,this.$logs.length=0,this.$datas={},this},n.prototype.export2json=function(){return{baseTime:this.$$baseTime,marks:this.$marks,logs:this.$logs,performance:this.$datas}},n.prototype.export2text=function(){return JSON.stringify(this.export2json())},t.exports=n},function(t,e){!function(){var e={POSITION:0,CLASS:2,RANGE:3,CLAUSE:6,REFERENCE:7,INTS:"0123456789",WORDS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",WHITESPACE:" \f\n\r \x0B \u2028\u2029\u2028\u2029 "},i="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",s={0:0,t:9,n:10,v:11,f:12,r:13},n={rndChar:function(t){return t[Math.floor(Math.random()*t.length)]},anyRndChar:function(){return String.fromCharCode(n.rndInt(0,65535))},strToChars:function(t){var e=/\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]^?])|([0tnvfr]))/g;return t=t.replace(e,function(t,e,n,r,o,a){var h,c=e?parseInt(e,16):n?parseInt(n,16):r?parseInt(r,8):o?i.indexOf(o):a?s[a]:void 0;return void 0!==c?(h=String.fromCharCode(c),h=h.replace(/[[\]{}^$.|?*+()]/g,function(t){return"\\"+t})):h="\\"+a,h})},rndInt:function(t,e){return t+Math.floor(Math.random()*(1+e-t))},findChar:function(t){for(var e="\\",i="]",s=0;;){var n=t.indexOf(i);if(t[n-1]!==e)return s+n;t=t.slice(++n),s+=n}},range:function(t,i,s){var n=e.WORDS;return n.slice(n.indexOf(i),n.indexOf(s)+1)},classRange:function(t){return t.replace(/(\w)-(\w)/g,n.range)},toBothCases:function(t){var e=t;return e+=t["to"+(t===t.toLowerCase()?"Upper":"Lower")+"Case"]()},inCaseClass:function(t,e){return e?t=t.replace(/[a-zA-Z]/g,function(t){return n.toBothCases(t)}):t},inCaseChar:function(t,i){return i&&/[a-zA-Z]/.test(t)?{type:e.CLASS,chars:n.toBothCases(t)}:t},flatten:function(t){for(var e=0;e<t.length-1;e++)if("string"==typeof t[e])for(var i=e+1;;){var s=t[i];if("string"!=typeof s)break;t[e]+=s,t.splice(i,1)}return 1===t.length?t[0]:t},reduce:function(t){if(t.stack)t.stack=n.flatten(t.stack);else if(t.options)for(var e=0,i=t.options.length;i>e;e++)t.options[e]=n.flatten(t.options[e]);return t.options||t.group||t.value?t:t.stack},nextClose:function(t){for(var e=0,i=0,s=t.length;s>i;i++){var n=t[i];switch(n){case")":if(0===e)return i+1;e--;break;case"(":e++;break;case"\\":i++}}}},r={type:e.POSITION,value:"b"},o={type:e.POSITION,value:"B"},a={type:e.POSITION,value:"^"},h={type:e.POSITION,value:"$"},c={type:e.CLASS,chars:e.WORDS},u={type:e.CLASS,chars:e.WORDS,not:!0},p={type:e.CLASS,chars:e.INTS},f={type:e.CLASS,chars:e.INTS,not:!0},l={type:e.CLASS,chars:e.WHITESPACE},d={type:e.CLASS,chars:e.WHITESPACE,not:!0},$={type:e.CLASS,chars:"\n",not:!0},g=function(t,i,s){var g,m=0,x={type:e.CLAUSE,stack:[]},v=x,y=x.stack,b=[];for(t=n.strToChars(t);m<t.length;)switch(g=t[m++]){case"\\":switch(g=t[m++]){case"b":y.push(r);break;case"B":y.push(o);break;case"w":y.push(c);break;case"W":y.push(u);break;case"d":y.push(p);break;case"D":y.push(f);break;case"s":y.push(l);break;case"S":y.push(d);break;default:/\d/.test(g)?y.push({type:e.REFERENCE,value:parseInt(g)}):y.push(g)}break;case"^":y.push(a);break;case"$":y.push(h);break;case"[":if(g=t[m],"\\"===g&&0===t.slice(m+1).indexOf("b]"))m+=3,y.push("\b");else{var k;"^"===g?(k=!0,m++):k=!1;var C=t.slice(m),E=n.findChar(C),w=C.substring(0,E);m+=E+1,y.push({type:e.CLASS,chars:n.inCaseClass(n.classRange(w),i),not:k})}break;case".":y.push($);break;case"(":g=t[m];var T;if("?"===g){if(g=t[m+1],m+=2,"!"===g){m+=n.nextClose(t.slice(m));break}T=!1}else T=!0;var S={type:e.CLAUSE,group:T,stack:[]};y.push(S),b.push(v),v=S,y=S.stack;break;case")":v=b.pop(),y=v.options?v.options[v.options.length-1]:v.stack;var A=y.length-1;y[A]=n.reduce(y[A]);break;case"|":v.options||(v.options=[v.stack],delete v.stack);var O=[];v.options.push(O),y=O;break;case"{":var L=/^(\d+)(,(\d+)?)?\}/.exec(t.slice(m)),I=parseInt(L[1]),D=L[2]?L[3]?parseInt(L[3]):1/0:I;m+=L[0].length;var B=y.pop();if(I===D)for(var R=0;I>R;R++)y.push(B);else y.push({type:e.RANGE,min:I,max:D,value:B});break;case"?":var B=y.pop();y.push({type:e.RANGE,min:0,max:1,value:B});break;case"+":var B=y.pop();y.push({type:e.RANGE,min:1,max:1/0,value:B});break;case"*":var B=y.pop();y.push({type:e.RANGE,min:0,max:1/0,value:B});break;default:y.push(n.inCaseChar(g,i))}return n.reduce(x)},m=function(t,i,s,r){if("string"==typeof t)return t;if(t.length){for(var o="",a=0,h=t.length;h>a;a++)o+=m(t[a],i,s,r);return o}switch(t.type){case e.POSITION:return"";case e.CLASS:if(!t.not)return n.rndChar(t.chars);for(;;){var c=s();if(-1===t.chars.indexOf(c))return c}case e.RANGE:for(var u=n.rndInt(t.min,t.max===1/0?t.min+i:t.max),o="",a=0;u>a;a++)o+=m(t.value,i,s,r);return o;case e.CLAUSE:if(t.options){var u=n.rndInt(0,t.options.length-1);return m(t.options[u],i,s,r)}var p=m(t.stack,i,s,r);return r.push(p),p;case e.REFERENCE:return r[t.value-1]}};RegExp.prototype.gen=function(){return void 0===this._randexp&&(this._randexp=g(this.source,this.ignoreCase,this.multiline),this._max=this._max||100,this._anyRndChar=this._anyRndChar||n.anyRndChar),m(this._randexp,this._max,this._anyRndChar,[])},"undefined"==typeof window&&(t.exports=m)}()},function(t,e,i){var s=i(6).$CP,n=i(1)._,r=i(1).settings,o=i(4),a=i(7).CALL;s.$setIdleTask=function(t){return this.$$idleTask=n.isFunction(t)?t:n.noop,this},s.$setActiveTime=function(t){return this.$$activeTime=n.now()+(t||0),this},s.$setTempInstruction=function(t){return this.$$tempInstruction=t?t.assignCase(this):void 0,this},s.$setState=function(t){return this.$$state=t,this},s.$pushBlock=function(t){return this.$$blockStack.push({counter:0,segment:t}),this},s.$pushScope=function(t){var e=this.$$blockStack;return this.$$scopeStack.push({blockIndex:e.length,vars:{}}),this.$pushBlock(this.$getProcess(t)),this},s.$popBlock=function(){return this.$$blockStack.pop(),this},s.$popScope=function(){var t=this.$$scopeStack.pop();return this.$$blockStack.length=t.blockIndex,this},s.$getCurrentBlock=function(){return n.last(this.$$blockStack)},s.$getCurrentScope=function(){return n.last(this.$$scopeStack)},s.$getProcess=function(t){return this.$$executionTree.process[t]},s.$exitLoop=function(){return this.$setActiveTime(this.$$getConfig("interval")||3e3),(this.$$currentLoop+=1)>=this.$$getConfig("times")?(this.$$exitCase(),this):(this.$setTempInstruction(o(a).create("main")),(r.nextLoopCallback||n.noop).call(this),this.hasDictionary()&&(this.$loopData=this.$dictionary.fetch()),this)},s.$runExp=function(t){return"function"==typeof t?t(this.$getCurrentScope().vars,this.$objectList,this.$loopData,n.countDOM,n.getInnerHTML):t},s.$pushLog=function(t,e){return this.getLog().log(t,e),this},s.$markLog=function(t,e){return this.getLog().markLog(t,e),this},s.$pushLogData=function(t,e){return this.getLog().data(t,e),this},s.$clearScope=function(){for(;this.$$scopeStack.length;)this.$popScope();return this},t.exports=s},function(t,e,i){var s=i(6).$CP,n=i(1).settings,r=i(9);s.hasDictionary=function(){return!!this.$dictionary},s.validateObjectList=function(t,e){return e.length?t?e.every(function(e){return null!==t[e]}):!1:!0},s.exportLog=function(t){return this.$$log["export2"+t]()},s.start=function(){var t=this.$$state;if("success"!==t&&"ready"!==t)throw new Error("Can not call play!");try{return this.$setState("running").$$bootstrap(),setTimeout(function(){this.$$core()}.bind(this),n.readyTimeout),this}catch(e){n.bootExceptionHandle(e)}},s.forceCofig=function(t){var e,i=this.$$executionTree.config;for(e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);return this},s.suspend=function(){if("running"!==this.$$state)throw new Error("Can not call pause!");return this.$setState("pause").$$interrupt(),this},s.resume=function(){if("pause"!==this.$$state)throw new Error("Can not call resume!");return this.$setState("running").$$core(),this},s.stop=function(){var t=this.$$state;if("running"!==t&&"pause"!==t)throw new Error("Can not call stop!");return this.$setState("ready").$$interrupt(),this},s.debug=function(){var t=this.$$state;if("success"!==t&&"ready"!==t)throw new Error("Can not call play!");return this.$setState("debug").$$bootstrap(),this},s.dictionary=function(t){return t instanceof r&&(this.$dictionary=t),this.$dictionary},s.getLog=function(){return this.$$log},s.getCurrentStep=function(){return this.$$counter},s.getCurrentLoop=function(){return this.$$currentLoop},s.getCurrentLine=function(){return this.$$instructionBuffer.$getLine()},t.exports=s},function(t,e,i){var s=i(16).parse,n=i(6).Case,r=i(1).setup,o=i(4),a=i(9),h=i(1).init,c=i(1).getLemoncaseFrame;i(12),i(13),i(11),window.getLemoncaseFrame=c,window.Dictionary=a,window.init=h,window.setup=r,window.parse=s,window.Case=n;var e={Case:n,setup:r,Instruction:o,parse:s,Dictionary:a,init:h,getLemoncaseFrame:c};"undefined"!=typeof angular&&angular.module("lemoncase",[]).provider("LC",function(){this.setup=e.setup,this.$get=[function(){return e}]}),t.exports=e},function(t,e,i){var s=i(2).types;t.exports=function(t){var e=t.prototype;e.parseExpression=function(){var t=this.parseMaybeAssign();if(this.type===s.comma){var e={type:"SequenceExpr"};for(e.expressions=[t];this.eat(s.comma);){var i=this.parseMaybeAssign();e.expressions.push(i)}return e}return t},e.parseMaybeAssign=function(){var t=this.parseMaybeConditional();if(this.type.isAssign){var e={type:"AssignmentExpr",left:t,operator:this.value};return this.next(),e.right=this.parseMaybeAssign(),e}return t},e.parseMaybeConditional=function(){return this.parseExprOps()},e.parseExprOps=function(){var t=this.start,e=this.parseMaybeUnary(!1);return this.parseExprOp(e,t,-1)},e.parseExprOp=function(t,e,i){var s=this.type.binop;if(null!=s&&s>i){var n=this.type,r=this.value;this.next();var o=this.start,a=this.parseExprOp(this.parseMaybeUnary(!1),o,s),h=this.buildBinary(e,t,a,r,n);return this.parseExprOp(h,e,i)}return t},e.buildBinary=function(t,e,i,n,r){var o={left:e,operator:n,right:i};return r===s.logicalAND||r===s.logicalOR?o.type="LogicalExpr":r===s.match?o.type="MatchExpr":o.type="BinaryExpr",o},e.parseMaybeUnary=function(t){var e;if(this.type.prefix){var i={},n=this.type===s.incDec;i.operator=this.value,i.prefix=!0,this.next(),i.argument=this.parseMaybeUnary(!1),n||(t=!0),i.type=n?"UpdateExpr":"UnaryExpr",e=i}else for(e=this.parseExprSubscripts();this.type.postfix;){var r={};r.operator=this.value,r.prefix=!1,r.argument=e,this.next(),r.type="UpdateExpr",e=r}return e},e.parseExprSubscripts=function(){var t=this.start,e=this.parseExprAtom();return this.parseSubscripts(e,t)},e.parseSubscripts=function(t,e){for(;;){if(this.eat(s.parenL)){var i={type:"CallExpr",callee:t};return this.expect(s.parenR),i}return t}},e.parseExprAtom=function(){var t;switch(this.type){case s.name:var e=this.parseIndent(this.type!==s.name);return{type:"Identifier",name:e};case s.regexp:var i=this.value;return t=this.parseLiteral("regexp"),t.regexp=i,t;case s.num:case s.string:return this.parseLiteral("literal",this.value);case s.objectAt:case s.dict:return this.parseExtLiteral(this.type);case s.parenL:return this.parseParenExpression();case s.tagAtL:case s.tagNumL:return this.parseTagExpression();default:this.unexpected()}},e.parseLiteral=function(t,e){var i={type:t,value:e,raw:this.input.slice(this.start,this.end)};return this.next(),i},e.parseExtLiteral=function(t){var e={type:t.label,value:this.value};return this.next(),e},e.parseParenExpression=function(){this.expect(s.parenL);var t=this.parseExpression();return this.expect(s.parenR),{type:"ParenthesizedExpr",expression:t}},e.parseTagExpression=function(){var t={type:this.type===s.tagAtL?"TextExpr":"CountExpr"};return this.next(),t.val=this.parseExpression(),this.expect(s.tagR),t},e.parseIndent=function(){var t;return this.type===s.name?t=this.value:this.unexpected(),this.next(),t}}},function(t,e,i){var s=i(21);t.exports={parse:function(t,e){return new s(e,t).parse()},tokenizer:function(t,e){return new s(e,t)}}},function(t,e,i){var s=i(8).getLineInfo,n=i(8).empowerErrMsg;t.exports=function(t){var e=t.prototype;e.raise=function(t,e){var i=s(this.input,t);e+=" ("+i.line+":"+i.column+")",e=n(this.input,i,e);var r=new SyntaxError(e);throw r.pos=t,r.loc=i,r.raisedAt=this.pos,r}}},function(t,e,i){var s=i(2).types;t.exports=function(t){var e=t.prototype;e.parseBindingList=function(t,e,i){for(var n=[],r=!0;!this.eat(t);)if(r?r=!1:this.expect(s.comma),e&&this.type===s.comma)n.push(null);else{if(i)break;var o=this.parseIndent();n.push(o)}return n}}},function(t,e,i){function s(t){var e={};for(var i in r)e[i]=t&&n(t,i)?t[i]:r[i];return e}var n=i(24).has,r={insertReturn:!0,onComment:function(){},plugins:{}};t.exports={defaultOptions:r,getOptions:s}},function(t,e,i){var s=i(2).types;t.exports=function(t){var e=t.prototype;e.eat=function(t){return this.type===t?(this.next(),!0):!1},e.semicolon=function(){this.eat(s.semi)||this.expected(s.semi)},e.expect=function(t){this.eat(t)||this.expected(t)},e.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},e.expected=function(t){this.raise(this.lastTokEnd,'Expect a "'+t.label+'" after')},e.UID=function(t){return t+this.nextID++}}},function(t,e,i){var s=i(19).getOptions,n=i(3).keywordRegexp,r=i(2).types,o=function(t,e){this.options=s(t),this.keywords=n,this.input=String(e),this.pos=0,this.type=r.eof,this.value=null,this.start=this.end=this.pos,this.lastTokStart=this.lastTokEnd=this.pos,this.exprAllowed=!1,this.labels=[],this.conf={},this.keys={},this.nextID=0,this.pcs={},this.pcsTable={},this.dTable={},this.obTable={}};o.prototype.parse=function(){this.nextToken();var t={CONFIG:this.conf,DATA_KEYS:this.keys,PROCESSES:this.pcs,DICTIONARY_KEYS:this.dTable,OBJECT_KEYS:this.obTable};return this.parseTopLevel(t)};var a=function(t){t(o)};a(i(17)),a(i(23)),a(i(22)),a(i(20)),a(i(15)),a(i(18)),t.exports=o},function(t,e,i){var s=i(2).types,n=(i(5).lineBreak,i(3).isIdentifierStart,i(3).isIdentifierChar,i(8).getLineInfo),r=i(25);t.exports=function(t){var e=t.prototype;e.parseTopLevel=function(t){var e=this.pcsTable;for(e.main={pos:0};this.type!==s.eof;)this.parseStructure();for(var i in e)e[i]&&this.raise(e[i].pos,"Invalid process call at");return t},e.parseStructure=function(){var t=this.type;return t.macro?this.parseSet():t===s._process?this.parseProcess():void this.raise(this.start,"Expect a #set or process")},e.parseSet=function(){var t=this.type;t.macro||this.unexpected();var e=t.label.substr(1).toLowerCase();this.writeConfig(e),this.next()},e.writeConfig=function(t){var e,i=this.conf;switch(i[t]&&this.raise(this.start,this.type.keyword+" was defined already"),t){case"screen":var s,n,r=this.value.split(",");2!==r.length&&this.raise("Invalid arguments"),s=~~parseInt(r[0],10),n=~~parseInt(r[1],10),e={width:s,height:n};break;default:e=parseInt(this.value,10)}i[t]=e},e.parseProcess=function(){var t={LINE:n(this.input,this.start),TYPE:170,BODY:{}},e=this.pcs,i=this.pcsTable;this.next();var s=this.parseIndent();e[s]&&this.raise(this.start,s+" process was defined already"),e[s]=t,i[s]=!1,this.parsePcParam(t),this.parsePcBlock(t)},e.parsePcParam=function(t){this.eat(s.parenL)&&(t.BODY.params=this.parseBindingList(s.parenR,!1,!1))},e.parsePcBlock=function(t){var e=this.parseBlock();e.length&&1===e[e.length-1].TYPE||e.push({LINE:-1,TYPE:1}),t.BODY.segment=e},e.parseBlock=function(){this.expect(s.braceL);for(var t=[];!this.eat(s.braceR);){var e=this.parseStatement(!0);t.push(e)}return t},e.parseStatement=function(t){var e=this.type,i=this.startNode();switch(e){case s._click:case s._rclick:case s._dblclick:case s._movein:case s._moveout:return this.parseMouseAction(i,e.keyword);case s._select:return this.parseSelectAction();case s._scroll:return this.parseScrollAction(i,e.keyword);case s._input:return this.parseInputAction(i,e.keyword);case s._return:return this.parseReturnStatement(i);case s._wait:return this.parseWaitStatement(i);case s._assert:return this.parseAssertStatement(i);case s._log:case s._console:return this.parseLogStatement(i,e===s._log?32:33);case s._jumpto:return this.parseGotoStatement(i);case s._refresh:return this.parseRefreshStatement(i);case s._var:return this.parseVarStatement(i);case s.name:return this.parseExprStatement(i);default:this.unexpected()}},e.parseReturnStatement=function(t){return this.next(),this.eat(s.semi)?t.args=null:this.raise(this.start,"Return expression is not supported"),this.finishNode(t,1)},e.parseVarStatement=function(t){return this.next(),this.parseVar(t),t.BODY.exp=r(t.BODY.raw),this.semicolon(),this.finishNode(t,16)},e.parseVar=function(t){for(var e=[];;){var i={};if(i.id=this.parseIndent(),this.eat(s.eq)?i.init=this.parseMaybeAssign():i.init=null,e.push(i),!this.eat(s.comma))break}t.BODY.raw={declarations:e,type:"varDecl"}},e.parseExprStatement=function(t){var e=this.parseExpression();if(this.semicolon(),"CallExpr"===e.type){var i=e.callee.name;return this.pcsTable[i]!==!1&&(this.pcsTable[i]={pos:this.lastTokStart}),t.BODY.identifier=i,this.finishNode(t,0)}var s=r(e);return t.BODY.raw=e,t.BODY.exp=s,this.finishNode(t,16)},e.parseWaitStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.delay=r(t.BODY.raw),this.semicolon(),this.finishNode(t,17)},e.parseMouseAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),t.BODY.action=e,this.semicolon(),this.finishNode(t,18)},e.parseScrollAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),this.expect(s._by),t.BODY.raw1=this.parseExpression(),t.BODY.param=r(t.BODY.raw1),t.BODY.action=e,this.finishNode(t,18)},e.parseSelectAction=function(){this.raise("work in progress...")},e.parseInputAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),this.expect(s._by),t.BODY.raw1=this.parseExpression(),t.BODY.param=r(t.BODY.raw1),t.BODY.action=e,this.semicolon(),this.finishNode(t,18)},e.parseAssertStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.exp=r(t.BODY.raw),this.eat(s._in)&&(this.type===s.num?t.BODY.timeout=this.value:this.unexpected(),this.next()),this.semicolon(),t.BODY.key=this.UID("#"),this.keys[t.BODY.key]=!!t.BODY.timeout,this.finishNode(t,19)},e.parseGotoStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.url=r(t.BODY.raw),this.semicolon(),this.finishNode(t,20)},e.parseRefreshStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,21)},e.parseLogStatement=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.msg=r(t.BODY.raw),this.semicolon(),this.finishNode(t,e)},e.startNode=function(){return{LINE:n(this.input,this.start).line,TYPE:0,BODY:{},start:this.start,end:0}},e.finishNode=function(t,e){return t.TYPE=e,t.end=this.lastTokEnd,t}}},function(t,e,i){var s=i(3).isIdentifierStart,n=i(3).isIdentifierChar,r=i(2).types,o=i(2).keywordTypes,a=i(5).isNewLine,h=i(5).lineBreak;t.exports=function(t){var e=t.prototype;e.next=function(){this.lastTokEnd=this.end,this.lastTokStart=this.start,this.nextToken()},e.nextToken=function(){return this.skipSpace(),this.start=this.pos,this.pos>=this.input.length?this.finishToken(r.eof):void this.readToken(this.fullCharCodeAtPos())},e.readToken=function(t){return s(t)||35===t?this.readWord():this.getTokenFromCode(t)},e.fullCharCodeAtPos=function(){return this.input.charCodeAt(this.pos)},e.skipBlockComment=function(){var t=this.pos,e=this.input.indexOf("*/",this.pos+=2);-1===e&&this.raise(this.pos-2,"unterminated comment"),this.pos=e+2,this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,e),t,this.pos)},e.skipLineComment=function(t){for(var e=this.pos,i=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&10!==i&&13!==i&&8232!==i&&8233!==i;)++this.pos,i=this.input.charCodeAt(this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+=t,this.pos),e,this.pos); | ||
},e.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&14>t))break t;++this.pos}}},e.readToken_bracket=function(){var t=this.pos++,e=this.fullCharCodeAtPos();if(s(e)){var i=this.readWord1();return e=this.fullCharCodeAtPos(),93!==e&&this.raise(t,"Unterminated dictionary index"),this.pos++,this.dTable[i]=!0,this.finishToken(r.dict,i)}return this.finishToken(r.bracketL)},e.readToken_brace=function(){var t=this.pos++,e=this.fullCharCodeAtPos();if(s(e)){var i=this.readWord1();return e=this.fullCharCodeAtPos(),125!==e&&this.raise(t,"Unterminated object store index"),this.pos++,this.obTable[i]=!0,this.finishToken(r.objectAt,i)}return this.finishToken(r.braceL)},e.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp("/")):61===t?this.finishOp(r.assign,2):62===t?this.finishOp(r.tagR,2):this.finishOp(r.slash,1)},e.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=42===t?r.star:r.modulo;return 61===e?this.finishOp(r.assign,i+1):this.finishOp(s,i)},e.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp("|")):e===t?this.finishOp(124===t?r.logicalOR:r.logicalAND,2):void this.raise(this.pos,"bitwise operator is not allowed")},e.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(r.incDec,2):61===e?this.finishOp(r.assign,2):this.finishOp(r.plusMin,1)},e.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;if(e===t&&this.raise(this.pos,"bitwise operator is not allowed"),60===t){if(35===e)return this.finishOp(r.tagNumL,2);if(64===e)return this.finishOp(r.tagAtL,2)}return 61===e&&(i=2),this.finishOp(r.relational,i)},e.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 126===e&&33===t?this.finishOp(r.match,2):61===e?this.finishOp(r.equality,61===this.input.charCodeAt(this.pos+2)?3:2):this.finishOp(61===t?r.eq:r.prefix,1)},e.getTokenFromCode=function(t){switch(t){case 40:return++this.pos,this.finishToken(r.parenL);case 41:return++this.pos,this.finishToken(r.parenR);case 59:return++this.pos,this.finishToken(r.semi);case 44:return++this.pos,this.finishToken(r.comma);case 91:return this.readToken_bracket();case 93:return++this.pos,this.finishToken(r.bracketR);case 123:return this.readToken_brace();case 125:return++this.pos,this.finishToken(r.braceR);case 58:return++this.pos,this.finishToken(r.colon);case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:var e=this.input.charCodeAt(this.pos+1);return 126!==e&&this.raise(this.pos,"bitwise operator is not allowed"),this.finishOp(r.match,2)}this.raise(this.pos,'Unexpected character "'+this.input[this.pos]+'"')},e.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+=e);return this.finishToken(t,i)},e.finishToken=function(t,e){this.end=this.pos,this.type=t,this.value=e,this.exprAllowed=this.type.beforeExpr},e.readRegexp=function(t){for(var e,i,s=this.pos;;){this.pos>=this.input.length&&this.raise(s,"Unterminated regular expression");var n=this.input.charAt(this.pos);if(h.test(n)&&this.raise(s,"Unterminated regular expression"),e)e=!1;else{if("["===n)i=!0;else if("]"===n&&i)i=!1;else if(n===t&&!i)break;e="\\"===n}++this.pos}var o=this.input.slice(s,this.pos);++this.pos;var a=this.readWord1();if(a){var c=/^[gim]*$/;c.test(a)||this.raise(s,"Invalid regular expression flag")}var u={pattern:o,flags:a,isGenerate:"|"===t};return this.finishToken(r.regexp,u)},e.readInt=function(t,e){for(var i=this.pos,s=0,n=0,r=null==e?1/0:e;r>n;++n){var o,a=this.fullCharCodeAtPos();if(o=a>=97?a-97+10:a>=65?a-65+10:a>=48&&57>=a?a-48:1/0,o>=t)break;++this.pos,s=s*t+o}return this.pos===i||null!=e&&this.pos-i!==e?null:s},e.readNumber=function(t){var e=this.pos,i=!1;t||null!==this.readInt(10)||this.raise(e,"Invalid Number");var n=this.fullCharCodeAtPos();46===n&&(++this.pos,this.readInt(10),i=!0,n=this.fullCharCodeAtPos()),69!==n&&101!==n||(n=this.input.charCodeAt(++this.pos),43!==n&&45!==n||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number"),i=!0),s(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=this.input.slice(e,this.pos);return o=i?parseFloat(a):parseInt(a,10),this.finishToken(r.num,o)},e.readString=function(t){for(var e="",i=this.start,s=++this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated string");var n=this.fullCharCodeAtPos();if(n===t)break;92===n?(e+=this.input.slice(s,this.pos),e+=this.readEscapedChar(),s=this.pos):(a(n)&&this.raise(i,"Unterminated string"),++this.pos)}return e+=this.input.slice(s,this.pos++),this.finishToken(r.string,e)},e.readEscapedChar=function(){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 116:return" ";case 98:return"\b";case 118:return"\x0B";case 102:return"\f";case 13:10===this.fullCharCodeAtPos()&&++this.pos;case 10:return"";default:return String.fromCharCode(t)}},e.readWord1=function(){for(var t="",e=!0,i=this.pos;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(n(s))++this.pos;else{if(!e||35!==s)break;++this.pos}e=!1}return t+=this.input.slice(i,this.pos)},e.readWord=function(){var t,e=this.pos,i=this.readWord1();if(this.keywords.test(i)){if(t=o[i],t.macro){var s=this.readMacro();return this.finishToken(t,s)}}else 35===i.charCodeAt(0)&&this.raise(e,"# is only valid for # macro"),t=r.name;return this.finishToken(t,i)},e.readMacro=function(){for(var t=this.pos,e=this.fullCharCodeAtPos();this.pos<this.input.length&&10!==e&&13!==e&&8232!==e&&8233!==e;)++this.pos,e=this.input.charCodeAt(this.pos);return this.input.slice(t,this.pos).trim()}}},function(t,e){function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports={isArray:i,has:s}},function(t,e){var i={varDecl:function(t,e){var i="",s=!0;return t.declarations.forEach(function(t){t.init&&(s||(i+=","),i+="$."+t.id+" = "+e(t.init),s=!1)}),"("+i+")"},SequenceExpr:function(t,e){var i="",s=!0;return t.expressions.forEach(function(t){s||(i+=","),i+=e(t),s=!1}),"("+i+")"},literal:function(t,e){return t.raw},regexp:function(t,e){if(t.regexp.isGenerate){var i=t.regexp;return"(/"+i.pattern+"/"+i.flags+").gen()"}return"("+t.raw+")"},dictionaryIndex:function(t,e){return"d."+t.value},objectStore:function(t,e){return"o."+t.value},Identifier:function(t,e){return"$."+t.name},LogicalExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},BinaryExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},MatchExpr:function(t,e){var i="";return"~~"===t.operator&&(i+="!"),i+"!("+e(t.left)+").match("+e(t.right)+").length"},UpdateExpr:function(t,e){var i="$."+t.argument;return t.prefix?t.operator+i:i+t.operator},UnaryExpr:function(t,e){return t.operator+"("+e(t.argument)+")"},AssignmentExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},ParenthesizedExpr:function(t,e){return"("+e(t.expression)+")"},TextExpr:function(t,e){var i="String("+e(t.val)+")";return"t("+i+")"},CountExpr:function(t,e){var i="String("+e(t.val)+")";return"c("+i+")"}};t.exports=function(t){var e=function s(t){var e=t.type;return i[e](t,s)}(t);return new Function("$,o,d,c,t","return "+e+";")}}]); | ||
//# sourceMappingURL=lemoncase.min.js.map | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.LC=e():t.LC=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(15)},function(t,e){t.exports={CALL:0,RETURN:1,EXIT:2,EXPRESSION:16,WAIT:17,TRIGGER:18,ASSERT:19,JUMPTO:20,REFRESH:21,LOG:32,CONSOLE:33,PROCESS:255}},function(t,e){function n(t,e){var n=r.contextFrame;n.style.height="100%",n.style.width="100%",t.appendChild(n),(e||s.noop).call(n)}function i(){return r.contextFrame}var s,r,o;s={now:Date.now||function(){return(new Date).getTime()},isString:function(t){return"string"==typeof t},isUndefined:function(t){return void 0===t},isDefined:function(t){return!s.isUndefined(t)},isNumber:function(t){return"number"==typeof t},isObject:function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},isElement:function(t){return!(!t||1!==t.nodeType)},isFunction:function(t){return"function"==typeof t},isArray:function(t){return"[object Array]"==={}.toString.call(t)},last:function(t){return t[t.length-1]},noop:function(){},forEach:function(t,e,n){e=e.bind(n);var i,s;if(this.isArray(t))for(i=0,s=t.length;s>i;i+=1)e(t[i],i,t);else{var r=Object.keys(t);for(i=0,s=r.length;s>i;i+=1)e(t[r[i]],r[i],t)}return t},document:function(){return r.contextFrame?r.contextFrame.contentWindow.document:document},countDOM:function(t){return s.document().querySelectorAll(t).length},getInnerHTML:function(t){var e=s.document().querySelector(t);return e?e[e.value?"value":"innerHTML"]:"Error:No such HTMLElement."}},r={contextFrame:document.createElement("iframe"),defaultNextLoopDelay:3e3,readyTimeout:3e3,defaultClock:10,bootExceptionHandle:s.noop,triggerCallback:s.noop,runCallback:s.noop,runExceptionHandle:s.noop,successCallback:s.noop,readyCallback:s.noop,nextLoopCallback:s.noop,consoleFn:s.noop},o=function(t){return s.isString(t)?r[t]:s.isObject(t)?void s.forEach(t,function(t,e){this[e]=t},r):void 0},o.setContextFrame=function(t){trigger.setupIframe(t),r.contextFrame=t},t.exports={_:s,settings:r,setup:o,init:n,getLemoncaseFrame:i}},function(t,e){function n(t,e){return new s(t,{beforeExpr:!0,binop:e})}function i(t,e){e=e||{},e.keyword=t,c[t]=a["_"+t]=new s(t,e)}var s=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.macro=!!e.macro},r={beforeExpr:!0},o={macro:!0},a={num:new s("num"),regexp:new s("regexp"),string:new s("string"),name:new s("name"),eof:new s("eof"),objectAt:new s("objectStore"),dict:new s("dictionaryIndex"),bracketL:new s("[",r),bracketR:new s("]"),braceL:new s("{",r),braceR:new s("}"),parenL:new s("(",r),parenR:new s(")"),comma:new s(",",r),semi:new s(";",r),colon:new s(":",r),tagNumL:new s("<#",r),tagAtL:new s("<@",r),tagR:new s("/>"),eq:new s("=",{beforeExpr:!0,isAssign:!0}),assign:new s("_=",{beforeExpr:!0,isAssign:!0}),incDec:new s("++/--",{prefix:!0,postfix:!0}),prefix:new s("prefix",{beforeExpr:!0,prefix:!0}),logicalOR:n("||",1),logicalAND:n("&&",2),equality:n("==/!=",6),relational:n("</>",7),plusMin:new s("+/-",{beforeExpr:!0,binop:9,prefix:!0}),modulo:n("%",10),star:n("*",10),slash:n("/",10),match:n("~~",6)},c={};i("in"),i("by",r),i("click",r),i("input",r),i("rclick",r),i("dblclick",r),i("movein",r),i("moveout",r),i("scroll",r),i("select",r),i("#CLOCK",o),i("#TIMES",o),i("#INTERVAL",o),i("#SCREEN",o),i("wait",r),i("assert",r),i("log",r),i("console",r),i("var"),i("process"),i("return",r),i("jumpto"),i("refresh"),t.exports={TokenType:s,types:a,keywordTypes:c}},function(t,e){function n(t){return 65>t?36===t:91>t?!0:97>t?95===t:123>t}function i(t){return 48>t?36===t:58>t?!0:65>t?!1:91>t?!0:97>t?95===t:123>t}var s=["in","by"],r=["click","input","rclick","dblclick","movein","moveout","scroll","select","jumpto","refresh"],o=["#CLOCK","#TIMES","#INTERVAL","#SCREEN"],a=["wait","assert","log","console","var","process","return"].concat(s).concat(r).concat(o),c=new RegExp("^("+a.join("|")+")$");t.exports={keywordRegexp:c,isIdentifierStart:n,isIdentifierChar:i}},function(t,e){var n=function(t,e){function n(t,e){this.$case=e,this.$body=t.BODY,this.$line=t.LINE}if(!e){var s=i[t];if(!s)throw new Error("TYPE:"+t+" instruction is not existed.");return s}if(i[t])throw new Error("The instruction factory: TYPE="+t+" is existed.");return n.prototype.execute=e.operation,n.prototype.line=function(){return this.$line},n.prototype.body=function(t){return t?this.$body[t]:this.$body},n.prototype.assignCase=function(t){return this.$case=t,this},n.create=function(){return new n({BODY:e.bodyFactory.apply(null,arguments)})},n.$new=function(t,e){return new n(t,e)},i[t]=n,n},i=[];t.exports=n},function(t,e){var n=/\r\n?|\n|\u2028|\u2029/;t.exports={lineBreak:n,lineBreakG:new RegExp(n.source,"g"),isNewLine:function(t){return 10===t||13===t||8232===t||8233===t}}},function(t,e,n){function i(t,e,n,i){var s={process:{},config:{}},r=[];return a.forEach(t.DATA_KEYS,function(t,e){t&&r.push(e)}),a.forEach(t.DICTIONARY_KEYS,function(t,e){if(!n.isFieldDefined(e))throw new Error("The field: "+e+" is undefined in dictionary.")}),a.forEach(t.OBJECT_KEYS,function(t,n){if(!e.hasOwnProperty(n))throw new Error("The key: "+n+" is undefined in object.")}),a.forEach(t.PROCESSES,function(t,e){var n=s.process[e]=[];a.forEach(t.BODY.segment,function(t){n.push(u(t.TYPE).$new(t,i))})}),s.config.times=t.CONFIG.times,s.config.interval=t.CONFIG.interval,s.config.screen=t.CONFIG.screen,{eT:s,dK:r}}function s(t,e,n){if(!(this instanceof s))return new s(t,e,n);var r=i(t,e,n,this);this.$$executionTree=r.eT,this.$dictionary=n,this.$objectList=e,this.$$log=new h(r.dK),this.$$state="ready",this.$$coreId=null,this.$$activeTime=0,this.$$currentLoop=0,this.$$blockStack=[],this.$$scopeStack=[],this.$$instructionBuffer=void 0,this.$$tempInstruction=void 0,this.$$idleTask=a.noop,this.$loopData=null}var r=n(1).CALL,o=n(1).EXIT,a=n(2)._,c=n(2).settings,h=n(10),u=n(5),p=s.prototype;p.$$getConfig=function(t){return this.$$executionTree.config[t]},p.$$bootstrap=function(){var t=c.contextFrame.style,e=this.$$getConfig("screen");return this.$$currentLoop=0,this.hasDictionary()&&(this.$loopData=this.$dictionary.load(this.$$getConfig("times")).fetch()),e&&(t.height=e.height+"px",t.width=e.width+"px"),this.$setActiveTime().$setTempInstruction(u(r).create("main")).$$log.initialization(),this},p.$$exitCase=function(){return this.$setState("success").$$interrupt(),(c.successCallback||a.noop).call(this),this},p.$$interrupt=function(){return clearInterval(this.$$coreId),this},p.$$popInstruction=function(){var t=this.$$tempInstruction,e=this.$getCurrentBlock();return t?(this.$setTempInstruction(),t):e?(this.$$instructionBuffer=e.segment[e.counter++],this.$$instructionBuffer):u(o).create(!0).assignCase(this)},p.$$run=function(){try{this.$$popInstruction().execute(),c.runCallback.call(this)}catch(t){console.error(t),c.runExceptionHandle.call(this,t)}return this},p.$$core=function(){var t=this;return this.$$coreId=setInterval(function(){t["$$"+(a.now()>=t.$$activeTime?"run":"idleTask")]()},this.$$getConfig("clock")||c.defaultClock),this},t.exports={Case:s,$CP:p}},function(t,e,n){function i(t,e){for(var n=1,i=0;;){c.lastIndex=i;var s=c.exec(t);if(!(s&&s.index<e))return new h(n,e-i);++n,i=s.index+s[0].length}}function s(t,e,n){var i=t.split(c)[e.line-1],s=i.substr(0,e.column),h=a(s),u=r(h),p=o(n,h);return"\n"+i+"\n"+u+"\n"+p}function r(t){for(var e=-1,n=-1,i="";++e<t;)i+=" ";for(i+="↑\n";++n<t;)i+=" ";return i+="↑"}function o(t,e){if(t.length/2>e)return t;for(var n=-1,i=e-Math.floor(t.length/2),s="";++n<i;)s+=" ";return s+=t}function a(t){for(var e,n=0,i=-1,s=t.length;++i<s;)switch(e=t.charCodeAt(i)){case 9:n+=4;break;default:n+=1}return n}var c=n(6).lineBreakG,h=function(t,e){this.line=t,this.column=e};h.prototype.offset=function(t){return new h(this.line,this.column+t)},t.exports={getLineInfo:i,empowerErrMsg:s}},function(t,e,n){function i(t){return this instanceof i?(this.$options={},this.$$buffer=[],this.$assignment=[],this.$field=[],this.field(t.field),void this.assignment(t.assignment)):new i(t)}var s=n(2)._;i.prototype.field=function(t){return s.isArray(t)&&(this.$field=t),this.$options.field=this.$field,this.$field},i.prototype.assignment=function(t){return s.isArray(t)&&(this.$assignment=t),this.$options.assignment=this.$assignment,this.$assignment},i.prototype.load=function(t){var e,n=this.$assignment.length,i=this.getKeys(),r=(i.length,function(t){s.forEach(i,function(e,n){this[e.name]=t[n]},this)}),o=function(){s.forEach(i,function(t){this[t.name]=t.pattern.gen()},this)};for(this.$$buffer=[],e=0;n>e&&t>e;e+=1)this.$$buffer.push(new r(this.$assignment[e]));for(null;t>e;e+=1)this.$$buffer.push(new o);return this},i.prototype.getKeys=function(){var t=[];return s.forEach(this.$field,function(t){this.push({name:t.name,pattern:new RegExp(t.pattern)})},t),t},i.prototype.fetch=function(){return this.$$buffer.shift()},i.prototype.isFieldDefined=function(t){var e,n=this.$field.length;for(e=0;n>e;e+=1)if(this.$field[e].name===t)return!0;return!1},t.exports=i},function(t,e,n){var i=n(2)._,s=function(t){this.$$baseTime=0,this.$dataKeys=t||[],this.$marks=[],this.$logs=[],this.$datas={}};s.prototype.initialization=function(){return this.clear(),this.$$baseTime=i.now(),i.forEach(this.$dataKeys,function(t){this[t]=[]},this.$datas),this},s.prototype.getLength=function(t){return this["$"+t].length},s.prototype.log=function(t,e){return this.$logs.push([t,i.now()-this.$$baseTime,e||0]),this},s.prototype.data=function(t,e){return this.$datas[t].push(e),this},s.prototype.markLog=function(t,e){return this.$marks.push([t,e,this.getLength("logs")-1]),this},s.prototype.clear=function(){return this.$$baseTime=0,this.$marks.length=0,this.$logs.length=0,this.$datas={},this},s.prototype.export2json=function(){return{baseTime:this.$$baseTime,marks:this.$marks,logs:this.$logs,performance:this.$datas}},s.prototype.export2text=function(){return JSON.stringify(this.export2json())},t.exports=s},function(t,e){!function(){var e={POSITION:0,CLASS:2,RANGE:3,CLAUSE:6,REFERENCE:7,INTS:"0123456789",WORDS:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",WHITESPACE:" \f\n\r \x0B \u2028\u2029\u2028\u2029 "},n="@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?",i={0:0,t:9,n:10,v:11,f:12,r:13},s={rndChar:function(t){return t[Math.floor(Math.random()*t.length)]},anyRndChar:function(){return String.fromCharCode(s.rndInt(0,65535))},strToChars:function(t){var e=/\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|(0?[0-7]{2})|c([@A-Z\[\\\]^?])|([0tnvfr]))/g;return t=t.replace(e,function(t,e,s,r,o,a){var c,h=e?parseInt(e,16):s?parseInt(s,16):r?parseInt(r,8):o?n.indexOf(o):a?i[a]:void 0;return void 0!==h?(c=String.fromCharCode(h),c=c.replace(/[[\]{}^$.|?*+()]/g,function(t){return"\\"+t})):c="\\"+a,c})},rndInt:function(t,e){return t+Math.floor(Math.random()*(1+e-t))},findChar:function(t){for(var e="\\",n="]",i=0;;){var s=t.indexOf(n);if(t[s-1]!==e)return i+s;t=t.slice(++s),i+=s}},range:function(t,n,i){var s=e.WORDS;return s.slice(s.indexOf(n),s.indexOf(i)+1)},classRange:function(t){return t.replace(/(\w)-(\w)/g,s.range)},toBothCases:function(t){var e=t;return e+=t["to"+(t===t.toLowerCase()?"Upper":"Lower")+"Case"]()},inCaseClass:function(t,e){return e?t=t.replace(/[a-zA-Z]/g,function(t){return s.toBothCases(t)}):t},inCaseChar:function(t,n){return n&&/[a-zA-Z]/.test(t)?{type:e.CLASS,chars:s.toBothCases(t)}:t},flatten:function(t){for(var e=0;e<t.length-1;e++)if("string"==typeof t[e])for(var n=e+1;;){var i=t[n];if("string"!=typeof i)break;t[e]+=i,t.splice(n,1)}return 1===t.length?t[0]:t},reduce:function(t){if(t.stack)t.stack=s.flatten(t.stack);else if(t.options)for(var e=0,n=t.options.length;n>e;e++)t.options[e]=s.flatten(t.options[e]);return t.options||t.group||t.value?t:t.stack},nextClose:function(t){for(var e=0,n=0,i=t.length;i>n;n++){var s=t[n];switch(s){case")":if(0===e)return n+1;e--;break;case"(":e++;break;case"\\":n++}}}},r={type:e.POSITION,value:"b"},o={type:e.POSITION,value:"B"},a={type:e.POSITION,value:"^"},c={type:e.POSITION,value:"$"},h={type:e.CLASS,chars:e.WORDS},u={type:e.CLASS,chars:e.WORDS,not:!0},p={type:e.CLASS,chars:e.INTS},f={type:e.CLASS,chars:e.INTS,not:!0},l={type:e.CLASS,chars:e.WHITESPACE},d={type:e.CLASS,chars:e.WHITESPACE,not:!0},v={type:e.CLASS,chars:"\n",not:!0},g=function(t,n,i){var g,m=0,$={type:e.CLAUSE,stack:[]},x=$,y=$.stack,b=[];for(t=s.strToChars(t);m<t.length;)switch(g=t[m++]){case"\\":switch(g=t[m++]){case"b":y.push(r);break;case"B":y.push(o);break;case"w":y.push(h);break;case"W":y.push(u);break;case"d":y.push(p);break;case"D":y.push(f);break;case"s":y.push(l);break;case"S":y.push(d);break;default:/\d/.test(g)?y.push({type:e.REFERENCE,value:parseInt(g)}):y.push(g)}break;case"^":y.push(a);break;case"$":y.push(c);break;case"[":if(g=t[m],"\\"===g&&0===t.slice(m+1).indexOf("b]"))m+=3,y.push("\b");else{var E;"^"===g?(E=!0,m++):E=!1;var k=t.slice(m),C=s.findChar(k),w=k.substring(0,C);m+=C+1,y.push({type:e.CLASS,chars:s.inCaseClass(s.classRange(w),n),not:E})}break;case".":y.push(v);break;case"(":g=t[m];var T;if("?"===g){if(g=t[m+1],m+=2,"!"===g){m+=s.nextClose(t.slice(m));break}T=!1}else T=!0;var S={type:e.CLAUSE,group:T,stack:[]};y.push(S),b.push(x),x=S,y=S.stack;break;case")":x=b.pop(),y=x.options?x.options[x.options.length-1]:x.stack;var O=y.length-1;y[O]=s.reduce(y[O]);break;case"|":x.options||(x.options=[x.stack],delete x.stack);var A=[];x.options.push(A),y=A;break;case"{":var I=/^(\d+)(,(\d+)?)?\}/.exec(t.slice(m)),L=parseInt(I[1]),R=I[2]?I[3]?parseInt(I[3]):1/0:L;m+=I[0].length;var B=y.pop();if(L===R)for(var D=0;L>D;D++)y.push(B);else y.push({type:e.RANGE,min:L,max:R,value:B});break;case"?":var B=y.pop();y.push({type:e.RANGE,min:0,max:1,value:B});break;case"+":var B=y.pop();y.push({type:e.RANGE,min:1,max:1/0,value:B});break;case"*":var B=y.pop();y.push({type:e.RANGE,min:0,max:1/0,value:B});break;default:y.push(s.inCaseChar(g,n))}return s.reduce($)},m=function(t,n,i,r){if("string"==typeof t)return t;if(t.length){for(var o="",a=0,c=t.length;c>a;a++)o+=m(t[a],n,i,r);return o}switch(t.type){case e.POSITION:return"";case e.CLASS:if(!t.not)return s.rndChar(t.chars);for(;;){var h=i();if(-1===t.chars.indexOf(h))return h}case e.RANGE:for(var u=s.rndInt(t.min,t.max===1/0?t.min+n:t.max),o="",a=0;u>a;a++)o+=m(t.value,n,i,r);return o;case e.CLAUSE:if(t.options){var u=s.rndInt(0,t.options.length-1);return m(t.options[u],n,i,r)}var p=m(t.stack,n,i,r);return r.push(p),p;case e.REFERENCE:return r[t.value-1]}};RegExp.prototype.gen=function(){return void 0===this._randexp&&(this._randexp=g(this.source,this.ignoreCase,this.multiline),this._max=this._max||100,this._anyRndChar=this._anyRndChar||s.anyRndChar),m(this._randexp,this._max,this._anyRndChar,[])},"undefined"==typeof window&&(t.exports=m)}()},function(t,e){!function(){"use strict";function e(t,e,n){var i,s=[t];for(i in n)n.hasOwnProperty(i)&&(s[n[i]]=e[i]||null);return s}function n(t){return 1===t.nodeType}function i(t){return t instanceof Window}function s(t){return null!==t&&"object"==typeof t}function r(t){return"function"==typeof t}function o(t,e){e?t.$$hashKey=e:delete t.$$hashKey}function a(t,e){var n,i,a,c,h,u,p,f,l=t.$$hashKey;if(e)for(i=0,n=e.length;n>i;++i)if(p=e[i],s(p)||r(p))for(f=Object.keys(p),c=0,a=f.length;a>c;c++)h=f[c],u=p[h],t[h]=u;return o(t,l),t}function c(t){return a(t,[].slice.call(arguments,1),!1)}function h(t,e,n){v&&t.dispatchEvent(new E(e,c({},A,n)))}function u(t,e,n){t.dispatchEvent(new C(e,c({},A,n)))}function p(t,e,n){t.dispatchEvent(new T(e,c({},A,n)))}function f(t){this.element=t,this.action=this.getActionRule(t)}var l,d=!0,v=!0,g=!0;try{l=new MouseEvent("click",{})}catch(m){d=!1}try{TouchEvent}catch($){v=!1}try{InputEvent}catch(x){g=!1}var y,b,E=function(t,n){var i=document.createEvent("UIEvent"),s={bubbles:1,cancelBubble:2,view:3,detail:4};return i.initUIEvent.apply(i,e(t,n,s)),i},k=d&&!v?Event:function(t,n){var i=document.createEvent("Event"),s={bubbles:1,cancelBubble:2};return i.initEvent.apply(i,e(t,n,s)),i},C=d&&!v?MouseEvent:function(t,n){var i=document.createEvent("MouseEvent"),s={bubbles:1,cancelBubble:2,view:3,detail:4,screenX:5,screenY:6,clientX:7,clientY:8,ctrlKey:9,altKey:10,shiftKey:11,metaKey:12,button:13,relatedTarget:14};return i.initMouseEvent.apply(i,e(t,n,s)),i},w=d&&!v?UIEvent:function(t,n){var i=document.createEvent("UIEvent"),s={bubbles:1,cancelBubble:2,view:3,detail:4};return i.initUIEvent.apply(i,e(t,n,s)),i},T=d&&!v?KeyboardEvent:function(t,n){var i=document.createEvent("KeyboardEvent"),s={bubbles:1,cancelBubble:2,view:3,"char":4,key:5,location:6,repeat:8};return i.initKeyboardEvent.apply(i,e(t,n,s)),i},S=(g?InputEvent:w,{contextIframe:null,window:function(){return S.contextIframe?S.contextIframe.contentWindow:window}}),O=[],A={bubbles:!0,cancelBubble:!0},I=0,L=1,R=2,B=3,D=4,N=5,_=6,P=7,Y=8,F=9,M=16,U=17,j=18,G=32,K=33,W=34,H=36,q=48,X=49;O[I]=function(t){h(this,"touchend",t),u(this,"mouseup",t)},O[L]=function(t){h(this,"touchstart",t),u(this,"mousedown",t)},O[R]=function(t){u(this,"mouseenter",t)},O[B]=function(t){u(this,"mouseleave",t)},O[D]=function(t){u(this,"mouseout",t)},O[N]=function(t){u(this,"mouseover",t)},O[_]=function(t){h(this,"touchmove",t),u(this,"mousemove",t)},O[P]=function(t){u(this,"click",t)},O[Y]=function(t){u(this,"dblclick",t)},O[F]=function(t){u(this,"contextmenu",t)},O[U]=function(t){p(this,"keydown",t)},O[j]=function(t){p(this,"keypress",t)},O[M]=function(t){p(this,"keyup",t)},O[W]=function(){this.focus()},O[K]=function(t){var e=S.contextIframe.style;e.width=t.width+"px",e.height=t.height+"px"},O[G]=function(t){S.window().scrollTo(t.x,t.y),this.dispatchEvent(new w("scroll"))},O[H]=function(t){var e=this[t.index];O[L].call(e,t),O[I].call(e,t),e.selected=!0,this.dispatchEvent(new w("select")),O[P].call(e,t),O[D].call(e,t)},O[q]=function(t){this.value=t.value,this.dispatchEvent(new w("input",t))},O[X]=function(){this.dispatchEvent(new k("change",{bubbles:!0}))},f.prototype.getActionRule=function(t){return t=t||this.element,t instanceof Window?b.window:"input"===t.tagName.toLowerCase()?b["input/"+t.type]:"textarea"===t.tagName.toLowerCase()?b.textarea:"select"===t.tagName.toLowerCase()?b.select:b.generic},f.prototype.does=function(t,e){var n,i,s;if(this.testAction(t)!==!0)throw"The element:"+this.element.outerHTNL+" can not use action:"+t;for(s=this.action[t],i=s.length,n=0;i>n;n+=1)O[s[n]].call(this.element,e||{});return this},f.prototype.testAction=function(t){return this.action.hasOwnProperty(t)},b=function(){var t={};return t["input/checkbox"]=t["input/radio"]=t["input/button"]=t.generic={click:[L,_,I,P],dblclick:[L,I,P,L,I,P,Y],rclick:[L,I,F],movein:[N,D],moveout:[_,D],scroll:[G]},t.textarea=t["input/text"]=t["input/password"]=t["input/email"]=c({},t.generic,{input:[W,U,j,q,M,X],click:[L,W,_,I,P],dblclick:[L,W,_,I,P,L,_,I,P,Y],rclick:[L,W,I,F]}),t.select=c({},t.generic,{select:[L,W,_,I,P,_,D,H]}),t.window={scroll:[G],resize:[K]},t}(),y=function(t){if(!i(t)&&!n(t))throw'"element" for trigger must be a HTMLElement';return new f(t)},y.setupIframe=function(t){if(!(t instanceof HTMLIFrameElement))throw'"element" must be a iframe element.';S.contextIframe=t},"undefined"!=typeof t&&t.exports?t.exports=y:window.trigger=y}()},function(t,e,n){var i=n(7).$CP,s=n(2)._,r=n(2).settings,o=n(5),a=n(1).CALL;i.$setIdleTask=function(t){return this.$$idleTask=s.isFunction(t)?t:s.noop,this},i.$setActiveTime=function(t){return this.$$activeTime=s.now()+(t||0),this},i.$setTempInstruction=function(t){return this.$$tempInstruction=t?t.assignCase(this):void 0,this},i.$setState=function(t){return this.$$state=t,this},i.$pushBlock=function(t){return this.$$blockStack.push({counter:0,segment:t}),this},i.$pushScope=function(t){var e=this.$$blockStack;return this.$$scopeStack.push({blockIndex:e.length,vars:{}}),this.$pushBlock(this.$getProcess(t)),this},i.$popBlock=function(){return this.$$blockStack.pop(),this},i.$popScope=function(){var t=this.$$scopeStack.pop();return this.$$blockStack.length=t.blockIndex,this},i.$getCurrentBlock=function(){return s.last(this.$$blockStack)},i.$getCurrentScope=function(){return s.last(this.$$scopeStack)},i.$getProcess=function(t){return this.$$executionTree.process[t]},i.$exitLoop=function(){return this.$setActiveTime(this.$$getConfig("interval")||3e3),(this.$$currentLoop+=1)>=this.$$getConfig("times")?(this.$$exitCase(),this):(this.$setTempInstruction(o(a).create("main")),(r.nextLoopCallback||s.noop).call(this),this.hasDictionary()&&(this.$loopData=this.$dictionary.fetch()),this)},i.$runExp=function(t){return"function"==typeof t?t(this.$getCurrentScope().vars,this.$objectList,this.$loopData,s.countDOM,s.getInnerHTML):t},i.$pushLog=function(t,e){return this.getLog().log(t,e),this},i.$markLog=function(t,e){return this.getLog().markLog(t,e),this},i.$pushLogData=function(t,e){return this.getLog().data(t,e),this},i.$clearScope=function(){for(;this.$$scopeStack.length;)this.$popScope();return this},t.exports=i},function(t,e,n){var i=n(7).$CP,s=n(2).settings,r=n(9);i.hasDictionary=function(){return!!this.$dictionary},i.validateObjectList=function(t,e){return e.length?t?e.every(function(e){return null!==t[e]}):!1:!0},i.exportLog=function(t){return this.$$log["export2"+t]()},i.start=function(){var t=this.$$state;if("success"!==t&&"ready"!==t)throw new Error("Can not call play!");try{return this.$setState("running").$$bootstrap(),setTimeout(function(){this.$$core()}.bind(this),s.readyTimeout),this}catch(e){s.bootExceptionHandle(e)}},i.forceCofig=function(t){var e,n=this.$$executionTree.config;for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return this},i.suspend=function(){if("running"!==this.$$state)throw new Error("Can not call pause!");return this.$setState("pause").$$interrupt(),this},i.resume=function(){if("pause"!==this.$$state)throw new Error("Can not call resume!");return this.$setState("running").$$core(),this},i.stop=function(){var t=this.$$state;if("running"!==t&&"pause"!==t)throw new Error("Can not call stop!");return this.$setState("ready").$$interrupt(),this},i.debug=function(){var t=this.$$state;if("success"!==t&&"ready"!==t)throw new Error("Can not call play!");return this.$setState("debug").$$bootstrap(),this},i.dictionary=function(t){return t instanceof r&&(this.$dictionary=t),this.$dictionary},i.getLog=function(){return this.$$log},i.getCurrentStep=function(){return this.$$counter},i.getCurrentLoop=function(){return this.$$currentLoop},i.getCurrentLine=function(){return this.$$instructionBuffer.$getLine()},i.getStatus=function(){return{loop:this.$$currentLoop,line:this.getCurrentLine(),state:this.$$state}},t.exports=i},function(t,e,n){var i=n(18).parse,s=n(7).Case,r=n(2).setup,o=n(5),a=n(9),c=n(2).init,h=n(2).getLemoncaseFrame;n(13),n(14),n(11),n(16);var e={Case:s,setup:r,Instruction:o,parse:i,Dictionary:a,init:c,getLemoncaseFrame:h};t.exports=e},function(t,e,n){var i=n(5),s=n(2).settings,r=n(2)._,o=n(1).CALL,a=n(1).RETURN,c=n(1).EXIT,h=n(1).EXPRESSION,u=n(1).WAIT,p=n(1).TRIGGER,f=n(1).ASSERT,l=n(1).JUMPTO,d=n(1).REFRESH,v=n(1).LOG,g=n(1).CONSOLE,m=(n(1).PROCESS,1),$=0;trigger=n(12),i(o,{operation:function(){var t=this.body("identifier");this.$case.$pushScope(t).$pushLog([o,t],this.line())},bodyFactory:function(t){return{identifier:t}}}),i(a,{operation:function(){this.$case.$pushLog([a]).$popScope()},bodyFactory:function(){return{}}}),i(c,{operation:function(){var t=this.body("isSuccess")?m:$,e=this.$case;e.$pushLog([c,t],this.line()).$markLog(t,e.getCurrentLoop()).$clearScope().$exitLoop()},bodyFactory:function(t){return{isSuccess:t}}}),i(h,{operation:function(){this.$case.$runExp(this.body("exp"))},bodyFactory:function(t){return{exp:t}}}),i(u,{operation:function(){var t=this.$case.$runExp(this.body("delay"));this.$case.$setActiveTime(t).$pushLog([u,t],this.line())},bodyFactory:function(t){return{delay:t}}}),i(p,{operation:function(){var t=this.$case.$runExp(this.body("object")),e={value:this.$case.$runExp(this.body("param"))},n=this.body("action"),o=r.document().querySelectorAll(t)[0];return o?(trigger(o).does(n,e),s.triggerCallback.call(this.$case,o),void this.$case.$pushLog([p,m,t,n,e],this.line())):(this.$case.$pushLog([p,$,t,n,e],this.line()).$setTempInstruction(i(c).create(!1).assignCase(this.$case)),void console.log("Can not find a DOM by cssPath: "+t))},bodyFactory:function(t,e,n){return{object:t,action:e,param:n}}}),i(f,{operation:function(){function t(){a.$runExp(n)&&a.$setIdleTask().$setTempInstruction().$setActiveTime().$pushLog([f,m],h.line()).$pushLogData(h.body("key"),r.now()-e)}var e=r.now(),n=this.body("exp"),o=this.body("timeout"),a=this.$case,h=this;a.$setTempInstruction(i(c).create(!1).assignCase(a)),o&&o>2*s.defaultClock&&a.$setActiveTime(o).$setIdleTask(t),a.$runExp(n)?(a.$setTempInstruction().$setActiveTime().$setIdleTask().$pushLog([f,m],this.line()),o&&a.$pushLogData(h.body("key"),0)):o||a.$pushLog([f,$],this.line())},bodyFactory:function(t,e,n){return{exp:t,timeout:e,key:n}}}),i(l,{operation:function(){var t=this.$case.$runExp(this.body("url"));s.contextFrame.src=t,this.$case.$pushLog([l,t],this.line())}}),i(d,{operation:function(){s.contextFrame.src=r.document().location.href,this.$case.$pushLog([d],this.line())}}),i(v,{operation:function(){this.$case.$pushLog([v,this.$case.$runExp(this.body("msg"))])},bodyFactory:function(t){return{msg:t}}}),i(g,{operation:function(){var t=this.$case.$runExp(this.body("msg"));console.log(t),s.consoleFn(t)},bodyFactory:function(t){return{msg:t}}})},function(t,e,n){var i=n(3).types;t.exports=function(t){var e=t.prototype;e.parseExpression=function(){var t=this.parseMaybeAssign();if(this.type===i.comma){var e={type:"SequenceExpr"};for(e.expressions=[t];this.eat(i.comma);){var n=this.parseMaybeAssign();e.expressions.push(n)}return e}return t},e.parseMaybeAssign=function(){var t=this.parseMaybeConditional();if(this.type.isAssign){var e={type:"AssignmentExpr",left:t,operator:this.value};return this.next(),e.right=this.parseMaybeAssign(),e}return t},e.parseMaybeConditional=function(){return this.parseExprOps()},e.parseExprOps=function(){var t=this.start,e=this.parseMaybeUnary(!1);return this.parseExprOp(e,t,-1)},e.parseExprOp=function(t,e,n){var i=this.type.binop;if(null!=i&&i>n){var s=this.type,r=this.value;this.next();var o=this.start,a=this.parseExprOp(this.parseMaybeUnary(!1),o,i),c=this.buildBinary(e,t,a,r,s);return this.parseExprOp(c,e,n)}return t},e.buildBinary=function(t,e,n,s,r){var o={left:e,operator:s,right:n};return r===i.logicalAND||r===i.logicalOR?o.type="LogicalExpr":r===i.match?o.type="MatchExpr":o.type="BinaryExpr",o},e.parseMaybeUnary=function(t){var e;if(this.type.prefix){var n={},s=this.type===i.incDec;n.operator=this.value,n.prefix=!0,this.next(),n.argument=this.parseMaybeUnary(!1),s||(t=!0),n.type=s?"UpdateExpr":"UnaryExpr",e=n}else for(e=this.parseExprSubscripts();this.type.postfix;){var r={};r.operator=this.value,r.prefix=!1,r.argument=e,this.next(),r.type="UpdateExpr",e=r}return e},e.parseExprSubscripts=function(){var t=this.start,e=this.parseExprAtom();return this.parseSubscripts(e,t)},e.parseSubscripts=function(t,e){for(;;){if(this.eat(i.parenL)){var n={type:"CallExpr",callee:t};return this.expect(i.parenR),n}return t}},e.parseExprAtom=function(){var t;switch(this.type){case i.name:var e=this.parseIndent(this.type!==i.name);return{type:"Identifier",name:e};case i.regexp:var n=this.value;return t=this.parseLiteral("regexp"),t.regexp=n,t;case i.num:case i.string:return this.parseLiteral("literal",this.value);case i.objectAt:case i.dict:return this.parseExtLiteral(this.type);case i.parenL:return this.parseParenExpression();case i.tagAtL:case i.tagNumL:return this.parseTagExpression();default:this.unexpected()}},e.parseLiteral=function(t,e){var n={type:t,value:e,raw:this.input.slice(this.start,this.end)};return this.next(),n},e.parseExtLiteral=function(t){var e={type:t.label,value:this.value};return this.next(),e},e.parseParenExpression=function(){this.expect(i.parenL);var t=this.parseExpression();return this.expect(i.parenR),{type:"ParenthesizedExpr",expression:t}},e.parseTagExpression=function(){var t={type:this.type===i.tagAtL?"TextExpr":"CountExpr"};return this.next(),t.val=this.parseExpression(),this.expect(i.tagR),t},e.parseIndent=function(){var t;return this.type===i.name?t=this.value:this.unexpected(),this.next(),t}}},function(t,e,n){var i=n(23);t.exports={parse:function(t,e){return new i(e,t).parse()},tokenizer:function(t,e){return new i(e,t)}}},function(t,e,n){var i=n(8).getLineInfo,s=n(8).empowerErrMsg;t.exports=function(t){var e=t.prototype;e.raise=function(t,e){var n=i(this.input,t);e+=" ("+n.line+":"+n.column+")",e=s(this.input,n,e);var r=new SyntaxError(e);throw r.pos=t,r.loc=n,r.raisedAt=this.pos,r}}},function(t,e,n){var i=n(3).types;t.exports=function(t){var e=t.prototype;e.parseBindingList=function(t,e,n){for(var s=[],r=!0;!this.eat(t);)if(r?r=!1:this.expect(i.comma),e&&this.type===i.comma)s.push(null);else{if(n)break;var o=this.parseIndent();s.push(o)}return s}}},function(t,e,n){function i(t){var e={};for(var n in r)e[n]=t&&s(t,n)?t[n]:r[n];return e}var s=n(26).has,r={insertReturn:!0,onComment:function(){},plugins:{}};t.exports={defaultOptions:r,getOptions:i}},function(t,e,n){var i=n(3).types;t.exports=function(t){var e=t.prototype;e.eat=function(t){return this.type===t?(this.next(),!0):!1},e.semicolon=function(){this.eat(i.semi)||this.expected(i.semi)},e.expect=function(t){this.eat(t)||this.expected(t)},e.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")},e.expected=function(t){this.raise(this.lastTokEnd,'Expect a "'+t.label+'" after')},e.UID=function(t){return t+this.nextID++}}},function(t,e,n){var i=n(21).getOptions,s=n(4).keywordRegexp,r=n(3).types,o=function(t,e){this.options=i(t),this.keywords=s,this.input=String(e),this.pos=0,this.type=r.eof,this.value=null,this.start=this.end=this.pos,this.lastTokStart=this.lastTokEnd=this.pos,this.exprAllowed=!1,this.labels=[],this.conf={},this.keys={},this.nextID=0,this.pcs={},this.pcsTable={},this.dTable={},this.obTable={}};o.prototype.parse=function(){this.nextToken();var t={CONFIG:this.conf,DATA_KEYS:this.keys,PROCESSES:this.pcs,DICTIONARY_KEYS:this.dTable,OBJECT_KEYS:this.obTable};return this.parseTopLevel(t)};var a=function(t){t(o)};a(n(19)),a(n(25)),a(n(24)),a(n(22)),a(n(17)),a(n(20)),t.exports=o},function(t,e,n){var i=n(3).types,s=(n(6).lineBreak,n(4).isIdentifierStart,n(4).isIdentifierChar,n(8).getLineInfo),r=n(27),o=n(1);t.exports=function(t){var e=t.prototype;e.parseTopLevel=function(t){var e=this.pcsTable;for(e.main={pos:0};this.type!==i.eof;)this.parseStructure();for(var n in e)e[n]&&this.raise(e[n].pos,"Invalid process call at");return t},e.parseStructure=function(){var t=this.type;return t.macro?this.parseSet():t===i._process?this.parseProcess():void this.raise(this.start,"Expect a #set or process")},e.parseSet=function(){var t=this.type;t.macro||this.unexpected();var e=t.label.substr(1).toLowerCase();this.writeConfig(e),this.next()},e.writeConfig=function(t){var e,n=this.conf;switch(n[t]&&this.raise(this.start,this.type.keyword+" was defined already"),t){case"screen":var i,s,r=this.value.split(",");2!==r.length&&this.raise("Invalid arguments"),i=~~parseInt(r[0],10),s=~~parseInt(r[1],10),e={width:i,height:s};break;default:e=parseInt(this.value,10)}n[t]=e},e.parseProcess=function(){var t={LINE:s(this.input,this.start),TYPE:o.PROCESS,BODY:{}},e=this.pcs,n=this.pcsTable;this.next();var i=this.parseIndent();e[i]&&this.raise(this.start,i+" process was defined already"),e[i]=t,n[i]=!1,this.parsePcParam(t),this.parsePcBlock(t)},e.parsePcParam=function(t){this.eat(i.parenL)&&(t.BODY.params=this.parseBindingList(i.parenR,!1,!1))},e.parsePcBlock=function(t){var e=this.parseBlock(); | ||
e.length&&e[e.length-1].TYPE===o.RETURN||e.push({LINE:-1,TYPE:o.RETURN}),t.BODY.segment=e},e.parseBlock=function(){this.expect(i.braceL);for(var t=[];!this.eat(i.braceR);){var e=this.parseStatement(!0);t.push(e)}return t},e.parseStatement=function(){var t=this.type,e=this.startNode();switch(t){case i._click:case i._rclick:case i._dblclick:case i._movein:case i._moveout:return this.parseMouseAction(e,t.keyword);case i._select:return this.parseSelectAction();case i._scroll:return this.parseScrollAction(e,t.keyword);case i._input:return this.parseInputAction(e,t.keyword);case i._return:return this.parseReturnStatement(e);case i._wait:return this.parseWaitStatement(e);case i._assert:return this.parseAssertStatement(e);case i._log:case i._console:return this.parseLogStatement(e,t===i._log?o.LOG:o.CONSOLE);case i._jumpto:return this.parseGotoStatement(e);case i._refresh:return this.parseRefreshStatement(e);case i._var:return this.parseVarStatement(e);case i.name:return this.parseExprStatement(e);default:this.unexpected()}},e.parseReturnStatement=function(t){return this.next(),this.eat(i.semi)?t.args=null:this.raise(this.start,"Return expression is not supported"),this.finishNode(t,o.RETURN)},e.parseVarStatement=function(t){return this.next(),this.parseVar(t),t.BODY.exp=r(t.BODY.raw),this.semicolon(),this.finishNode(t,o.EXPRESSION)},e.parseVar=function(t){for(var e=[];;){var n={};if(n.id=this.parseIndent(),this.eat(i.eq)?n.init=this.parseMaybeAssign():n.init=null,e.push(n),!this.eat(i.comma))break}t.BODY.raw={declarations:e,type:"varDecl"}},e.parseExprStatement=function(t){var e=this.parseExpression();if(this.semicolon(),"CallExpr"===e.type){var n=e.callee.name;return this.pcsTable[n]!==!1&&(this.pcsTable[n]={pos:this.lastTokStart}),t.BODY.identifier=n,this.finishNode(t,o.CALL)}var i=r(e);return t.BODY.raw=e,t.BODY.exp=i,this.finishNode(t,o.EXPRESSION)},e.parseWaitStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.delay=r(t.BODY.raw),this.semicolon(),this.finishNode(t,o.WAIT)},e.parseMouseAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),t.BODY.action=e,this.semicolon(),this.finishNode(t,o.TRIGGER)},e.parseScrollAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),this.expect(i._by),t.BODY.raw1=this.parseExpression(),t.BODY.param=r(t.BODY.raw1),t.BODY.action=e,this.finishNode(t,o.TRIGGER)},e.parseSelectAction=function(){this.raise("work in progress...")},e.parseInputAction=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.object=r(t.BODY.raw),this.expect(i._by),t.BODY.raw1=this.parseExpression(),t.BODY.param=r(t.BODY.raw1),t.BODY.action=e,this.semicolon(),this.finishNode(t,o.TRIGGER)},e.parseAssertStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.exp=r(t.BODY.raw),this.eat(i._in)&&(this.type===i.num?t.BODY.timeout=this.value:this.unexpected(),this.next()),this.semicolon(),t.BODY.key=this.UID("#"),this.keys[t.BODY.key]=!!t.BODY.timeout,this.finishNode(t,o.ASSERT)},e.parseGotoStatement=function(t){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.url=r(t.BODY.raw),this.semicolon(),this.finishNode(t,o.JUMPTO)},e.parseRefreshStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,o.REFRESH)},e.parseLogStatement=function(t,e){return this.next(),t.BODY.raw=this.parseExpression(),t.BODY.msg=r(t.BODY.raw),this.semicolon(),this.finishNode(t,e)},e.startNode=function(){return{LINE:s(this.input,this.start).line,TYPE:0,BODY:{},start:this.start,end:0}},e.finishNode=function(t,e){return t.TYPE=e,t.end=this.lastTokEnd,t}}},function(t,e,n){var i=n(4).isIdentifierStart,s=n(4).isIdentifierChar,r=n(3).types,o=n(3).keywordTypes,a=n(6).isNewLine,c=n(6).lineBreak;t.exports=function(t){var e=t.prototype;e.next=function(){this.lastTokEnd=this.end,this.lastTokStart=this.start,this.nextToken()},e.nextToken=function(){return this.skipSpace(),this.start=this.pos,this.pos>=this.input.length?this.finishToken(r.eof):void this.readToken(this.fullCharCodeAtPos())},e.readToken=function(t){return i(t)||35===t?this.readWord():this.getTokenFromCode(t)},e.fullCharCodeAtPos=function(){return this.input.charCodeAt(this.pos)},e.skipBlockComment=function(){var t=this.pos,e=this.input.indexOf("*/",this.pos+=2);-1===e&&this.raise(this.pos-2,"unterminated comment"),this.pos=e+2,this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,e),t,this.pos)},e.skipLineComment=function(t){for(var e=this.pos,n=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&10!==n&&13!==n&&8232!==n&&8233!==n;)++this.pos,n=this.input.charCodeAt(this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+=t,this.pos),e,this.pos)},e.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&14>t))break t;++this.pos}}},e.readToken_bracket=function(){var t=this.pos++,e=this.fullCharCodeAtPos();if(i(e)){var n=this.readWord1();return e=this.fullCharCodeAtPos(),93!==e&&this.raise(t,"Unterminated dictionary index"),this.pos++,this.dTable[n]=!0,this.finishToken(r.dict,n)}return this.finishToken(r.bracketL)},e.readToken_brace=function(){var t=this.pos++,e=this.fullCharCodeAtPos();if(i(e)){var n=this.readWord1();return e=this.fullCharCodeAtPos(),125!==e&&this.raise(t,"Unterminated object store index"),this.pos++,this.obTable[n]=!0,this.finishToken(r.objectAt,n)}return this.finishToken(r.braceL)},e.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp("/")):61===t?this.finishOp(r.assign,2):62===t?this.finishOp(r.tagR,2):this.finishOp(r.slash,1)},e.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),n=1,i=42===t?r.star:r.modulo;return 61===e?this.finishOp(r.assign,n+1):this.finishOp(i,n)},e.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp("|")):e===t?this.finishOp(124===t?r.logicalOR:r.logicalAND,2):void this.raise(this.pos,"bitwise operator is not allowed")},e.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.finishOp(r.incDec,2):61===e?this.finishOp(r.assign,2):this.finishOp(r.plusMin,1)},e.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),n=1;if(e===t&&this.raise(this.pos,"bitwise operator is not allowed"),60===t){if(35===e)return this.finishOp(r.tagNumL,2);if(64===e)return this.finishOp(r.tagAtL,2)}return 61===e&&(n=2),this.finishOp(r.relational,n)},e.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 126===e&&33===t?this.finishOp(r.match,2):61===e?this.finishOp(r.equality,61===this.input.charCodeAt(this.pos+2)?3:2):this.finishOp(61===t?r.eq:r.prefix,1)},e.getTokenFromCode=function(t){switch(t){case 40:return++this.pos,this.finishToken(r.parenL);case 41:return++this.pos,this.finishToken(r.parenR);case 59:return++this.pos,this.finishToken(r.semi);case 44:return++this.pos,this.finishToken(r.comma);case 91:return this.readToken_bracket();case 93:return++this.pos,this.finishToken(r.bracketR);case 123:return this.readToken_brace();case 125:return++this.pos,this.finishToken(r.braceR);case 58:return++this.pos,this.finishToken(r.colon);case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 126:var e=this.input.charCodeAt(this.pos+1);return 126!==e&&this.raise(this.pos,"bitwise operator is not allowed"),this.finishOp(r.match,2);default:this.raise(this.pos,'Unexpected character "'+this.input[this.pos]+'"')}},e.finishOp=function(t,e){var n=this.input.slice(this.pos,this.pos+=e);return this.finishToken(t,n)},e.finishToken=function(t,e){this.end=this.pos,this.type=t,this.value=e,this.exprAllowed=this.type.beforeExpr},e.readRegexp=function(t){for(var e,n,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(c.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if("["===s)n=!0;else if("]"===s&&n)n=!1;else if(s===t&&!n)break;e="\\"===s}++this.pos}var o=this.input.slice(i,this.pos);++this.pos;var a=this.readWord1();if(a){var h=/^[gim]*$/;h.test(a)||this.raise(i,"Invalid regular expression flag")}var u={pattern:o,flags:a,isGenerate:"|"===t};return this.finishToken(r.regexp,u)},e.readInt=function(t,e){for(var n=this.pos,i=0,s=0,r=null==e?1/0:e;r>s;++s){var o,a=this.fullCharCodeAtPos();if(o=a>=97?a-97+10:a>=65?a-65+10:a>=48&&57>=a?a-48:1/0,o>=t)break;++this.pos,i=i*t+o}return this.pos===n||null!=e&&this.pos-n!==e?null:i},e.readNumber=function(t){var e=this.pos,n=!1;t||null!==this.readInt(10)||this.raise(e,"Invalid Number");var s=this.fullCharCodeAtPos();46===s&&(++this.pos,this.readInt(10),n=!0,s=this.fullCharCodeAtPos()),69!==s&&101!==s||(s=this.input.charCodeAt(++this.pos),43!==s&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number"),n=!0),i(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=this.input.slice(e,this.pos);return o=n?parseFloat(a):parseInt(a,10),this.finishToken(r.num,o)},e.readString=function(t){for(var e="",n=this.start,i=++this.pos;;){this.pos>=this.input.length&&this.raise(n,"Unterminated string");var s=this.fullCharCodeAtPos();if(s===t)break;92===s?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(),i=this.pos):(a(s)&&this.raise(n,"Unterminated string"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(r.string,e)},e.readEscapedChar=function(){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 116:return" ";case 98:return"\b";case 118:return"\x0B";case 102:return"\f";case 13:10===this.fullCharCodeAtPos()&&++this.pos;case 10:return"";default:return String.fromCharCode(t)}},e.readWord1=function(){for(var t="",e=!0,n=this.pos;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(s(i))++this.pos;else{if(!e||35!==i)break;++this.pos}e=!1}return t+=this.input.slice(n,this.pos)},e.readWord=function(){var t,e=this.pos,n=this.readWord1();if(this.keywords.test(n)){if(t=o[n],t.macro){var i=this.readMacro();return this.finishToken(t,i)}}else 35===n.charCodeAt(0)&&this.raise(e,"# is only valid for # macro"),t=r.name;return this.finishToken(t,n)},e.readMacro=function(){for(var t=this.pos,e=this.fullCharCodeAtPos();this.pos<this.input.length&&10!==e&&13!==e&&8232!==e&&8233!==e;)++this.pos,e=this.input.charCodeAt(this.pos);return this.input.slice(t,this.pos).trim()}}},function(t,e){function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports={isArray:n,has:i}},function(t,e){var n={varDecl:function(t,e){var n="",i=!0;return t.declarations.forEach(function(t){t.init&&(i||(n+=","),n+="$."+t.id+" = "+e(t.init),i=!1)}),"("+n+")"},SequenceExpr:function(t,e){var n="",i=!0;return t.expressions.forEach(function(t){i||(n+=","),n+=e(t),i=!1}),"("+n+")"},literal:function(t){return t.raw},regexp:function(t){if(t.regexp.isGenerate){var e=t.regexp;return"(/"+e.pattern+"/"+e.flags+").gen()"}return"("+t.raw+")"},dictionaryIndex:function(t){return"d."+t.value},objectStore:function(t){return"o."+t.value},Identifier:function(t){return"$."+t.name},LogicalExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},BinaryExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},MatchExpr:function(t,e){var n="";return"~~"===t.operator&&(n+="!"),n+"!("+e(t.left)+").match("+e(t.right)+").length"},UpdateExpr:function(t){var e="$."+t.argument;return t.prefix?t.operator+e:e+t.operator},UnaryExpr:function(t,e){return t.operator+"("+e(t.argument)+")"},AssignmentExpr:function(t,e){return e(t.left)+t.operator+e(t.right)},ParenthesizedExpr:function(t,e){return"("+e(t.expression)+")"},TextExpr:function(t,e){var n="String("+e(t.val)+")";return"t("+n+")"},CountExpr:function(t,e){var n="String("+e(t.val)+")";return"c("+n+")"}};t.exports=function(t){var e=function i(t){var e=t.type;return n[e](t,i)}(t);return new Function("$,o,d,c,t","return "+e+";")}}])}); |
{ | ||
"name": "lc2", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "browser automation library", | ||
"main": "./src/index.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "ava", | ||
"pack": "webpack", | ||
"start": "webpack-dev-server", | ||
"build": "webpack && webpack -p --config webpack.production.js" | ||
"dev": "webpack-dev-server", | ||
"build": "webpack && webpack -p --output-filename lemoncase.min.js" | ||
}, | ||
@@ -16,2 +15,8 @@ "repository": { | ||
}, | ||
"files": [ | ||
"dist/", | ||
"lib", | ||
"src/", | ||
"index.js" | ||
], | ||
"keywords": [ | ||
@@ -24,14 +29,7 @@ "test" | ||
"author": "李超", | ||
"license": "GPL-v3", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"angular": "^1.5.0", | ||
"angular": "^1.5.2", | ||
"ava": "^0.13.0", | ||
"codemirror": "^5.12.0", | ||
"gulp": "^3.9.1", | ||
"gulp-include": "^2.1.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "^1.5.3", | ||
"gulp-util": "^3.0.7", | ||
"vinyl-buffer": "^1.0.0", | ||
"vinyl-source-stream": "^1.1.0", | ||
"codemirror": "^5.13.2", | ||
"webpack": "^1.12.14", | ||
@@ -47,4 +45,4 @@ "webpack-dev-server": "^1.14.1" | ||
"dependencies": { | ||
"oc-trigger": "^1.0.1" | ||
"oc-trigger": "^1.0.2" | ||
} | ||
} |
/*jslint vars: true, sloppy: true, nomen: true */ | ||
/*global require, console, trigger, module */ | ||
var $CP = require('./case').$CP, | ||
@@ -6,3 +7,3 @@ _ = require('../global')['_'], | ||
IF = require('./instruction'), | ||
CALL = require('../instructions').CALL; | ||
CALL = require('../instructionType').CALL; | ||
@@ -138,2 +139,2 @@ $CP.$setIdleTask = function (taskFn) { | ||
module.exports = $CP; | ||
module.exports = $CP; |
/*jslint vars: true, sloppy: true, nomen: true */ | ||
/*global require, console, trigger, module */ | ||
var $CP = require('./case').$CP, | ||
@@ -121,2 +122,10 @@ settings = require('../global').settings, | ||
module.exports = $CP; | ||
$CP.getStatus = function () { | ||
return { | ||
loop: this.$$currentLoop, | ||
line: this.getCurrentLine(), | ||
state: this.$$state | ||
}; | ||
}; | ||
module.exports = $CP; |
/*jslint plusplus: true, sloppy: true, nomen: true */ | ||
var CALL = require('../instructions').CALL, | ||
EXIT = require('../instructions').EXIT, | ||
/*global require, console, trigger, module */ | ||
var CALL = require('../instructionType').CALL, | ||
EXIT = require('../instructionType').EXIT, | ||
_ = require('../global')['_'], | ||
@@ -52,3 +53,3 @@ settings = require('../global').settings, | ||
if (!(this instanceof Case)) { | ||
return new Case(syntaxTree); | ||
return new Case(syntaxTree, object, dictionary); | ||
} | ||
@@ -162,2 +163,2 @@ | ||
$CP: $CP | ||
}; | ||
}; |
/*jslint vars: true, sloppy: true, nomen: true */ | ||
/*global require, console, trigger, module */ | ||
var IF = function InstructionFactory(TYPE, opts) { | ||
@@ -49,2 +50,2 @@ if (!opts) { | ||
module.exports = IF; | ||
module.exports = IF; |
/*jslint vars: true, sloppy: true, nomen: true */ | ||
/*global require, console, trigger, module */ | ||
var callMainIns, exitIns, _, settings, setup; | ||
@@ -121,2 +122,2 @@ | ||
getLemoncaseFrame: getLemoncaseFrame | ||
}; | ||
}; |
@@ -12,9 +12,3 @@ var parse = require('./parser/index').parse, | ||
require('../lib/ranexp'); | ||
window.getLemoncaseFrame = getLemoncaseFrame; | ||
window.Dictionary = Dictionary; | ||
window.init = init; | ||
window.setup = setup; | ||
window.parse = parse; | ||
window.Case = Case; | ||
require('./instructions'); | ||
@@ -31,12 +25,2 @@ var exports = { | ||
if (typeof angular !== 'undefined') { | ||
angular.module('lemoncase', []).provider('LC', function () { | ||
this.setup = exports.setup; | ||
this.$get = [function () { | ||
return exports; | ||
}]; | ||
}); | ||
} | ||
module.exports = exports; |
@@ -5,20 +5,24 @@ /*jslint sloppy: true, nomen: true */ | ||
settings = require('./global').settings, | ||
_ = require('./global')['_']; | ||
_ = require('./global')['_'], | ||
var CALL = 0x00, | ||
RETURN = 0x01, | ||
EXIT = 0x02, | ||
CALL = require('./instructionType').CALL, | ||
RETURN = require('./instructionType').RETURN, | ||
EXIT = require('./instructionType').EXIT, | ||
EXPRESSION = 0x10, | ||
WAIT = 0x11, | ||
TRIGGER = 0x12, | ||
ASSERT = 0x13, | ||
JUMPTO = 0x14, | ||
REFRESH = 0x15, | ||
EXPRESSION = require('./instructionType').EXPRESSION, | ||
WAIT = require('./instructionType').WAIT, | ||
TRIGGER = require('./instructionType').TRIGGER, | ||
ASSERT = require('./instructionType').ASSERT, | ||
JUMPTO = require('./instructionType').JUMPTO, | ||
REFRESH = require('./instructionType').REFRESH, | ||
LOG = 0x20, | ||
CONSOLE = 0x21, | ||
LOG = require('./instructionType').LOG, | ||
CONSOLE = require('./instructionType').CONSOLE, | ||
PROCESS = require('./instructionType').PROCESS, | ||
PASSED = 1, | ||
FAILURE = 0; | ||
FAILURE = 0 | ||
trigger = require('oc-trigger'); | ||
@@ -211,15 +215,1 @@ IF(CALL, { | ||
}); | ||
module.exports = { | ||
CALL: CALL, | ||
RETURN: RETURN, | ||
EXIT: EXIT, | ||
EXPRESSION: EXPRESSION, | ||
WAIT: WAIT, | ||
TRIGGER: TRIGGER, | ||
ASSERT: ASSERT, | ||
JUMPTO: JUMPTO, | ||
REFRESH: REFRESH, | ||
LOG: LOG, | ||
CONSOLE: CONSOLE | ||
} |
@@ -66,4 +66,2 @@ var tt = require('./tokentype.js').types; | ||
pp.parseMaybeConditional = function () { | ||
// maybe we will need '?' in the future? | ||
@@ -177,3 +175,3 @@ | ||
this.expect(tt.parenR); | ||
return node; | ||
@@ -208,3 +206,3 @@ } else { | ||
return this.parseLiteral('literal', this.value); | ||
case tt.objectAt: case tt.dict: | ||
@@ -235,3 +233,3 @@ return this.parseExtLiteral(this.type); | ||
}; | ||
pp.parseExtLiteral = function (type) { | ||
@@ -242,5 +240,5 @@ var node = { | ||
}; | ||
this.next(); | ||
return node; | ||
@@ -284,3 +282,3 @@ }; | ||
return name; | ||
} | ||
}; | ||
}; | ||
}; |
@@ -32,2 +32,2 @@ // the keywords | ||
isIdentifierChar: isIdentifierChar | ||
}; | ||
}; |
@@ -10,2 +10,2 @@ var Parser = require('./state.js'); | ||
} | ||
}; | ||
}; |
@@ -21,2 +21,2 @@ var getLineInfo = require('./locutil.js').getLineInfo; | ||
}; | ||
}; | ||
}; |
@@ -28,3 +28,3 @@ var lineBreakG = require('./whitespace.js').lineBreakG; | ||
function empowerErrMsg (input, loc, msg) { | ||
function empowerErrMsg(input, loc, msg) { | ||
var errLine = input.split(lineBreakG)[loc.line - 1]; | ||
@@ -40,21 +40,21 @@ var strBeforeErr = errLine.substr(0, loc.column); | ||
function genArrow (width) { | ||
function genArrow(width) { | ||
var i = -1, j = -1, out = ''; | ||
while (++i < width) { | ||
out += ' '; | ||
} | ||
out += '↑\n'; | ||
while (++j < width) { | ||
out += ' '; | ||
} | ||
out += '↑'; | ||
return out; | ||
} | ||
function positionMsg (msg, width) { | ||
function positionMsg(msg, width) { | ||
// very long message, no need to reposition | ||
@@ -64,3 +64,3 @@ if (msg.length / 2 > width) { | ||
} | ||
var i = -1, emptyWidth = width - Math.floor(msg.length / 2), newMsg = ''; | ||
@@ -78,10 +78,10 @@ | ||
// calculate width of string | ||
function widthOf (str) { | ||
var code, | ||
function widthOf(str) { | ||
var code, | ||
width = 0, | ||
i = -1, len = str.length; | ||
while (++i < len) { | ||
code = str.charCodeAt(i); | ||
switch (code) { | ||
@@ -96,3 +96,3 @@ case 9: // '\t' | ||
} | ||
return width; | ||
@@ -104,2 +104,2 @@ } | ||
empowerErrMsg: empowerErrMsg | ||
}; | ||
}; |
@@ -25,3 +25,3 @@ var tt = require('./tokentype.js').types; | ||
return elts; | ||
} | ||
}; | ||
}; | ||
}; |
@@ -5,7 +5,7 @@ var has = require('./util.js').has; | ||
insertReturn: true, | ||
onComment: function (){}, | ||
onComment: function () {}, | ||
plugins: {} | ||
}; | ||
function getOptions (options) { | ||
function getOptions(options) { | ||
var result = {}; | ||
@@ -22,2 +22,2 @@ for (var op in defaultOptions) { | ||
getOptions: getOptions | ||
}; | ||
}; |
@@ -26,10 +26,10 @@ var tt = require('./tokentype.js').types; | ||
}; | ||
pp.expected = function (type) { | ||
this.raise(this.lastTokEnd, 'Expect a "' + type.label + '" after'); | ||
}; | ||
pp.UID = function (string) { | ||
return string + this.nextID++; | ||
}; | ||
}; | ||
}; |
@@ -6,3 +6,3 @@ var getOptions = require('./options.js').getOptions; | ||
var Parser = function (options, input) { | ||
this.options = getOptions(options); | ||
this.options = getOptions(options); | ||
this.keywords = keywordRegexp; | ||
@@ -65,3 +65,2 @@ this.input = String(input); | ||
module.exports = Parser; | ||
module.exports = Parser; |
@@ -1,11 +0,13 @@ | ||
var tt = require('./tokentype.js').types; | ||
var tt = require('./tokentype').types; | ||
var lineBreak = require('./whitespace.js').lineBreak; | ||
var lineBreak = require('./whitespace').lineBreak; | ||
var isIdentifierStart = require('./identifier.js').isIdentifierStart; | ||
var isIdentifierChar = require('./identifier.js').isIdentifierChar; | ||
var isIdentifierStart = require('./identifier').isIdentifierStart; | ||
var isIdentifierChar = require('./identifier').isIdentifierChar; | ||
var getLineInfo = require('./locutil.js').getLineInfo; | ||
var genExpr = require('./walk.js'); | ||
var getLineInfo = require('./locutil').getLineInfo; | ||
var genExpr = require('./walk'); | ||
var insDefinition = require('../instructionType'); | ||
module.exports = function (Parser) { | ||
@@ -30,3 +32,3 @@ var pp = Parser.prototype; | ||
} | ||
for (var process in pcsTable) { | ||
@@ -40,3 +42,3 @@ if (pcsTable[process]) this.raise(pcsTable[process].pos, 'Invalid process call at'); | ||
}; | ||
pp.parseStructure = function () { | ||
@@ -58,3 +60,3 @@ var globaltype = this.type; | ||
var key = setType.label.substr(1).toLowerCase(); // #CLOCK --> clock | ||
this.writeConfig(key); | ||
@@ -64,9 +66,9 @@ | ||
}; | ||
pp.writeConfig = function (key) { | ||
var val; | ||
var confTable = this.conf; | ||
if (confTable[key]) this.raise(this.start, this.type.keyword + ' was defined already'); | ||
switch (key) { | ||
@@ -83,3 +85,3 @@ case "screen": | ||
break; | ||
default: | ||
@@ -89,3 +91,3 @@ val = parseInt(this.value, 10); | ||
} | ||
confTable[key] = val; | ||
@@ -96,6 +98,6 @@ }; | ||
var node = { | ||
LINE: getLineInfo(this.input, this.start), | ||
TYPE: 0xAA, | ||
BODY: {} | ||
}, | ||
LINE: getLineInfo(this.input, this.start), | ||
TYPE: insDefinition.PROCESS, | ||
BODY: {} | ||
}, | ||
pcs = this.pcs, | ||
@@ -111,3 +113,3 @@ pcsTable = this.pcsTable; | ||
// mark it as initialized | ||
pcsTable[name] = false; | ||
pcsTable[name] = false; | ||
@@ -129,8 +131,8 @@ this.parsePcParam(node); | ||
var statements = this.parseBlock(); | ||
// no statements or no return | ||
if (!statements.length || statements[statements.length - 1].TYPE !== 0x01) { | ||
if (!statements.length || statements[statements.length - 1].TYPE !== insDefinition.RETURN) { | ||
statements.push({ | ||
LINE: -1, | ||
TYPE: 0x01, | ||
TYPE: insDefinition.RETURN, | ||
}); | ||
@@ -155,3 +157,3 @@ } | ||
pp.parseStatement = function (declaration) { | ||
pp.parseStatement = function () { | ||
var starttype = this.type, node = this.startNode(); | ||
@@ -176,3 +178,6 @@ | ||
case tt._log: case tt._console: | ||
return this.parseLogStatement(node, starttype === tt._log ? 0x20 : 0x21); | ||
return this.parseLogStatement(node, | ||
starttype === tt._log | ||
? insDefinition.LOG | ||
: insDefinition.CONSOLE); | ||
case tt._jumpto: | ||
@@ -197,3 +202,3 @@ return this.parseGotoStatement(node); | ||
return this.finishNode(node, 0x01); | ||
return this.finishNode(node, insDefinition.RETURN); | ||
}; | ||
@@ -209,3 +214,3 @@ | ||
return this.finishNode(node, 0x10); | ||
return this.finishNode(node, insDefinition.EXPRESSION); | ||
}; | ||
@@ -238,8 +243,8 @@ | ||
}; | ||
pp.parseExprStatement = function (node) { | ||
var expr = this.parseExpression(); | ||
this.semicolon(); | ||
// fn() | ||
@@ -252,28 +257,28 @@ if (expr.type === 'CallExpr') { | ||
} | ||
node.BODY.identifier = callee; | ||
return this.finishNode(node, 0x00); | ||
return this.finishNode(node, insDefinition.CALL); | ||
} | ||
// a = 1 | ||
var fn = genExpr(expr); | ||
node.BODY.raw = expr; | ||
node.BODY.exp = fn; | ||
return this.finishNode(node, 0x10); | ||
} | ||
return this.finishNode(node, insDefinition.EXPRESSION); | ||
}; | ||
pp.parseWaitStatement = function (node) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.delay = genExpr(node.BODY.raw); | ||
this.semicolon(); | ||
return this.finishNode(node, 0x11); | ||
} | ||
return this.finishNode(node, insDefinition.WAIT); | ||
}; | ||
pp.parseMouseAction = function (node, keyword) { | ||
@@ -288,48 +293,48 @@ this.next(); | ||
return this.finishNode(node, 0x12); | ||
return this.finishNode(node, insDefinition.TRIGGER); | ||
}; | ||
pp.parseScrollAction = function (node, keyword) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.object = genExpr(node.BODY.raw); | ||
this.expect(tt._by); | ||
node.BODY.raw1 = this.parseExpression(); | ||
node.BODY.param = genExpr(node.BODY.raw1); | ||
node.BODY.action = keyword; | ||
return this.finishNode(node, 0x12); | ||
return this.finishNode(node, insDefinition.TRIGGER); | ||
}; | ||
pp.parseSelectAction = function () { | ||
this.raise('work in progress...'); | ||
}; | ||
pp.parseInputAction = function (node, keyword) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.object = genExpr(node.BODY.raw); | ||
this.expect(tt._by); | ||
node.BODY.raw1 = this.parseExpression(); | ||
node.BODY.param = genExpr(node.BODY.raw1); | ||
node.BODY.action = keyword; | ||
this.semicolon(); | ||
return this.finishNode(node, 0x12); | ||
return this.finishNode(node, insDefinition.TRIGGER); | ||
}; | ||
pp.parseAssertStatement = function (node) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.exp = genExpr(node.BODY.raw); | ||
if (this.eat(tt._in)) { | ||
@@ -341,6 +346,6 @@ if (this.type === tt.num) { | ||
} | ||
this.next(); | ||
} | ||
this.semicolon(); | ||
@@ -350,15 +355,15 @@ //do not forgot the data key | ||
this.keys[node.BODY.key] = node.BODY.timeout ? true : false; | ||
return this.finishNode(node, 0x13); | ||
} | ||
return this.finishNode(node, insDefinition.ASSERT); | ||
}; | ||
pp.parseGotoStatement = function (node) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.url = genExpr(node.BODY.raw); | ||
this.semicolon(); | ||
return this.finishNode(node, 0x14); | ||
return this.finishNode(node, insDefinition.JUMPTO); | ||
}; | ||
@@ -371,16 +376,16 @@ | ||
return this.finishNode(node, 0x15); | ||
return this.finishNode(node, insDefinition.REFRESH); | ||
}; | ||
pp.parseLogStatement = function (node, type) { | ||
this.next(); | ||
node.BODY.raw = this.parseExpression(); | ||
node.BODY.msg = genExpr(node.BODY.raw); | ||
this.semicolon(); | ||
return this.finishNode(node, type); | ||
}; | ||
pp.startNode = function () { | ||
@@ -393,11 +398,11 @@ return { | ||
end: 0 | ||
} | ||
}; | ||
}; | ||
pp.finishNode = function (node, type) { | ||
node.TYPE = type; | ||
node.end = this.lastTokEnd; | ||
return node; | ||
}; | ||
}; | ||
}; |
@@ -56,4 +56,5 @@ var isIdentifierStart = require('./identifier.js').isIdentifierStart; | ||
var ch = this.input.charCodeAt(this.pos+=startSkip); | ||
while (this.pos < this.input.length && ch !== 10 && ch !== 13 | ||
&& ch !== 8232 && ch !== 8233) { | ||
while (this.pos < this.input.length && | ||
ch !== 10 && ch !== 13 && | ||
ch !== 8232 && ch !== 8233) { | ||
++this.pos; | ||
@@ -76,4 +77,4 @@ ch = this.input.charCodeAt(this.pos); | ||
case 32: case 160: // ' ' | ||
++this.pos; | ||
break; | ||
++this.pos; | ||
break; | ||
case 13: | ||
@@ -84,4 +85,4 @@ if (this.input.charCodeAt(this.pos + 1) === 10) { | ||
case 10: case 8232: case 8233: //new line | ||
++this.pos; | ||
break; | ||
++this.pos; | ||
break; | ||
case 47: // '/' | ||
@@ -258,5 +259,5 @@ switch (this.input.charCodeAt(this.pos + 1)) { | ||
return this.finishOp(tt.match, 2); | ||
default: | ||
this.raise(this.pos, 'Unexpected character "' + this.input[this.pos] + '"'); | ||
} | ||
this.raise(this.pos, 'Unexpected character "' + this.input[this.pos] + '"'); | ||
}; | ||
@@ -312,3 +313,3 @@ | ||
} | ||
var value = { | ||
@@ -318,3 +319,3 @@ pattern: content, | ||
isGenerate: close === '|' | ||
} | ||
}; | ||
@@ -324,3 +325,3 @@ return this.finishToken(tt.regexp, value); | ||
pp.readInt = function(radix, len) { | ||
pp.readInt = function (radix, len) { | ||
var start = this.pos, total = 0; | ||
@@ -354,3 +355,3 @@ for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { | ||
next = this.input.charCodeAt(++this.pos); | ||
if (next === 43 || next === 45) ++ this.pos; // +/- | ||
if (next === 43 || next === 45) ++this.pos; // +/- | ||
if (this.readInt(10) === null) this.raise(start, 'Invalid number'); | ||
@@ -398,3 +399,3 @@ isFloat = true; | ||
case 102: return '\f'; | ||
case 13: if (this.fullCharCodeAtPos() === 10) ++ this.pos; // '\r\n' | ||
case 13: if (this.fullCharCodeAtPos() === 10) ++this.pos; // '\r\n' | ||
case 10: return ''; | ||
@@ -414,3 +415,3 @@ default: | ||
++this.pos;//for #set | ||
} else{ | ||
} else { | ||
break; | ||
@@ -455,4 +456,5 @@ } | ||
var ch = this.fullCharCodeAtPos(); | ||
while (this.pos < this.input.length && ch !== 10 && ch !== 13 | ||
&& ch !== 8232 && ch !== 8233) { | ||
while (this.pos < this.input.length && | ||
ch !== 10 && ch !== 13 && | ||
ch !== 8232 && ch !== 8233) { | ||
++this.pos; | ||
@@ -464,2 +466,2 @@ ch = this.input.charCodeAt(this.pos); | ||
}; | ||
}; | ||
}; |
@@ -15,4 +15,4 @@ // The assignment of fine-grained, information-carrying type objects | ||
var TokenType = function (label, conf) { | ||
if (conf === undefined) { conf = {} } | ||
var TokenType = function(label, conf) { | ||
if (conf === undefined) { conf = {}; } | ||
@@ -29,3 +29,3 @@ this.label = label; | ||
function binop (name, prec) { | ||
function binop(name, prec) { | ||
return new TokenType(name, { beforeExpr: true, binop: prec }); | ||
@@ -127,2 +127,2 @@ } | ||
keywordTypes: keywords | ||
}; | ||
}; |
@@ -8,3 +8,3 @@ function isArray(obj) { | ||
function has(obj, propName) { | ||
return Object.prototype.hasOwnProperty.call(obj, propName) | ||
return Object.prototype.hasOwnProperty.call(obj, propName); | ||
} | ||
@@ -15,2 +15,2 @@ | ||
has: has | ||
}; | ||
}; |
@@ -6,13 +6,13 @@ // walk a javascript style tree and transform it into a function | ||
var out = '', first = true; | ||
node.declarations.forEach(function (decl) { | ||
if (decl.init) { | ||
if (!first) out += ','; | ||
out += '$.' + decl.id + ' = ' + c(decl.init); | ||
first = false; | ||
} | ||
}); | ||
return '(' + out + ')'; | ||
@@ -22,8 +22,8 @@ }, | ||
var out = '', first = true; | ||
node.expressions.forEach(function (expr) { | ||
if (!first) out += ','; | ||
out += c(expr); | ||
first = false; | ||
@@ -34,12 +34,12 @@ }); | ||
}, | ||
// end point node | ||
literal: function (node, c) { | ||
literal: function (node) { | ||
return node.raw; | ||
}, | ||
regexp: function (node, c) { | ||
regexp: function (node) { | ||
// regex.gen | ||
if (node.regexp.isGenerate) { | ||
var val = node.regexp; | ||
return '(/' + val.pattern + '/' + val.flags + ').gen()'; | ||
@@ -50,12 +50,12 @@ } | ||
}, | ||
dictionaryIndex: function (node, c) { | ||
dictionaryIndex: function (node) { | ||
return 'd.' + node.value; | ||
}, | ||
objectStore: function (node, c) { | ||
objectStore: function (node) { | ||
return 'o.' + node.value; | ||
}, | ||
Identifier: function (node, c) { | ||
Identifier: function (node) { | ||
return '$.' + node.name; | ||
}, | ||
// binary operator | ||
@@ -70,10 +70,10 @@ LogicalExpr: function (node, c) { | ||
var out = ''; | ||
if (node.operator === '~~') out += '!'; | ||
return out + '!(' + c(node.left) + ').match(' + c(node.right) + ').length'; | ||
}, | ||
// unary | ||
UpdateExpr: function (node, c) { | ||
UpdateExpr: function (node) { | ||
var inside = '$.' + node.argument; | ||
@@ -86,3 +86,3 @@ | ||
}, | ||
// assign | ||
@@ -92,3 +92,3 @@ AssignmentExpr: function (node, c) { | ||
}, | ||
// () | ||
@@ -98,6 +98,6 @@ ParenthesizedExpr: function (node, c) { | ||
}, | ||
TextExpr: function (node, c) { | ||
var inside = 'String(' + c(node.val) + ')'; | ||
return 't(' + inside + ')'; | ||
@@ -107,3 +107,3 @@ }, | ||
var inside = 'String(' + c(node.val) + ')'; | ||
return 'c(' + inside + ')'; | ||
@@ -113,10 +113,10 @@ } | ||
module.exports = function genExpr (node) { | ||
var string = (function c(node){ | ||
module.exports = function genExpr(node) { | ||
var string = (function c(node) { | ||
var type = node.type; | ||
return visitors[type](node, c); | ||
})(node); | ||
return new Function('$,o,d,c,t', 'return ' + string + ';'); | ||
}; |
@@ -9,5 +9,5 @@ // Matches a whole line break (where CRLF is considered a single | ||
lineBreakG: new RegExp(lineBreak.source, 'g'), | ||
isNewLine: function isNewLine (code) { | ||
return code === 10 || code === 13 || code === 0x2028 || code == 0x2029; | ||
isNewLine: function isNewLine(code) { | ||
return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; | ||
} | ||
}; | ||
}; |
Sorry, the diff of this file is too big to display
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
5
0
0
240600
32
6134
Updatedoc-trigger@^1.0.2