changeset in labs/bespinclient: Bug 572259 - Part 1: Import jsli...

1 view
Skip to first unread message

Patrick Walton

unread,
Sep 13, 2010, 8:39:08 PM9/13/10
to bespin-...@googlegroups.com
changeset 780d540a1ca1 in /repo/hg/mozilla/labs/bespinclient
details: http://hg.mozilla.org/labs/bespinclient?cmd=changeset;node=780d540a1ca1
description:
Bug 572259 - Part 1: Import jslint into our tree

diffstat:

plugins/thirdparty/jslint.js | 5675 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 5675 insertions(+), 0 deletions(-)

diffs (truncated from 5680 to 300 lines):

diff --git a/plugins/thirdparty/jslint.js b/plugins/thirdparty/jslint.js
new file mode 100644
--- /dev/null
+++ b/plugins/thirdparty/jslint.js
@@ -0,0 +1,5675 @@
+// jslint.js
+// 2010-08-28
+
+// Mozilla: Plugin metadata
+"define metadata";
+({
+ "description": "JSLint support code"
+});
+"end";
+
+/*
+Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+/*
+ JSLINT is a global function. It takes two parameters.
+
+ var myResult = JSLINT(source, option);
+
+ The first parameter is either a string or an array of strings. If it is a
+ string, it will be split on '\n' or '\r'. If it is an array of strings, it
+ is assumed that each string represents one line. The source can be a
+ JavaScript text, or HTML text, or a Konfabulator text.
+
+ The second parameter is an optional object of options which control the
+ operation of JSLINT. Most of the options are booleans: They are all are
+ optional and have a default value of false.
+
+ If it checks out, JSLINT returns true. Otherwise, it returns false.
+
+ If false, you can inspect JSLINT.errors to find out the problems.
+ JSLINT.errors is an array of objects containing these members:
+
+ {
+ line : The line (relative to 0) at which the lint was found
+ character : The character (relative to 0) at which the lint was found
+ reason : The problem
+ evidence : The text line in which the problem occurred
+ raw : The raw message before the details were inserted
+ a : The first detail
+ b : The second detail
+ c : The third detail
+ d : The fourth detail
+ }
+
+ If a fatal error was found, a null will be the last element of the
+ JSLINT.errors array.
+
+ You can request a Function Report, which shows all of the functions
+ and the parameters and vars that they use. This can be used to find
+ implied global variables and other problems. The report is in HTML and
+ can be inserted in an HTML <body>.
+
+ var myReport = JSLINT.report(limited);
+
+ If limited is true, then the report will be limited to only errors.
+
+ You can request a data structure which contains JSLint's results.
+
+ var myData = JSLINT.data();
+
+ It returns a structure with this form:
+
+ {
+ errors: [
+ {
+ line: NUMBER,
+ character: NUMBER,
+ reason: STRING,
+ evidence: STRING
+ }
+ ],
+ functions: [
+ name: STRING,
+ line: NUMBER,
+ last: NUMBER,
+ param: [
+ STRING
+ ],
+ closure: [
+ STRING
+ ],
+ var: [
+ STRING
+ ],
+ exception: [
+ STRING
+ ],
+ outer: [
+ STRING
+ ],
+ unused: [
+ STRING
+ ],
+ global: [
+ STRING
+ ],
+ label: [
+ STRING
+ ]
+ ],
+ globals: [
+ STRING
+ ],
+ member: {
+ STRING: NUMBER
+ },
+ unuseds: [
+ {
+ name: STRING,
+ line: NUMBER
+ }
+ ],
+ implieds: [
+ {
+ name: STRING,
+ line: NUMBER
+ }
+ ],
+ urls: [
+ STRING
+ ],
+ json: BOOLEAN
+ }
+
+ Empty arrays will not be included.
+
+*/
+
+/*jslint
+ evil: true, nomen: false, onevar: false, regexp: false, strict: true
+*/
+
+/*members "\b", "\t", "\n", "\f", "\r", "!=", "!==", "\"", "%",
+ "(begin)", "(breakage)", "(context)", "(error)", "(global)",
+ "(identifier)", "(last)", "(line)", "(loopage)", "(name)", "(onevar)",
+ "(params)", "(scope)", "(verb)", "*", "+", "++", "-", "--", "\/",
+ "<", "<=", "==", "===", ">", ">=", ADSAFE, ActiveXObject,
+ Array, Boolean, COM, CScript, Canvas, CustomAnimation, Date, Debug, E,
+ Enumerator, Error, EvalError, FadeAnimation, Flash, FormField, Frame,
+ Function, HotKey, Image, JSON, LN10, LN2, LOG10E, LOG2E, MAX_VALUE,
+ MIN_VALUE, Math, MenuItem, MoveAnimation, NEGATIVE_INFINITY, Number,
+ Object, Option, PI, POSITIVE_INFINITY, Point, RangeError, Rectangle,
+ ReferenceError, RegExp, ResizeAnimation, RotateAnimation, SQRT1_2,
+ SQRT2, ScrollBar, String, Style, SyntaxError, System, Text, TextArea,
+ Timer, TypeError, URIError, URL, VBArray, WScript, Web, Window, XMLDOM,
+ XMLHttpRequest, "\\", a, abbr, acronym, addEventListener, address,
+ adsafe, alert, aliceblue, animator, antiquewhite, appleScript, applet,
+ apply, approved, aqua, aquamarine, area, arguments, arity, article,
+ aside, audio, autocomplete, azure, b, background,
+ "background-attachment", "background-color", "background-image",
+ "background-position", "background-repeat", base, bdo, beep, beige, big,
+ bisque, bitwise, black, blanchedalmond, block, blockquote, blue,
+ blueviolet, blur, body, border, "border-bottom", "border-bottom-color",
+ "border-bottom-style", "border-bottom-width", "border-collapse",
+ "border-color", "border-left", "border-left-color", "border-left-style",
+ "border-left-width", "border-right", "border-right-color",
+ "border-right-style", "border-right-width", "border-spacing",
+ "border-style", "border-top", "border-top-color", "border-top-style",
+ "border-top-width", "border-width", bottom, br, brown, browser,
+ burlywood, button, bytesToUIString, c, cadetblue, call, callee, caller,
+ canvas, cap, caption, "caption-side", cases, center, charAt, charCodeAt,
+ character, chartreuse, chocolate, chooseColor, chooseFile, chooseFolder,
+ cite, clear, clearInterval, clearTimeout, clip, close, closeWidget,
+ closed, closure, cm, code, col, colgroup, color, command, comment,
+ condition, confirm, console, constructor, content, convertPathToHFS,
+ convertPathToPlatform, coral, cornflowerblue, cornsilk,
+ "counter-increment", "counter-reset", create, crimson, css, cursor,
+ cyan, d, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen,
+ darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred,
+ darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise,
+ darkviolet, data, datalist, dd, debug, decodeURI, decodeURIComponent,
+ deeppink, deepskyblue, defaultStatus, defineClass, del, deserialize,
+ details, devel, dfn, dialog, dimension, dimgray, dir, direction,
+ display, div, dl, document, dodgerblue, dt, edition, else, em, embed,
+ empty, "empty-cells", encodeURI, encodeURIComponent, entityify, eqeqeq,
+ errors, es5, escape, eval, event, evidence, evil, ex, exception, exec, exps,
+ fieldset, figure, filesystem, firebrick, first, float, floor,
+ floralwhite, focus, focusWidget, font, "font-face", "font-family",
+ "font-size", "font-size-adjust", "font-stretch", "font-style",
+ "font-variant", "font-weight", footer, forestgreen, forin, form,
+ fragment, frame, frames, frameset, from, fromCharCode, fuchsia, fud,
+ funct, function, functions, g, gainsboro, gc, getComputedStyle,
+ ghostwhite, global, globals, gold, goldenrod, gray, green, greenyellow,
+ h1, h2, h3, h4, h5, h6, hasOwnProperty, head, header, height, help,
+ hgroup, history, honeydew, hotpink, hr, 'hta:application', html,
+ i, iTunes, id, identifier,
+ iframe, img, immed, implieds, in, include, indent, indexOf, indianred,
+ indigo, init, input, ins, isAlpha, isApplicationRunning, isDigit,
+ isFinite, isNaN, ivory, join, jslint, json, kbd, keygen, khaki,
+ konfabulatorVersion, label, labelled, lang, last, lavender,
+ lavenderblush, lawngreen, laxbreak, lbp, led, left, legend,
+ lemonchiffon, length, "letter-spacing", li, lib, lightblue, lightcoral,
+ lightcyan, lightgoldenrodyellow, lightgreen, lightpink, lightsalmon,
+ lightseagreen, lightskyblue, lightslategray, lightsteelblue,
+ lightyellow, lime, limegreen, line, "line-height", linen, link,
+ "list-style", "list-style-image", "list-style-position",
+ "list-style-type", load, loadClass, location, log, m, magenta, map,
+ margin, "margin-bottom", "margin-left", "margin-right", "margin-top",
+ mark, "marker-offset", maroon, match, "max-height", "max-width", maxerr,
+ maxlen, md5, media, mediumaquamarine, mediumblue, mediumorchid,
+ mediumpurple, mediumseagreen, mediumslateblue, mediumspringgreen,
+ mediumturquoise, mediumvioletred, member, menu, message, meta, meter,
+ midnightblue, "min-height", "min-width", mintcream, mistyrose, mm,
+ moccasin, moveBy, moveTo, name, nav, navajowhite, navigator, navy, new,
+ newcap, noframes, nomen, noscript, nud, object, ol, oldlace, olive,
+ olivedrab, on, onbeforeunload, onblur, onerror, onevar, onfocus, onload,
+ onresize, onunload, opacity, open, openURL, opener, opera, optgroup,
+ option, orange, orangered, orchid, outer, outline, "outline-color",
+ "outline-style", "outline-width", output, overflow, "overflow-x",
+ "overflow-y", p, padding, "padding-bottom", "padding-left",
+ "padding-right", "padding-top", page, "page-break-after",
+ "page-break-before", palegoldenrod, palegreen, paleturquoise,
+ palevioletred, papayawhip, param, parent, parseFloat, parseInt,
+ passfail, pc, peachpuff, peru, pink, play, plum, plusplus, pop,
+ popupMenu, position, powderblue, pre, predef, preferenceGroups,
+ preferences, print, progress, prompt, prototype, pt, purple, push, px,
+ q, quit, quotes, random, range, raw, reach, readFile, readUrl, reason,
+ red, regexp, reloadWidget, removeEventListener, replace, report,
+ reserved, resizeBy, resizeTo, resolvePath, resumeUpdates, rhino, right,
+ rosybrown, royalblue, rp, rt, ruby, runCommand, runCommandInBg,
+ saddlebrown, safe, salmon, samp, sandybrown, saveAs, savePreferences,
+ screen, script, scroll, scrollBy, scrollTo, seagreen, seal, search,
+ seashell, section, select, serialize, setInterval, setTimeout, shift,
+ showWidgetPreferences, sienna, silver, skyblue, slateblue, slategray,
+ sleep, slice, small, snow, sort, source, span, spawn, speak, split,
+ springgreen, src, stack, status, steelblue, strict, strong, style,
+ styleproperty, sub, substr, sup, supplant, suppressUpdates, sync,
+ system, table, "table-layout", tan, tbody, td, teal, tellWidget, test,
+ "text-align", "text-decoration", "text-indent", "text-shadow",
+ "text-transform", textarea, tfoot, th, thead, thistle, time, title,
+ toLowerCase, toString, toUpperCase, toint32, token, tomato, top, tr, tt,
+ turquoise, type, u, ul, undef, unescape, "unicode-bidi", unused,
+ unwatch, updateNow, urls, value, valueOf, var, version,
+ "vertical-align", video, violet, visibility, watch, wheat, white,
+ "white-space", whitesmoke, widget, width, windows, "word-spacing",
+ "word-wrap", yahooCheckLogin, yahooLogin, yahooLogout, yellow,
+ yellowgreen, "z-index"
+*/
+
+// We build the application inside a function so that we produce only a single
+// global variable. The function will be invoked, its return value is the JSLINT
+// application itself.
+
+"use strict";
+
+var JSLINT = (function () {
+ var adsafe_id, // The widget's ADsafe id.
+ adsafe_may, // The widget may load approved scripts.
+ adsafe_went, // ADSAFE.go has been called.
+ anonname, // The guessed name for anonymous functions.
+ approved, // ADsafe approved urls.
+
+ atrule = {
+ media : true,
+ 'font-face': true,
+ page : true
+ },
+
+// These are operators that should not be used with the ! operator.
+
+ bang = {
+ '<': true,
+ '<=': true,
+ '==': true,
+ '===': true,
+ '!==': true,
+ '!=': true,
+ '>': true,
+ '>=': true,
+ '+': true,
+ '-': true,
+ '*': true,
+ '/': true,
+ '%': true

Reply all
Reply to author
Forward
0 new messages