NOBUG: Fixed file access permissions
[moodle.git] / lib / yuilib / 3.13.0 / yui-log-nodejs / yui-log-nodejs-coverage.js
blob2372e71ac0dcb357d515639e48612878c8b7366d
1 /*
2 YUI 3.13.0 (build 508226d)
3 Copyright 2013 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
6 */
8 if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
9 if (!__coverage__['build/yui-log-nodejs/yui-log-nodejs.js']) {
10    __coverage__['build/yui-log-nodejs/yui-log-nodejs.js'] = {"path":"build/yui-log-nodejs/yui-log-nodejs.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0,0],"12":[0,0],"13":[0,0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0]},"f":{"1":0,"2":0,"3":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":15,"loc":{"start":{"line":15,"column":17},"end":{"line":15,"column":36}}},"3":{"name":"(anonymous_3)","line":26,"loc":{"start":{"line":26,"column":12},"end":{"line":26,"column":32}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":81,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":4,"column":21}},"3":{"start":{"line":6,"column":0},"end":{"line":11,"column":1}},"4":{"start":{"line":7,"column":4},"end":{"line":7,"column":33}},"5":{"start":{"line":8,"column":4},"end":{"line":8,"column":36}},"6":{"start":{"line":10,"column":4},"end":{"line":10,"column":20}},"7":{"start":{"line":13,"column":0},"end":{"line":13,"column":29}},"8":{"start":{"line":15,"column":0},"end":{"line":23,"column":2}},"9":{"start":{"line":16,"column":4},"end":{"line":18,"column":5}},"10":{"start":{"line":17,"column":8},"end":{"line":17,"column":19}},"11":{"start":{"line":19,"column":4},"end":{"line":21,"column":5}},"12":{"start":{"line":20,"column":8},"end":{"line":20,"column":19}},"13":{"start":{"line":22,"column":4},"end":{"line":22,"column":52}},"14":{"start":{"line":26,"column":0},"end":{"line":73,"column":2}},"15":{"start":{"line":27,"column":4},"end":{"line":27,"column":27}},"16":{"start":{"line":28,"column":4},"end":{"line":30,"column":5}},"17":{"start":{"line":29,"column":8},"end":{"line":29,"column":34}},"18":{"start":{"line":31,"column":4},"end":{"line":31,"column":20}},"19":{"start":{"line":32,"column":4},"end":{"line":32,"column":73}},"20":{"start":{"line":34,"column":4},"end":{"line":36,"column":5}},"21":{"start":{"line":35,"column":8},"end":{"line":35,"column":21}},"22":{"start":{"line":38,"column":4},"end":{"line":49,"column":5}},"23":{"start":{"line":39,"column":8},"end":{"line":48,"column":9}},"24":{"start":{"line":41,"column":12},"end":{"line":45,"column":13}},"25":{"start":{"line":42,"column":16},"end":{"line":42,"column":37}},"26":{"start":{"line":44,"column":16},"end":{"line":44,"column":39}},"27":{"start":{"line":51,"column":4},"end":{"line":51,"column":18}},"28":{"start":{"line":52,"column":4},"end":{"line":52,"column":29}},"29":{"start":{"line":53,"column":4},"end":{"line":53,"column":13}},"30":{"start":{"line":54,"column":4},"end":{"line":64,"column":5}},"31":{"start":{"line":56,"column":12},"end":{"line":56,"column":28}},"32":{"start":{"line":57,"column":12},"end":{"line":57,"column":18}},"33":{"start":{"line":59,"column":12},"end":{"line":59,"column":21}},"34":{"start":{"line":60,"column":12},"end":{"line":60,"column":18}},"35":{"start":{"line":62,"column":12},"end":{"line":62,"column":21}},"36":{"start":{"line":63,"column":12},"end":{"line":63,"column":18}},"37":{"start":{"line":65,"column":4},"end":{"line":69,"column":5}},"38":{"start":{"line":66,"column":8},"end":{"line":68,"column":9}},"39":{"start":{"line":67,"column":12},"end":{"line":67,"column":29}},"40":{"start":{"line":72,"column":4},"end":{"line":72,"column":102}},"41":{"start":{"line":75,"column":0},"end":{"line":77,"column":1}},"42":{"start":{"line":76,"column":4},"end":{"line":76,"column":27}}},"branchMap":{"1":{"line":3,"type":"cond-expr","locations":[{"start":{"line":3,"column":52},"end":{"line":3,"column":58}},{"start":{"line":3,"column":61},"end":{"line":3,"column":66}}]},"2":{"line":16,"type":"if","locations":[{"start":{"line":16,"column":4},"end":{"line":16,"column":4}},{"start":{"line":16,"column":4},"end":{"line":16,"column":4}}]},"3":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":19,"column":4}},{"start":{"line":19,"column":4},"end":{"line":19,"column":4}}]},"4":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":28,"column":4}},{"start":{"line":28,"column":4},"end":{"line":28,"column":4}}]},"5":{"line":31,"type":"binary-expr","locations":[{"start":{"line":31,"column":8},"end":{"line":31,"column":9}},{"start":{"line":31,"column":13},"end":{"line":31,"column":19}}]},"6":{"line":32,"type":"cond-expr","locations":[{"start":{"line":32,"column":14},"end":{"line":32,"column":67}},{"start":{"line":32,"column":70},"end":{"line":32,"column":72}}]},"7":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":4},"end":{"line":34,"column":4}},{"start":{"line":34,"column":4},"end":{"line":34,"column":4}}]},"8":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]},"9":{"line":38,"type":"binary-expr","locations":[{"start":{"line":38,"column":9},"end":{"line":38,"column":32}},{"start":{"line":38,"column":37},"end":{"line":38,"column":57}}]},"10":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":12},"end":{"line":41,"column":12}},{"start":{"line":41,"column":12},"end":{"line":41,"column":12}}]},"11":{"line":41,"type":"binary-expr","locations":[{"start":{"line":41,"column":16},"end":{"line":41,"column":27}},{"start":{"line":41,"column":31},"end":{"line":41,"column":40}},{"start":{"line":41,"column":44},"end":{"line":41,"column":54}}]},"12":{"line":52,"type":"cond-expr","locations":[{"start":{"line":52,"column":20},"end":{"line":52,"column":22}},{"start":{"line":52,"column":25},"end":{"line":52,"column":27}}]},"13":{"line":54,"type":"switch","locations":[{"start":{"line":55,"column":8},"end":{"line":57,"column":18}},{"start":{"line":58,"column":8},"end":{"line":60,"column":18}},{"start":{"line":61,"column":8},"end":{"line":63,"column":18}}]},"14":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":65,"column":4}},{"start":{"line":65,"column":4},"end":{"line":65,"column":4}}]},"15":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"16":{"line":66,"type":"binary-expr","locations":[{"start":{"line":66,"column":12},"end":{"line":66,"column":15}},{"start":{"line":66,"column":19},"end":{"line":66,"column":43}}]},"17":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":0},"end":{"line":75,"column":0}},{"start":{"line":75,"column":0},"end":{"line":75,"column":0}}]}},"code":["(function () { YUI.add('yui-log-nodejs', function (Y, NAME) {","","var sys = require(process.binding('natives').util ? 'util' : 'sys'),","    hasColor = false;","","try {","    var stdio = require(\"stdio\");","    hasColor = stdio.isStderrATTY();","} catch (ex) {","    hasColor = true;","}","","Y.config.useColor = hasColor;","","Y.consoleColor = function(str, num) {","    if (!this.config.useColor) {","        return str;","    }","    if (!num) {","        num = '32';","    }","    return \"\\u001b[\" + num +\"m\" + str + \"\\u001b[0m\";","};","","","var logFn = function(str, t, m) {","    var id = '', lvl, mLvl;","    if (this.id) {","        id = '[' + this.id + ']:';","    }","    t = t || 'info';","    m = (m) ? this.consoleColor(' (' +  m.toLowerCase() + '):', 35) : '';","","    if (str === null) {","        str = 'null';","    }","","    if ((typeof str === 'object') || str instanceof Array) {","        try {","            //Should we use this?","            if (str.tagName || str._yuid || str._query) {","                str = str.toString();","            } else {","                str = sys.inspect(str);","            }","        } catch (e) {","            //Fail catcher","        }","    }","","    lvl = '37;40';","    mLvl = ((str) ? '' : 31);","    t = t+''; //Force to a string..","    switch (t.toLowerCase()) {","        case 'error':","            lvl = mLvl = 31;","            break;","        case 'warn':","            lvl = 33;","            break;","        case 'debug':","            lvl = 34;","            break;","    }","    if (typeof str === 'string') {","        if (str && str.indexOf(\"\\n\") !== -1) {","            str = \"\\n\" + str;","        }","    }","","    // output log messages to stderr","    sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));","};","","if (!Y.config.logFn) {","    Y.config.logFn = logFn;","}","","","","}, '3.13.0');","","}());"]};
12 var __cov_2yKP3acunwOe6fWd9ox0UQ = __coverage__['build/yui-log-nodejs/yui-log-nodejs.js'];
13 __cov_2yKP3acunwOe6fWd9ox0UQ.s['1']++;YUI.add('yui-log-nodejs',function(Y,NAME){__cov_2yKP3acunwOe6fWd9ox0UQ.f['1']++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['2']++;var sys=require(process.binding('natives').util?(__cov_2yKP3acunwOe6fWd9ox0UQ.b['1'][0]++,'util'):(__cov_2yKP3acunwOe6fWd9ox0UQ.b['1'][1]++,'sys')),hasColor=false;__cov_2yKP3acunwOe6fWd9ox0UQ.s['3']++;try{__cov_2yKP3acunwOe6fWd9ox0UQ.s['4']++;var stdio=require('stdio');__cov_2yKP3acunwOe6fWd9ox0UQ.s['5']++;hasColor=stdio.isStderrATTY();}catch(ex){__cov_2yKP3acunwOe6fWd9ox0UQ.s['6']++;hasColor=true;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['7']++;Y.config.useColor=hasColor;__cov_2yKP3acunwOe6fWd9ox0UQ.s['8']++;Y.consoleColor=function(str,num){__cov_2yKP3acunwOe6fWd9ox0UQ.f['2']++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['9']++;if(!this.config.useColor){__cov_2yKP3acunwOe6fWd9ox0UQ.b['2'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['10']++;return str;}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['2'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['11']++;if(!num){__cov_2yKP3acunwOe6fWd9ox0UQ.b['3'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['12']++;num='32';}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['3'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['13']++;return'\x1b['+num+'m'+str+'\x1b[0m';};__cov_2yKP3acunwOe6fWd9ox0UQ.s['14']++;var logFn=function(str,t,m){__cov_2yKP3acunwOe6fWd9ox0UQ.f['3']++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['15']++;var id='',lvl,mLvl;__cov_2yKP3acunwOe6fWd9ox0UQ.s['16']++;if(this.id){__cov_2yKP3acunwOe6fWd9ox0UQ.b['4'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['17']++;id='['+this.id+']:';}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['4'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['18']++;t=(__cov_2yKP3acunwOe6fWd9ox0UQ.b['5'][0]++,t)||(__cov_2yKP3acunwOe6fWd9ox0UQ.b['5'][1]++,'info');__cov_2yKP3acunwOe6fWd9ox0UQ.s['19']++;m=m?(__cov_2yKP3acunwOe6fWd9ox0UQ.b['6'][0]++,this.consoleColor(' ('+m.toLowerCase()+'):',35)):(__cov_2yKP3acunwOe6fWd9ox0UQ.b['6'][1]++,'');__cov_2yKP3acunwOe6fWd9ox0UQ.s['20']++;if(str===null){__cov_2yKP3acunwOe6fWd9ox0UQ.b['7'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['21']++;str='null';}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['7'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['22']++;if((__cov_2yKP3acunwOe6fWd9ox0UQ.b['9'][0]++,typeof str==='object')||(__cov_2yKP3acunwOe6fWd9ox0UQ.b['9'][1]++,str instanceof Array)){__cov_2yKP3acunwOe6fWd9ox0UQ.b['8'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['23']++;try{__cov_2yKP3acunwOe6fWd9ox0UQ.s['24']++;if((__cov_2yKP3acunwOe6fWd9ox0UQ.b['11'][0]++,str.tagName)||(__cov_2yKP3acunwOe6fWd9ox0UQ.b['11'][1]++,str._yuid)||(__cov_2yKP3acunwOe6fWd9ox0UQ.b['11'][2]++,str._query)){__cov_2yKP3acunwOe6fWd9ox0UQ.b['10'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['25']++;str=str.toString();}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['10'][1]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['26']++;str=sys.inspect(str);}}catch(e){}}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['8'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['27']++;lvl='37;40';__cov_2yKP3acunwOe6fWd9ox0UQ.s['28']++;mLvl=str?(__cov_2yKP3acunwOe6fWd9ox0UQ.b['12'][0]++,''):(__cov_2yKP3acunwOe6fWd9ox0UQ.b['12'][1]++,31);__cov_2yKP3acunwOe6fWd9ox0UQ.s['29']++;t=t+'';__cov_2yKP3acunwOe6fWd9ox0UQ.s['30']++;switch(t.toLowerCase()){case'error':__cov_2yKP3acunwOe6fWd9ox0UQ.b['13'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['31']++;lvl=mLvl=31;__cov_2yKP3acunwOe6fWd9ox0UQ.s['32']++;break;case'warn':__cov_2yKP3acunwOe6fWd9ox0UQ.b['13'][1]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['33']++;lvl=33;__cov_2yKP3acunwOe6fWd9ox0UQ.s['34']++;break;case'debug':__cov_2yKP3acunwOe6fWd9ox0UQ.b['13'][2]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['35']++;lvl=34;__cov_2yKP3acunwOe6fWd9ox0UQ.s['36']++;break;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['37']++;if(typeof str==='string'){__cov_2yKP3acunwOe6fWd9ox0UQ.b['14'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['38']++;if((__cov_2yKP3acunwOe6fWd9ox0UQ.b['16'][0]++,str)&&(__cov_2yKP3acunwOe6fWd9ox0UQ.b['16'][1]++,str.indexOf('\n')!==-1)){__cov_2yKP3acunwOe6fWd9ox0UQ.b['15'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['39']++;str='\n'+str;}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['15'][1]++;}}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['14'][1]++;}__cov_2yKP3acunwOe6fWd9ox0UQ.s['40']++;sys.error(this.consoleColor(t.toLowerCase()+':',lvl)+m+' '+this.consoleColor(str,mLvl));};__cov_2yKP3acunwOe6fWd9ox0UQ.s['41']++;if(!Y.config.logFn){__cov_2yKP3acunwOe6fWd9ox0UQ.b['17'][0]++;__cov_2yKP3acunwOe6fWd9ox0UQ.s['42']++;Y.config.logFn=logFn;}else{__cov_2yKP3acunwOe6fWd9ox0UQ.b['17'][1]++;}},'3.13.0');