diff options
Diffstat (limited to 'node_modules/montage/core/jshint.js')
-rwxr-xr-x | node_modules/montage/core/jshint.js | 3945 |
1 files changed, 3945 insertions, 0 deletions
diff --git a/node_modules/montage/core/jshint.js b/node_modules/montage/core/jshint.js new file mode 100755 index 00000000..584b5aef --- /dev/null +++ b/node_modules/montage/core/jshint.js | |||
@@ -0,0 +1,3945 @@ | |||
1 | /* | ||
2 | * JSHint, by JSHint Community. | ||
3 | * | ||
4 | * Licensed under the same slightly modified MIT license that JSLint is. | ||
5 | * It stops evil-doers everywhere. | ||
6 | * | ||
7 | * JSHint is a derivative work of JSLint: | ||
8 | * | ||
9 | * Copyright (c) 2002 Douglas Crockford (www.JSLint.com) | ||
10 | * | ||
11 | * Permission is hereby granted, free of charge, to any person obtaining | ||
12 | * a copy of this software and associated documentation files (the "Software"), | ||
13 | * to deal in the Software without restriction, including without limitation | ||
14 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
15 | * and/or sell copies of the Software, and to permit persons to whom | ||
16 | * the Software is furnished to do so, subject to the following conditions: | ||
17 | * | ||
18 | * The above copyright notice and this permission notice shall be included | ||
19 | * in all copies or substantial portions of the Software. | ||
20 | * | ||
21 | * The Software shall be used for Good, not Evil. | ||
22 | * | ||
23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
28 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
29 | * DEALINGS IN THE SOFTWARE. | ||
30 | * | ||
31 | * JSHint was forked from 2010-12-16 edition of JSLint. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | /* | ||
36 | JSHINT is a global function. It takes two parameters. | ||
37 | |||
38 | var myResult = JSHINT(source, option); | ||
39 | |||
40 | The first parameter is either a string or an array of strings. If it is a | ||
41 | string, it will be split on '\n' or '\r'. If it is an array of strings, it | ||
42 | is assumed that each string represents one line. The source can be a | ||
43 | JavaScript text or a JSON text. | ||
44 | |||
45 | The second parameter is an optional object of options which control the | ||
46 | operation of JSHINT. Most of the options are booleans: They are all | ||
47 | optional and have a default value of false. One of the options, predef, | ||
48 | can be an array of names, which will be used to declare global variables, | ||
49 | or an object whose keys are used as global names, with a boolean value | ||
50 | that determines if they are assignable. | ||
51 | |||
52 | If it checks out, JSHINT returns true. Otherwise, it returns false. | ||
53 | |||
54 | If false, you can inspect JSHINT.errors to find out the problems. | ||
55 | JSHINT.errors is an array of objects containing these members: | ||
56 | |||
57 | { | ||
58 | line : The line (relative to 0) at which the lint was found | ||
59 | character : The character (relative to 0) at which the lint was found | ||
60 | reason : The problem | ||
61 | evidence : The text line in which the problem occurred | ||
62 | raw : The raw message before the details were inserted | ||
63 | a : The first detail | ||
64 | b : The second detail | ||
65 | c : The third detail | ||
66 | d : The fourth detail | ||
67 | } | ||
68 | |||
69 | If a fatal error was found, a null will be the last element of the | ||
70 | JSHINT.errors array. | ||
71 | |||
72 | You can request a Function Report, which shows all of the functions | ||
73 | and the parameters and vars that they use. This can be used to find | ||
74 | implied global variables and other problems. The report is in HTML and | ||
75 | can be inserted in an HTML <body>. | ||
76 | |||
77 | var myReport = JSHINT.report(limited); | ||
78 | |||
79 | If limited is true, then the report will be limited to only errors. | ||
80 | |||
81 | You can request a data structure which contains JSHint's results. | ||
82 | |||
83 | var myData = JSHINT.data(); | ||
84 | |||
85 | It returns a structure with this form: | ||
86 | |||
87 | { | ||
88 | errors: [ | ||
89 | { | ||
90 | line: NUMBER, | ||
91 | character: NUMBER, | ||
92 | reason: STRING, | ||
93 | evidence: STRING | ||
94 | } | ||
95 | ], | ||
96 | functions: [ | ||
97 | name: STRING, | ||
98 | line: NUMBER, | ||
99 | last: NUMBER, | ||
100 | param: [ | ||
101 | STRING | ||
102 | ], | ||
103 | closure: [ | ||
104 | STRING | ||
105 | ], | ||
106 | var: [ | ||
107 | STRING | ||
108 | ], | ||
109 | exception: [ | ||
110 | STRING | ||
111 | ], | ||
112 | outer: [ | ||
113 | STRING | ||
114 | ], | ||
115 | unused: [ | ||
116 | STRING | ||
117 | ], | ||
118 | global: [ | ||
119 | STRING | ||
120 | ], | ||
121 | label: [ | ||
122 | STRING | ||
123 | ] | ||
124 | ], | ||
125 | globals: [ | ||
126 | STRING | ||
127 | ], | ||
128 | member: { | ||
129 | STRING: NUMBER | ||
130 | }, | ||
131 | unuseds: [ | ||
132 | { | ||
133 | name: STRING, | ||
134 | line: NUMBER | ||
135 | } | ||
136 | ], | ||
137 | implieds: [ | ||
138 | { | ||
139 | name: STRING, | ||
140 | line: NUMBER | ||
141 | } | ||
142 | ], | ||
143 | urls: [ | ||
144 | STRING | ||
145 | ], | ||
146 | json: BOOLEAN | ||
147 | } | ||
148 | |||
149 | Empty arrays will not be included. | ||
150 | |||
151 | */ | ||
152 | |||
153 | /*jshint | ||
154 | evil: true, nomen: false, onevar: false, regexp: false, strict: true, boss: true | ||
155 | */ | ||
156 | |||
157 | /*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%", "(begin)", | ||
158 | "(breakage)", "(context)", "(error)", "(global)", "(identifier)", "(last)", | ||
159 | "(line)", "(loopage)", "(name)", "(onevar)", "(params)", "(scope)", | ||
160 | "(statement)", "(verb)", "*", "+", "++", "-", "--", "\/", "<", "<=", "==", | ||
161 | "===", ">", ">=", $, $$, $A, $F, $H, $R, $break, $continue, $w, Abstract, Ajax, | ||
162 | __filename, __dirname, ActiveXObject, Array, ArrayBuffer, ArrayBufferView, | ||
163 | Autocompleter, Assets, Boolean, Builder, Buffer, Browser, COM, CScript, Canvas, | ||
164 | CustomAnimation, Class, Control, Chain, Color, Cookie, Core, DataView, Date, | ||
165 | Debug, Draggable, Draggables, Droppables, Document, DomReady, DOMReady, Drag, | ||
166 | E, Enumerator, Enumerable, Element, Elements, Error, Effect, EvalError, Event, | ||
167 | Events, FadeAnimation, Field, Flash, Float32Array, Float64Array, Form, | ||
168 | FormField, Frame, Function, Fx, GetObject, Group, Hash, HotKey, HTMLElement, | ||
169 | HtmlTable, Iframe, IframeShim, Image, Int16Array, Int32Array, Int8Array, | ||
170 | Insertion, InputValidator, JSON, Keyboard, Locale, LN10, LN2, LOG10E, LOG2E, | ||
171 | MAX_VALUE, MIN_VALUE, Mask, Math, MenuItem, MoveAnimation, MooTools, Native, | ||
172 | NEGATIVE_INFINITY, Number, Object, ObjectRange, Option, Options, OverText, PI, | ||
173 | POSITIVE_INFINITY, PeriodicalExecuter, Point, Position, Prototype, RangeError, | ||
174 | Rectangle, ReferenceError, RegExp, ResizeAnimation, Request, RotateAnimation, | ||
175 | SQRT1_2, SQRT2, ScrollBar, ScriptEngine, ScriptEngineBuildVersion, | ||
176 | ScriptEngineMajorVersion, ScriptEngineMinorVersion, Scriptaculous, Scroller, | ||
177 | Slick, Slider, Selector, String, Style, SyntaxError, Sortable, Sortables, | ||
178 | SortableObserver, Sound, Spinner, System, Swiff, Text, TextArea, Template, | ||
179 | Timer, Tips, Type, TypeError, Toggle, Try, URI, URIError, URL, VBArray, WSH, | ||
180 | WScript, Web, Window, XMLDOM, XMLHttpRequest, XPathEvaluator, XPathException, | ||
181 | XPathExpression, XPathNamespace, XPathNSResolver, XPathResult, "\\", a, | ||
182 | addEventListener, address, alert, apply, applicationCache, arguments, arity, | ||
183 | asi, b, bitwise, block, blur, boolOptions, boss, browser, c, call, callee, | ||
184 | caller, cases, charAt, charCodeAt, character, clearInterval, clearTimeout, | ||
185 | close, closed, closure, comment, condition, confirm, console, constructor, | ||
186 | content, couch, create, css, curly, d, data, datalist, dd, debug, decodeURI, | ||
187 | decodeURIComponent, defaultStatus, defineClass, deserialize, devel, document, | ||
188 | dojo, dijit, dojox, define, edition, else, emit, encodeURI, encodeURIComponent, | ||
189 | entityify, eqeqeq, eqnull, errors, es5, escape, eval, event, evidence, evil, | ||
190 | ex, exception, exec, exps, expr, exports, FileReader, first, floor, focus, | ||
191 | forin, fragment, frames, from, fromCharCode, fud, funct, function, functions, | ||
192 | g, gc, getComputedStyle, getRow, GLOBAL, global, globals, globalstrict, | ||
193 | hasOwnProperty, help, history, i, id, | ||
194 | identifier, immed, implieds, include, indent, indexOf, init, ins, instanceOf, | ||
195 | isAlpha, isApplicationRunning, isArray, isDigit, isFinite, isNaN, join, jshint, | ||
196 | JSHINT, json, jquery, jQuery, keys, label, labelled, last, lastsemic, laxbreak, | ||
197 | latedef, lbp, led, left, length, line, load, loadClass, localStorage, location, | ||
198 | log, loopfunc, m, match, maxerr, maxlen, member,message, meta, module, moveBy, | ||
199 | moveTo, mootools, name, navigator, new, newcap, noarg, node, noempty, nomen, | ||
200 | nonew, nud, onbeforeunload, onblur, onerror, onevar, onfocus, onload, onresize, | ||
201 | onunload, open, openDatabase, openURL, opener, opera, outer, param, parent, | ||
202 | parseFloat, parseInt, passfail, plusplus, predef, print, process, prompt, | ||
203 | prototype, prototypejs, push, quit, range, raw, reach, reason, regexp, | ||
204 | readFile, readUrl, regexdash, removeEventListener, replace, report, require, | ||
205 | reserved, resizeBy, resizeTo, resolvePath, resumeUpdates, respond, rhino, right, | ||
206 | runCommand, scroll, screen, scripturl, scrollBy, scrollTo, scrollbar, search, seal, send, | ||
207 | serialize, setInterval, setTimeout, shift, slice, sort,spawn, split, stack, | ||
208 | status, start, strict, sub, substr, supernew, shadow, supplant, sum, sync, | ||
209 | test, toLowerCase, toString, toUpperCase, toint32, token, top, trailing, type, | ||
210 | typeOf, Uint16Array, Uint32Array, Uint8Array, undef, unused, urls, value, valueOf, | ||
211 | var, version, WebSocket, white, window, Worker, wsh*/ | ||
212 | |||
213 | /*global exports: false */ | ||
214 | |||
215 | // We build the application inside a function so that we produce only a single | ||
216 | // global variable. That function will be invoked immediately, and its return | ||
217 | // value is the JSHINT function itself. | ||
218 | |||
219 | var JSHINT = (function (setup) { | ||
220 | |||
221 | var actual; | ||
222 | var JSHINT = function () { | ||
223 | if (!actual) { | ||
224 | actual = setup(JSHINT); | ||
225 | } | ||
226 | return actual.apply(this, arguments); | ||
227 | }; | ||
228 | |||
229 | return JSHINT; | ||
230 | |||
231 | })(function (JSHINT) { | ||
232 | "use strict"; | ||