Skip to content
Browse files

-Converting test suite to MUnit

  • Loading branch information...
1 parent 6bf26e3 commit f71d7fba279861fc7baf416ce97228e5eaa2704c @codenothing committed Jul 15, 2012
View
1 .gitignore
@@ -0,0 +1 @@
+node_modules/
View
9 .lintignore
@@ -1,9 +0,0 @@
-# nothing good can come from the git directory
-.git/
-
-# Demo includes
-demo/jquery-linedtextarea.js
-demo/jquery-1.4.2.js
-
-# Skip over test files, they are already handled internally
-test/src/files/
View
9 .nodelint.json
@@ -0,0 +1,9 @@
+{
+ "ignore": [
+ ".git/",
+ "node_modules/",
+ "bin/",
+ "demo/jquery-linedtextarea.js",
+ "demo/jquery-1.4.2.js"
+ ]
+}
View
7 Makefile
@@ -4,10 +4,7 @@ all:
@echo "\n\x1B[1;31mPC_LOAD_LETTER\x1B[0m\n"
test: lint
- @node test/start.js
-
-test-single:
- @node test/single.js
+ @node build/test.js
lint:
- @build/bin/nodelint .
+ @nlint .
View
21 README.md
@@ -1,11 +1,26 @@
JSONLint is a JSON Linter that allows for comments in your JSON Files.
+
+Installation
+------------
+
+For use with nodejs, use npm
+
+```bash
+$ npm install -g json-lint
+```
+
+For use in browser environments, include the script tag
+
+```html
+<script type='text/javascript' src='jsonlint.js'></script>
+```
+
Usage
-----
```js
-// JSONLint is exposed to the window object in a browser,
-// but if in a nodejs enviorment
-var JSONLint = require('/path/to/jsonlint.js');
+// Require it for nodejs environment
+var JSONLint = require( 'json-lint' );
// Run the JSON string through the linter
var lint = JSONLint( json, options );
View
183 build/bin/nodelint
@@ -1,183 +0,0 @@
-#! /usr/bin/env node
-/* vim:set ft=javascript : */
-/*
- * Nodelint [VERSION]
- * [DATE]
- * A fork of tav's nodelint (http://github.com/tav/nodelint)
- * Corey Hart @ http://www.codenothing.com
- */
-(function(){function p(t,z,r){if(r===undefined){r=z;z={}}p.Render(t,z,function(e,j){if(e)return r.call(j,e||"Expecting a file or directory to lint.");j=p.Format(j);if(j.options.logfile)q.writeFile(j.options.logfile,j.logfile,"utf8",function(g){j.output+="\n\n"+p.Color.blue(g?"Unable to write to logfile - "+(g.message||g):"Logs have been recorded to "+j.options.logfile)+"\n\n";r.call(j,null,j)});else{j.output+="\n\n";r.call(j,null,j)}})}var q=require("fs");module.exports=p})();var Nodelint=module.exports;
-(function(p,q){var t=require("sys"),z=require("path"),r=/^\~\//,e=/^\//,j={version:"[VERSION]",date:"[DATE]",info:function(g){t.puts(p.Color.blue(g))},warn:function(g){t.puts(p.Color.yellow(g))},error:function(g){t.error(p.Color.bold.red(g.message||g));process.exit(1)},normalize:function(g){if(r.exec(g))g=g.replace(r,process.env.HOME+"/");else e.exec(g)||(g=process.cwd()+"/"+g);return z.normalize(g)},extend:function(){var g=Array.prototype.slice.call(arguments),n=-1,u=g.length,L=false,f=this,y,D;
-if(typeof g[0]=="boolean"){L=g.shift();u=g.length}if(u>1){f=g.shift();u=g.length}for(;++n<u;){D=g[n];for(y in D)if(D.hasOwnProperty(y))f[y]=L&&D[y]&&Array.isArray(D[y])?j.extend(L,f[y]||[],D[y]):L&&typeof D[y]=="object"&&D[y]!==null?j.extend(L,f[y]||{},D[y]):D[y]}return f},each:function(g,n,u){var L=-1,f=g.length;if(u===q){u=n;n=q}n=n||g;if(f===q)for(L in g){if(u.call(n,g[L],L,g)===false)break}else for(;++L<f;)if(u.call(n,g[L],L,g)===false)break;return g},leave:function(g,n){t[g>0?"error":"puts"](n);
-process.on("exit",function(){process.reallyExit(g)})}};j.extend(p,j)})(Nodelint);
-Nodelint.Options={help:false,logfile:null,encodings:null,use:null,add:null,"default":null,verbose:false,"show-passed":false,"show-ignored":false,"show-missing":false,"show-warnings":false,"Nodelint-cli":false,"Nodelint-pre-commit":false,"Nodelint-pre-commit-all":false,_csl:{encodings:true,use:true,add:true},_paths:{logfile:true,add:true},_special:{},_shortcuts:{h:{"long":"help",expect:false,"default":true},l:{"long":"logfile",expect:true,"default":null},e:{"long":"encodings",expect:true,"default":null},
-u:{"long":"use",expect:true,"default":null},a:{"long":"add",expect:true,"default":null},d:{"long":"default",expect:true,"default":null},v:{"long":"verbose",expect:false,"default":true},p:{"long":"show-passed",expect:false,"default":true},i:{"long":"show-ignored",expect:false,"default":true},m:{"long":"show-missing",expect:false,"default":true},w:{"long":"show-warnings",expect:false,"default":true}}};
-(function(p,q){function t(j){return j===q||j.length<1||j==="undefined"?q:j==="true"?true:j==="false"?false:j==="null"?null:j==parseFloat(j)?parseFloat(j):j}require("path");var z=/^--/,r=/^-/,e=/node$/;p.ARGV=function(j,g,n){if(n===q&&typeof g=="boolean"){n=g;g=q}var u=g&&Array.isArray(g);g=u?g.slice(0):process.argv.slice(0);var L=j._shortcuts;n=n?j:{};var f=[],y,D,N,O;for(!u&&e.exec(g.shift())&&g.shift();g.length;){u=g.shift();if(z.exec(u)){u=u.replace(z,"");if(u.indexOf("=")>-1){u=u.split("=");if(j.hasOwnProperty(u[0]))n[u[0]]=
-t(u[1]);else{O=t(u[1]);u=u[0].split("_");N="_"+u[0];u=u[1];n[N]||(n[N]={});n[N][u]=O}}else if(j.hasOwnProperty(u))n[u]=true;else{u=u.split("_");N="_"+u[0];u=u[1];n[N]||(n[N]={});n[N][u]=O}}else if(r.exec(u))if((u=u.replace(r,"")).length>1){D=-1;for(N=u.length;++D<N;)if(y=L[u[D]])n[y["long"]]=y.expect&&g.length?t(g.shift()):y["default"]}else{if(y=L[u])n[y["long"]]=y.expect&&g.length?t(g.shift()):y["default"]}else f.push(u)}if(j._csl)for(D in j._csl)if(j._csl[D]===true&&typeof n[D]=="string")n[D]=n[D].split(",");
-if(j._paths)for(D in j._paths)if(j._paths[D]===true&&n[D])if(Array.isArray(n[D])){O=-1;for(N=n[D].length;++O<N;)n[D][O]=p.normalize(n[D][O])}else n[D]=p.normalize(n[D].trim());if(j._special)for(D in j._special)if(typeof j._special[D]=="function"&&n[D])n[D]=j._special[D](n[D],n);return{targets:f,options:n}}})(Nodelint);
-(function(p,q){function t(e,j,g){if(!(this instanceof t))return new t(e,j,g);if(g===q){g=j;j={}}j=j||{};this.name=e||"Unnamed Tracker";this.callback=g||z;this.timeout=j.timeout||-1;this.markers=j.markers||{};this.hold=true;this.errord=this.fin=false;this.results={};for(var n in this.markers)if(this.markers.hasOwnProperty(n)&&this.markers[n]===true)this.results[n]=true;j.autostart&&this.start()}var z=function(){},r=Date.now();t.prototype={guid:function(){return"Tracking_"+this.name+"_"+ ++r},mark:function(e,
-j){if(arguments.length===0){var g=this.guid();this.markers[g]=false;return g}else if(arguments.length===1)this.markers[e]=false;else{this.markers[e]=true;this.results[e]=j;this.check()}},unmark:function(e){this.markers.hasOwnProperty(e)&&delete this.markers[e];this.results.hasOwnProperty(e)&&delete this.results[e]},check:function(){if(this.fin)return true;else if(this.hold||this.errord)return false;for(var e in this.markers)if(this.markers[e]===false)return false;if(this.timeid)this.timeid=clearTimeout(this.timeid);
-this.callback.call(this,null,this.results,this);return this.fin=true},error:function(e){if(e){this.stop();this.errord=true;this.callback.call(this,e,null,this)}else return this.errord},stop:function(){this.hold=true;if(this.timeid)this.timeid=clearTimeout(this.timeid)},start:function(){var e=this;e.hold=false;if(!e.check()&&e.timeout>-1)e.timeid=setTimeout(function(){e.error(Error(e.name+" Tracking Timeout"))},e.timeout)}};p.Tracking=t})(Nodelint);
-(function(p){function q(z,r,e){return"\u001b["+(r?1:0)+";"+q.colors[z]+"m"+e+"\u001b[0m"}var t=require("sys");q.colors={red:31,green:32,yellow:33,blue:34};q.bold={};q.puts={bold:{}};p.each(q.colors,function(z,r){q[r]=function(e){return q(r,false,e)};q.bold[r]=function(e){return q(r,true,e)};q.puts[r]=function(e){return t.puts(q(r,false,e))};q.puts.bold[r]=function(e){return t.puts(q(r,true,e))}});p.Color=q})(Nodelint);
-(function(p){function q(e){if(e)if(q[e])q[e]();else p.leave(1,"Unknown Help Target - "+e);else p.leave(0,q._display)}var t=p.Color,z=t.bold,r=require("sys");p.extend(q,{_display:[z.red("Usage:"),"\tNodelint [options] file.js [file2.js dir dir2]\n",z.red("Options:"),"",t.red(" -l FILE, --logfile=FILE"),"\tDefine a logfile to output results to.\n",t.red(" -j FILE, --jslint=FILE"),"\tDefine a custom jslint file to use.\n",t.red(" -e ENCODINGS, --encodings=ENCODINGS"),"\tDefine a comma-sparated list of encodings to check for.\n",
-t.red(" -v, --verbose"),"\tVerbose mode. Outputs processing information like what directory is currently being read, or what file is currently being linted.\n",t.red(" -p, --show-passed"),"\tOutput list of files that passed jslint.\n",t.red(" -i, --show-ignored"),"\tOutput list of files ignored based on lintignore files.\n",t.red(" -m, --show-missing"),"\tOutput missing files that were expected.\n",t.red(" -w, --show-warnings"),"\tOutput warning messages during processing.\n",t.red(" --Nodelint-cli"),
-"\tTrigger Cli run of arguments.\n",t.red(" --Nodelint-pre-commit=VCS"),"\tRun the pre-commit hook on files to be committed for the version control system defined. Blocks commit on error.\n",t.red(" --Nodelint-pre-commit-all"),"\tRun Nodelint across the entire project before, and block commit on error.\n",z.red("Passing JSLint Options:"),"\tNodelint --adsafe=true [more options] file.js\n"].join("\n"),encodings:function(){r.puts(z.blue("\nSupported Encoding Conversions:"));p.each(p.Encodings,function(e,
-j){r.puts(j)});p.leave(0,"")}});p.Help=q})(Nodelint);(function(p){p.Encodings={"UTF-8-BOM":function(q){if(q.buffer[0]===239&&q.buffer[1]===187&&q.buffer[2]===191){q.buffer=q.buffer.slice(3,q.buffer.length);q.content=q.buffer.toString()}}}})(Nodelint);
-(function(p){function q(t,z,r){var e,j=q.linters,g=r["default"];for(e in j)if(!(r.use&&r.use.indexOf(e)===-1))if(j[e].hasOwnProperty("match")&&j[e].match.exec(t))return j[e].call(this,t,z,r);if(g&&j[g])return j[g].call(this,t,z,r);return null}require("fs");p.extend(q,{linters:{},check:function(t,z){var r,e=q.linters;for(r in e)if(!(z.use&&z.use.indexOf(r)===-1))if(e[r].hasOwnProperty("match")&&e[r].match.exec(t))return true;return false},add:function(t,z){var r;p.Options[t.name]=null;p.Options["_"+
-t.name]={};p.Options._paths[t.name]=true;q.linters[t.name]=function(e,j,g){if(!r)if(g[t.name]){var n=global.Nodelint;global.Nodelint=p;require(g[t.name]);global.Nodelint=n;r=q[t.name]}else r=q[t.name]?q[t.name]:require(t.path);if(g.verbose)p.info((t.display||t.name)+"ing "+e);return z.call(this,r,e,j,g["_"+t.name],g)};p.extend(q.linters[t.name],t)}});p.Linters=q})(Nodelint);
-(function(p,q){function t(B){return RegExp("^"+(B||"").replace(n,".*").replace(u,"\\'").replace(L,'\\"').replace(f,"\\/").replace(y,"\\(").replace(D,"\\)").replace(N,"\\{").replace(O,"\\}").replace(Ja,"\\[").replace(ha,"\\]").replace(ja,"\\$").replace(da,"\\^")+"$")}function z(B,C,G){if(this instanceof z){if(G===q&&typeof C=="function"){G=C;C={}}}else return new z(B,C,G);var w=this,H,E=global.Nodelint;w.options=p.extend(true,{},p.Options,C||{});w.ignore=[];w._rignore=[];w._lintignore=[];w.missing=
-[];w.passes=[];w.errors=[];w.count={files:0,errors:0};if(B)Array.isArray(B)||(B=[B]);else return G.call(w,"No file path provided.");if(w.options.add&&w.options.add.length){global.Nodelint=p;w.options.add.forEach(function(R){require(R)});global.Nodelint=E}H=new j("Main Render Tracker",function(R){G.call(w,R,w)});B.forEach(function(R){var I=H.mark();w.stat(R,function(S,P,V){if(S)return H.error(S);w.start(P,V,function(ia){ia?H.error(ia):H.mark(I,true)})})});H.start()}var r=require("fs");require("sys");
-var e=require("path"),j=p.Tracking,g=/\/[^\/]*$/,n=/\*/g,u=/'/g,L=/"/g,f=/\//g,y=/\(/g,D=/\)/g,N=/\{/g,O=/\}/g,Ja=/\[/g,ha=/\]/g,ja=/\$/g,da=/\^/g;z.prototype={start:function(B,C,G){var w=this,H=B.isDirectory(),E="/",R=C,I=new j("Circular Lint Ignore",function(S){if(S)G.call(w,S);else w[H?"dir":"file"](C,B,G)});H||(R=R.replace(g,""));I.mark("root");w.lintignore("/",function(){I.mark("root",true)});R.split("/").forEach(function(S){if(!(!S||S==="")){E+=S+"/";var P=I.mark();w.lintignore(E,function(){I.mark(P,
-true)})}});I.start()},readdir:function(B,C){var G=this;if(B[B.length-1]!=="/")B+="/";r.readdir(B,function(w,H){w&&C.call(G,w);for(var E=H.length;E--;)H[E]=B+H[E];C.call(G,null,B,H)})},parseLintignore:function(B,C,G){var w=this,H=new j("Parsing Ignore List: "+B+".lintignore",G);C.split("\n").forEach(function(E){if(!(!E||E===""||E[0]=="#")){H.mark(E);if(E.indexOf("*")>-1){w._rignore.push(t(e.normalize(B+E)));return H.mark(E,true)}w.stat(B+E,function(R,I,S){if(R){w.options["show-warnings"]&&p.warn(R);
-return H.mark(E,R)}if(I.isDirectory()&&S[S.length-1]!="/")S+="/";w.ignore.push(S);H.mark(E,true)})}});H.start()},lintignore:function(B,C){var G=this,w=B+".lintignore";if(B[B.length-1]!="/")w=(B+="/")+".lintignore";if(G._lintignore.indexOf(w)>-1)return C.call(G);G._lintignore.push(w);e.exists(w,function(H){if(!H)return C.call(G);r.readFile(w,"utf-8",function(E,R){return E?C.call(G,E):G.parseLintignore(B,R||"",C)})})},normalize:function(B,C){var G=this;r.realpath(B,function(w,H){C.call(G,w,w||e.normalize(H))})},
-stat:function(B,C){var G=this;e.exists(B,function(w){if(w)G.normalize(B,function(H,E){if(H)return C.call(G,H);r.stat(E,function(R,I){C.call(G,null,I,E)})});else{G.missing.push("Invalid File or Path: "+B);C.call(G,"Invalid File or Path: "+B)}})},rignore:function(B){for(var C=this._rignore.length;C--;)if(this._rignore[C].exec(B))return true;return false},file:function(B,C,G){var w=this;w.normalize(B,function(H,E){if(H)return G.call(w,H);r.readFile(E,"utf-8",function(R,I){var S={},P=false;if(R)return G.call(w,
-R);if(w.options.encodings){S={path:E,stat:C,content:I,buffer:new Buffer(I)};P=false;p.each(w.options.encodings,function(V){if(!V||!p.Encodings[V]){P="Invalid Encoding: "+V;return false}V=p.Encodings[V].call(p,S);if(typeof V=="string"&&V.length){P="Encoding Error: "+V+"\nFile: "+E;return false}});if(P)return G.call(w,P);else I=S.content}w.count.files++;P=p.Linters.call(w,E,I,w.options);if(P===null)p.error("Unable to lint "+E);else if(P&&P.length){w.count.errors+=P.length;w.errors.push({file:E,errors:P})}else w.passes.push(E);
-return G.call(w,null,w)})})},renderdir:function(B,C,G){var w=this,H=j("Rendering Directory: "+B,function(E){G.call(w,E,w)});C.forEach(function(E){var R=H.mark(),I=false,S,P=function(V){V?H.error(V):H.mark(R,true)};w.stat(E,function(V,ia,ca){if(V)return H.error(V);if((S=ia.isDirectory())&&ca[ca.length-1]!="/")ca+="/";if(w.ignore.indexOf(ca)>-1||(I=w.rignore(ca))){I&&w.ignore.push(ca);return H.mark(R,true)}if(S)w.dir(ca,ia,P);else p.Linters.check.call(w,ca,w.options)===false?H.mark(R,true):w.file(ca,
-ia,P)})});H.start()},dir:function(B,C,G){var w=this;if(B[0]!="/")return w.normalize(B,function(H,E){return H?G.call(w,H):w.dir(E,C,G)});w.options.verbose&&p.info("Reading "+B);w.lintignore(B,function(){w.readdir(B,function(H,E,R){return H?G.call(w,H):R.length<1?G.call(w,null,w):w.renderdir(E,R,G)})})}};p.Render=z})(Nodelint);
-(function(p){function q(j){if(typeof q[j]=="function")q[j]();else{z.error(t.red("Nodelint doesn't support pre-commit hook for "+j));process.exit(1)}}var t=p.Color.bold,z=require("sys"),r=require("child_process").spawn,e=/\.js$/;p.extend(q,{git:function(){var j=r("git",["diff","--cached","--name-only","--diff-filter=ACM"]),g={stdout:"",stderr:""},n=p.ARGV(p.Options,true),u=[];p.each(g,function(L,f){j[f].on("data",function(y){g[f]+=y})});j.on("exit",function(L){if(L||g.stderr.length){z.puts(t.red(L||
-g.stderr));process.exit(1)}g.stdout.trim().split("\n").forEach(function(f){if(e.exec((f||"").trim()))u.push(f)});u.length?p(u,n.options,q.Results):process.exit(0)})},svn:function(){var j=p.ARGV(p.Options,true),g=[];j.targets.forEach(function(n){if(e.exec((n||"").trim()))g.push(n)});g.length?p(g,j.options,q.Results):process.exit(0)},All:function(){var j=p.ARGV(p.Options,true);if(!j.targets.length)j.targets=[process.cwd()];p(j.targets,j.options,q.Results)},Results:function(j,g){if(j){z.error(t.red(j.message||
-j));process.exit(1)}else g.errors.length?p.leave(1,g.stderr):process.exit(0)}});p.Precommit=q})(Nodelint);
-(function(p,q){var t=p.Color,z=t.bold;p.Format=function(r){var e=[],j=[],g=[];if(!r)return q;if(r.ignore.length&&r.options["show-ignored"]){r.ignore.forEach(function(n){j.push(t.yellow("Ignored "+n));e.unshift(n)});e.unshift("\n=======================================\n\nIgnored Files\n")}if(r.missing.length&&r.options["show-missing"]){r.missing.forEach(function(n){j.push(t.yellow("Missing "+n));e.unshift(n)});e.unshift("\n=======================================\n\nMissing Files\n")}if(r.passes.length&&
-r.options["show-passed"]){r.passes.forEach(function(n){j.push(t.green(n+" passed with 0 errors"));e.unshift(n)});e.unshift("\n=======================================\n\nFiles passed with 0 errors.\n")}j.length&&j.push("\n=======================================\n\n");r.errors.forEach(function(n){g.length&&g.push("\n=======================================\n");n.errors.forEach(function(u){if(u){g.push(t.red(n.file+", Line "+u.line+", Character "+u.character),u.error,u.evidence?u.evidence+"\n":"");e.unshift(n.file+
-", Line "+u.line+", Character "+u.character,u.error,u.evidence?u.evidence+"\n":"")}});e.unshift("\n=======================================\n")});(g.length?g:j).push(r.count.errors?"\n=======================================\n":"",z.red("Total Files: "+r.count.files),z.red("Total Errors: "+r.count.errors));e.unshift("Total Files: "+r.count.files,"Total Errors: "+r.count.errors);r.logfile=e.join("\n");r.output=j.join("\n")+g.join("\n");r.stdout=j.join("\n");r.stderr=g.join("\n");return r}})(Nodelint);
-(function(p){p.Cli=function(q){p.extend(true,p.Options,q||{});q=p.ARGV(p.Options);if(q.options.help)p.Help(q.targets[0]);else if(q.options["Nodelint-pre-commit"]||p.Options["Nodelint-pre-commit"])p.Precommit(q.options["Nodelint-pre-commit"]||p.Options["Nodelint-pre-commit"]);else q.options["Nodelint-pre-commit-all"]||p.Options["Nodelint-pre-commit-all"]?p.Precommit.All():p(q.targets,q.options,function(t,z){t?p.error(t):p.leave(z.count.errors?1:0,z.output)})}})(Nodelint);
-(function(p){var q=/^\#\!.*/,t=/^\s*(\S*(\s+\S+)*)\s*$/;p.Linters.add({name:"jslint",display:"JSLint",path:__dirname+"/jslint.js",build:__filename,match:/\.js$/i},function(z,r,e,j){e=e.replace(q,"");if(z(e,j))return[];else{z.errors[z.errors.length-1]===null&&z.errors.pop();r=-1;for(e=z.errors.length;++r<e;){z.errors[r].error=z.errors[r].reason;z.errors[r].evidence=(z.errors[r].evidence||"").replace(t,"$1")}return z.errors}})})(Nodelint);
-var JSLINT=function(){function p(){}function q(b,d){return Object.prototype.hasOwnProperty.call(b,d)}function t(b,d){for(var c in d)if(q(d,c))b[c]=d[c]}function z(){if(!m.safe){m.rhino&&t(X,Ab);m.devel&&t(X,Bb);if(m.browser||m.sidebar)t(X,Cb);m.sidebar&&t(X,Db);m.widget&&t(X,Eb)}}function r(b,d,c){throw{name:"JSLintError",line:d,character:c,message:b+" ("+Math.floor(d/za.length*100)+"% scanned)."};}function e(b,d,c,h,k,l){var v;d=d||a;if(d.id==="(end)")d=i;v=d.line||0;d=d.from||0;c={id:"(error)",
-raw:b,evidence:za[v-1]||"",line:v,character:d,a:c,b:h,c:k,d:l};c.reason=b.supplant(c);JSLINT.errors.push(c);m.passfail&&r("Stopping. ",v,d);Ta+=1;Ta>=m.maxerr&&r("Too many errors.",v,d);return c}function j(b,d,c,h,k,l,v){return e(b,{line:d,from:c},h,k,l,v)}function g(b,d,c,h,k,l){b=e(b,d,c,h,k,l);r("Stopping, unable to continue.",b.line,b.character)}function n(b,d,c,h,k,l,v){return g(b,{line:d,from:c},h,k,l,v)}function u(b,d){if(m.safe&&x["(global)"]&&typeof X[b]!=="boolean")e("ADsafe global: "+b+
-".",i);else b==="hasOwnProperty"&&e("'hasOwnProperty' is a really bad name.");if(q(x,b)&&!x["(global)"])e(x[b]===true?"'{a}' was used before it was defined.":"'{a}' is already defined.",a,b);x[b]=d;if(x["(global)"]){ob[b]=x;if(q(pa,b)){e("'{a}' was used before it was defined.",a,b);delete pa[b]}}else Y[b]=x}function L(b){b=b||0;for(var d=0,c;d<=b;){(c=Ka[d])||(c=Ka[d]=ka.token());d+=1}return c}function f(b,d){switch(i.id){case "(number)":a.id==="."&&e("A dot following a number can be confused with a decimal point.",
-i);break;case "-":if(a.id==="-"||a.id==="--")e("Confusing minusses.");break;case "+":if(a.id==="+"||a.id==="++")e("Confusing plusses.")}if(i.type==="(string)"||i.identifier)Ua=i.value;if(b&&a.id!==b)if(d)a.id==="(end)"?e("Unmatched '{a}'.",d,d.id):e("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",a,b,d.id,d.line,a.value);else if(a.type!=="(identifier)"||a.value!==b)e("Expected '{a}' and instead saw '{b}'.",a,b,a.value);ba=i;for(i=a;;){a=Ka.shift()||ka.token();if(a.id==="(end)"||
-a.id==="(error)")break;if(a.type==="special"){var c=void 0,h=void 0,k=void 0,l=a.value;c=void 0;var v=void 0;switch(l){case "*/":g("Unbegun comment.");break;case "/*members":case "/*member":l="/*members";qa||(qa={});h=qa;break;case "/*jslint":m.safe&&e("ADsafe restriction.");h=m;k=Fb;break;case "/*global":m.safe&&e("ADsafe restriction.");h=X}c=ka.token();a:for(;;){for(;;){if(c.type==="special"&&c.value==="*/")break a;if(c.id!=="(endline)"&&c.id!==",")break;c=ka.token()}c.type!=="(string)"&&c.type!==
-"(identifier)"&&l!=="/*members"&&g("Bad option.",c);v=ka.token();if(v.id===":"){v=ka.token();h===qa&&g("Expected '{a}' and instead saw '{b}'.",c,"*/",":");if(c.value==="indent"&&l==="/*jslint"){c=+v.value;if(typeof c!=="number"||!isFinite(c)||c<=0||Math.floor(c)!==c)g("Expected a small integer and instead saw '{a}'.",v,v.value);h.white=true;h.indent=c}else if(c.value==="maxerr"&&l==="/*jslint"){c=+v.value;if(typeof c!=="number"||!isFinite(c)||c<=0||Math.floor(c)!==c)g("Expected a small integer and instead saw '{a}'.",
-v,v.value);h.maxerr=c}else if(c.value==="maxlen"&&l==="/*jslint"){c=+v.value;if(typeof c!=="number"||!isFinite(c)||c<=0||Math.floor(c)!==c)g("Expected a small integer and instead saw '{a}'.",v,v.value);h.maxlen=c}else if(v.value==="true")h[c.value]=true;else if(v.value==="false")h[c.value]=false;else g("Bad option value.",v);c=ka.token()}else{l==="/*jslint"&&g("Missing option value.",c);h[c.value]=false;c=v}}k&&z()}else if(a.id!=="(endline)")break}}function y(b,d){var c;a.id==="(end)"&&g("Unexpected early end of program.",
-i);f();m.safe&&typeof X[i.value]==="boolean"&&a.id!=="("&&a.id!=="."&&e("ADsafe violation.",i);if(d){Ua="anonymous";x["(verb)"]=i.value}if(d===true&&i.fud)c=i.fud();else{if(i.nud)c=i.nud();else if(a.type==="(number)"&&i.id==="."){e("A leading decimal point can be confused with a dot: '.{a}'.",i,a.value);f();return i}else g("Expected an identifier and instead saw '{a}'.",i,i.id);for(;b<a.lbp;){f();if(i.led)c=i.led(c);else g("Expected an operator and instead saw '{a}'.",i,i.id)}}return c}function D(b,
-d){b=b||i;d=d||a;if(m.white||F==="styleproperty"||F==="style")b.character!==d.from&&b.line===d.line&&e("Unexpected space after '{a}'.",d,b.value)}function N(b,d){b=b||i;d=d||a;m.white&&!b.comment&&b.line===d.line&&D(b,d)}function O(b,d){if(m.white){b=b||i;d=d||a;b.line===d.line&&b.character===d.from&&e("Missing space after '{a}'.",a,b.value)}}function Ja(b,d){b=b||i;d=d||a;if(!m.laxbreak&&b.line!==d.line)e("Bad line breaking before '{a}'.",d,d.id);else if(m.white){b=b||i;d=d||a;b.character===d.from&&
-e("Missing space after '{a}'.",a,b.value)}}function ha(b){if(m.white&&a.id!=="(end)"){b=Z+(b||0);a.from!==b&&e("Expected '{a}' to have an indentation at {b} instead at {c}.",a,a.value,b,a.from)}}function ja(b){b=b||i;b.line!==a.line&&e("Line breaking error '{a}'.",b,b.value)}function da(){if(i.line!==a.line)m.laxbreak||e("Bad line breaking before '{a}'.",i,a.id);else i.character!==a.from&&m.white&&e("Unexpected space after '{a}'.",a,i.value);f(",");O(i,a)}function B(b,d){var c=ea[b];if(!c||typeof c!==
-"object")ea[b]=c={id:b,lbp:d,value:b};return c}function C(b){return B(b,0)}function G(b,d){var c=C(b);c.identifier=c.reserved=true;c.fud=d;return c}function w(b,d){var c=G(b,d);c.block=true;return c}function H(b){var d=b.id.charAt(0);if(d>="a"&&d<="z"||d>="A"&&d<="Z")b.identifier=b.reserved=true;return b}function E(b,d){var c=B(b,150);H(c);c.nud=typeof d==="function"?d:function(){this.right=y(150);this.arity="unary";if(this.id==="++"||this.id==="--")if(m.plusplus)e("Unexpected use of '{a}'.",this,
-this.id);else if((!this.right.identifier||this.right.reserved)&&this.right.id!=="."&&this.right.id!=="[")e("Bad operand.",this);return this};return c}function R(b,d){var c=C(b);c.type=b;c.nud=d;return c}function I(b,d){var c=R(b,d);c.identifier=c.reserved=true;return c}function S(b){return I(b,function(){if(this.id==="this"||this.id==="arguments"||this.id==="eval")if(Va&&x["(global)"])e("Strict violation.",this);else m.safe&&e("ADsafe violation.",this);return this})}function P(b,d,c,h){b=B(b,c);H(b);
-b.led=function(k){if(!h){Ja(ba,i);O(i,a)}if(typeof d==="function")return d(k,this);else{this.left=k;this.right=y(c);return this}};return b}function V(b,d){var c=B(b,100);c.led=function(h){Ja(ba,i);O(i,a);var k=y(100);if(h&&h.id==="NaN"||k&&k.id==="NaN")e("Use the isNaN function to compare with NaN.",this);else d&&d.apply(this,[h,k]);h.id==="!"&&e("Confusing use of '{a}'.",h,"!");k.id==="!"&&e("Confusing use of '{a}'.",h,"!");this.left=h;this.right=k;return this};return c}function ia(b){return b&&
-(b.type==="(number)"&&+b.value===0||b.type==="(string)"&&b.value===" "||b.type==="true"||b.type==="false"||b.type==="undefined"||b.type==="null")}function ca(b){B(b,20).exps=true;return P(b,function(d,c){var h;c.left=d;X[d.value]===false&&Y[d.value]["(global)"]===true&&e("Read only.",d);if(m.safe){h=d;do{typeof X[h.value]==="boolean"&&e("ADsafe violation.",h);h=h.left}while(h)}if(d){if(d.id==="."||d.id==="["){if(!d.left||d.left.value==="arguments")e("Bad assignment.",c);c.right=y(19);return c}else if(d.identifier&&
-!d.reserved){c.right=y(19);return c}d===ea["function"]&&e("Expected an identifier in an assignment and instead saw a function invocation.",i)}g("Bad assignment.",c)},20)}function ta(b,d,c){b=B(b,c);H(b);b.led=typeof d==="function"?d:function(h){m.bitwise&&e("Unexpected use of '{a}'.",this,this.id);this.left=h;this.right=y(c);return this};return b}function ua(b){B(b,20).exps=true;return P(b,function(d,c){m.bitwise&&e("Unexpected use of '{a}'.",c,c.id);O(ba,i);O(i,a);if(d){if(d.id==="."||d.id==="["||
-d.identifier&&!d.reserved){y(19);return c}d===ea["function"]&&e("Expected an identifier in an assignment, and instead saw a function invocation.",i);return c}g("Bad assignment.",c)},20)}function pb(b){b=B(b,150);b.led=function(d){if(m.plusplus)e("Unexpected use of '{a}'.",this,this.id);else if((!d.identifier||d.reserved)&&d.id!=="."&&d.id!=="[")e("Bad operand.",this);this.left=d;return this};return b}function Wa(){a.reserved&&e("Expected an identifier and instead saw '{a}' (a reserved word).",a,a.id);
-if(a.identifier){f();return i.value}}function Aa(){var b=Wa();if(b)return b;i.id==="function"&&a.id==="("?e("Missing name in function statement."):g("Expected an identifier and instead saw '{a}'.",a,a.value)}function La(b){var d=0,c;if(!(a.id!==";"||Xa))for(;;){c=L(d);if(c.reach)break;if(c.id!=="(endline)"){if(c.id==="function"){e("Inner functions should be listed at the top of the outer function.",c);break}e("Unreachable '{a}' after '{b}'.",c,c.value,b);break}d+=1}}function Ya(b){var d=Z,c=Y,h=a;
-if(h.id===";"){e("Unnecessary semicolon.",h);f(";")}else{if(h.identifier&&!h.reserved&&L().id===":"){f();f(":");Y=Object.create(c);u(h.value,"label");a.labelled||e("Label '{a}' on {b} statement.",a,h.value,a.value);Za.test(h.value+":")&&e("Label '{a}' looks like a javascript url.",h,h.value);a.label=h.value;h=a}b||ha();b=y(0,true);if(!h.block){if(!b||!b.exps)e("Expected an assignment or function call and instead saw an expression.",i);else b.id==="("&&b.left.id==="new"&&e("Do not use 'new' for side effects.");
-if(a.id!==";")j("Missing semicolon.",i.line,i.from+i.value.length);else{D(i,a);f(";");O(i,a)}}Z=d;Y=c;return b}}function qb(){if(a.value==="use strict"){f();f(";");return Va=true}else return false}function Ba(b){var d=[],c;b&&!qb()&&m.strict&&e('Missing "use strict" statement.',a);if(m.adsafe)switch(b){case "script":if(!va)if(a.value!=="ADSAFE"||L(0).id!=="."||L(1).value!=="id"&&L(1).value!=="go")g("ADsafe violation: Missing ADSAFE.id or ADSAFE.go.",a);if(a.value==="ADSAFE"&&L(0).id==="."&&L(1).value===
-"id"){va&&g("ADsafe violation.",a);f("ADSAFE");f(".");f("id");f("(");a.value!==ga&&g("ADsafe violation: id does not match.",a);f("(string)");f(")");f(";");va=true}break;case "lib":if(a.value==="ADSAFE"){f("ADSAFE");f(".");f("lib");f("(");f("(string)");da();b=y(0);b.id!=="function"&&g("The second argument to lib must be a function.",b);(c=(c=b.funct["(params)"])&&c.join(", "))&&c!=="lib"&&g("Expected '{a}' and instead saw '{b}'.",b,"(lib)","("+c+")");f(")");f(";");return d}else g("ADsafe lib violation.")}for(;!a.reach&&
-a.id!=="(end)";)if(a.id===";"){e("Unnecessary semicolon.");f(";")}else d.push(Ya());return d}function la(b){var d,c=Ca,h=Z,k=Y,l;Ca=b;Y=Object.create(Y);O(i,a);l=a;if(a.id==="{"){f("{");if(a.id!=="}"||i.line!==a.line){for(Z+=m.indent;!b&&a.from>Z;)Z+=m.indent;b||qb();d=Ba();Z-=m.indent;ha()}f("}",l);Z=h}else{e("Expected '{a}' and instead saw '{b}'.",a,"{",a.value);Xa=true;d=[Ya()];Xa=false}x["(verb)"]=null;Y=k;Ca=c;return d}function rb(){return this}function Ma(b){qa&&typeof qa[b]!=="boolean"&&e("Unexpected /*member '{a}'.",
-i,b);if(typeof ra[b]==="number")ra[b]+=1;else ra[b]=1}function $a(b){var d=b.value;b=b.line;var c=pa[d];if(typeof c==="function")c=false;if(c)c[c.length-1]!==b&&c.push(b);else{c=[b];pa[d]=c}}function ab(){if(a.identifier){f();return true}}function Na(){if(a.id==="-"){f("-");D();ja()}if(a.type==="(number)"){f("(number)");return true}}function bb(){if(a.type==="(string)"){f();return true}}function ma(){var b,d,c;if(a.identifier){c=a.value;if(c==="rgb"||c==="rgba"){f();f("(");for(b=0;b<3;b+=1){b&&f(",");
-d=a.value;if(a.type!=="(number)"||d<0){e("Expected a positive number and instead saw '{a}'",a,d);f()}else{f();if(a.id==="%"){f("%");d>100&&e("Expected a percentage and instead saw '{a}'",i,d)}else d>255&&e("Expected a small number and instead saw '{a}'",i,d)}}if(c==="rgba"){f(",");d=+a.value;if(a.type!=="(number)"||d<0||d>1)e("Expected a number between 0 and 1 and instead saw '{a}'",a,d);f();if(a.id==="%"){e("Unexpected '%'.");f("%")}}f(")");return true}else if(Gb[a.value]===true){f();return true}}else if(a.type===
-"(color)"){f();return true}return false}function T(){if(a.id==="-"){f("-");D();ja()}if(a.type==="(number)"){f();if(a.type!=="(string)"&&sb[a.value]===true){D();f()}else+i.value!==0&&e("Expected a linear unit and instead saw '{a}'.",a,a.value);return true}return false}function wa(){if(a.identifier)switch(a.value){case "thin":case "medium":case "thick":f();return true}else return T()}function Da(){if(a.identifier){if(a.value==="auto"){f();return true}}else return T()}function sa(){var b,d;if(a.identifier&&
-a.value==="url"){a=ka.range("(",")");d=a.value;b=d.charAt(0);if(b==='"'||b==="'")if(d.slice(-1)!==b)e("Bad url string.");else{d=d.slice(1,-1);d.indexOf(b)>=0&&e("Bad url string.")}d||e("Missing url.");f();m.safe&&tb.test(d)&&g("ADsafe URL violation.");Ea.push(d);return true}return false}function cb(b){var d=0,c,h,k,l=0;switch(typeof b){case "function":return b();case "string":if(a.identifier&&a.value===b){f();return true}return false}for(;;){if(d>=b.length)return false;k=b[d];d+=1;if(k===true)break;
-else if(typeof k==="number"){c=k;k=b[d];d+=1}else c=1;for(h=false;c>0;)if(cb(k)){h=true;c-=1}else break;if(h)return true}l=d;for(c=[];;){k=false;for(d=l;d<b.length;d+=1)if(!c[d])if(cb(Oa[b[d]])){k=h=true;c[d]=true;break}if(!k)return h}}function ub(){for(var b;;){if(a.id==="}"||a.id==="(end)"||fa&&a.id===fa)break;for(;a.id===";";){e("Misplaced ';'.");f(";")}for(b=void 0;a.id==="*"||a.id==="#"||a.value==="_";){m.css||e("Unexpected '{a}'.",a,a.value);f()}if(a.id==="-"){m.css||e("Unexpected '{a}'.",a,
-a.value);f("-");a.identifier||e("Expected a non-standard style attribute and instead saw '{a}'.",a,a.value);f();b=db}else{if(a.identifier)if(q(Oa,a.value))b=Oa[a.value];else{b=db;m.css||e("Unrecognized style attribute '{a}'.",a,a.value)}else e("Excepted a style attribute, and instead saw '{a}'.",a,a.value);f()}f(":");if(a.identifier&&a.value==="inherit")f();else if(!cb(b)){e("Unexpected token '{a}'.",a,a.value);f()}if(a.id==="!"){f("!");D();a.identifier&&a.value==="important"?f():e("Expected '{a}' and instead saw '{b}'.",
-a,"important",a.value)}a.id==="}"||a.id===fa?e("Missing '{a}'.",a,";"):f(";")}}function eb(){if(a.identifier){q(fb,a.value)||e("Expected a tagName, and instead saw {a}.",a,a.value);f()}else switch(a.id){case ">":case "+":f();eb();break;case ":":f(":");switch(a.value){case "active":case "after":case "before":case "checked":case "disabled":case "empty":case "enabled":case "first-child":case "first-letter":case "first-line":case "first-of-type":case "focus":case "hover":case "last-of-type":case "link":case "only-of-type":case "root":case "target":case "visited":f();
-break;case "lang":f();f("(");a.identifier||e("Expected a lang code, and instead saw :{a}.",a,a.value);f(")");break;case "nth-child":case "nth-last-child":case "nth-last-of-type":case "nth-of-type":f();f("(");a:if(a.id==="(number)"){f();if(a.value==="n"&&a.identifier){D();f();if(a.id==="+"){D();f("+");D();f("(number)")}}}else{switch(a.value){case "odd":case "even":if(a.identifier){f();break a}}e("Unexpected token '{a}'.",a,a.value)}f(")");break;case "not":f();f("(");a.id===":"&&L(0).value==="not"&&
-e("Nested not.");eb();f(")");break;default:e("Expected a pseudo, and instead saw :{a}.",a,a.value)}break;case "#":f("#");a.identifier||e("Expected an id, and instead saw #{a}.",a,a.value);f();break;case "*":f("*");break;case ".":f(".");a.identifier||e("Expected a class, and instead saw #.{a}.",a,a.value);f();break;case "[":f("[");a.identifier||e("Expected an attribute, and instead saw [{a}].",a,a.value);f();if(a.id==="="||a.value==="~="||a.value==="$="||a.value==="|="||a.id==="*="||a.id==="^="){f();
-a.type!=="(string)"&&e("Expected a string, and instead saw {a}.",a,a.value);f()}f("]");break;default:g("Expected a CSS selector, and instead saw {a}.",a,a.value)}}function vb(){for(var b;a.id==="@";){b=L();if(b.identifier&&b.value==="import"){f("@");f();if(!sa()){e("Expected '{a}' and instead saw '{b}'.",a,"url",a.value);f()}f(";")}else break}for(;a.id!=="</"&&a.id!=="(end)";){a:{b=void 0;if(a.id==="{")e("Expected a style pattern, and instead saw '{a}'.",a,a.id);else if(a.id==="@"){f("@");b=a.value;
-if(a.identifier&&Hb[b]===true){f();break a}e("Expected an at-rule, and instead saw @{a}.",a,b)}for(;;){eb();if(a.id==="</"||a.id==="{"||a.id==="(end)")break a;a.id===","&&da()}}F="styleproperty";if(a.id===";")f(";");else{f("{");ub();F="style";f("}")}}}function gb(b){var d,c;if(x["(onevar)"]&&m.onevar)e("Too many var statements.");else x["(global)"]||(x["(onevar)"]=true);for(this.first=[];;){O(i,a);d=Aa();x["(global)"]&&X[d]===false&&e("Redefinition of '{a}'.",i,d);u(d,"unused");if(b)break;c=i;this.first.push(i);
-if(a.id==="="){O(i,a);f("=");O(i,a);a.id==="undefined"&&e("It is not necessary to initialize '{a}' to 'undefined'.",i,d);L(0).id==="="&&a.identifier&&g("Variable {a} was not declared correctly.",a,a.value);d=y(0);c.first=d}if(a.id!==",")break;da()}return this}function wb(b){var d=Y;Y=Object.create(d);x={"(name)":b||'"'+Ua+'"',"(line)":a.line,"(context)":x,"(breakage)":0,"(loopage)":0,"(scope)":Y};i.funct=x;Fa.push(x);b&&u(b,"function");b=x;var c;a:{var h,k=a,l=[];f("(");N();if(a.id===")"){f(")");
-N(ba,i);c=void 0}else for(;;){h=Aa();l.push(h);u(h,"parameter");if(a.id===",")da();else{f(")",k);N(ba,i);c=l;break a}}}b["(params)"]=c;la(false);Y=d;x["(last)"]=i.line;x=x["(context)"]}function hb(){function b(){var c={},h=a;f("{");if(a.id!=="}")for(;;){if(a.id==="(end)")g("Missing '}' to match '{' from line {a}.",a,h.line);else if(a.id==="}"){e("Unexpected comma.",i);break}else if(a.id===",")g("Unexpected comma.",a);else a.id!=="(string)"&&e("Expected a string and instead saw {a}.",a,a.value);if(c[a.value]===
-true)e("Duplicate key '{a}'.",a,a.value);else if(a.value==="__proto__")e("Stupid key '{a}'.",a,a.value);else c[a.value]=true;f();f(":");hb();if(a.id!==",")break;f(",")}f("}")}function d(){var c=a;f("[");if(a.id!=="]")for(;;){if(a.id==="(end)")g("Missing ']' to match '[' from line {a}.",a,c.line);else if(a.id==="]"){e("Unexpected comma.",i);break}else a.id===","&&g("Unexpected comma.",a);hb();if(a.id!==",")break;f(",")}f("]")}switch(a.id){case "{":b();break;case "[":d();break;case "true":case "false":case "null":case "(number)":case "(string)":f();
-break;case "-":f("-");i.character!==a.from&&e("Unexpected space after '-'.",i);D(i,a);f("(number)");break;default:g("Expected a JSON value.",a)}}function xb(b){var d=[],c;for(c in b)q(b,c)&&d.push(c);return d}var ga,va,Ga,Ua,Pa,Hb={media:true,"font-face":true,page:true},Ib={"<":true,"<=":true,"==":true,"===":true,"!==":true,"!=":true,">":true,">=":true,"+":true,"-":true,"*":true,"/":true,"%":true},yb={arguments:true,callee:true,caller:true,constructor:true,eval:true,prototype:true,stack:true,unwatch:true,
-valueOf:true,watch:true},Fb={adsafe:true,bitwise:true,browser:true,cap:true,css:true,debug:true,devel:true,eqeqeq:true,evil:true,forin:true,fragment:true,immed:true,laxbreak:true,newcap:true,nomen:true,on:true,onevar:true,passfail:true,plusplus:true,regexp:true,rhino:true,undef:true,safe:true,sidebar:true,strict:true,sub:true,white:true,widget:true},Cb={addEventListener:false,blur:false,clearInterval:false,clearTimeout:false,close:false,closed:false,defaultStatus:false,document:false,event:false,
-focus:false,frames:false,getComputedStyle:false,history:false,Image:false,length:false,location:false,moveBy:false,moveTo:false,name:false,navigator:false,onbeforeunload:true,onblur:true,onerror:true,onfocus:true,onload:true,onresize:true,onunload:true,open:false,opener:false,Option:false,parent:false,print:false,removeEventListener:false,resizeBy:false,resizeTo:false,screen:false,scroll:false,scrollBy:false,scrollTo:false,setInterval:false,setTimeout:false,status:false,top:false,XMLHttpRequest:false},
-Oa,db,Gb={aliceblue:true,antiquewhite:true,aqua:true,aquamarine:true,azure:true,beige:true,bisque:true,black:true,blanchedalmond:true,blue:true,blueviolet:true,brown:true,burlywood:true,cadetblue:true,chartreuse:true,chocolate:true,coral:true,cornflowerblue:true,cornsilk:true,crimson:true,cyan:true,darkblue:true,darkcyan:true,darkgoldenrod:true,darkgray:true,darkgreen:true,darkkhaki:true,darkmagenta:true,darkolivegreen:true,darkorange:true,darkorchid:true,darkred:true,darksalmon:true,darkseagreen:true,
-darkslateblue:true,darkslategray:true,darkturquoise:true,darkviolet:true,deeppink:true,deepskyblue:true,dimgray:true,dodgerblue:true,firebrick:true,floralwhite:true,forestgreen:true,fuchsia:true,gainsboro:true,ghostwhite:true,gold:true,goldenrod:true,gray:true,green:true,greenyellow:true,honeydew:true,hotpink:true,indianred:true,indigo:true,ivory:true,khaki:true,lavender:true,lavenderblush:true,lawngreen:true,lemonchiffon:true,lightblue:true,lightcoral:true,lightcyan:true,lightgoldenrodyellow:true,
-lightgreen:true,lightpink:true,lightsalmon:true,lightseagreen:true,lightskyblue:true,lightslategray:true,lightsteelblue:true,lightyellow:true,lime:true,limegreen:true,linen:true,magenta:true,maroon:true,mediumaquamarine:true,mediumblue:true,mediumorchid:true,mediumpurple:true,mediumseagreen:true,mediumslateblue:true,mediumspringgreen:true,mediumturquoise:true,mediumvioletred:true,midnightblue:true,mintcream:true,mistyrose:true,moccasin:true,navajowhite:true,navy:true,oldlace:true,olive:true,olivedrab:true,
-orange:true,orangered:true,orchid:true,palegoldenrod:true,palegreen:true,paleturquoise:true,palevioletred:true,papayawhip:true,peachpuff:true,peru:true,pink:true,plum:true,powderblue:true,purple:true,red:true,rosybrown:true,royalblue:true,saddlebrown:true,salmon:true,sandybrown:true,seagreen:true,seashell:true,sienna:true,silver:true,skyblue:true,slateblue:true,slategray:true,snow:true,springgreen:true,steelblue:true,tan:true,teal:true,thistle:true,tomato:true,turquoise:true,violet:true,wheat:true,
-white:true,whitesmoke:true,yellow:true,yellowgreen:true},na,ib,sb={"%":true,cm:true,em:true,ex:true,"in":true,mm:true,pc:true,pt:true,px:true},Qa,Bb={alert:false,confirm:false,console:false,Debug:false,opera:false,prompt:false},Jb={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"/":"\\/","\\":"\\\\"},x,Ha=["closure","exception","global","label","outer","unused","var"],Fa,ob,fb={a:{},abbr:{},acronym:{},address:{},applet:{},area:{empty:true,parent:" map "},article:{},aside:{},
-audio:{},b:{},base:{empty:true,parent:" head "},bdo:{},big:{},blockquote:{},body:{parent:" html noframes "},br:{empty:true},button:{},canvas:{parent:" body p div th td "},caption:{parent:" table "},center:{},cite:{},code:{},col:{empty:true,parent:" table colgroup "},colgroup:{parent:" table "},command:{parent:" menu "},datalist:{},dd:{parent:" dl "},del:{},details:{},dialog:{},dfn:{},dir:{},div:{},dl:{},dt:{parent:" dl "},em:{},embed:{},fieldset:{},figure:{},font:{},footer:{},form:{},frame:{empty:true,
-parent:" frameset "},frameset:{parent:" html frameset "},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},head:{parent:" html "},header:{},hgroup:{},html:{parent:"*"},hr:{empty:true},i:{},iframe:{},img:{empty:true},input:{empty:true},ins:{},kbd:{},keygen:{},label:{},legend:{parent:" details fieldset figure "},li:{parent:" dir menu ol ul "},link:{empty:true,parent:" head "},map:{},mark:{},menu:{},meta:{empty:true,parent:" head noframes noscript "},meter:{},nav:{},noframes:{parent:" html body "},noscript:{parent:" body head noframes "},
-object:{},ol:{},optgroup:{parent:" select "},option:{parent:" optgroup select "},output:{},p:{},param:{empty:true,parent:" applet object "},pre:{},progress:{},q:{},rp:{},rt:{},ruby:{},samp:{},script:{empty:true,parent:" body div frame head iframe p pre span "},section:{},select:{},small:{},span:{},source:{},strong:{},style:{parent:" head ",empty:true},sub:{},sup:{},table:{},tbody:{parent:" table "},td:{parent:" tr "},textarea:{},tfoot:{parent:" table "},th:{parent:" tr "},thead:{parent:" table "},
-time:{},title:{parent:" head "},tr:{parent:" table tbody thead tfoot "},tt:{},u:{},ul:{},"var":{},video:{}},Ra,pa,Ca,Z,xa,za,Ka,ra,qa,a,Xa,m,X,jb,ba,Ab={defineClass:false,deserialize:false,gc:false,help:false,load:false,loadClass:false,print:false,quit:false,readFile:false,readUrl:false,runCommand:false,seal:false,serialize:false,spawn:false,sync:false,toint32:false,version:false},Y,Db={System:false},Sa,aa,Kb={Array:false,Boolean:false,Date:false,decodeURI:false,decodeURIComponent:false,encodeURI:false,
-encodeURIComponent:false,Error:false,eval:false,EvalError:false,Function:false,hasOwnProperty:false,isFinite:false,isNaN:false,JSON:false,Math:false,Number:false,Object:false,parseInt:false,parseFloat:false,RangeError:false,ReferenceError:false,RegExp:false,String:false,SyntaxError:false,TypeError:false,URIError:false},Lb={E:true,LN2:true,LN10:true,LOG2E:true,LOG10E:true,PI:true,SQRT1_2:true,SQRT2:true,MAX_VALUE:true,MIN_VALUE:true,NEGATIVE_INFINITY:true,POSITIVE_INFINITY:true},Va,ea={},kb,i,Ea,Ta,
-Eb={alert:true,animator:true,appleScript:true,beep:true,bytesToUIString:true,Canvas:true,chooseColor:true,chooseFile:true,chooseFolder:true,closeWidget:true,COM:true,convertPathToHFS:true,convertPathToPlatform:true,CustomAnimation:true,escape:true,FadeAnimation:true,filesystem:true,Flash:true,focusWidget:true,form:true,FormField:true,Frame:true,HotKey:true,Image:true,include:true,isApplicationRunning:true,iTunes:true,konfabulatorVersion:true,log:true,md5:true,MenuItem:true,MoveAnimation:true,openURL:true,
-play:true,Point:true,popupMenu:true,preferenceGroups:true,preferences:true,print:true,prompt:true,random:true,Rectangle:true,reloadWidget:true,ResizeAnimation:true,resolvePath:true,resumeUpdates:true,RotateAnimation:true,runCommand:true,runCommandInBg:true,saveAs:true,savePreferences:true,screen:true,ScrollBar:true,showWidgetPreferences:true,sleep:true,speak:true,Style:true,suppressUpdates:true,system:true,tellWidget:true,Text:true,TextArea:true,Timer:true,unescape:true,updateNow:true,URL:true,Web:true,
-widget:true,Window:true,XMLDOM:true,XMLHttpRequest:true,yahooCheckLogin:true,yahooLogin:true,yahooLogout:true},F,fa,lb=/@cc|<\/?|script|\]*s\]|<\s*!|&lt/i,Mb=/[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Nb=/^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jslint|members?|global)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/;
-na=/^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--)/;var Ob=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,Pb=/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,Qb=/[>&]|<[\/!]?|--/,Rb=/\*\/|\/\*/,mb=/^([a-zA-Z_$][a-zA-Z0-9_$]*)$/,Za=/^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i,tb=/&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i,
-Sb=/[^a-zA-Z0-9+\-_\/ ]/,Tb=/[\[\]\/\\"'*<>.&:(){}+=#]/,Ub={outer:na,html:na,style:/^\s*([{:#%.=,>+\[\]@()"';]|\*=?|\$=|\|=|\^=|~=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/,styleproperty:/^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/};if(typeof Object.create!=="function")Object.create=function(b){p.prototype=b;return new p};String.prototype.entityify=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};String.prototype.isAlpha=
-function(){return this>="a"&&this<="z\uffff"||this>="A"&&this<="Z\uffff"};String.prototype.isDigit=function(){return this>="0"&&this<="9"};String.prototype.supplant=function(b){return this.replace(/\{([^{}]*)\}/g,function(d,c){var h=b[c];return typeof h==="string"||typeof h==="number"?h:d})};String.prototype.name=function(){if(mb.test(this))return this;if(Ob.test(this))return'"'+this.replace(Pb,function(b){var d=Jb[b];if(d)return d;return"\\u"+("0000"+b.charCodeAt().toString(16)).slice(-4)})+'"';
-return'"'+this+'"'};var ka=function(){function b(){var v;if(k>=za.length)return false;c=1;l=za[k];k+=1;v=l.search(/ \t/);v>=0&&j("Mixed spaces and tabs.",k,v+1);l=l.replace(/\t/g,kb);v=l.search(Mb);v>=0&&j("Unsafe character.",k,v);m.maxlen&&m.maxlen<l.length&&j("Line too long.",k,l.length);return true}function d(v,M){var A,o;o=v==="(color)"?{type:v}:v==="(punctuator)"||v==="(identifier)"&&q(ea,M)?ea[M]||ea["(error)"]:ea[v];o=Object.create(o);if(v==="(string)"||v==="(range)")Za.test(M);if(v==="(identifier)"){o.identifier=
-true;if(M==="__iterator__"||M==="__proto__")n("Reserved name '{a}'.",k,h,M);else if(m.nomen&&(M.charAt(0)==="_"||M.charAt(M.length-1)==="_"))j("Unexpected {a} in '{b}'.",k,h,"dangling '_'",M)}o.value=M;o.line=k;o.character=c;o.from=h;A=o.id;if(A!=="(endline)")jb=A&&("(,=:[!&|?{};".indexOf(A.charAt(A.length-1))>=0||A==="return");return o}var c,h,k,l;return{init:function(v){za=typeof v==="string"?v.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split("\n"):v;k=0;b();h=1},range:function(v,M){var A,o="";h=
-c;for(l.charAt(0)!==v&&n("Expected '{a}' and instead saw '{b}'.",k,c,v,l.charAt(0));;){l=l.slice(1);c+=1;A=l.charAt(0);switch(A){case "":n("Missing '{a}'.",k,c,A);break;case M:l=l.slice(1);c+=1;return d("(range)",o);case fa:case "\\":j("Unexpected '{a}'.",k,c,A)}o+=A}},token:function(){function v(U){if(U=U.exec(l)){s=U[0].length;U=U[1];o=U.charAt(0);l=l.substr(s);h=c+s-U.length;c+=s;return U}}function M(U){function Ia(nb){var ya=parseInt(l.substr($+1,nb),16);$+=nb;ya>=32&&ya<=126&&ya!==34&&ya!==92&&
-ya!==39&&j("Unnecessary escapement.",k,c);c+=nb;W=String.fromCharCode(ya)}var W,$,zb="";xa&&U!=='"'&&j("Strings must use doublequote.",k,c);if(fa===U||F==="scriptstring"&&!fa)return d("(punctuator)",U);for($=0;;){for(;$>=l.length;){$=0;if(F!=="html"||!b())n("Unclosed string.",k,h)}W=l.charAt($);if(W===U){c+=1;l=l.substr($+1);return d("(string)",zb,U)}if(W<" "){if(W==="\n"||W==="\r")break;j("Control character in string: {a}.",k,c+$,l.slice(0,$))}else if(W===fa)j("Bad HTML string",k,c+$);else if(W===
-"<")if(m.safe&&F==="html")j("ADsafe string violation.",k,c+$);else if(l.charAt($+1)==="/"&&(F||m.safe))j("Expected '<\\/' and instead saw '</'.",k,c);else{if(l.charAt($+1)==="!"&&(F||m.safe))j("Unexpected '<!' in a string.",k,c)}else if(W==="\\")if(F==="html")m.safe&&j("ADsafe string violation.",k,c+$);else if(F==="styleproperty"){$+=1;c+=1;W=l.charAt($);W!==U&&j("Escapement in style string.",k,c+$)}else{$+=1;c+=1;W=l.charAt($);switch(W){case fa:j("Bad HTML string",k,c+$);break;case "\\":case "'":case '"':case "/":break;
-case "b":W="\u0008";break;case "f":W="\u000c";break;case "n":W="\n";break;case "r":W="\r";break;case "t":W="\t";break;case "u":Ia(4);break;case "v":W="\u000b";break;case "x":xa&&j("Avoid \\x-.",k,c);Ia(2);break;default:j("Bad escapement.",k,c)}}zb+=W;c+=1;$+=1}}for(var A,o,J,Q,s,K;;){if(!l)return d(b()?"(endline)":"(end)","");for(;F==="outer";){Q=l.search(Qb);if(Q===0)break;else if(Q>0){c+=1;l=l.slice(Q);break}else if(!b())return d("(end)","")}if(J=v(Ub[F]||Nb)){if(o.isAlpha()||o==="_"||o==="$")return d("(identifier)",
-J);if(o.isDigit()){F!=="style"&&!isFinite(Number(J))&&j("Bad number '{a}'.",k,c,J);F!=="style"&&F!=="styleproperty"&&l.substr(0,1).isAlpha()&&j("Missing space after '{a}'.",k,c,J);if(o==="0"){Q=J.substr(1,1);if(!Q.isDigit())if(xa&&(Q==="x"||Q==="X"))j("Avoid 0x-. '{a}'.",k,c,J)}J.substr(J.length-1)==="."&&j("A trailing decimal point can be confused with a dot '{a}'.",k,c,J);return d("(number)",J)}switch(J){case '"':case "'":return M(J);case "//":if(Sa||F&&F!=="script")j("Unexpected comment.",k,c);
-else if(F==="script"&&/<\s*\//i.test(l))j("Unexpected </ in comment.",k,c);else if((m.safe||F==="script")&&lb.test(l))j("Dangerous comment.",k,c);l="";i.comment=true;break;case "/*":if(Sa||F&&F!=="script"&&F!=="style"&&F!=="styleproperty")j("Unexpected comment.",k,c);for(m.safe&&lb.test(l)&&j("ADsafe comment violation.",k,c);;){Q=l.search(Rb);if(Q>=0)break;if(b())m.safe&&lb.test(l)&&j("ADsafe comment violation.",k,c);else n("Unclosed comment.",k,c)}c+=Q+2;l.substr(Q,1)==="/"&&n("Nested comment.",
-k,c);l=l.substr(Q+2);i.comment=true;break;case "/*members":case "/*member":case "/*jslint":case "/*global":case "*/":return{value:J,type:"special",line:k,character:c,from:h};case "":break;case "/":i.id==="/="&&n("A regular expression literal can be confused with '/='.",k,h);if(jb){for(s=J=Q=0;;){A=true;o=l.charAt(s);s+=1;switch(o){case "":n("Unclosed regular expression.",k,h);return;case "/":Q>0&&j("Unescaped '{a}'.",k,h+s,"/");o=l.substr(0,s-1);for(K={g:true,i:true,m:true};K[l.charAt(s)]===true;){K[l.charAt(s)]=
-false;s+=1}c+=s;l=l.substr(s);K=l.charAt(0);if(K==="/"||K==="*")n("Confusing regular expression.",k,h);return d("(regexp)",o);case "\\":o=l.charAt(s);if(o<" ")j("Unexpected control character in regular expression.",k,h+s);else o==="<"&&j("Unexpected escaped character '{a}' in regular expression.",k,h+s,o);s+=1;break;case "(":Q+=1;A=false;if(l.charAt(s)==="?"){s+=1;switch(l.charAt(s)){case ":":case "=":case "!":s+=1;break;default:j("Expected '{a}' and instead saw '{b}'.",k,h+s,":",l.charAt(s))}}else J+=
-1;break;case "|":A=false;break;case ")":if(Q===0)j("Unescaped '{a}'.",k,h+s,")");else Q-=1;break;case " ":for(K=1;l.charAt(s)===" ";){s+=1;K+=1}K>1&&j("Spaces are hard to count. Use {{a}}.",k,h+s,K);break;case "[":o=l.charAt(s);if(o==="^"){s+=1;m.regexp&&j("Insecure '{a}'.",k,h+s,o)}K=false;if(o==="]"){j("Empty class.",k,h+s-1);K=true}a:do{o=l.charAt(s);s+=1;switch(o){case "[":case "^":j("Unescaped '{a}'.",k,h+s,o);K=true;break;case "-":if(K)K=false;else{j("Unescaped '{a}'.",k,h+s,"-");K=true}break;
-case "]":K||j("Unescaped '{a}'.",k,h+s-1,"-");break a;case "\\":o=l.charAt(s);if(o<" ")j("Unexpected control character in regular expression.",k,h+s);else o==="<"&&j("Unexpected escaped character '{a}' in regular expression.",k,h+s,o);s+=1;K=true;break;case "/":j("Unescaped '{a}'.",k,h+s-1,"/");K=true;break;case "<":if(F==="script"){o=l.charAt(s);if(o==="!"||o==="/")j("HTML confusion in regular expression '<{a}'.",k,h+s,o)}K=true;break;default:K=true}}while(o);break;case ".":m.regexp&&j("Insecure '{a}'.",
-k,h+s,o);break;case "]":case "?":case "{":case "}":case "+":case "*":j("Unescaped '{a}'.",k,h+s,o);break;case "<":if(F==="script"){o=l.charAt(s);if(o==="!"||o==="/")j("HTML confusion in regular expression '<{a}'.",k,h+s,o)}}if(A)switch(l.charAt(s)){case "?":case "+":case "*":s+=1;if(l.charAt(s)==="?")s+=1;break;case "{":s+=1;o=l.charAt(s);if(o<"0"||o>"9")j("Expected a number and instead saw '{a}'.",k,h+s,o);s+=1;for(K=+o;;){o=l.charAt(s);if(o<"0"||o>"9")break;s+=1;K=+o+K*10}A=K;if(o===","){s+=1;A=
-Infinity;o=l.charAt(s);if(o>="0"&&o<="9"){s+=1;for(A=+o;;){o=l.charAt(s);if(o<"0"||o>"9")break;s+=1;A=+o+A*10}}}if(l.charAt(s)!=="}")j("Expected '{a}' and instead saw '{b}'.",k,h+s,"}",o);else s+=1;if(l.charAt(s)==="?")s+=1;K>A&&j("'{a}' should not be greater than '{b}'.",k,h+s,K,A)}}o=l.substr(0,s-1);c+=s;l=l.substr(s);return d("(regexp)",o)}return d("(punctuator)",J);case "<\!--":s=k;for(o=c;;){Q=l.indexOf("--");if(Q>=0)break;Q=l.indexOf("<!");Q>=0&&n("Nested HTML comment.",k,c+Q);b()||n("Unclosed HTML comment.",
-s,o)}s=l.indexOf("<!");s>=0&&s<Q&&n("Nested HTML comment.",k,c+s);c+=Q;l[Q+2]!==">"&&n("Expected --\>.",k,c);c+=3;l=l.slice(Q+3);break;case "#":if(F==="html"||F==="styleproperty"){for(;;){o=l.charAt(0);if((o<"0"||o>"9")&&(o<"a"||o>"f")&&(o<"A"||o>"F"))break;c+=1;l=l.substr(1);J+=o}J.length!==4&&J.length!==7&&j("Bad hex color '{a}'.",k,h+s,J);return d("(color)",J)}return d("(punctuator)",J);default:if(F==="outer"&&o==="&"){c+=1;for(l=l.substr(1);;){o=l.charAt(0);c+=1;l=l.substr(1);if(o===";")break;
-o>="0"&&o<="9"||o>="a"&&o<="z"||o==="#"||n("Bad entity",k,h+s,c)}break}return d("(punctuator)",J)}}else{for(o=J="";l&&l<"!";)l=l.substr(1);if(l)if(F==="html")return d("(error)",l.charAt(0));else n("Unexpected '{a}'.",k,c,l.substr(0,1))}}}}}();db=[sa,function(){for(;;)if(a.identifier)switch(a.value.toLowerCase()){case "url":sa();break;case "expression":e("Unexpected expression '{a}'.",a,a.value);f();break;default:f()}else{if(a.id===";"||a.id==="!"||a.id==="(end)"||a.id==="}")return true;f()}}];na=
-["none","hidden","dotted","dashed","solid","double","ridge","inset","outset"];ib=["auto","always","avoid","left","right"];Qa=["auto","hidden","scroll","visible"];Oa={background:[true,"background-attachment","background-color","background-image","background-position","background-repeat"],"background-attachment":["scroll","fixed"],"background-color":["transparent",ma],"background-image":["none",sa],"background-position":[2,[T,"top","bottom","left","right","center"]],"background-repeat":["repeat","repeat-x",
-"repeat-y","no-repeat"],border:[true,"border-color","border-style","border-width"],"border-bottom":[true,"border-bottom-color","border-bottom-style","border-bottom-width"],"border-bottom-color":ma,"border-bottom-style":na,"border-bottom-width":wa,"border-collapse":["collapse","separate"],"border-color":["transparent",4,ma],"border-left":[true,"border-left-color","border-left-style","border-left-width"],"border-left-color":ma,"border-left-style":na,"border-left-width":wa,"border-right":[true,"border-right-color",
-"border-right-style","border-right-width"],"border-right-color":ma,"border-right-style":na,"border-right-width":wa,"border-spacing":[2,T],"border-style":[4,na],"border-top":[true,"border-top-color","border-top-style","border-top-width"],"border-top-color":ma,"border-top-style":na,"border-top-width":wa,"border-width":[4,wa],bottom:[T,"auto"],"caption-side":["bottom","left","right","top"],clear:["both","left","none","right"],clip:[function(){var b;if(a.identifier&&a.value==="rect"){f();f("(");for(b=
-0;b<4;b+=1)if(!T()){e("Expected a number and instead saw '{a}'.",a,a.value);break}f(")");return true}return false},"auto"],color:ma,content:["open-quote","close-quote","no-open-quote","no-close-quote",bb,sa,function(){if(a.identifier&&a.value==="counter"){f();f("(");f();if(a.id===","){da();a.type!=="(string)"&&e("Expected a string and instead saw '{a}'.",a,a.value);f()}f(")");return true}if(a.identifier&&a.value==="counters"){f();f("(");a.identifier||e("Expected a name and instead saw '{a}'.",a,a.value);
-f();if(a.id===","){da();a.type!=="(string)"&&e("Expected a string and instead saw '{a}'.",a,a.value);f()}if(a.id===","){da();a.type!=="(string)"&&e("Expected a string and instead saw '{a}'.",a,a.value);f()}f(")");return true}return false},function(){if(a.identifier&&a.value==="attr"){f();f("(");a.identifier||e("Expected a name and instead saw '{a}'.",a,a.value);f();f(")");return true}return false}],"counter-increment":[ab,"none"],"counter-reset":[ab,"none"],cursor:[sa,"auto","crosshair","default",
-"e-resize","help","move","n-resize","ne-resize","nw-resize","pointer","s-resize","se-resize","sw-resize","w-resize","text","wait"],direction:["ltr","rtl"],display:["block","compact","inline","inline-block","inline-table","list-item","marker","none","run-in","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group"],"empty-cells":["show","hide"],"float":["left","none","right"],font:["caption","icon","menu","message-box",
-"small-caption","status-bar",true,"font-size","font-style","font-weight","font-family"],"font-family":function(){for(;a.id!==";";){!ab()&&!bb()&&e("Expected a name and instead saw '{a}'.",a,a.value);if(a.id!==",")return true;da()}},"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","larger","smaller",T],"font-size-adjust":["none",Na],"font-stretch":["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded",
-"extra-expanded"],"font-style":["normal","italic","oblique"],"font-variant":["normal","small-caps"],"font-weight":["normal","bold","bolder","lighter",Na],height:[T,"auto"],left:[T,"auto"],"letter-spacing":["normal",T],"line-height":["normal",function(){if(a.id==="-"){f("-");D()}if(a.type==="(number)"){f();if(a.type!=="(string)"&&sb[a.value]===true){D();f()}return true}return false}],"list-style":[true,"list-style-image","list-style-position","list-style-type"],"list-style-image":["none",sa],"list-style-position":["inside",
-"outside"],"list-style-type":["circle","disc","square","decimal","decimal-leading-zero","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","hebrew","katakana","hiragana-iroha","katakana-oroha","none"],margin:[4,Da],"margin-bottom":Da,"margin-left":Da,"margin-right":Da,"margin-top":Da,"marker-offset":[T,"auto"],"max-height":[T,"none"],"max-width":[T,"none"],"min-height":T,"min-width":T,opacity:Na,outline:[true,"outline-color","outline-style","outline-width"],
-"outline-color":["invert",ma],"outline-style":["dashed","dotted","double","groove","inset","none","outset","ridge","solid"],"outline-width":wa,overflow:Qa,"overflow-x":Qa,"overflow-y":Qa,padding:[4,T],"padding-bottom":T,"padding-left":T,"padding-right":T,"padding-top":T,"page-break-after":ib,"page-break-before":ib,position:["absolute","fixed","relative","static"],quotes:[8,bb],right:[T,"auto"],"table-layout":["auto","fixed"],"text-align":["center","justify","left","right"],"text-decoration":["none",
-"underline","overline","line-through","blink"],"text-indent":T,"text-shadow":["none",4,[ma,T]],"text-transform":["capitalize","uppercase","lowercase","none"],top:[T,"auto"],"unicode-bidi":["normal","embed","bidi-override"],"vertical-align":["baseline","bottom","sub","super","top","text-top","middle","text-bottom",T],visibility:["visible","hidden","collapse"],"white-space":["normal","nowrap","pre","pre-line","pre-wrap","inherit"],width:[T,"auto"],"word-spacing":["normal",T],"word-wrap":["break-word",
-"normal"],"z-index":["auto",Na]};R("(number)",rb);R("(string)",rb);ea["(identifier)"]={type:"(identifier)",lbp:0,identifier:true,nud:function(){var b=this.value,d=Y[b],c;if(typeof d==="function")d=undefined;else if(typeof d==="boolean"){c=x;x=Fa[0];u(b,"var");d=x;x=c}if(x===d)switch(x[b]){case "unused":x[b]="var";break;case "label":e("'{a}' is a statement label.",i,b)}else if(x["(global)"]){m.undef&&X[b]!=="boolean"&&e("'{a}' is not defined.",i,b);$a(i)}else switch(x[b]){case "closure":case "function":case "var":case "unused":e("'{a}' used out of scope.",
-i,b);break;case "label":e("'{a}' is a statement label.",i,b);break;case "outer":case "global":break;default:if(d===true)x[b]=true;else if(d===null){e("'{a}' is not allowed.",i,b);$a(i)}else if(typeof d!=="object"){if(m.undef)e("'{a}' is not defined.",i,b);else x[b]=true;$a(i)}else switch(d[b]){case "function":case "var":case "unused":d[b]="closure";x[b]=d["(global)"]?"global":"outer";break;case "closure":case "parameter":x[b]=d["(global)"]?"global":"outer";break;case "label":e("'{a}' is a statement label.",
-i,b)}}return this},led:function(){g("Expected an operator and instead saw '{a}'.",a,a.value)}};R("(regexp)",function(){return this});C("(endline)");C("(begin)");C("(end)").reach=true;C("</").reach=true;C("<!");C("<\!--");C("--\>");C("(error)").reach=true;C("}").reach=true;C(")");C("]");C('"').reach=true;C("'").reach=true;C(";");C(":").reach=true;C(",");C("#");C("@");I("else");I("case").reach=true;I("catch");I("default").reach=true;I("finally");S("arguments");S("eval");S("false");S("Infinity");S("NaN");
-S("null");S("this");S("true");ca("=","assign",20);ca("+=","assignadd",20);ca("-=","assignsub",20);ca("*=","assignmult",20);ca("/=","assigndiv",20).nud=function(){g("A regular expression literal can be confused with '/='.")};ca("%=","assignmod",20);ua("&=","assignbitand",20);ua("|=","assignbitor",20);ua("^=","assignbitxor",20);ua("<<=","assignshiftleft",20);ua(">>=","assignshiftright",20);ua(">>>=","assignshiftrightunsigned",20);P("?",function(b,d){d.left=b;d.right=y(10);f(":");d["else"]=y(10);return d},
-30);P("||","or",40);P("&&","and",50);ta("|","bitor",70);ta("^","bitxor",80);ta("&","bitand",90);V("==",function(b,d){if(m.eqeqeq)e("Expected '{a}' and instead saw '{b}'.",this,"===","==");else if(ia(b))e("Use '{a}' to compare with '{b}'.",this,"===",b.value);else ia(d)&&e("Use '{a}' to compare with '{b}'.",this,"===",d.value);return this});V("===");V("!=",function(b,d){if(m.eqeqeq)e("Expected '{a}' and instead saw '{b}'.",this,"!==","!=");else if(ia(b))e("Use '{a}' to compare with '{b}'.",this,"!==",
-b.value);else ia(d)&&e("Use '{a}' to compare with '{b}'.",this,"!==",d.value);return this});V("!==");V("<");V(">");V("<=");V(">=");ta("<<","shiftleft",120);ta(">>","shiftright",120);ta(">>>","shiftrightunsigned",120);P("in","in",120);P("instanceof","instanceof",120);P("+",function(b,d){var c=y(130);if(b&&c&&b.id==="(string)"&&c.id==="(string)"){b.value+=c.value;b.character=c.character;Za.test(b.value)&&e("JavaScript URL.",b);return b}d.left=b;d.right=c;return d},130);E("+","num");P("-","sub",130);
-E("-","neg");P("*","mult",140);P("/","div",140);P("%","mod",140);pb("++","postinc");E("++","preinc");ea["++"].exps=true;pb("--","postdec");E("--","predec");ea["--"].exps=true;E("delete",function(){var b=y(0);if(!b||b.id!=="."&&b.id!=="[")e("Expected '{a}' and instead saw '{b}'.",a,".",a.value);this.first=b;return this}).exps=true;E("~",function(){m.bitwise&&e("Unexpected '{a}'.",this,"~");y(150);return this});E("!",function(){this.right=y(150);this.arity="unary";Ib[this.right.id]===true&&e("Confusing use of '{a}'.",
-this,"!");return this});E("typeof","typeof");E("new",function(){var b=y(155),d;if(b&&b.id!=="function")if(b.identifier){b["new"]=true;switch(b.value){case "Object":e("Use the object literal notation {}.",i);break;case "Array":if(a.id!=="(")e("Use the array literal notation [].",i);else{f("(");if(a.id===")")e("Use the array literal notation [].",i);else{d=y(0);b.dimension=d;if(d.id==="(number)"&&/[.+\-Ee]/.test(d.value)||d.id==="-"&&!d.right||d.id==="(string)"||d.id==="["||d.id==="{"||d.id==="true"||
-d.id==="false"||d.id==="null"||d.id==="undefined"||d.id==="Infinity")e("Use the array literal notation [].",i);a.id!==")"&&g("Use the array literal notation [].",i)}f(")")}this.first=b;return this;case "Number":case "String":case "Boolean":case "Math":case "JSON":e("Do not use {a} as a constructor.",i,b.value);break;case "Function":m.evil||e("The Function constructor is eval.");break;case "Date":case "RegExp":break;default:if(b.id!=="function"){d=b.value.substr(0,1);if(m.newcap&&(d<"A"||d>"Z"))e("A constructor name should start with an uppercase letter.",
-i)}}}else b.id!=="."&&b.id!=="["&&b.id!=="("&&e("Bad constructor.",i);else e("Weird construction. Delete 'new'.",this);D(i,a);a.id!=="("&&e("Missing '()' invoking a constructor.");this.first=b;return this});ea["new"].exps=true;P(".",function(b,d){D(ba,i);var c=Aa();typeof c==="string"&&Ma(c);d.left=b;d.right=c;if(!m.evil&&b&&b.value==="document"&&(c==="write"||c==="writeln"))e("document.write can be a form of eval.",b);else if(m.adsafe)if(b&&b.value==="ADSAFE")if(c==="id"||c==="lib")e("ADsafe violation.",
-d);else if(c==="go"){if(F!=="script")e("ADsafe violation.",d);else if(Ga||a.id!=="("||L(0).id!=="(string)"||L(0).value!==ga||L(1).id!==",")g("ADsafe violation: go.",d);Ga=true;va=false}if(!m.evil&&(c==="eval"||c==="execScript"))e("eval is evil.");else if(m.safe)for(;;){yb[c]===true&&e("ADsafe restricted word '{a}'.",i,c);if(typeof X[b.value]!=="boolean"||a.id==="(")break;if(Lb[c]===true){a.id==="."&&e("ADsafe violation.",d);break}if(a.id!=="."){e("ADsafe violation.",d);break}f(".");i.left=d;i.right=
-c;d=i;c=Aa();typeof c==="string"&&Ma(c)}return d},160,true);P("(",function(b,d){D(ba,i);N();var c=0,h=[];if(b)if(b.type==="(identifier)"){if(b.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/))if(b.value!=="Number"&&b.value!=="String"&&b.value!=="Boolean"&&b.value!=="Date")if(b.value==="Math")e("Math is not a function.",b);else m.newcap&&e("Missing 'new' prefix when invoking a constructor.",b)}else b.id==="."&&m.safe&&b.left.value==="Math"&&b.right==="random"&&e("ADsafe violation.",b);if(a.id!==
-")")for(;;){h[h.length]=y(10);c+=1;if(a.id!==",")break;da()}f(")");m.immed&&b.id==="function"&&a.id!==")"&&e("Wrap the entire immediate function invocation in parens.",d);N(ba,i);if(typeof b==="object"){b.value==="parseInt"&&c===1&&e("Missing radix parameter.",b);if(!m.evil)if(b.value==="eval"||b.value==="Function"||b.value==="execScript")e("eval is evil.",b);else if(h[0]&&h[0].id==="(string)"&&(b.value==="setTimeout"||b.value==="setInterval"))e("Implied eval is evil. Pass a function instead of a string.",
-b);!b.identifier&&b.id!=="."&&b.id!=="["&&b.id!=="("&&b.id!=="&&"&&b.id!=="||"&&b.id!=="?"&&e("Bad invocation.",b)}d.left=b;return d},155,true).exps=true;E("(",function(){N();var b=y(0);f(")",this);N(ba,i);if(m.immed&&b.id==="function")a.id==="("?e("Move the invocation into the parens that contain the function.",a):e("Do not wrap function literals in parens unless they are to be immediately invoked.",this);return b});P("[",function(b,d){N();var c=y(0),h;if(c&&c.type==="(string)"){if(m.safe&&yb[c.value]===
-true)e("ADsafe restricted word '{a}'.",d,c.value);else if(!m.evil&&(c.value==="eval"||c.value==="execScript"))e("eval is evil.",d);else if(m.safe&&(c.value.charAt(0)==="_"||c.value.charAt(0)==="-"))e("ADsafe restricted subscript '{a}'.",d,c.value);Ma(c.value);if(!m.sub&&mb.test(c.value)){h=ea[c.value];if(!h||!h.reserved)e("['{a}'] is better written in dot notation.",c,c.value)}}else if(!c||c.type!=="(number)"||c.value<0)m.safe&&e("ADsafe subscripting.");f("]",d);N(ba,i);d.left=b;d.right=c;return d},
-160,true);E("[",function(){var b=i.line!==a.line;this.first=[];if(b){Z+=m.indent;if(a.from===Z+m.indent)Z+=m.indent}for(;a.id!=="(end)";){for(;a.id===",";){e("Extra comma.");f(",")}if(a.id==="]")break;b&&i.line!==a.line&&ha();this.first.push(y(10));if(a.id===","){da();if(a.id==="]"){e("Extra comma.",i);break}}else break}if(b){Z-=m.indent;ha()}f("]",this);return this},160);(function(b){b.nud=function(){var d,c,h={};if(d=i.line!==a.line){Z+=m.indent;if(a.from===Z+m.indent)Z+=m.indent}for(;;){if(a.id===
-"}")break;d&&ha();c=Wa(true);if(!c)if(a.id==="(string)"){c=a.value;mb.test(c);f()}else if(a.id==="(number)"){c=a.value.toString();f()}else g("Expected '{a}' and instead saw '{b}'.",a,"}",a.value);h[c]===true&&e("Duplicate member '{a}'.",a,c);h[c]=true;Ma(c);f(":");O(i,a);y(10);if(a.id===","){da();if(a.id===","||a.id==="}")e("Extra comma.",i)}else break}if(d){Z-=m.indent;ha()}f("}",this);return this};b.fud=function(){g("Expected to see a statement and instead saw a block.",i)}})(C("{"));G("var",gb).exps=
-true;w("function",function(){Ca&&e("Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.",i);var b=Aa();D(i,a);u(b,"unused");wb(b);a.id==="("&&a.line===i.line&&g("Function statements are not invocable. Wrap the whole function invocation in parens.");return this});E("function",function(){var b=Wa();b?D(i,a):O(i,a);wb(b);x["(loopage)"]&&e("Don't make functions within a loop.");return this});w("if",function(){var b=a;f("(");
-O(this,b);N();y(20);if(a.id==="="){f("=");y(20)}f(")",b);N(ba,i);la(true);if(a.id==="else"){O(i,a);f("else");a.id==="if"||a.id==="switch"?Ya(true):la(true)}return this});w("try",function(){var b,d;m.adsafe&&e("ADsafe try violation.",this);la(false);if(a.id==="catch"){f("catch");O(i,a);f("(");d=Y;Y=Object.create(d);b=a.value;a.type!=="(identifier)"?e("Expected an identifier and instead saw '{a}'.",a,b):u(b,"exception");f();f(")");la(false);b=true;Y=d}if(a.id==="finally"){f("finally");la(false)}else{b||
-g("Expected '{a}' and instead saw '{b}'.",a,"catch",a.value);return this}});w("while",function(){var b=a;x["(breakage)"]+=1;x["(loopage)"]+=1;f("(");O(this,b);N();y(20);if(a.id==="="){f("=");y(20)}f(")",b);N(ba,i);la(true);x["(breakage)"]-=1;x["(loopage)"]-=1;return this}).labelled=true;I("with");w("switch",function(){var b=a,d=false;x["(breakage)"]+=1;f("(");O(this,b);N();this.condition=y(20);f(")",b);N(ba,i);O(i,a);b=a;f("{");O(i,a);Z+=m.indent;for(this.cases=[];;)switch(a.id){case "case":switch(x["(verb)"]){case "break":case "case":case "continue":case "return":case "switch":case "throw":break;
-default:e("Expected a 'break' statement before 'case'.",i)}ha(-m.indent);f("case");this.cases.push(y(20));d=true;f(":");x["(verb)"]="case";break;case "default":switch(x["(verb)"]){case "break":case "continue":case "return":case "throw":break;default:e("Expected a 'break' statement before 'default'.",i)}ha(-m.indent);f("default");d=true;f(":");break;case "}":Z-=m.indent;ha();f("}",b);if(this.cases.length===1||this.condition.id==="true"||this.condition.id==="false")e("This 'switch' should be an 'if'.",
-this);x["(breakage)"]-=1;x["(verb)"]=undefined;return;case "(end)":g("Missing '{a}'.",a,"}");return;default:if(d)switch(i.id){case ",":g("Each value should have its own case label.");return;case ":":Ba();break;default:g("Missing ':' on a case clause.",i)}else g("Expected '{a}' and instead saw '{b}'.",a,"case",a.value)}}).labelled=true;G("debugger",function(){m.debug||e("All 'debugger' statements should be removed.");return this}).exps=true;(function(){var b=G("do",function(){x["(breakage)"]+=1;x["(loopage)"]+=
-1;this.first=la(true);f("while");var d=a;O(i,d);f("(");N();y(20);if(a.id==="="){f("=");y(20)}f(")",d);N(ba,i);x["(breakage)"]-=1;x["(loopage)"]-=1;return this});b.labelled=true;b.exps=true})();w("for",function(){var b=a;x["(breakage)"]+=1;x["(loopage)"]+=1;f("(");O(this,b);N();if(L(a.id==="var"?1:0).id==="in"){if(a.id==="var"){f("var");gb(true)}else{switch(x[a.value]){case "unused":x[a.value]="var";break;case "var":break;default:e("Bad for in variable '{a}'.",a,a.value)}f()}f("in");y(20);f(")",b)}else{if(a.id!==
-";")if(a.id==="var"){f("var");gb()}else for(;;){y(0,"for");if(a.id!==",")break;da()}ja(i);f(";");if(a.id!==";"){y(20);if(a.id==="="){f("=");y(20)}}ja(i);f(";");a.id===";"&&g("Expected '{a}' and instead saw '{b}'.",a,")",";");if(a.id!==")")for(;;){y(0,"for");if(a.id!==",")break;da()}f(")",b);N(ba,i)}la(true);x["(breakage)"]-=1;x["(loopage)"]-=1;return this}).labelled=true;G("break",function(){var b=a.value;x["(breakage)"]===0&&e("Unexpected '{a}'.",a,this.value);ja(this);if(a.id!==";")if(i.line===
-a.line){if(x[b]!=="label")e("'{a}' is not a statement label.",a,b);else Y[b]!==x&&e("'{a}' is out of scope.",a,b);this.first=a;f()}La("break");return this}).exps=true;G("continue",function(){var b=a.value;x["(breakage)"]===0&&e("Unexpected '{a}'.",a,this.value);ja(this);if(a.id!==";"){if(i.line===a.line){if(x[b]!=="label")e("'{a}' is not a statement label.",a,b);else Y[b]!==x&&e("'{a}' is out of scope.",a,b);this.first=a;f()}}else x["(loopage)"]||e("Unexpected '{a}'.",a,this.value);La("continue");
-return this}).exps=true;G("return",function(){ja(this);a.id==="(regexp)"&&e("Wrap the /regexp/ literal in parens to disambiguate the slash operator.");if(a.id!==";"&&!a.reach){O(i,a);this.first=y(20)}La("return");return this}).exps=true;G("throw",function(){ja(this);O(i,a);this.first=y(20);La("throw");return this}).exps=true;I("void");I("class");I("const");I("enum");I("export");I("extends");I("let");I("yield");I("implements");I("interface");I("package");I("private");I("protected");I("public");I("static");
-var oa=function(b,d){var c,h;JSLINT.errors=[];X=Object.create(Kb);if(d){c=d.predef;if(c instanceof Array)for(h=0;h<c.length;h+=1)X[c[h]]=true;if(d.adsafe)d.safe=true;if(d.safe){d.browser=false;d.css=false;d.debug=false;d.devel=false;d.eqeqeq=true;d.evil=false;d.forin=false;d.nomen=true;d.on=false;d.rhino=false;d.safe=true;d.sidebar=false;d.strict=true;d.sub=false;d.undef=true;d.widget=false;X.Date=null;X.eval=null;X.Function=null;X.Object=null;X.ADSAFE=false;X.lib=false}m=d}else m={};m.indent=m.indent||
-4;m.maxerr=m.maxerr||500;ga="";Ga=va=false;Pa={};if(m.approved)for(h=0;h<m.approved.length;h+=1)Pa[m.approved[h]]=m.approved[h];else Pa.test="test";kb="";for(h=0;h<m.indent;h+=1)kb+=" ";Z=1;Y=ob=Object.create(X);x={"(global)":true,"(name)":"(global)","(scope)":Y,"(breakage)":0,"(loopage)":0};Fa=[x];Ra={};Ea=[];F=Sa=false;aa=null;ra={};qa=null;pa={};Ca=false;Ka=[];xa=false;Ta=0;ka.init(b);jb=true;Va=false;ba=i=a=ea["(begin)"];z();try{f();if(a.value.charAt(0)==="<"){a:{var k,l,v,M,A,o,J,Q=m.white,s;
-F="html";fa="";for(aa=null;;){switch(a.value){case "<":F="html";f("<");l={};o=a;o.identifier||e("Bad identifier {a}.",o,o.value);M=o.value;if(m.cap)M=M.toLowerCase();o.name=M;f();if(!aa){aa=[];c=M;if(c!=="html"&&!m.fragment)c==="div"&&m.adsafe?g("ADSAFE: Use the fragment option."):g("Expected '{a}' and instead saw '{b}'.",i,"html",c);if(m.adsafe){c==="html"&&g("Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files.",i);if(m.fragment)c!=="div"&&g("ADsafe violation: Wrap the widget in a div.",
-i);else g("Use the fragment option.",i)}m.browser=true;z()}J=fb[M];typeof J!=="object"&&g("Unrecognized tag '<{a}>'.",o,M);v=J.empty;for(o.type=M;;){if(a.id==="/"){f("/");a.id!==">"&&e("Expected '{a}' and instead saw '{b}'.",a,">",a.value);break}if(a.id&&a.id.substr(0,1)===">")break;if(!a.identifier){if(a.id==="(end)"||a.id==="(error)")g("Missing '>'.",a);e("Bad identifier.")}m.white=true;O(i,a);k=a.value;m.white=Q;f();!m.cap&&k!==k.toLowerCase()&&e("Attribute '{a}' not all lower case.",a,k);k=k.toLowerCase();
-fa="";q(l,k)&&e("Attribute '{a}' repeated.",a,k);if(k.slice(0,2)==="on"){m.on||e("Avoid HTML event handlers.");F="scriptstring";f("=");A=a.id;A!=='"'&&A!=="'"&&g("Missing quote.");fa=A;s=m.white;m.white=false;f(A);Ba("on");m.white=s;a.id!==A&&g("Missing close quote on script attribute.");F="html";fa="";f(A);J=false}else if(k==="style"){F="scriptstring";f("=");A=a.id;A!=='"'&&A!=="'"&&g("Missing quote.");F="styleproperty";fa=A;f(A);ub();F="html";fa="";f(A);J=false}else if(a.id==="="){f("=");J=a.value;
-!a.identifier&&a.id!=='"'&&a.id!=="'"&&a.type!=="(string)"&&a.type!=="(number)"&&a.type!=="(color)"&&e("Expected an attribute value and instead saw '{a}'.",i,k);f()}else J=true;l[k]=J;c=k;h=J;var K=void 0,U=void 0;if(c==="id"){K=typeof h==="string"?h.toUpperCase():"";Ra[K]===true&&e("Duplicate id='{a}'.",a,h);if(/^[A-Za-z][A-Za-z0-9._:\-]*$/.test(h)){if(m.adsafe)if(ga)if(h.slice(0,ga.length)!==ga)e("ADsafe violation: An id must have a '{a}' prefix",a,ga);else/^[A-Z]+_[A-Z]+$/.test(h)||e("ADSAFE violation: bad id.");
-else{ga=h;/^[A-Z]+_$/.test(h)||e("ADSAFE violation: bad id.")}}else e("Bad id: '{a}'.",a,h);U=h.search(Tb);U>=0&&e("Unexpected character '{a}' in {b}.",i,h.charAt(U),c);Ra[K]=true}else if(c==="class"||c==="type"||c==="name"){U=h.search(Sb);U>=0&&e("Unexpected character '{a}' in {b}.",i,h.charAt(U),c);Ra[K]=true}else if(c==="href"||c==="background"||c==="content"||c==="data"||c.indexOf("src")>=0||c.indexOf("url")>=0){m.safe&&tb.test(h)&&g("ADsafe URL violation.");Ea.push(h)}else if(c==="for"){if(m.adsafe)if(ga)if(h.slice(0,
-ga.length)!==ga)e("ADsafe violation: An id must have a '{a}' prefix",a,ga);else/^[A-Z]+_[A-Z]+$/.test(h)||e("ADSAFE violation: bad id.");else e("ADSAFE violation: bad id.")}else c==="name"&&m.adsafe&&h.indexOf("_")>=0&&e("ADsafe name violation.")}c=M;h=l;K=void 0;var Ia=fb[c];U=void 0;Sa=false;Ia||g("Unrecognized tag '<{a}>'.",a,c===c.toLowerCase()?c:c+" (capitalization error)");if(aa.length>0){c==="html"&&g("Too many <html> tags.",i);if(U=Ia.parent)U.indexOf(" "+aa[aa.length-1].name+" ")<0&&g("A '<{a}>' must be within '<{b}>'.",
-i,c,U);else if(!m.adsafe&&!m.fragment){K=aa.length;do{K<=0&&g("A '<{a}>' must be within '<{b}>'.",i,c,"body");K-=1}while(aa[K].name!=="body")}}switch(c){case "div":m.adsafe&&aa.length===1&&!ga&&e("ADSAFE violation: missing ID_.");break;case "script":F="script";f(">");Z=a.from;h.lang&&e("lang is deprecated.",i);m.adsafe&&aa.length!==1&&e("ADsafe script placement violation.",i);if(h.src){if(m.adsafe&&(!va||!Pa[h.src]))e("ADsafe unapproved script source.",i);h.type&&e("type is unnecessary.",i)}else{Ga&&
-g("ADsafe script violation.",i);Ba("script")}F="html";f("</");!a.identifier&&a.value!=="script"&&e("Expected '{a}' and instead saw '{b}'.",a,"script",a.value);f();F="outer";break;case "style":F="style";f(">");vb();F="html";f("</");!a.identifier&&a.value!=="style"&&e("Expected '{a}' and instead saw '{b}'.",a,"style",a.value);f();F="outer";break;case "input":switch(h.type){case "radio":case "checkbox":case "button":case "reset":case "submit":break;case "text":case "file":case "password":case "file":case "hidden":case "image":m.adsafe&&
-h.autocomplete!=="off"&&e("ADsafe autocomplete violation.");break;default:e("Bad input type.")}break;case "applet":case "body":case "embed":case "frame":case "frameset":case "head":case "iframe":case "noembed":case "noframes":case "object":case "param":m.adsafe&&e("ADsafe violation: Disallowed tag: "+c)}v||aa.push(o);F="outer";f(">");break;case "</":F="html";f("</");a.identifier||e("Bad identifier.");M=a.value;if(m.cap)M=M.toLowerCase();f();aa||g("Unexpected '{a}'.",a,"</"+M+">");(o=aa.pop())||g("Unexpected '{a}'.",
-a,"</"+M+">");o.name!==M&&g("Expected '{a}' and instead saw '{b}'.",a,"</"+o.name+">","</"+M+">");a.id!==">"&&g("Missing '{a}'.",a,">");F="outer";f(">");break;case "<!":m.safe&&e("ADsafe HTML violation.");for(F="html";;){f();if(a.id===">"||a.id==="(end)")break;a.value.indexOf("--")>=0&&e("Unexpected --.");a.value.indexOf("<")>=0&&e("Unexpected <.");a.value.indexOf(">")>=0&&e("Unexpected >.")}F="outer";f(">");break;case "(end)":break a;default:a.id==="(end)"?g("Missing '{a}'.",a,"</"+aa[aa.length-
-1].value+">"):f()}if(aa&&aa.length===0&&(m.adsafe||!m.fragment||a.id==="(end)"))break}a.id!=="(end)"&&g("Unexpected material after the end.")}m.adsafe&&!Ga&&e("ADsafe violation: Missing ADSAFE.go.",this)}else switch(a.id){case "{":case "[":xa=m.laxbreak=true;hb();break;case "@":case "*":case "#":case ".":case ":":F="style";f();if(i.id!=="@"||!a.identifier||a.value!=="charset"||i.line!==1||i.from!==1)g('A css file should begin with @charset "UTF-8";');f();a.type!=="(string)"&&a.value!=="UTF-8"&&g('A css file should begin with @charset "UTF-8";');
-f();f(";");vb();break;default:m.adsafe&&m.fragment&&g("Expected '{a}' and instead saw '{b}'.",a,"<div>",a.value);Ba("lib")}f("(end)")}catch(W){if(W)JSLINT.errors.push({reason:W.message,line:W.line||a.line,character:W.character||a.from},null)}return JSLINT.errors.length===0};oa.data=function(){var b={functions:[]},d;d=[];var c,h,k,l,v=[];if(oa.errors.length)b.errors=oa.errors;if(xa)b.json=true;for(l in pa)q(pa,l)&&d.push({name:l,line:pa[l]});if(d.length>0)b.implieds=d;if(Ea.length>0)b.urls=Ea;d=xb(Y);
-if(d.length>0)b.globals=d;for(h=1;h<Fa.length;h+=1){c=Fa[h];d={};for(k=0;k<Ha.length;k+=1)d[Ha[k]]=[];for(l in c)if(q(c,l)&&l.charAt(0)!=="("){k=c[l];if(Object.prototype.toString.apply(d[k])==="[object Array]"){d[k].push(l);k==="unused"&&v.push({name:l,line:c["(line)"],"function":c["(name)"]})}}for(k=0;k<Ha.length;k+=1)d[Ha[k]].length===0&&delete d[Ha[k]];d.name=c["(name)"];d.param=c["(params)"];d.line=c["(line)"];d.last=c["(last)"];b.functions.push(d)}if(v.length>0)b.unused=v;for(l in ra)if(typeof ra[l]===
-"number"){b.member=ra;break}return b};oa.report=function(b){function d(o,J){var Q,s,K;if(J){A.push("<div><i>"+o+"</i> ");J=J.sort();for(s=0;s<J.length;s+=1)if(J[s]!==K){K=J[s];A.push((Q?", ":"")+K);Q=true}A.push("</div>")}}var c=oa.data(),h=[],k,l,v;k="";var M,A=[];if(c.errors||c.implieds||c.unused){l=true;A.push("<div id=errors><i>Error:</i>");if(c.errors)for(v=0;v<c.errors.length;v+=1)if(h=c.errors[v]){k=h.evidence||"";A.push("<p>Problem"+(isFinite(h.line)?" at line "+h.line+" character "+h.character:
-"")+": "+h.reason.entityify()+"</p><p class=evidence>"+(k&&(k.length>80?k.slice(0,77)+"...":k).entityify())+"</p>")}if(c.implieds){h=[];for(v=0;v<c.implieds.length;v+=1)h[v]="<code>"+c.implieds[v].name+"</code>&nbsp;<i>"+c.implieds[v].line+"</i>";A.push("<p><i>Implied global:</i> "+h.join(", ")+"</p>")}if(c.unused){h=[];for(v=0;v<c.unused.length;v+=1)h[v]="<code><u>"+c.unused[v].name+"</u></code>&nbsp;<i>"+c.unused[v].line+"</i> <code>"+c.unused[v]["function"]+"</code>";A.push("<p><i>Unused variable:</i> "+
-h.join(", ")+"</p>")}c.json&&A.push("<p>JSON: bad.</p>");A.push("</div>")}if(!b){A.push("<br><div id=functions>");c.urls&&d("URLs<br>",c.urls,"<br>");if(F==="style")A.push("<p>CSS.</p>");else if(c.json&&!l)A.push("<p>JSON: good.</p>");else c.globals?A.push("<div><i>Global</i> "+c.globals.sort().join(", ")+"</div>"):A.push("<div><i>No new global variables introduced.</i></div>");for(v=0;v<c.functions.length;v+=1){b=c.functions[v];A.push("<br><div class=function><i>"+b.line+"-"+b.last+"</i> "+(b.name||
-"")+"("+(b.param?b.param.join(", "):"")+")</div>");d("<big><b>Unused</b></big>",b.unused);d("Closure",b.closure);d("Variable",b["var"]);d("Exception",b.exception);d("Outer",b.outer);d("Global",b.global);d("Label",b.label)}if(c.member){h=xb(c.member);if(h.length){h=h.sort();k="<br><pre id=members>/*members ";l=10;for(v=0;v<h.length;v+=1){b=h[v];M=b.name();if(l+M.length>72){A.push(k+"<br>");k="\t";l=1}l+=M.length+2;if(c.member[b]===1)M="<i>"+M+"</i>";if(v<h.length-1)M+=", ";k+=M}A.push(k+"<br>*/</pre>")}A.push("</div>")}}return A.join("")};
-oa.jslint=oa;oa.edition="2010-03-12";return oa}();Nodelint.Linters.jslint=JSLINT;(function(p){var q={name:"jsonlint",display:"JSONLint",path:__dirname+"/jsonlint.js",build:__filename,match:rjson=/\.json$/i};p.Linters.add(q,function(t,z,r,e){result=t(r,e);return result.error?[result]:[]})})(Nodelint);
-(function(){function p(g,n){if(!(this instanceof p))return new p(g,n);this.json=g||"";this.options=n||{};this.lower=this.json.toLowerCase();if(!this.options.hasOwnProperty("comments"))this.options.comments=true;this.c="";this.i=-1;this.length=this.json.length;this.line=1;this.character=0;this.endblock="";this.commabreak=false;try{this.render()}catch(u){if(typeof u!="string")throw u;this.error=u;this.setEvidence()}}var q=/[0-9]/,t=/(\r\n|\r|\n)/,z=/\r\n|\r|\n/,r=/(\s|\t)/,e=/\\("|\\|\/|b|f|n|r|t|u[0-9]{4})/,
-j=/^(\-|\+)?[0-9]/;p.prototype={render:function(){for(var g="",n=false;++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.options.comments&&this.c=="/"){g=this.json[this.i+1];if(g=="*")this.multicomment();else if(g=="/")this.comment();else throw"Unknown character '/', maybe a comment?";}else if(t.exec(this.c)){this.line++;this.character=0}else if(!r.exec(this.c))if(n)throw"Unknown character '"+this.c+"', expecting end of file.";else if(this.c=="["){n=true;this.array()}else if(this.c==
-"{"){n=true;this.object()}else throw"Unknown character '"+this.c+"', expecting opening block '{' or '[', or maybe a comment";}if(!n)throw"Invalid JSON, no content.";},multicomment:function(){for(;++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.c=="*"&&this.json[this.i+1]=="/"){this.i++;this.character++;break}else if(t.exec(this.c)){this.line++;this.character=0}}},comment:function(){for(;++this.i<this.length;){this.c=this.json[this.i];this.character++;if(t.exec(this.c)){this.line++;
-this.character=0;break}}},array:function(){var g=this.endblock,n=this.commabreak,u=false;this.endblock="]";for(this.commabreak=false;(u=this.value())!==true&&this.i<this.length;);if(!u)throw"EOF Error. Expecting closing ']'";this.endblock=g;this.commabreak=n},object:function(){var g=this.endblock,n=this.commabreak,u=false,L="",f=true;this.endblock="}";for(this.commabreak=false;++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.options.comments&&this.c=="/"){L=this.json[this.i+
-1];if(L=="*")this.multicomment();else if(L=="/")this.comment();else throw"Unknown character '/', maybe a comment?";}else if(t.exec(this.c)){this.line++;this.character=0}else if(!r.exec(this.c))if(this.c=='"'){f=false;if(this.key()===true){this.endblock=g;this.commabreak=n;u=true;break}}else if(f&&this.c=="}"){this.endblock=g;this.commabreak=n;u=true;break}else throw"Unknown Character '"+this.c+"', expecting a string for key statement.";}if(!u)throw"EOF Error, expecting closing '}'.";},key:function(){this.string();
-for(var g="";++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.options.comments&&this.c=="/"){g=this.json[this.i+1];if(g=="*")this.multicomment();else if(g=="/")this.comment();else throw"Unknown character '/', maybe a comment?";}else if(t.exec(this.c)){this.line++;this.character=0}else if(!r.exec(this.c))if(this.c==":")return this.value();else throw"Unknown Character '"+this.c+"', expecting a semicolon.";}},value:function(){for(var g="";++this.i<this.length;){this.c=this.json[this.i];
-this.character++;if(this.options.comments&&this.c=="/"){g=this.json[this.i+1];if(g=="*")this.multicomment();else if(g=="/")this.comment();else throw"Unknown character '/', maybe a comment?";}else if(t.exec(this.c)){this.line++;this.character=0}else if(!r.exec(this.c))if(this.c=="{"){this.object();return this.endval()}else if(this.c=="["){this.array();return this.endval()}else if(this.c=='"'){this.string();return this.endval()}else if(this.json.indexOf("true",this.i)===this.i){this.i+=3;this.character+=
-3;return this.endval()}else if(this.json.indexOf("false",this.i)===this.i){this.i+=4;this.character+=4;return this.endval()}else if(this.json.indexOf("null",this.i)===this.i){this.i+=3;this.character+=3;return this.endval()}else if(this.c=="-"||q.exec(this.c))return this.numeric();else if(this.c=="]"&&this.endblock=="]"){if(this.commabreak)throw"Unexpected End Of Array Error. Expecting a value statement.";return true}else throw"Unknown Character '"+this.c+"', expecting a value.";}},string:function(){for(var g=
-false,n;++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.c=="\\")if((n=e.exec(this.json.substr(this.i)))&&n.index===0){this.i+=n[1].length;this.character+=n[1].length}else throw"Invalid Reverse Solidus '\\' declaration.";else if(t.exec(this.c)){this.line++;this.character=0}else if(this.c=='"'){g=true;break}}if(!g)throw"EOF: No close string '\"' found.";},numeric:function(){var g=true,n=null,u=null;this.i--;for(this.character--;++this.i<this.length;){this.c=this.json[this.i];
-this.character++;if(g){g=false;if(this.c=="-"){if(!q.exec(this.json[this.i+1]))throw"Unknown Character '"+this.c+"' following a negative, expecting a numeric value.";continue}}if(n&&this.c=="."){n=false;u=true}else if(u&&this.c.toLowerCase()=="e"){u=false;g=true;if(j.exec(this.json.substr(this.i+1,2))){this.character++;this.i++}else{this.character++;throw"Unknown Character '"+this.json[this.i+1]+"' following e notation, expecting a numeric value.";}}else if(q.exec(this.c)){if(n===null)n=true}else{this.i--;
-this.character--;return this.endval()}}},endval:function(){this.commabreak=false;for(var g="";++this.i<this.length;){this.c=this.json[this.i];this.character++;if(this.options.comments&&this.c=="/"){g=this.json[this.i+1];if(g=="*")this.multicomment();else if(g=="/")this.comment();else throw"Unknown character '/', maybe a comment?";}else if(t.exec(this.c)){this.line++;this.character=0}else if(!r.exec(this.c))if(this.c==","){this.commabreak=true;break}else if(this.c==this.endblock)return true;else throw"Unknown Character '"+
-this.c+"', expecting a comma or a closing '"+this.endblock+"'";}},setEvidence:function(){this.evidence=(this.json.split(z)[this.line-1]||"").trim();if(this.evidence.length>80)this.evidence=this.evidence.substr(0,77)+"..."}};Nodelint.Linters.jsonlint=p})(this);(function(p){p.Options=p.extend(true,p.Options,{});process.argv[1]==__filename&&p.Cli({verbose:true,"show-passed":true})})(Nodelint);
View
1 build/lint.js
@@ -0,0 +1 @@
+require( 'nlint' ).render( __dirname + '/../' );
View
1 build/test.js
@@ -0,0 +1 @@
+require( 'munit' ).render( __dirname + '/../test/' );
View
8 package.json
@@ -4,8 +4,8 @@
"url": "https://github.com/codenothing/jsonlint",
"keywords": [ "json", "lint", "comments" ],
"author": "Corey Hart <corey@codenothing.com>",
- "version": "0.1.0",
- "main": "jsonlint.js",
+ "version": "0.1.1",
+ "main": "./jsonlint.js",
"homepage": "https://github.com/codenothing/jsonlint",
"engines": {
"node": ">=0.5"
@@ -19,5 +19,9 @@
},
"scripts": {
"test": "make test"
+ },
+ "devDependencies": {
+ "nlint": "0.0.2",
+ "munit": "0.0.1"
}
}
View
2 test/munit.js
@@ -0,0 +1,2 @@
+global.MUnit = require( 'munit' );
+global.JSONLint = require( '../jsonlint.js' );
View
17 test/single.js
@@ -1,17 +0,0 @@
-// Test String (Editable)
-var test = '{"test":"\\"double quote\\""}';
-
-
-
-// Test Env (Don't Touch)
-var lint = require('../jsonlint')( test ), color = require('./src/color');
-
-if ( lint.error ) {
- color.puts.red( "Failed Single Test" );
- console.log( lint );
- process.exit( 1 );
-}
-else {
- color.puts.green( "Single Test Passed" );
- process.exit( 0 );
-}
View
10 test/src/clean.js → test/src/clean/clean.js
@@ -1,4 +1,4 @@
-module.exports = [
+var tests = [
// Empties
"[]",
"{}",
@@ -62,3 +62,11 @@ module.exports = [
// Multi Object
"{ \"test\": null, \"ing\": true, \"a\": false, \"b\": -101.101e-101 }"
];
+
+MUnit( 'Clean', tests.length, function( assert ) {
+ tests.forEach(function( test, index ) {
+ var lint = JSONLint( test );
+
+ assert.ok( index, ! lint.error );
+ });
+});
View
44 test/src/color.js
@@ -1,44 +0,0 @@
-var sys = require('sys'),
- Color = module.exports = function( color, bold, str ) {
- return "\x1B[" + ( bold ? 1 : 0 ) + ";" + Color.colors[ color ] + "m" + str + "\x1B[0m";
- };
-
-// Color references
-Color.colors = {
- red: 31,
- green: 32,
- yellow: 33,
- blue: 34
-};
-
-// Bold object
-Color.bold = {};
-Color.puts = { bold: {} };
-
-
-// Iteration mimic hack
-(function( obj, fn ) {
- for ( var i in obj ) {
- fn.call( obj[ i ], obj[ i ], i );
- }
-})( Color.colors, function( value, color ) {
- // Normal color
- Color[ color ] = function( msg ) {
- return Color( color, false, msg );
- };
-
- // Bolded color
- Color.bold[ color ] = function( msg ) {
- return Color( color, true, msg );
- };
-
- // Auto output of normal color
- Color.puts[ color ] = function( msg ) {
- return sys.puts( Color( color, false, msg ) );
- };
-
- // Auto output of bold color
- Color.puts.bold[ color ] = function( msg ) {
- return sys.puts( Color( color, true, msg ) );
- };
-});
View
164 test/src/core.js
@@ -1,164 +0,0 @@
-var JSONLint = require('../../jsonlint'),
- Color = require('./color'),
- fs = require('fs');
-
-function Unit( block, specials ) {
- // Argument handling
- this.block = block || [];
- this.specials = specials || {};
-
- // Focused tests
- this.spec = require('./files/spec');
- this.tests = {
- clean: require('./clean'),
- invalid: require('./invalid')
- };
-
- // Internals
- this.passes = 0;
- this.errors = 0;
- this.count = 0;
-
- // Start loading the test sheets
- // while other tests are running
- this.sheets( 'clean' );
- this.sheets( 'invalid' );
- this.focus();
-}
-
-Unit.prototype = {
-
- // Focused tests
- focus: function(){
- var self = this, i, row;
-
- // Clean simple tests
- self.tests.clean.forEach(function( test, i ) {
- self.clean( "Clean Test[" + i + "]", test );
- });
-
- // Invalid simple tests
- for ( i in self.tests.invalid ) {
- row = self.tests.invalid[ i ];
- self.invalid( "Invalid Test[" + i + "]", row.json, row.line, row.character );
- }
- },
-
- // Full sheet testing
- sheets: function( dir ) {
- var self = this, path = __dirname + '/files/' + dir + '/', fin = 0;
-
- fs.readdir( path, function( e, files ) {
- if ( e ) {
- Color.puts.bold.red( e );
- process.exit( 1 );
- }
-
- if ( ! files.length ) {
- self.sheets[ dir ] = true;
- self.finished();
- }
-
- files.forEach(function( file ) {
- // Block insertion
- if ( self.block.indexOf( file ) > -1 ) {
- // Assign finished marking
- if ( ++fin >= files.length ) {
- self.sheets[ dir ] = true;
- self.finished();
- }
- return;
- }
-
- fs.readFile( path + file, 'utf-8', function( e, data ) {
- if ( e ) {
- Color.puts.bold.red( e );
- process.exit( 1 );
- }
-
- // Run through JSONLint
- if ( dir == 'clean' ) {
- self.clean( file, data, self.specials[ file ] );
- }
- else if ( self.spec[ file ] ) {
- self.invalid( file, data, self.spec[ file ].line, self.spec[ file ].character, self.specials[ file ] );
- }
- else {
- Color.puts.bold.red( "Invalid files must have a spec entry" );
- process.exit( 1 );
- }
-
- // Assign finished marking
- if ( ++fin >= files.length ) {
- self.sheets[ dir ] = true;
- self.finished();
- }
- });
- });
- });
- },
-
- // Clean marking
- clean: function( name, test, options ) {
- this.count++;
- var lint = JSONLint( test, options );
-
- if ( lint.error ) {
- this.errors++;
- Color.puts.red( "Failed " + name );
- console.log( lint );
- }
- else {
- this.passes++;
- Color.puts.green( "Passed " + name );
- }
- },
-
- // Invalid marking
- invalid: function( name, test, line, character, options ) {
- this.count++;
- var lint = JSONLint( test, options );
-
- if ( lint.error ) {
- if ( lint.line === line && lint.character === character ) {
- this.passes++;
- Color.puts.green( "Passed " + name + ", error thrown matches expectations." );
- }
- else {
- this.errors++;
- Color.puts.red( "Failed " + name + ", expecting error on line " + line + ", character " + character );
- console.log( lint );
- }
- }
- else {
- this.errors++;
- Color.puts.red( "Failed " + name + ", didn't throw an error" );
- }
- },
-
- // Final output
- finished: function(){
- if ( ! this.sheets.clean || ! this.sheets.invalid ) {
- return;
- }
-
- // Final Report
- if ( this.errors > 0 ) {
- Color.puts.bold.red( "\n\n" + this.errors + " Tests Failed." );
- process.exit( 1 );
- }
- else {
- Color.puts.bold.green( "\n\n All " + this.count + " Tests Passed." );
- process.exit( 0 );
- }
- }
-
-};
-
-// Instance creator
-Unit.start = function( block, specials ) {
- return new Unit( block, specials );
-};
-
-// Expose for use
-module.exports = Unit;
View
105 test/src/files/files.js
@@ -0,0 +1,105 @@
+var fs = require( 'fs' ),
+ expect = 0,
+ tests = [
+
+ {
+ file: 'Numeric.json'
+ },
+
+ {
+ file: 'comments.json'
+ },
+
+ {
+ file: 'multi-comment.json'
+ },
+
+ {
+ file: 'nested.json'
+ },
+
+ {
+ file: 'pit.json'
+ },
+
+ {
+ file: 'strings.json'
+ },
+
+
+ {
+ file: 'endofarray.json',
+ error: true,
+ line: 1,
+ character: 9
+ },
+
+ {
+ file: 'nocomments.json',
+ error: true,
+ line: 2,
+ character: 2,
+ options: {
+ comments: false
+ }
+ },
+
+ {
+ file: 'nomulticomment.json',
+ error: true,
+ line: 1,
+ character: 1,
+ options: {
+ comments: false
+ }
+ },
+
+ {
+ file: 'string.json',
+ error: true,
+ line: 2,
+ character: 3
+ },
+
+ {
+ file: 'empty.json',
+ error: true,
+ line: 1,
+ character: 0
+ },
+
+ {
+ file: 'multi-object.json',
+ error: true,
+ line: 5,
+ character: 1
+ }
+
+ ];
+
+
+tests.forEach(function( test ) {
+ expect += test.error ? 2 : 1;
+});
+
+MUnit( 'Files', expect, function( assert ) {
+ tests.forEach(function( test ) {
+ fs.readFile( __dirname + '/json/' + test.file, 'utf-8', function( e, contents ) {
+ if ( e ) {
+ return assert.fail( test.file );
+ }
+
+ var lint = JSONLint( contents, test.options );
+ if ( ! lint.error ) {
+ assert.ok( test.file, ! test.error );
+ }
+ else if ( ! test.error ) {
+ assert.fail( test.file );
+ }
+ else {
+ assert.equal( test.file + '-line', lint.line, test.line );
+ assert.equal( test.file + '-character', lint.character, test.character );
+ }
+ });
+ });
+});
View
7 test/src/files/json/.nodelint.json
@@ -0,0 +1,7 @@
+{
+ "ignore": [
+ "string.json",
+ "multi-object.json",
+ "endofarray.json"
+ ]
+}
View
0 test/src/files/clean/Numeric.json → test/src/files/json/Numeric.json
File renamed without changes.
View
0 test/src/files/clean/comments.json → test/src/files/json/comments.json
File renamed without changes.
View
0 test/src/files/invalid/empty.json → test/src/files/json/empty.json
File renamed without changes.
View
0 test/src/files/invalid/endofarray.json → test/src/files/json/endofarray.json
File renamed without changes.
View
0 test/src/files/clean/multi-comment.json → test/src/files/json/multi-comment.json
File renamed without changes.
View
0 test/src/files/invalid/multi-object.json → test/src/files/json/multi-object.json
File renamed without changes.
View
0 test/src/files/clean/nested.json → test/src/files/json/nested.json
File renamed without changes.
View
0 test/src/files/invalid/nocomments.json → test/src/files/json/nocomments.json
File renamed without changes.
View
0 test/src/files/invalid/nomulticomment.json → test/src/files/json/nomulticomment.json
File renamed without changes.
View
0 test/src/files/clean/pit.json → test/src/files/json/pit.json
File renamed without changes.
View
0 test/src/files/invalid/string.json → test/src/files/json/string.json
File renamed without changes.
View
0 test/src/files/clean/strings.json → test/src/files/json/strings.json
File renamed without changes.
View
31 test/src/files/spec.js
@@ -1,31 +0,0 @@
-module.exports = {
- 'endofarray.json': {
- line: 1,
- character: 9
- },
-
- 'nocomments.json': {
- line: 2,
- character: 2
- },
-
- 'nomulticomment.json': {
- line: 1,
- character: 1
- },
-
- 'string.json': {
- line: 2,
- character: 3
- },
-
- 'empty.json': {
- line: 1,
- character: 0
- },
-
- 'multi-object.json': {
- line: 5,
- character: 1
- }
-};
View
16 test/src/invalid.js → test/src/invalid/invalid.js
@@ -1,4 +1,4 @@
-module.exports = {
+var tests = {
// JSON cannot be empty
"Empty Test": {
json: "",
@@ -198,3 +198,17 @@ module.exports = {
line: 1
}
};
+
+MUnit( 'Inavlid', Object.keys( tests ).count * 2, function( assert ) {
+ MUnit.each( tests, function( object, name ) {
+ var lint = JSONLint( object.json, object.options );
+
+ if ( ! lint.error ) {
+ assert.fail( name );
+ }
+ else {
+ assert.equal( name + '-line', lint.line, object.line );
+ assert.equal( name + '-character', lint.character, object.character );
+ }
+ });
+});
View
15 test/start.js
@@ -1,15 +0,0 @@
-// Temporary files to block during rendering
-var block = [
-];
-
-// Special options for certain files
-var specials = {
- 'nocomments.json': {
- comments: false
- },
- 'nomulticomment.json': {
- comments: false
- }
-};
-
-require('./src/core').start( block, specials );

0 comments on commit f71d7fb

Please sign in to comment.
Something went wrong with that request. Please try again.