'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function q(e,f,d,h){var a,b,c;a=e.description;for(var g=0;g<f.length;g++){b=f[g];c="string"===typeof b?b:b[0];b="string"===typeof b?null:b[1];c=-1!==a.indexOf(c);if(h||c)e.severity=d;c&&b&&(e.description=b)}}var r=["Dangerous comment"],v=[["Expected '{'","Statement body should be inside '{ }' braces."]],
w="Missing semicolon;Extra comma;Missing property name;Unmatched ; and instead saw; is not defined;Unclosed string;Stopping, unable to continue".split(";");d.registerHelper("lint","javascript",function(e,f,k){if(!window.JSHINT)return[];JSHINT(e,f.jshint_options,f.globals);e=JSHINT.data().errors;f=[];if(e){k=k.options.indentUnit||4;for(var h=0;h<e.length;h++){var a=e[h];if(a){var b=a.character,c=0,g=0,m=-1!=a.reason.toLowerCase().search("mixed spaces and tabs");try{var t=!!a.evidence&&!m;if(t)for(var n=
0,l=0;n<b&&l<b;n++,l++)9==a.evidence.charCodeAt(n)&&(l+=k-1,g+=1);b-=g*(k-1);if(t||m)var u=a.evidence.length>b?a.evidence.substr(b-1):"",p=m?u.match(/([ \t])*/):u.match(/([a-zA-Z0-9_])*/),c=p&&p.length?p[0].length:0}catch(x){console.log("javascript-lint: error parsing source "+x.message)}a.description=a.reason;a.start=b;a.end=b+(c||1);q(a,v,"warning",!0);q(a,w,"error");a:{b=a.description;for(c=0;c<r.length;c++)if(-1!==b.indexOf(r[c])){b=!0;break a}b=!1}(a=b?null:a)&&f.push({message:a.description,
severity:a.severity,from:d.Pos(a.line-1,a.start-1),to:d.Pos(a.line-1,a.end-1)})}}}return f})});
