added old data
This commit is contained in:
1328
project3/node_modules/jshint/CHANGELOG.md
generated
vendored
Normal file
1328
project3/node_modules/jshint/CHANGELOG.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
20
project3/node_modules/jshint/LICENSE
generated
vendored
Normal file
20
project3/node_modules/jshint/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright 2012 Anton Kovalyov (http://jshint.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 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.
|
117
project3/node_modules/jshint/README.md
generated
vendored
Normal file
117
project3/node_modules/jshint/README.md
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
# JSHint, A Static Code Analysis Tool for JavaScript
|
||||
|
||||
\[ [Use it online](http://jshint.com/) •
|
||||
[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) •
|
||||
[Install](http://jshint.com/install/) •
|
||||
[Contribute](http://jshint.com/contribute/) •
|
||||
[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \]
|
||||
|
||||
[](https://www.npmjs.com/package/jshint)
|
||||
[](https://travis-ci.org/jshint/jshint)
|
||||
[](https://ci.appveyor.com/project/jshint/jshint/branch/master)
|
||||
[](https://david-dm.org/jshint/jshint)
|
||||
[](https://david-dm.org/jshint/jshint#info=devDependencies)
|
||||
[](https://coveralls.io/r/jshint/jshint?branch=master)
|
||||
|
||||
JSHint is a community-driven tool that detects errors and potential problems in
|
||||
JavaScript code. Since JSHint is so flexible, you can easily adjust it in
|
||||
the environment you expect your code to execute. JSHint is open source and
|
||||
will always stay this way.
|
||||
|
||||
## Our goal
|
||||
|
||||
The project aims to help JavaScript developers write complex programs
|
||||
without worrying about typos and language gotchas.
|
||||
|
||||
Any code base eventually becomes huge at some point, so simple mistakes — that
|
||||
would not show themselves when written — can become show stoppers and add
|
||||
extra hours of debugging. So, static code analysis tools come into play
|
||||
and help developers spot such problems. JSHint scans a program written in
|
||||
JavaScript and reports about commonly made mistakes and potential bugs. The
|
||||
potential problem could be a syntax error, a bug due to an implicit type
|
||||
conversion, a leaking variable, or something else entirely.
|
||||
|
||||
Only 15% of all programs linted on [jshint.com](http://jshint.com) pass the
|
||||
JSHint checks. In all other cases, JSHint finds some red flags that could've
|
||||
been bugs or potential problems.
|
||||
|
||||
Please note, that while static code analysis tools can spot many different kind
|
||||
of mistakes, it can't detect if your program is correct, fast or has memory
|
||||
leaks. You should always combine tools like JSHint with unit and functional
|
||||
tests as well as with code reviews.
|
||||
|
||||
## Reporting a bug
|
||||
|
||||
To report a bug simply create a
|
||||
[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe
|
||||
your problem or suggestion. We welcome all kinds of feedback regarding
|
||||
JSHint including but not limited to:
|
||||
|
||||
* When JSHint doesn't work as expected
|
||||
* When JSHint complains about valid JavaScript code that works in all browsers
|
||||
* When you simply want a new option or feature
|
||||
|
||||
Before reporting a bug, please look around to see if there are any open or closed tickets
|
||||
that discuss your issue, and remember the wisdom: pull request > bug report > tweet.
|
||||
|
||||
## Who uses JSHint?
|
||||
|
||||
Engineers from these companies and projects use JSHint:
|
||||
|
||||
* [Mozilla](https://www.mozilla.org/)
|
||||
* [Wikipedia](https://wikipedia.org/)
|
||||
* [Facebook](https://facebook.com/)
|
||||
* [Twitter](https://twitter.com/)
|
||||
* [Bootstrap](http://getbootstrap.com/)
|
||||
* [Disqus](https://disqus.com/)
|
||||
* [Medium](https://medium.com/)
|
||||
* [Yahoo!](https://yahoo.com/)
|
||||
* [SmugMug](http://smugmug.com/)
|
||||
* [jQuery](http://jquery.com/)
|
||||
* [PDF.js](http://mozilla.github.io/pdf.js)
|
||||
* [Coursera](http://coursera.com/)
|
||||
* [Adobe Brackets](http://brackets.io/)
|
||||
* [Apache Cordova](http://cordova.io/)
|
||||
* [RedHat](http://redhat.com/)
|
||||
* [SoundCloud](http://soundcloud.com/)
|
||||
* [Nodejitsu](http://nodejitsu.com/)
|
||||
* [Yelp](https://yelp.com/)
|
||||
* [Voxer](http://voxer.com/)
|
||||
* [EnyoJS](http://enyojs.com/)
|
||||
* [QuickenLoans](http://quickenloans.com/)
|
||||
* [Cloud9](http://c9.io/)
|
||||
* [CodeClimate](https://codeclimate.com/)
|
||||
* [Zendesk](http://zendesk.com/)
|
||||
* [Apache CouchDB](http://couchdb.apache.org/)
|
||||
* [Google](https://www.google.com/)
|
||||
* [Codacy](https://www.codacy.com) [ref](https://support.codacy.com/hc/en-us/articles/207995005-Special-Thanks)
|
||||
* [Spotify](https://www.spotify.com)
|
||||
|
||||
And many more!
|
||||
|
||||
## License
|
||||
|
||||
Most files are published using [the standard MIT Expat
|
||||
license](https://www.gnu.org/licenses/license-list.html#Expat). One file,
|
||||
however, is provided under a slightly modified version of that license. The
|
||||
so-called [JSON license](https://www.gnu.org/licenses/license-list.html#JSON)
|
||||
is a non-free license, and unfortunately, we can't change it due to historical
|
||||
reasons. This license is included as an in-line within the file it concerns.
|
||||
|
||||
## The JSHint Team
|
||||
|
||||
JSHint is currently maintained by [Rick Waldron](https://github.com/rwaldron/),
|
||||
[Caitlin Potter](https://github.com/caitp/), [Mike
|
||||
Pennisi](https://github.com/jugglinmike/), and [Luke
|
||||
Page](https://github.com/lukeapage). You can reach them via admin@jshint.org.
|
||||
|
||||
## Previous Maintainers
|
||||
|
||||
Originating from the JSLint project in 2010, JSHint has been maintained by a
|
||||
number of dedicated individuals. In chronological order, they are: Douglas
|
||||
Crockford, Anton Kovalyov, and Mike Sherov. We appreciate their long-term
|
||||
commitment!
|
||||
|
||||
## Thank you!
|
||||
|
||||
We really appreciate all kinds of feedback and contributions. Thanks for using and supporting JSHint!
|
6
project3/node_modules/jshint/bin/apply
generated
vendored
Executable file
6
project3/node_modules/jshint/bin/apply
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var shjs = require("shelljs");
|
||||
var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".diff";
|
||||
|
||||
shjs.exec('curl "' + url + '" | git apply');
|
38
project3/node_modules/jshint/bin/build
generated
vendored
Executable file
38
project3/node_modules/jshint/bin/build
generated
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env node
|
||||
/*jshint shelljs:true */
|
||||
|
||||
"use strict";
|
||||
|
||||
var path = require("path");
|
||||
var build = require("../scripts/build");
|
||||
require("shelljs/make");
|
||||
|
||||
var distDir = path.join(__dirname, "../dist");
|
||||
|
||||
if (!test("-e", distDir))
|
||||
mkdir(distDir);
|
||||
|
||||
build("web", function(err, version, src) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
src.to(distDir + "/jshint.js");
|
||||
console.log("Built: " + version + " (web)");
|
||||
});
|
||||
|
||||
build("rhino", function(err, version, src) {
|
||||
var dest;
|
||||
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
dest = distDir + "/jshint-rhino.js";
|
||||
chmod("+x", dest);
|
||||
|
||||
src.to(dest);
|
||||
console.log("Built: " + version + " (Rhino)");
|
||||
});
|
3
project3/node_modules/jshint/bin/jshint
generated
vendored
Executable file
3
project3/node_modules/jshint/bin/jshint
generated
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
require("../src/cli.js").interpret(process.argv);
|
36
project3/node_modules/jshint/bin/land
generated
vendored
Executable file
36
project3/node_modules/jshint/bin/land
generated
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
"use strict";
|
||||
|
||||
var url = "https://github.com/jshint/jshint/pull/" + process.argv[2] + ".patch";
|
||||
var https = require("https");
|
||||
var shjs = require("shelljs");
|
||||
var opts = require("url").parse(url);
|
||||
var msg = process.argv[3];
|
||||
|
||||
opts.rejectUnauthorized = false;
|
||||
opts.agent = new https.Agent(opts);
|
||||
|
||||
https.get(opts, succ).on("error", err);
|
||||
|
||||
function succ(res) {
|
||||
if (res.statusCode !== 200)
|
||||
return void console.log("error:", res.statusCode);
|
||||
|
||||
var data = "";
|
||||
res.on("data", function (chunk) {
|
||||
data += chunk.toString();
|
||||
});
|
||||
|
||||
res.on("end", function () {
|
||||
data = data.split("\n");
|
||||
data = data[1].replace(/^From\:\s/, "");
|
||||
data = data.replace(/"/g, "");
|
||||
|
||||
shjs.exec("git commit -s --author=\"" + data + "\" --message=\"" + msg + "\"");
|
||||
});
|
||||
}
|
||||
|
||||
function err(res) {
|
||||
console.log("error:", res.message);
|
||||
}
|
22
project3/node_modules/jshint/data/ascii-identifier-data.js
generated
vendored
Normal file
22
project3/node_modules/jshint/data/ascii-identifier-data.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
var identifierStartTable = [];
|
||||
|
||||
for (var i = 0; i < 128; i++) {
|
||||
identifierStartTable[i] =
|
||||
i === 36 || // $
|
||||
i >= 65 && i <= 90 || // A-Z
|
||||
i === 95 || // _
|
||||
i >= 97 && i <= 122; // a-z
|
||||
}
|
||||
|
||||
var identifierPartTable = [];
|
||||
|
||||
for (var i = 0; i < 128; i++) {
|
||||
identifierPartTable[i] =
|
||||
identifierStartTable[i] || // $, _, A-Z, a-z
|
||||
i >= 48 && i <= 57; // 0-9
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
asciiIdentifierStartTable: identifierStartTable,
|
||||
asciiIdentifierPartTable: identifierPartTable
|
||||
};
|
1
project3/node_modules/jshint/data/es5-identifier-names.js
generated
vendored
Normal file
1
project3/node_modules/jshint/data/es5-identifier-names.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
project3/node_modules/jshint/data/non-ascii-identifier-part-only.js
generated
vendored
Normal file
5
project3/node_modules/jshint/data/non-ascii-identifier-part-only.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
project3/node_modules/jshint/data/non-ascii-identifier-start.js
generated
vendored
Normal file
5
project3/node_modules/jshint/data/non-ascii-identifier-start.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31234
project3/node_modules/jshint/dist/jshint-rhino.js
generated
vendored
Executable file
31234
project3/node_modules/jshint/dist/jshint-rhino.js
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
31232
project3/node_modules/jshint/dist/jshint.js
generated
vendored
Normal file
31232
project3/node_modules/jshint/dist/jshint.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
103
project3/node_modules/jshint/package.json
generated
vendored
Normal file
103
project3/node_modules/jshint/package.json
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"_from": "jshint@^2.9.1-rc2",
|
||||
"_id": "jshint@2.11.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-ooaD/hrBPhu35xXW4gn+o3SOuzht73gdBuffgJzrZBJZPGgGiiTvJEgTyxFvBO2nz0+X1G6etF8SzUODTlLY6Q==",
|
||||
"_location": "/jshint",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "jshint@^2.9.1-rc2",
|
||||
"name": "jshint",
|
||||
"escapedName": "jshint",
|
||||
"rawSpec": "^2.9.1-rc2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.9.1-rc2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jshint/-/jshint-2.11.0.tgz",
|
||||
"_shasum": "7f3d99820b8b653eaaec7015a563b2d8101cbbc8",
|
||||
"_spec": "jshint@^2.9.1-rc2",
|
||||
"_where": "/home/massiveatoms/Desktop/cs142/project3",
|
||||
"author": {
|
||||
"name": "Anton Kovalyov",
|
||||
"email": "anton@kovalyov.net",
|
||||
"url": "http://anton.kovalyov.net/"
|
||||
},
|
||||
"bin": {
|
||||
"jshint": "bin/jshint"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jshint/jshint/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"cli": "~1.0.0",
|
||||
"console-browserify": "1.1.x",
|
||||
"exit": "0.1.x",
|
||||
"htmlparser2": "3.8.x",
|
||||
"lodash": "~4.17.11",
|
||||
"minimatch": "~3.0.2",
|
||||
"shelljs": "0.3.x",
|
||||
"strip-json-comments": "1.0.x"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Static analysis tool for JavaScript",
|
||||
"devDependencies": {
|
||||
"async": "~2.1.2",
|
||||
"browserify": "9.x",
|
||||
"conventional-changelog": "0.4.x",
|
||||
"conventional-github-releaser": "0.4.x",
|
||||
"coveralls": "2.11.x",
|
||||
"istanbul": "0.3.x",
|
||||
"jscs": "1.11.x",
|
||||
"mock-stdin": "0.3.x",
|
||||
"nodeunit": "0.9.x",
|
||||
"phantom": "~4.0.1",
|
||||
"phantomjs-prebuilt": "~2.1.7",
|
||||
"regenerate": "1.2.x",
|
||||
"results-interpreter": "~1.0.0",
|
||||
"sinon": "1.12.x",
|
||||
"test262-stream": "~1.2.1",
|
||||
"unicode-11.0.0": "0.7.x",
|
||||
"unicode-5.2.0": "^0.7.5"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"data",
|
||||
"dist",
|
||||
"src"
|
||||
],
|
||||
"homepage": "http://jshint.com/",
|
||||
"license": "(MIT AND JSON)",
|
||||
"main": "./src/jshint.js",
|
||||
"name": "jshint",
|
||||
"preferGlobal": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jshint/jshint.git"
|
||||
},
|
||||
"scripts": {
|
||||
"browser-test-server": "node tests/helpers/browser/server",
|
||||
"build": "node bin/build",
|
||||
"changelog": "conventional-changelog -p jshint -i CHANGELOG.md -w",
|
||||
"coverage": "istanbul -- cover ./node_modules/nodeunit/bin/nodeunit tests/unit tests/unit/unstable",
|
||||
"coverage-report": "npm run coverage && istanbul report html",
|
||||
"data": "node scripts/generate-identifier-data",
|
||||
"fetch-test262": "git submodule init && git submodule update",
|
||||
"github-release": "conventional-github-releaser -p jshint",
|
||||
"pretest": "node ./bin/jshint src && jscs src",
|
||||
"test": "npm run test-node && npm run test-browser",
|
||||
"test-262": "node tests/test262",
|
||||
"test-all": "npm run test-node && npm run test-browser && npm run test-262",
|
||||
"test-browser": "node tests/browser",
|
||||
"test-cli": "nodeunit tests/cli.js",
|
||||
"test-node": "npm run test-unit && npm run test-cli && npm run test-regression",
|
||||
"test-regression": "nodeunit tests/regression",
|
||||
"test-unit": "nodeunit tests/unit tests/unit/unstable"
|
||||
},
|
||||
"version": "2.11.0"
|
||||
}
|
BIN
project3/node_modules/jshint/src/.jshint.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.jshint.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.lex.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.lex.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.messages.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.messages.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.options.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.options.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.prod-params.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.prod-params.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.reg.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.reg.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.scope-manager.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.scope-manager.js.swp
generated
vendored
Normal file
Binary file not shown.
BIN
project3/node_modules/jshint/src/.vars.js.swp
generated
vendored
Normal file
BIN
project3/node_modules/jshint/src/.vars.js.swp
generated
vendored
Normal file
Binary file not shown.
771
project3/node_modules/jshint/src/cli.js
generated
vendored
Normal file
771
project3/node_modules/jshint/src/cli.js
generated
vendored
Normal file
@@ -0,0 +1,771 @@
|
||||
"use strict";
|
||||
|
||||
var _ = require("lodash");
|
||||
var fs = require("fs");
|
||||
var cli = require("cli");
|
||||
var path = require("path");
|
||||
var shjs = require("shelljs");
|
||||
var minimatch = require("minimatch");
|
||||
var htmlparser = require("htmlparser2");
|
||||
var exit = require("exit");
|
||||
var stripJsonComments = require("strip-json-comments");
|
||||
var JSHINT = require("./jshint.js").JSHINT;
|
||||
var defReporter = require("./reporters/default").reporter;
|
||||
|
||||
var OPTIONS = {
|
||||
"config": ["c", "Custom configuration file", "string", false ],
|
||||
"reporter": ["reporter", "Custom reporter (<PATH>|jslint|checkstyle|unix)", "string", undefined ],
|
||||
"prereq": [
|
||||
"prereq",
|
||||
"Comma-separated list of prerequisites (paths). E.g. files which include " +
|
||||
"definitions of global variables used throughout your project",
|
||||
"string",
|
||||
null
|
||||
],
|
||||
"exclude": ["exclude",
|
||||
"Exclude files matching the given filename pattern (same as .jshintignore)", "string", null],
|
||||
"exclude-path": ["exclude-path", "Pass in a custom jshintignore file path", "string", null],
|
||||
"filename": ["filename",
|
||||
"Pass in a filename when using STDIN to emulate config lookup for that file name",
|
||||
"string", null],
|
||||
"verbose": ["verbose", "Show message codes"],
|
||||
"show-non-errors": ["show-non-errors", "Show additional data generated by jshint"],
|
||||
"extra-ext": ["e",
|
||||
"Comma-separated list of file extensions to use (default is .js)", "string", ""],
|
||||
|
||||
"extract": [
|
||||
"extract",
|
||||
"Extract inline scripts contained in HTML (auto|always|never, default to never)",
|
||||
"string",
|
||||
"never"
|
||||
],
|
||||
|
||||
// Deprecated options.
|
||||
"jslint-reporter": [
|
||||
"jslint-reporter",
|
||||
deprecated("Use a jslint compatible reporter", "--reporter=jslint")
|
||||
],
|
||||
|
||||
"checkstyle-reporter": [
|
||||
"checkstyle-reporter",
|
||||
deprecated("Use a CheckStyle compatible XML reporter", "--reporter=checkstyle")
|
||||
]
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the same text but with a deprecation notice.
|
||||
* Useful for options descriptions.
|
||||
*
|
||||
* @param {string} text
|
||||
* @param {string} alt (optional) Alternative command to include in the
|
||||
* deprecation notice.
|
||||
*
|
||||
* @returns {string}
|
||||
*/
|
||||
function deprecated(text, alt) {
|
||||
if (!alt) {
|
||||
return text + " (DEPRECATED)";
|
||||
}
|
||||
|
||||
return text + " (DEPRECATED, use " + alt + " instead)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find a configuration file in either project directory
|
||||
* or in the home directory. Configuration files are named
|
||||
* '.jshintrc'.
|
||||
*
|
||||
* @param {string} file path to the file to be linted
|
||||
* @returns {string} a path to the config file
|
||||
*/
|
||||
function findConfig(file) {
|
||||
var dir = path.dirname(path.resolve(file));
|
||||
var envs = getHomeDir();
|
||||
var proj = findFile(".jshintrc", dir);
|
||||
var home;
|
||||
|
||||
if (proj)
|
||||
return proj;
|
||||
|
||||
else if (envs) {
|
||||
home = path.normalize(path.join(envs, ".jshintrc"));
|
||||
|
||||
if (shjs.test("-e", home))
|
||||
return home;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getHomeDir() {
|
||||
var homePath = "";
|
||||
var environment = global.process.env;
|
||||
var paths = [
|
||||
environment.USERPROFILE,
|
||||
environment.HOME,
|
||||
environment.HOMEPATH,
|
||||
environment.HOMEDRIVE + environment.HOMEPATH
|
||||
];
|
||||
|
||||
while (paths.length) {
|
||||
homePath = paths.shift();
|
||||
if (fs.existsSync(homePath)) {
|
||||
return homePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to find JSHint configuration within a package.json file
|
||||
* (if any). It search in the current directory and then goes up
|
||||
* all the way to the root just like findFile.
|
||||
*
|
||||
* @param {string} file path to the file to be linted
|
||||
* @returns {object} config object
|
||||
*/
|
||||
function loadNpmConfig(file) {
|
||||
var dir = path.dirname(path.resolve(file));
|
||||
var fp = findFile("package.json", dir);
|
||||
|
||||
if (!fp)
|
||||
return null;
|
||||
|
||||
try {
|
||||
return require(fp).jshintConfig;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to import a reporter file and returns its reference.
|
||||
*
|
||||
* @param {string} fp a path to the reporter file
|
||||
* @returns {object} imported module for the reporter or 'null'
|
||||
* if a module cannot be imported.
|
||||
*/
|
||||
function loadReporter(fp) {
|
||||
try {
|
||||
return require(fp).reporter;
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Storage for memoized results from find file
|
||||
// Should prevent lots of directory traversal &
|
||||
// lookups when liniting an entire project
|
||||
var findFileResults = {};
|
||||
|
||||
/**
|
||||
* Searches for a file with a specified name starting with
|
||||
* 'dir' and going all the way up either until it finds the file
|
||||
* or hits the root.
|
||||
*
|
||||
* @param {string} name filename to search for (e.g. .jshintrc)
|
||||
* @param {string} dir directory to start search from (default:
|
||||
* current working directory)
|
||||
*
|
||||
* @returns {string} normalized filename
|
||||
*/
|
||||
function findFile(name, cwd) {
|
||||
cwd = cwd || process.cwd();
|
||||
|
||||
var filename = path.normalize(path.join(cwd, name));
|
||||
if (findFileResults[filename] !== undefined) {
|
||||
return findFileResults[filename];
|
||||
}
|
||||
|
||||
var parent = path.resolve(cwd, "../");
|
||||
|
||||
if (shjs.test("-e", filename)) {
|
||||
findFileResults[filename] = filename;
|
||||
return filename;
|
||||
}
|
||||
|
||||
if (cwd === parent) {
|
||||
findFileResults[filename] = null;
|
||||
return null;
|
||||
}
|
||||
|
||||
return findFile(name, parent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a list of files that have to be skipped. JSHint assumes that
|
||||
* the list is located in a file called '.jshintignore'.
|
||||
*
|
||||
* @return {array} a list of files to ignore.
|
||||
*/
|
||||
function loadIgnores(params) {
|
||||
var file = findFile(params.excludePath || ".jshintignore", params.cwd) || "";
|
||||
|
||||
if (!file && !params.exclude) {
|
||||
return [];
|
||||
}
|
||||
|
||||
var lines = (file ? shjs.cat(file) : "").split("\n");
|
||||
var exclude = params.exclude || "";
|
||||
lines.unshift.apply(lines, exclude.split(","));
|
||||
|
||||
return lines
|
||||
.filter(function(line) {
|
||||
return !!line.trim();
|
||||
})
|
||||
.map(function(line) {
|
||||
if (line[0] === "!")
|
||||
return "!" + path.resolve(path.dirname(file), line.substr(1).trim());
|
||||
|
||||
return path.join(path.dirname(file), line.trim());
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether we should ignore a file or not.
|
||||
*
|
||||
* @param {string} fp a path to a file
|
||||
* @param {array} patterns a list of patterns for files to ignore
|
||||
*
|
||||
* @return {boolean} 'true' if file should be ignored, 'false' otherwise.
|
||||
*/
|
||||
function isIgnored(fp, patterns) {
|
||||
return patterns.some(function(ip) {
|
||||
if (minimatch(path.resolve(fp), ip, { nocase: true, dot: true })) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (path.resolve(fp) === ip) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (shjs.test("-d", fp) && ip.match(/^[^\/\\]*[\/\\]?$/) &&
|
||||
fp.match(new RegExp("^" + ip + ".*"))) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract JS code from a given source code. The source code my be either HTML
|
||||
* code or JS code. In the latter case, no extraction will be done unless
|
||||
* 'always' is given.
|
||||
*
|
||||
* @param {string} code a piece of code
|
||||
* @param {string} when 'always' will extract the JS code, no matter what.
|
||||
* 'never' won't do anything. 'auto' will check if the code looks like HTML
|
||||
* before extracting it.
|
||||
*
|
||||
* @return {string} the extracted code
|
||||
*/
|
||||
function extract(code, when) {
|
||||
// A JS file won't start with a less-than character, whereas a HTML file
|
||||
// should always start with that.
|
||||
if (when !== "always" && (when !== "auto" || !/^\s*</.test(code)))
|
||||
return code;
|
||||
|
||||
var inscript = false;
|
||||
var index = 0;
|
||||
var js = [];
|
||||
var startOffset;
|
||||
|
||||
// Test if current tag is a valid <script> tag.
|
||||
function onopen(name, attrs) {
|
||||
if (name !== "script")
|
||||
return;
|
||||
|
||||
if (attrs.type && !/text\/javascript/.test(attrs.type.toLowerCase()))
|
||||
return;
|
||||
|
||||
// Mark that we're inside a <script> a tag and push all new lines
|
||||
// in between the last </script> tag and this <script> tag to preserve
|
||||
// location information.
|
||||
inscript = true;
|
||||
js.push.apply(js, code.slice(index, parser.endIndex).match(/\r\n|\n|\r/g));
|
||||
startOffset = null;
|
||||
}
|
||||
|
||||
function onclose(name) {
|
||||
if (name !== "script" || !inscript)
|
||||
return;
|
||||
|
||||
inscript = false;
|
||||
index = parser.startIndex;
|
||||
startOffset = null;
|
||||
}
|
||||
|
||||
function ontext(data) {
|
||||
if (!inscript)
|
||||
return;
|
||||
|
||||
var lines = data.split(/\r\n|\n|\r/);
|
||||
|
||||
if (!startOffset) {
|
||||
lines.some(function(line) {
|
||||
if (!line) return;
|
||||
startOffset = /^(\s*)/.exec(line)[1];
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// check for startOffset again to remove leading white space from first line
|
||||
if (startOffset) {
|
||||
lines = lines.map(function(line) {
|
||||
return line.replace(startOffset, "");
|
||||
});
|
||||
data = lines.join("\n");
|
||||
}
|
||||
|
||||
js.push(data); // Collect JavaScript code.
|
||||
}
|
||||
|
||||
var parser = new htmlparser.Parser({ onopentag: onopen, onclosetag: onclose, ontext: ontext });
|
||||
parser.parseComplete(code);
|
||||
|
||||
return js.join("");
|
||||
}
|
||||
|
||||
/**
|
||||
* Crude version of source maps: extract how much JavaSscript in HTML
|
||||
* was shifted based on first JS line. For example if first js line
|
||||
* is offset by 4 spaces, each line in this js fragment will have offset 4
|
||||
* to restore the original column.
|
||||
*
|
||||
* @param {string} code a piece of code
|
||||
* @param {string} when 'always' will extract the JS code, no matter what.
|
||||
* 'never' won't do anything. 'auto' will check if the code looks like HTML
|
||||
* before extracting it.
|
||||
*
|
||||
* @return {Array} extracted offsets
|
||||
*/
|
||||
function extractOffsets(code, when) {
|
||||
// A JS file won't start with a less-than character, whereas a HTML file
|
||||
// should always start with that.
|
||||
if (when !== "always" && (when !== "auto" || !/^\s*</.test(code)))
|
||||
return;
|
||||
|
||||
var inscript = false;
|
||||
var index = 0;
|
||||
var lineCounter = 0;
|
||||
var startOffset;
|
||||
var offsets = [];
|
||||
|
||||
// Test if current tag is a valid <script> tag.
|
||||
function onopen(name, attrs) {
|
||||
if (name !== "script")
|
||||
return;
|
||||
|
||||
if (attrs.type && !/text\/javascript/.test(attrs.type.toLowerCase()))
|
||||
return;
|
||||
|
||||
// Mark that we're inside a <script> a tag and push all new lines
|
||||
// in between the last </script> tag and this <script> tag to preserve
|
||||
// location information.
|
||||
inscript = true;
|
||||
var fragment = code.slice(index, parser.endIndex);
|
||||
var n = (fragment.match(/\r\n|\n|\r/g) || []).length;
|
||||
lineCounter += n;
|
||||
startOffset = null;
|
||||
}
|
||||
|
||||
function onclose(name) {
|
||||
if (name !== "script" || !inscript)
|
||||
return;
|
||||
|
||||
inscript = false;
|
||||
index = parser.startIndex;
|
||||
startOffset = null;
|
||||
}
|
||||
|
||||
function ontext(data) {
|
||||
if (!inscript)
|
||||
return;
|
||||
|
||||
var lines = data.split(/\r\n|\n|\r/);
|
||||
|
||||
if (!startOffset) {
|
||||
lines.some(function(line) {
|
||||
if (!line) return;
|
||||
startOffset = /^(\s*)/.exec(line)[1];
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// check for startOffset again to remove leading white space from first line
|
||||
lines.forEach(function() {
|
||||
lineCounter += 1;
|
||||
if (startOffset) {
|
||||
offsets[lineCounter] = startOffset.length;
|
||||
} else {
|
||||
offsets[lineCounter] = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var parser = new htmlparser.Parser({ onopentag: onopen, onclosetag: onclose, ontext: ontext });
|
||||
parser.parseComplete(code);
|
||||
return offsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively gather all files that need to be linted,
|
||||
* excluding those that user asked to ignore.
|
||||
*
|
||||
* @param {string} fp a path to a file or directory to lint
|
||||
* @param {array} files a pointer to an array that stores a list of files
|
||||
* @param {array} ignores a list of patterns for files to ignore
|
||||
* @param {array} ext a list of non-dot-js extensions to lint
|
||||
*/
|
||||
function collect(fp, files, ignores, ext) {
|
||||
if (ignores && isIgnored(fp, ignores)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!shjs.test("-e", fp)) {
|
||||
cli.error("Can't open " + fp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shjs.test("-d", fp)) {
|
||||
shjs.ls(fp).forEach(function(item) {
|
||||
var itempath = path.join(fp, item);
|
||||
if (shjs.test("-d", itempath) || item.match(ext)) {
|
||||
collect(itempath, files, ignores, ext);
|
||||
}
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
files.push(fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs JSHint against provided file and saves the result
|
||||
*
|
||||
* @param {string} code code that needs to be linted
|
||||
* @param {object} results a pointer to an object with results
|
||||
* @param {object} config an object with JSHint configuration
|
||||
* @param {object} data a pointer to an object with extra data
|
||||
* @param {string} file (optional) file name that is being linted
|
||||
*/
|
||||
function lint(code, results, config, data, file) {
|
||||
var globals;
|
||||
var lintData;
|
||||
var buffer = [];
|
||||
|
||||
config = config || {};
|
||||
config = JSON.parse(JSON.stringify(config));
|
||||
|
||||
if (config.prereq) {
|
||||
config.prereq.forEach(function(fp) {
|
||||
fp = path.join(config.dirname, fp);
|
||||
if (shjs.test("-e", fp))
|
||||
buffer.push(shjs.cat(fp));
|
||||
});
|
||||
delete config.prereq;
|
||||
}
|
||||
|
||||
if (config.globals) {
|
||||
globals = config.globals;
|
||||
delete config.globals;
|
||||
}
|
||||
|
||||
if (config.overrides) {
|
||||
if (file) {
|
||||
_.each(config.overrides, function(options, pattern) {
|
||||
if (minimatch(path.normalize(file), pattern, { nocase: true, matchBase: true })) {
|
||||
if (options.globals) {
|
||||
globals = _.extend(globals || {}, options.globals);
|
||||
delete options.globals;
|
||||
}
|
||||
_.extend(config, options);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
delete config.overrides;
|
||||
}
|
||||
|
||||
delete config.dirname;
|
||||
|
||||
buffer.push(code);
|
||||
buffer = buffer.join("\n");
|
||||
buffer = buffer.replace(/^\uFEFF/, ""); // Remove potential Unicode BOM.
|
||||
|
||||
if (!JSHINT(buffer, config, globals)) {
|
||||
JSHINT.errors.forEach(function(err) {
|
||||
if (err) {
|
||||
results.push({ file: file || "stdin", error: err });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
lintData = JSHINT.data();
|
||||
|
||||
if (lintData) {
|
||||
lintData.file = file || "stdin";
|
||||
data.push(lintData);
|
||||
}
|
||||
}
|
||||
|
||||
var exports = {
|
||||
extract: extract,
|
||||
exit: exit,
|
||||
|
||||
/**
|
||||
* Returns a configuration file or nothing, if it can't be found.
|
||||
*/
|
||||
getConfig: function(fp) {
|
||||
return loadNpmConfig(fp) || exports.loadConfig(findConfig(fp));
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads and parses a configuration file.
|
||||
*
|
||||
* @param {string} fp a path to the config file
|
||||
* @returns {object} config object
|
||||
*/
|
||||
loadConfig: function(fp) {
|
||||
if (!fp) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!shjs.test("-e", fp)) {
|
||||
cli.error("Can't find config file: " + fp);
|
||||
exports.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
var config = JSON.parse(stripJsonComments(shjs.cat(fp)));
|
||||
config.dirname = path.dirname(fp);
|
||||
|
||||
if (config['extends']) {
|
||||
var baseConfig = exports.loadConfig(path.resolve(config.dirname, config['extends']));
|
||||
config = _.merge({}, baseConfig, config, function(a, b) {
|
||||
if (_.isArray(a)) {
|
||||
return a.concat(b);
|
||||
}
|
||||
});
|
||||
delete config['extends'];
|
||||
}
|
||||
|
||||
return config;
|
||||
} catch (err) {
|
||||
cli.error("Can't parse config file: " + fp + "\nError:" + err);
|
||||
exports.exit(1);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Gathers all files that need to be linted
|
||||
*
|
||||
* @param {object} post-processed options from 'interpret':
|
||||
* args - CLI arguments
|
||||
* ignores - A list of files/dirs to ignore (defaults to .jshintignores)
|
||||
* extensions - A list of non-dot-js extensions to check
|
||||
*/
|
||||
gather: function(opts) {
|
||||
var files = [];
|
||||
|
||||
var reg = new RegExp("\\.(js" +
|
||||
(!opts.extensions ? "" : "|" +
|
||||
opts.extensions.replace(/,/g, "|").replace(/[\. ]/g, "")) + ")$");
|
||||
|
||||
var ignores = !opts.ignores ? loadIgnores({ cwd: opts.cwd }) :
|
||||
opts.ignores.map(function(target) {
|
||||
return path.resolve(target);
|
||||
});
|
||||
|
||||
opts.args.forEach(function(target) {
|
||||
collect(target, files, ignores, reg);
|
||||
});
|
||||
|
||||
return files;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gathers all files that need to be linted, lints them, sends them to
|
||||
* a reporter and returns the overall result.
|
||||
*
|
||||
* @param {object} post-processed options from 'interpret':
|
||||
* args - CLI arguments
|
||||
* config - Configuration object
|
||||
* reporter - Reporter function
|
||||
* ignores - A list of files/dirs to ignore
|
||||
* extensions - A list of non-dot-js extensions to check
|
||||
* @param {function} cb a callback to call when function is finished
|
||||
* asynchronously.
|
||||
*
|
||||
* @returns {bool} 'true' if all files passed, 'false' otherwise and 'null'
|
||||
* when function will be finished asynchronously.
|
||||
*/
|
||||
run: function(opts, cb) {
|
||||
var files = exports.gather(opts);
|
||||
var results = [];
|
||||
var data = [];
|
||||
|
||||
function mergeCLIPrereq(config) {
|
||||
if (opts.prereq) {
|
||||
config.prereq = (config.prereq || []).concat(opts.prereq.split(/\s*,\s*/));
|
||||
}
|
||||
}
|
||||
|
||||
var filename;
|
||||
|
||||
// There is an if(filename) check in the lint() function called below.
|
||||
// passing a filename of undefined is the same as calling the function
|
||||
// without a filename. If there is no opts.filename, filename remains
|
||||
// undefined and lint() is effectively called with 4 parameters.
|
||||
if (opts.filename) {
|
||||
filename = path.resolve(opts.filename);
|
||||
}
|
||||
if (opts.useStdin && opts.ignores.indexOf(filename) === -1) {
|
||||
cli.withStdin(function(code) {
|
||||
var config = opts.config;
|
||||
|
||||
if (filename && !config) {
|
||||
config = exports.getConfig(filename);
|
||||
}
|
||||
|
||||
config = config || {};
|
||||
|
||||
mergeCLIPrereq(config);
|
||||
|
||||
lint(extract(code, opts.extract), results, config, data, filename);
|
||||
(opts.reporter || defReporter)(results, data, { verbose: opts.verbose });
|
||||
cb(results.length === 0);
|
||||
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
files.forEach(function(file) {
|
||||
var config = opts.config || exports.getConfig(file);
|
||||
var code;
|
||||
var errors = [];
|
||||
|
||||
try {
|
||||
code = shjs.cat(file);
|
||||
} catch (err) {
|
||||
cli.error("Can't open " + file);
|
||||
exports.exit(1);
|
||||
}
|
||||
|
||||
mergeCLIPrereq(config);
|
||||
|
||||
lint(extract(code, opts.extract), errors, config, data, file);
|
||||
|
||||
if (errors.length) {
|
||||
var offsets = extractOffsets(code, opts.extract);
|
||||
if (offsets && offsets.length) {
|
||||
errors.forEach(function(errorInfo) {
|
||||
var line = errorInfo.error.line;
|
||||
if (line >= 0 && line < offsets.length && offsets[line]) {
|
||||
errorInfo.error.character += offsets[line];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
results = results.concat(errors);
|
||||
}
|
||||
});
|
||||
|
||||
(opts.reporter || defReporter)(results, data, { verbose: opts.verbose });
|
||||
return results.length === 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper exposed for testing.
|
||||
* Used to determine is stdout has any buffered output before exiting the program
|
||||
*/
|
||||
getBufferSize: function() {
|
||||
return process.stdout.bufferSize;
|
||||
},
|
||||
|
||||
/**
|
||||
* Main entrance function. Parses arguments and calls 'run' when
|
||||
* its done. This function is called from bin/jshint file.
|
||||
*
|
||||
* @param {object} args, arguments in the process.argv format.
|
||||
*/
|
||||
interpret: function(args) {
|
||||
cli.setArgv(args);
|
||||
cli.options = {};
|
||||
|
||||
cli.enable("version", "glob", "help");
|
||||
cli.setApp(path.resolve(__dirname + "/../package.json"));
|
||||
|
||||
var options = cli.parse(OPTIONS);
|
||||
// Use config file if specified
|
||||
var config;
|
||||
if (options.config) {
|
||||
config = exports.loadConfig(options.config);
|
||||
}
|
||||
|
||||
switch (true) {
|
||||
// JSLint reporter
|
||||
case options.reporter === "jslint":
|
||||
case options["jslint-reporter"]:
|
||||
options.reporter = "./reporters/jslint_xml.js";
|
||||
break;
|
||||
|
||||
// CheckStyle (XML) reporter
|
||||
case options.reporter === "checkstyle":
|
||||
case options["checkstyle-reporter"]:
|
||||
options.reporter = "./reporters/checkstyle.js";
|
||||
break;
|
||||
|
||||
// Unix reporter
|
||||
case options.reporter === "unix":
|
||||
options.reporter = "./reporters/unix.js";
|
||||
break;
|
||||
|
||||
// Reporter that displays additional JSHint data
|
||||
case options["show-non-errors"]:
|
||||
options.reporter = "./reporters/non_error.js";
|
||||
break;
|
||||
|
||||
// Custom reporter
|
||||
case options.reporter !== undefined:
|
||||
options.reporter = path.resolve(process.cwd(), options.reporter);
|
||||
}
|
||||
|
||||
var reporter;
|
||||
if (options.reporter) {
|
||||
reporter = loadReporter(options.reporter);
|
||||
|
||||
if (reporter === null) {
|
||||
cli.error("Can't load reporter file: " + options.reporter);
|
||||
exports.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// This is a hack. exports.run is both sync and async function
|
||||
// because I needed stdin support (and cli.withStdin is async)
|
||||
// and was too lazy to change tests.
|
||||
|
||||
function done(passed) {
|
||||
/*jshint eqnull:true */
|
||||
|
||||
if (passed == null)
|
||||
return;
|
||||
|
||||
exports.exit(passed ? 0 : 2);
|
||||
}
|
||||
|
||||
done(exports.run({
|
||||
args: cli.args,
|
||||
config: config,
|
||||
reporter: reporter,
|
||||
ignores: loadIgnores({ exclude: options.exclude, excludePath: options["exclude-path"] }),
|
||||
extensions: options["extra-ext"],
|
||||
verbose: options.verbose,
|
||||
extract: options.extract,
|
||||
filename: options.filename,
|
||||
prereq: options.prereq,
|
||||
useStdin: { "-": true, "/dev/stdin": true }[args[args.length - 1]]
|
||||
}, done));
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = exports;
|
6624
project3/node_modules/jshint/src/jshint.js
generated
vendored
Normal file
6624
project3/node_modules/jshint/src/jshint.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2208
project3/node_modules/jshint/src/lex.js
generated
vendored
Normal file
2208
project3/node_modules/jshint/src/lex.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
266
project3/node_modules/jshint/src/messages.js
generated
vendored
Normal file
266
project3/node_modules/jshint/src/messages.js
generated
vendored
Normal file
@@ -0,0 +1,266 @@
|
||||
"use strict";
|
||||
|
||||
var _ = require("lodash");
|
||||
|
||||
var errors = {
|
||||
// JSHint options
|
||||
E001: "Bad {a}option: '{b}'.",
|
||||
E002: "Bad option value.",
|
||||
|
||||
// JSHint input
|
||||
E003: "Expected a JSON value.",
|
||||
E004: "Input is neither a string nor an array of strings.",
|
||||
E005: "Input is empty.",
|
||||
E006: "Unexpected early end of program.",
|
||||
|
||||
// Strict mode
|
||||
E007: "Missing \"use strict\" statement.",
|
||||
E008: "Strict violation.",
|
||||
E009: "Option 'validthis' can't be used in a global scope.",
|
||||
E010: "'with' is not allowed in strict mode.",
|
||||
|
||||
// Constants
|
||||
E011: "'{a}' has already been declared.",
|
||||
E012: "const '{a}' is initialized to 'undefined'.",
|
||||
E013: "Attempting to override '{a}' which is a constant.",
|
||||
|
||||
// Regular expressions
|
||||
E014: "A regular expression literal can be confused with '/='.",
|
||||
E015: "Unclosed regular expression.",
|
||||
E016: "Invalid regular expression.",
|
||||
|
||||
// Tokens
|
||||
E017: "Unclosed comment.",
|
||||
E018: "Unbegun comment.",
|
||||
E019: "Unmatched '{a}'.",
|
||||
E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.",
|
||||
E021: "Expected '{a}' and instead saw '{b}'.",
|
||||
E022: "Line breaking error '{a}'.",
|
||||
E023: "Missing '{a}'.",
|
||||
E024: "Unexpected '{a}'.",
|
||||
E025: "Missing ':' on a case clause.",
|
||||
E026: "Missing '}' to match '{' from line {a}.",
|
||||
E027: "Missing ']' to match '[' from line {a}.",
|
||||
E028: "Illegal comma.",
|
||||
E029: "Unclosed string.",
|
||||
|
||||
// Everything else
|
||||
E030: "Expected an identifier and instead saw '{a}'.",
|
||||
E031: "Bad assignment.", // FIXME: Rephrase
|
||||
E032: "Expected a small integer or 'false' and instead saw '{a}'.",
|
||||
E033: "Expected an operator and instead saw '{a}'.",
|
||||
E034: "get/set are ES5 features.",
|
||||
E035: "Missing property name.",
|
||||
E036: "Expected to see a statement and instead saw a block.",
|
||||
E037: null,
|
||||
E038: null,
|
||||
E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.",
|
||||
E040: "Each value should have its own case label.",
|
||||
E041: "Unrecoverable syntax error.",
|
||||
E042: "Stopping.",
|
||||
E043: "Too many errors.",
|
||||
E044: null,
|
||||
E045: "Invalid for each loop.",
|
||||
E046: "Yield expressions may only occur within generator functions.",
|
||||
E047: null,
|
||||
E048: "{a} declaration not directly within block.",
|
||||
E049: "A {a} cannot be named '{b}'.",
|
||||
E050: "Mozilla requires the yield expression to be parenthesized here.",
|
||||
E051: null,
|
||||
E052: "Unclosed template literal.",
|
||||
E053: "{a} declarations are only allowed at the top level of module scope.",
|
||||
E054: "Class properties must be methods. Expected '(' but instead saw '{a}'.",
|
||||
E055: "The '{a}' option cannot be set after any executable code.",
|
||||
E056: "'{a}' was used before it was declared, which is illegal for '{b}' variables.",
|
||||
E057: "Invalid meta property: '{a}.{b}'.",
|
||||
E058: "Missing semicolon.",
|
||||
E059: "Incompatible values for the '{a}' and '{b}' linting options.",
|
||||
E060: "Non-callable values cannot be used as the second operand to instanceof.",
|
||||
E061: "Invalid position for 'yield' expression (consider wrapping in parenthesis).",
|
||||
E062: "Rest parameter does not a support default value.",
|
||||
E063: "Super property may only be used within method bodies.",
|
||||
E064: "Super call may only be used within class method bodies.",
|
||||
E065: "Functions defined outside of strict mode with non-simple parameter lists may not " +
|
||||
"enable strict mode.",
|
||||
E066: "Asynchronous iteration is only available with for-of loops."
|
||||
};
|
||||
|
||||
var warnings = {
|
||||
W001: "'hasOwnProperty' is a really bad name.",
|
||||
W002: "Value of '{a}' may be overwritten in IE 8 and earlier.",
|
||||
W003: "'{a}' was used before it was defined.",
|
||||
W004: "'{a}' is already defined.",
|
||||
W005: "A dot following a number can be confused with a decimal point.",
|
||||
W006: "Confusing minuses.",
|
||||
W007: "Confusing plusses.",
|
||||
W008: "A leading decimal point can be confused with a dot: '{a}'.",
|
||||
W009: "The array literal notation [] is preferable.",
|
||||
W010: "The object literal notation {} is preferable.",
|
||||
W011: null,
|
||||
W012: null,
|
||||
W013: null,
|
||||
W014: "Misleading line break before '{a}'; readers may interpret this as an expression boundary.",
|
||||
W015: null,
|
||||
W016: "Unexpected use of '{a}'.",
|
||||
W017: "Bad operand.",
|
||||
W018: "Confusing use of '{a}'.",
|
||||
W019: "Use the isNaN function to compare with NaN.",
|
||||
W020: "Read only.",
|
||||
W021: "Reassignment of '{a}', which is a {b}. " +
|
||||
"Use 'var' or 'let' to declare bindings that may change.",
|
||||
W022: "Do not assign to the exception parameter.",
|
||||
W023: null,
|
||||
W024: "Expected an identifier and instead saw '{a}' (a reserved word).",
|
||||
W025: "Missing name in function declaration.",
|
||||
W026: "Inner functions should be listed at the top of the outer function.",
|
||||
W027: "Unreachable '{a}' after '{b}'.",
|
||||
W028: "Label '{a}' on {b} statement.",
|
||||
W030: "Expected an assignment or function call and instead saw an expression.",
|
||||
W031: "Do not use 'new' for side effects.",
|
||||
W032: "Unnecessary semicolon.",
|
||||
W033: "Missing semicolon.",
|
||||
W034: "Unnecessary directive \"{a}\".",
|
||||
W035: "Empty block.",
|
||||
W036: "Unexpected /*member '{a}'.",
|
||||
W037: "'{a}' is a statement label.",
|
||||
W038: "'{a}' used out of scope.",
|
||||
W039: null,
|
||||
W040: "If a strict mode function is executed using function invocation, " +
|
||||
"its 'this' value will be undefined.",
|
||||
W041: null,
|
||||
W042: "Avoid EOL escaping.",
|
||||
W043: "Bad escaping of EOL. Use option multistr if needed.",
|
||||
W044: "Bad or unnecessary escaping.", /* TODO(caitp): remove W044 */
|
||||
W045: "Bad number '{a}'.",
|
||||
W046: "Don't use extra leading zeros '{a}'.",
|
||||
W047: "A trailing decimal point can be confused with a dot: '{a}'.",
|
||||
W048: "Unexpected control character in regular expression.",
|
||||
W049: "Unexpected escaped character '{a}' in regular expression.",
|
||||
W050: "JavaScript URL.",
|
||||
W051: "Variables should not be deleted.",
|
||||
W052: "Unexpected '{a}'.",
|
||||
W053: "Do not use {a} as a constructor.",
|
||||
W054: "The Function constructor is a form of eval.",
|
||||
W055: "A constructor name should start with an uppercase letter.",
|
||||
W056: "Bad constructor.",
|
||||
W057: "Weird construction. Is 'new' necessary?",
|
||||
W058: "Missing '()' invoking a constructor.",
|
||||
W059: "Avoid arguments.{a}.",
|
||||
W060: "document.write can be a form of eval.",
|
||||
W061: "eval can be harmful.",
|
||||
W062: "Wrap an immediate function invocation in parens " +
|
||||
"to assist the reader in understanding that the expression " +
|
||||
"is the result of a function, and not the function itself.",
|
||||
W063: "Math is not a function.",
|
||||
W064: "Missing 'new' prefix when invoking a constructor.",
|
||||
W065: "Missing radix parameter.",
|
||||
W066: "Implied eval. Consider passing a function instead of a string.",
|
||||
W067: "Bad invocation.",
|
||||
W068: "Wrapping non-IIFE function literals in parens is unnecessary.",
|
||||
W069: "['{a}'] is better written in dot notation.",
|
||||
W070: "Extra comma. (it breaks older versions of IE)",
|
||||
W071: "This function has too many statements. ({a})",
|
||||
W072: "This function has too many parameters. ({a})",
|
||||
W073: "Blocks are nested too deeply. ({a})",
|
||||
W074: "This function's cyclomatic complexity is too high. ({a})",
|
||||
W075: "Duplicate {a} '{b}'.",
|
||||
W076: "Unexpected parameter '{a}' in get {b} function.",
|
||||
W077: "Expected a single parameter in set {a} function.",
|
||||
W078: "Setter is defined without getter.",
|
||||
W079: "Redefinition of '{a}'.",
|
||||
W080: "It's not necessary to initialize '{a}' to 'undefined'.",
|
||||
W081: null,
|
||||
W082: "Function declarations should not be placed in blocks. " +
|
||||
"Use a function expression or move the statement to the top of " +
|
||||
"the outer function.",
|
||||
W083: "Functions declared within loops referencing an outer scoped " +
|
||||
"variable may lead to confusing semantics. ({a})",
|
||||
W084: "Expected a conditional expression and instead saw an assignment.",
|
||||
W085: "Don't use 'with'.",
|
||||
W086: "Expected a 'break' statement before '{a}'.",
|
||||
W087: "Forgotten 'debugger' statement?",
|
||||
W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.",
|
||||
W089: "The body of a for in should be wrapped in an if statement to filter " +
|
||||
"unwanted properties from the prototype.",
|
||||
W090: "'{a}' is not a statement label.",
|
||||
W091: null,
|
||||
W093: "Did you mean to return a conditional instead of an assignment?",
|
||||
W094: "Unexpected comma.",
|
||||
W095: "Expected a string and instead saw {a}.",
|
||||
W096: "The '{a}' key may produce unexpected results.",
|
||||
W097: "Use the function form of \"use strict\".",
|
||||
W098: "'{a}' is defined but never used.",
|
||||
W099: null,
|
||||
W100: null,
|
||||
W101: "Line is too long.",
|
||||
W102: null,
|
||||
W103: "The '{a}' property is deprecated.",
|
||||
W104: "'{a}' is available in ES{b} (use 'esversion: {b}') or Mozilla JS extensions (use moz).",
|
||||
W105: null,
|
||||
W106: "Identifier '{a}' is not in camel case.",
|
||||
W107: "Script URL.",
|
||||
W108: "Strings must use doublequote.",
|
||||
W109: "Strings must use singlequote.",
|
||||
W110: "Mixed double and single quotes.",
|
||||
W112: "Unclosed string.",
|
||||
W113: "Control character in string: {a}.",
|
||||
W114: "Avoid {a}.",
|
||||
W115: "Octal literals are not allowed in strict mode.",
|
||||
W116: "Expected '{a}' and instead saw '{b}'.",
|
||||
W117: "'{a}' is not defined.",
|
||||
W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).",
|
||||
W119: "'{a}' is only available in ES{b} (use 'esversion: {b}').",
|
||||
W120: "You might be leaking a variable ({a}) here.",
|
||||
W121: "Extending prototype of native object: '{a}'.",
|
||||
W122: "Invalid typeof value '{a}'",
|
||||
W123: "'{a}' is already defined in outer scope.",
|
||||
W124: "A generator function should contain at least one yield expression.",
|
||||
W125: "This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp",
|
||||
W126: "Unnecessary grouping operator.",
|
||||
W127: "Unexpected use of a comma operator.",
|
||||
W128: "Empty array elements require elision=true.",
|
||||
W129: "'{a}' is defined in a future version of JavaScript. Use a " +
|
||||
"different variable name to avoid migration issues.",
|
||||
W130: "Invalid element after rest element.",
|
||||
W131: "Invalid parameter after rest parameter.",
|
||||
W132: "`var` declarations are forbidden. Use `let` or `const` instead.",
|
||||
W133: "Invalid for-{a} loop left-hand-side: {b}.",
|
||||
W134: "The '{a}' option is only available when linting ECMAScript {b} code.",
|
||||
W135: "{a} may not be supported by non-browser environments.",
|
||||
W136: "'{a}' must be in function scope.",
|
||||
W137: "Empty destructuring: this is unnecessary and can be removed.",
|
||||
W138: "Regular parameters should not come after default parameters.",
|
||||
W139: "Function expressions should not be used as the second operand to instanceof.",
|
||||
W140: "Missing comma.",
|
||||
W141: "Empty {a}: this is unnecessary and can be removed.",
|
||||
W142: "Empty {a}: consider replacing with `import '{b}';`.",
|
||||
W143: "Assignment to properties of a mapped arguments object may cause " +
|
||||
"unexpected changes to formal parameters.",
|
||||
W144: "'{a}' is a non-standard language feature. Enable it using the '{b}' unstable option.",
|
||||
W145: "Superfluous 'case' clause.",
|
||||
W146: "Unnecessary `await` expression.",
|
||||
W147: "Regular expressions should include the 'u' flag.",
|
||||
W148: "Unnecessary RegExp 's' flag."
|
||||
};
|
||||
|
||||
var info = {
|
||||
I001: "Comma warnings can be turned off with 'laxcomma'.",
|
||||
I002: null,
|
||||
I003: "ES5 option is now set per default"
|
||||
};
|
||||
|
||||
exports.errors = {};
|
||||
exports.warnings = {};
|
||||
exports.info = {};
|
||||
|
||||
_.each(errors, function(desc, code) {
|
||||
exports.errors[code] = { code: code, desc: desc };
|
||||
});
|
||||
|
||||
_.each(warnings, function(desc, code) {
|
||||
exports.warnings[code] = { code: code, desc: desc };
|
||||
});
|
||||
|
||||
_.each(info, function(desc, code) {
|
||||
exports.info[code] = { code: code, desc: desc };
|
||||
});
|
94
project3/node_modules/jshint/src/name-stack.js
generated
vendored
Normal file
94
project3/node_modules/jshint/src/name-stack.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* The NameStack class is used to approximate function name inference as
|
||||
* introduced by ECMAScript 2015. In that edition, the `name` property of
|
||||
* function objects is set according to the function's syntactic form. For
|
||||
* certain forms, this value depends on values available to the runtime during
|
||||
* execution. For example:
|
||||
*
|
||||
* var fnName = function() {};
|
||||
*
|
||||
* In the program code above, the function object's `name` property is set to
|
||||
* `"fnName"` during execution.
|
||||
*
|
||||
* This general "name inference" behavior extends to a number of additional
|
||||
* syntactic forms, not all of which can be implemented statically. `NameStack`
|
||||
* is a support class representing a "best-effort" attempt to implement the
|
||||
* specified behavior in cases where this may be done statically.
|
||||
*
|
||||
* For more information on this behavior, see the following blog post:
|
||||
* https://bocoup.com/blog/whats-in-a-function-name
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
function NameStack() {
|
||||
this._stack = [];
|
||||
}
|
||||
|
||||
Object.defineProperty(NameStack.prototype, "length", {
|
||||
get: function() {
|
||||
return this._stack.length;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Create a new entry in the stack. Useful for tracking names across
|
||||
* expressions.
|
||||
*/
|
||||
NameStack.prototype.push = function() {
|
||||
this._stack.push(null);
|
||||
};
|
||||
|
||||
/**
|
||||
* Discard the most recently-created name on the stack.
|
||||
*/
|
||||
NameStack.prototype.pop = function() {
|
||||
this._stack.pop();
|
||||
};
|
||||
|
||||
/**
|
||||
* Update the most recent name on the top of the stack.
|
||||
*
|
||||
* @param {object} token The token to consider as the source for the most
|
||||
* recent name.
|
||||
*/
|
||||
NameStack.prototype.set = function(token) {
|
||||
this._stack[this.length - 1] = token;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generate a string representation of the most recent name.
|
||||
*
|
||||
* @returns {string}
|
||||
*/
|
||||
NameStack.prototype.infer = function() {
|
||||
var nameToken = this._stack[this.length - 1];
|
||||
var prefix = "";
|
||||
var type;
|
||||
|
||||
// During expected operation, the topmost entry on the stack will only
|
||||
// reflect the current function's name when the function is declared without
|
||||
// the `function` keyword (i.e. for in-line accessor methods). In other
|
||||
// cases, the `function` expression itself will introduce an empty entry on
|
||||
// the top of the stack, and this should be ignored.
|
||||
if (!nameToken || nameToken.type === "class") {
|
||||
nameToken = this._stack[this.length - 2];
|
||||
}
|
||||
|
||||
if (!nameToken) {
|
||||
return "(empty)";
|
||||
}
|
||||
|
||||
type = nameToken.type;
|
||||
|
||||
if (type !== "(string)" && type !== "(number)" && type !== "(identifier)" && type !== "default") {
|
||||
return "(expression)";
|
||||
}
|
||||
|
||||
if (nameToken.accessorType) {
|
||||
prefix = nameToken.accessorType + " ";
|
||||
}
|
||||
|
||||
return prefix + nameToken.value;
|
||||
};
|
||||
|
||||
module.exports = NameStack;
|
1126
project3/node_modules/jshint/src/options.js
generated
vendored
Normal file
1126
project3/node_modules/jshint/src/options.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
115
project3/node_modules/jshint/src/platforms/rhino.js
generated
vendored
Normal file
115
project3/node_modules/jshint/src/platforms/rhino.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
/*jshint boss: true, rhino: true, unused: true, undef: true, quotmark: double */
|
||||
/*global JSHINT, readFully */
|
||||
|
||||
(function(args) {
|
||||
"use strict";
|
||||
|
||||
var filenames = [];
|
||||
var flags = {};
|
||||
var opts = {};
|
||||
var globals = {};
|
||||
var retval = 0;
|
||||
var readf = (typeof readFully === "function" ? readFully : readFile);
|
||||
|
||||
var optstr; // arg1=val1,arg2=val2,...
|
||||
var predef; // global1=true,global2,global3,...
|
||||
|
||||
args.forEach(function(arg) {
|
||||
if (arg.indexOf("--") === 0) {
|
||||
// Configuration Flags might be boolean or will be split into name and value
|
||||
if (arg.indexOf("=") > -1) {
|
||||
var o = arg.split("=");
|
||||
flags[o[0].slice(2)] = o[1];
|
||||
} else {
|
||||
flags[arg.slice(2)] = true;
|
||||
}
|
||||
|
||||
return;
|
||||
} else if (arg.indexOf("=") > -1) {
|
||||
// usual rhino configuration, like "boss=true,browser=true"
|
||||
if (!optstr) {
|
||||
// First time it's the options.
|
||||
optstr = arg;
|
||||
} else {
|
||||
predef = arg;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (optstr) {
|
||||
predef = arg;
|
||||
return;
|
||||
}
|
||||
|
||||
filenames.push(arg);
|
||||
});
|
||||
|
||||
if (filenames.length === 0) {
|
||||
print("Usage: jshint.js file.js");
|
||||
quit(1);
|
||||
}
|
||||
|
||||
// If a config flag has been provided, try and load that
|
||||
if ("config" in flags) {
|
||||
var cfgFileContent;
|
||||
try {
|
||||
cfgFileContent = readf(flags.config);
|
||||
} catch (e) {
|
||||
print("Could not read config file " + flags.config);
|
||||
quit(1);
|
||||
}
|
||||
|
||||
opts = JSON.parse(cfgFileContent);
|
||||
}
|
||||
|
||||
if (optstr) {
|
||||
optstr.split(",").forEach(function(arg) {
|
||||
var o = arg.split("=");
|
||||
if (o[0] === "indent") {
|
||||
opts[o[0]] = parseInt(o[1], 10);
|
||||
} else {
|
||||
opts[o[0]] = (function(ov) {
|
||||
switch (ov) {
|
||||
case "true":
|
||||
return true;
|
||||
case "false":
|
||||
return false;
|
||||
default:
|
||||
return ov;
|
||||
}
|
||||
}(o[1]));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
globals = opts.globals || {};
|
||||
delete(opts.globals);
|
||||
|
||||
if (predef) {
|
||||
predef.split(",").forEach(function(arg) {
|
||||
var global = arg.split("=");
|
||||
globals[global[0]] = global[1] === "true" ? true : false;
|
||||
});
|
||||
}
|
||||
|
||||
filenames.forEach(function(name) {
|
||||
var input = readf(name);
|
||||
|
||||
if (!input) {
|
||||
print("jshint: Couldn't open file " + name);
|
||||
quit(1);
|
||||
}
|
||||
|
||||
if (!JSHINT(input, opts, globals)) {
|
||||
for (var i = 0, err; err = JSHINT.errors[i]; i += 1) {
|
||||
print(err.reason + " (" + name + ":" + err.line + ":" + err.character + ")");
|
||||
print("> " + (err.evidence || "").replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
|
||||
print("");
|
||||
}
|
||||
retval = 2;
|
||||
}
|
||||
});
|
||||
|
||||
quit(retval);
|
||||
}(arguments));
|
48
project3/node_modules/jshint/src/prod-params.js
generated
vendored
Normal file
48
project3/node_modules/jshint/src/prod-params.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* This module defines a set of enum-like values intended for use as bit
|
||||
* "flags" during parsing. The ECMAScript grammar defines a number of such
|
||||
* "production parameters" to control how certain forms are parsed in context.
|
||||
* JSHint implements additional parameters to facilitate detection of lint
|
||||
* warnings.
|
||||
*
|
||||
* An equivalent implementation which described the context in terms of a
|
||||
* "lookup table" object would be more idiomatic for a JavaScript project like
|
||||
* JSHint. However, because the number of contexts scales with the number of
|
||||
* expressions in the input program, this would have non-negligible impact on
|
||||
* the process's memory footprint.
|
||||
*/
|
||||
module.exports = {
|
||||
/**
|
||||
* Enabled when parsing expressions within ES2015 "export" declarations,
|
||||
* allowing otherwise-unreferenced bindings to be considered "used".
|
||||
*/
|
||||
export: 1,
|
||||
|
||||
/**
|
||||
* Enabled when parsing expressions within the head of `for` statements,
|
||||
* allowing to distinguish between `for-in` and "C-style" `for` statements.
|
||||
*/
|
||||
noin: 2,
|
||||
|
||||
/**
|
||||
* Enabled when the expression begins the statement, allowing the parser to
|
||||
* correctly select between the null denotation ("nud") and first null
|
||||
* denotation ("fud") parsing strategy.
|
||||
*/
|
||||
initial: 4,
|
||||
|
||||
preAsync: 8,
|
||||
|
||||
async: 16,
|
||||
|
||||
/**
|
||||
* Enabled when any exception thrown by the expression will be caught by a
|
||||
* TryStatement.
|
||||
*/
|
||||
tryClause: 32,
|
||||
|
||||
/**
|
||||
* Enabled when parsing the body of a generator function.
|
||||
*/
|
||||
yield: 64
|
||||
};
|
57
project3/node_modules/jshint/src/reg.js
generated
vendored
Normal file
57
project3/node_modules/jshint/src/reg.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Regular expressions. Some of these are stupidly long.
|
||||
*/
|
||||
|
||||
/*jshint maxlen:1000 */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Unsafe comment or string (ax)
|
||||
exports.unsafeString =
|
||||
/@cc|<\/?|script|\]\s*\]|<\s*!|</i;
|
||||
|
||||
// Characters in strings that need escaping (nx and nxg)
|
||||
exports.needEsc =
|
||||
/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/;
|
||||
|
||||
exports.needEscGlobal =
|
||||
/[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
||||
|
||||
// Star slash (lx)
|
||||
exports.starSlash = /\*\//;
|
||||
|
||||
// Identifier (ix)
|
||||
exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;
|
||||
|
||||
// JavaScript URL (jx)
|
||||
exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;
|
||||
|
||||
// Catches /* falls through */ comments (ft)
|
||||
exports.fallsThrough = /^\s*falls?\sthrough\s*$/;
|
||||
|
||||
// very conservative rule (eg: only one space between the start of the comment and the first character)
|
||||
// to relax the maxlen option
|
||||
exports.maxlenException = /^(?:(?:\/\/|\/\*|\*) ?)?[^ ]+$/;
|
||||
|
||||
// Node.js releases prior to version 8 include a version of the V8 engine which
|
||||
// incorrectly interprets the character class escape `\s`. The following
|
||||
// regular expression may be replaced with `/\s/` when JSHint removes support
|
||||
// for Node.js versions prior to 8.
|
||||
// Source:
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
|
||||
exports.whitespace = /[ \f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/;
|
||||
|
||||
exports.nonzeroDigit = /^[1-9]$/;
|
||||
|
||||
exports.decimalDigit = /^[0-9]$/;
|
||||
|
||||
exports.regexpSyntaxChars = /[\^$\\.*+?()[\]{}|]/;
|
||||
|
||||
exports.regexpQuantifiers = /[*+?{]/;
|
||||
|
||||
exports.regexpControlEscapes = /[fnrtv]/;
|
||||
|
||||
exports.regexpCharClasses = /[dDsSwW]/;
|
||||
|
||||
// Identifies the "dot" atom in regular expressions
|
||||
exports.regexpDot = /(^|[^\\])(\\\\)*\./;
|
94
project3/node_modules/jshint/src/reporters/checkstyle.js
generated
vendored
Normal file
94
project3/node_modules/jshint/src/reporters/checkstyle.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
// Author: Boy Baukema
|
||||
// http://github.com/relaxnow
|
||||
module.exports =
|
||||
{
|
||||
reporter: function(results, data, opts) {
|
||||
"use strict";
|
||||
|
||||
var files = {},
|
||||
out = [],
|
||||
pairs = {
|
||||
"&": "&",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
"<": "<",
|
||||
">": ">"
|
||||
},
|
||||
fileName, i, issue, errorMessage;
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
function encode(s) {
|
||||
for (var r in pairs) {
|
||||
if (typeof(s) !== "undefined") {
|
||||
s = s.replace(new RegExp(r, "g"), pairs[r]);
|
||||
}
|
||||
}
|
||||
return s || "";
|
||||
}
|
||||
|
||||
results.forEach(function(result) {
|
||||
// Register the file
|
||||
result.file = result.file.replace(/^\.\//, '');
|
||||
if (!files[result.file]) {
|
||||
files[result.file] = [];
|
||||
}
|
||||
|
||||
// Create the error message
|
||||
errorMessage = result.error.reason;
|
||||
if (opts.verbose) {
|
||||
errorMessage += ' (' + result.error.code + ')';
|
||||
}
|
||||
|
||||
var typeNo = result.error.code;
|
||||
var severity = '';
|
||||
switch (typeNo[0]) {
|
||||
case 'I':
|
||||
severity = 'info';
|
||||
break;
|
||||
case 'W':
|
||||
severity = 'warning';
|
||||
break;
|
||||
case 'E':
|
||||
severity = 'error';
|
||||
break;
|
||||
}
|
||||
|
||||
// Add the error
|
||||
files[result.file].push({
|
||||
severity: severity,
|
||||
line: result.error.line,
|
||||
column: result.error.character,
|
||||
message: errorMessage,
|
||||
source: 'jshint.' + result.error.code
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
out.push("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
out.push("<checkstyle version=\"4.3\">");
|
||||
|
||||
for (fileName in files) {
|
||||
if (files.hasOwnProperty(fileName)) {
|
||||
out.push("\t<file name=\"" + fileName + "\">");
|
||||
for (i = 0; i < files[fileName].length; i++) {
|
||||
issue = files[fileName][i];
|
||||
out.push(
|
||||
"\t\t<error " +
|
||||
"line=\"" + issue.line + "\" " +
|
||||
"column=\"" + issue.column + "\" " +
|
||||
"severity=\"" + issue.severity + "\" " +
|
||||
"message=\"" + encode(issue.message) + "\" " +
|
||||
"source=\"" + encode(issue.source) + "\" " +
|
||||
"/>"
|
||||
);
|
||||
}
|
||||
out.push("\t</file>");
|
||||
}
|
||||
}
|
||||
|
||||
out.push("</checkstyle>");
|
||||
|
||||
console.log(out.join("\n"));
|
||||
}
|
||||
};
|
34
project3/node_modules/jshint/src/reporters/default.js
generated
vendored
Normal file
34
project3/node_modules/jshint/src/reporters/default.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
reporter: function(results, data, opts) {
|
||||
var len = results.length;
|
||||
var str = '';
|
||||
var prevfile;
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
results.forEach(function(result) {
|
||||
var file = result.file;
|
||||
var error = result.error;
|
||||
|
||||
if (prevfile && prevfile !== file) {
|
||||
str += "\n";
|
||||
}
|
||||
prevfile = file;
|
||||
|
||||
str += file + ': line ' + error.line + ', col ' +
|
||||
error.character + ', ' + error.reason;
|
||||
|
||||
if (opts.verbose) {
|
||||
str += ' (' + error.code + ')';
|
||||
}
|
||||
|
||||
str += '\n';
|
||||
});
|
||||
|
||||
if (str) {
|
||||
console.log(str + "\n" + len + ' error' + ((len === 1) ? '' : 's'));
|
||||
}
|
||||
}
|
||||
};
|
56
project3/node_modules/jshint/src/reporters/jslint_xml.js
generated
vendored
Normal file
56
project3/node_modules/jshint/src/reporters/jslint_xml.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
module.exports =
|
||||
{
|
||||
reporter: function(results) {
|
||||
"use strict";
|
||||
|
||||
var files = {},
|
||||
out = [],
|
||||
pairs = {
|
||||
"&": "&",
|
||||
'"': """,
|
||||
"'": "'",
|
||||
"<": "<",
|
||||
">": ">"
|
||||
},
|
||||
file, i, issue;
|
||||
|
||||
function encode(s) {
|
||||
for (var r in pairs) {
|
||||
if (typeof(s) !== "undefined") {
|
||||
s = s.replace(new RegExp(r, "g"), pairs[r]);
|
||||
}
|
||||
}
|
||||
return s || "";
|
||||
}
|
||||
|
||||
|
||||
results.forEach(function(result) {
|
||||
result.file = result.file.replace(/^\.\//, '');
|
||||
if (!files[result.file]) {
|
||||
files[result.file] = [];
|
||||
}
|
||||
files[result.file].push(result.error);
|
||||
});
|
||||
|
||||
out.push("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
|
||||
out.push("<jslint>");
|
||||
|
||||
for (file in files) {
|
||||
out.push("\t<file name=\"" + file + "\">");
|
||||
for (i = 0; i < files[file].length; i++) {
|
||||
issue = files[file][i];
|
||||
out.push("\t\t<issue line=\"" + issue.line +
|
||||
"\" char=\"" + issue.character +
|
||||
"\" reason=\"" + encode(issue.reason) +
|
||||
"\" evidence=\"" + encode(issue.evidence) +
|
||||
(issue.code ? "\" severity=\"" + encode(issue.code.charAt(0)) : "") +
|
||||
"\" />");
|
||||
}
|
||||
out.push("\t</file>");
|
||||
}
|
||||
|
||||
out.push("</jslint>");
|
||||
|
||||
console.log(out.join("\n") + "\n");
|
||||
}
|
||||
};
|
52
project3/node_modules/jshint/src/reporters/non_error.js
generated
vendored
Normal file
52
project3/node_modules/jshint/src/reporters/non_error.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
reporter: function(results, data, opts) {
|
||||
var len = results.length,
|
||||
str = '',
|
||||
file, error, globals, unuseds;
|
||||
|
||||
results.forEach(function(result) {
|
||||
file = result.file;
|
||||
error = result.error;
|
||||
str += file + ': line ' + error.line + ', col ' +
|
||||
error.character + ', ' + error.reason;
|
||||
|
||||
// Add the error code if the --verbose option is set
|
||||
if (opts.verbose) {
|
||||
str += ' (' + error.code + ')';
|
||||
}
|
||||
|
||||
str += '\n';
|
||||
});
|
||||
|
||||
str += len > 0 ? ("\n" + len + ' error' + ((len === 1) ? '' : 's')) : "";
|
||||
|
||||
data.forEach(function(data) {
|
||||
file = data.file;
|
||||
globals = data.implieds;
|
||||
unuseds = data.unused;
|
||||
|
||||
if (globals || unuseds) {
|
||||
str += '\n\n' + file + ' :\n';
|
||||
}
|
||||
|
||||
if (globals) {
|
||||
str += '\tImplied globals:\n';
|
||||
globals.forEach(function(global) {
|
||||
str += '\t\t' + global.name + ': ' + global.line + '\n';
|
||||
});
|
||||
}
|
||||
if (unuseds) {
|
||||
str += '\tUnused Variables:\n\t\t';
|
||||
unuseds.forEach(function(unused) {
|
||||
str += unused.name + '(' + unused.line + '), ';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (str) {
|
||||
console.log(str + "\n");
|
||||
}
|
||||
}
|
||||
};
|
37
project3/node_modules/jshint/src/reporters/unix.js
generated
vendored
Normal file
37
project3/node_modules/jshint/src/reporters/unix.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
// Reporter that respects Unix output conventions
|
||||
// frequently employed by preprocessors and compilers.
|
||||
// The format is "FILENAME:LINE:COL: MESSAGE".
|
||||
|
||||
module.exports = {
|
||||
reporter: function(results, data, opts) {
|
||||
var len = results.length;
|
||||
var str = "";
|
||||
var prevfile;
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
results.forEach(function(result) {
|
||||
var file = result.file;
|
||||
var error = result.error;
|
||||
|
||||
if (prevfile && prevfile !== file) {
|
||||
str += "\n";
|
||||
}
|
||||
prevfile = file;
|
||||
|
||||
str += file + ":" + error.line + ":" + error.character + ": " + error.reason;
|
||||
|
||||
if (opts.verbose) {
|
||||
str += " (" + error.code + ")";
|
||||
}
|
||||
|
||||
str += "\n";
|
||||
});
|
||||
|
||||
if (str) {
|
||||
console.log(str + "\n" + len + " error" + ((len === 1) ? "" : "s"));
|
||||
}
|
||||
}
|
||||
};
|
1038
project3/node_modules/jshint/src/scope-manager.js
generated
vendored
Normal file
1038
project3/node_modules/jshint/src/scope-manager.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
192
project3/node_modules/jshint/src/state.js
generated
vendored
Normal file
192
project3/node_modules/jshint/src/state.js
generated
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
"use strict";
|
||||
var NameStack = require("./name-stack.js");
|
||||
|
||||
var state = {
|
||||
syntax: {},
|
||||
|
||||
/**
|
||||
* Determine if the code currently being linted is strict mode code.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isStrict: function() {
|
||||
return this.directive["use strict"] || this.inClassBody ||
|
||||
this.option.module || this.option.strict === "implied";
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if the current state warrants a warning for statements outside
|
||||
* of strict mode code.
|
||||
*
|
||||
* While emitting warnings based on function scope would be more intuitive
|
||||
* (and less noisy), JSHint observes statement-based semantics in order to
|
||||
* preserve legacy behavior.
|
||||
*
|
||||
* This method does not take the state of the parser into account, making no
|
||||
* distinction between global code and function code. Because the "missing
|
||||
* 'use strict'" warning is *also* reported at function boundaries, this
|
||||
* function interprets `strict` option values `true` and `undefined` as
|
||||
* equivalent.
|
||||
*/
|
||||
stmtMissingStrict: function() {
|
||||
if (this.option.strict === "global") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.option.strict === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.option.globalstrict) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
allowsGlobalUsd: function() {
|
||||
return this.option.strict === "global" || this.option.globalstrict ||
|
||||
this.option.module || this.impliedClosure();
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if the current configuration describes an environment that is
|
||||
* wrapped in an immediately-invoked function expression prior to evaluation.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
impliedClosure: function() {
|
||||
return this.option.node || this.option.phantom || this.option.browserify;
|
||||
},
|
||||
|
||||
// Assumption: chronologically ES3 < ES5 < ES6 < Moz
|
||||
|
||||
inMoz: function() {
|
||||
return this.option.moz;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 10 should be accepted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES10: function() {
|
||||
return this.esVersion >= 10;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 9 should be accepted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES9: function() {
|
||||
return this.esVersion >= 9;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 8 should be accepted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES8: function() {
|
||||
return this.esVersion >= 8;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 7 should be accepted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES7: function() {
|
||||
return this.esVersion >= 7;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 6 should be accepted.
|
||||
*
|
||||
* @param {boolean} strict - When `true`, do not interpret the `moz` option
|
||||
* as ECMAScript 6
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES6: function(strict) {
|
||||
if (!strict && this.option.moz) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return this.esVersion >= 6;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine if constructs introduced in ECMAScript 5 should be accepted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
inES5: function() {
|
||||
return !this.esVersion || this.esVersion >= 5 || this.option.moz;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determine the current version of the input language by inspecting the
|
||||
* value of all ECMAScript-version-related options. This logic is necessary
|
||||
* to ensure compatibility with deprecated options `es3`, `es5`, and
|
||||
* `esnext`, and it may be drastically simplified when those options are
|
||||
* removed.
|
||||
*
|
||||
* @returns {string|null} - the name of any incompatible option detected,
|
||||
* `null` otherwise
|
||||
*/
|
||||
inferEsVersion: function() {
|
||||
var badOpt = null;
|
||||
|
||||
if (this.option.esversion) {
|
||||
if (this.option.es3) {
|
||||
badOpt = "es3";
|
||||
} else if (this.option.es5) {
|
||||
badOpt = "es5";
|
||||
} else if (this.option.esnext) {
|
||||
badOpt = "esnext";
|
||||
}
|
||||
|
||||
if (badOpt) {
|
||||
return badOpt;
|
||||
}
|
||||
|
||||
if (this.option.esversion === 2015) {
|
||||
this.esVersion = 6;
|
||||
} else {
|
||||
this.esVersion = this.option.esversion;
|
||||
}
|
||||
} else if (this.option.es3) {
|
||||
this.esVersion = 3;
|
||||
} else if (this.option.esnext) {
|
||||
this.esVersion = 6;
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.tokens = {
|
||||
prev: null,
|
||||
next: null,
|
||||
curr: null
|
||||
};
|
||||
|
||||
this.option = { unstable: {} };
|
||||
this.esVersion = 5;
|
||||
this.funct = null;
|
||||
this.ignored = {};
|
||||
this.directive = Object.create(null);
|
||||
this.jsonMode = false;
|
||||
this.lines = [];
|
||||
this.tab = "";
|
||||
this.cache = {}; // Node.JS doesn't have Map. Sniff.
|
||||
this.ignoredLines = {};
|
||||
this.forinifcheckneeded = false;
|
||||
this.nameStack = new NameStack();
|
||||
this.inClassBody = false;
|
||||
}
|
||||
};
|
||||
|
||||
exports.state = state;
|
144
project3/node_modules/jshint/src/style.js
generated
vendored
Normal file
144
project3/node_modules/jshint/src/style.js
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
"use strict";
|
||||
|
||||
exports.register = function(linter) {
|
||||
// Check for properties named __proto__. This special property was
|
||||
// deprecated and then re-introduced for ES6.
|
||||
|
||||
linter.on("Identifier", function style_scanProto(data) {
|
||||
if (linter.getOption("proto")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.name === "__proto__") {
|
||||
linter.warn("W103", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.name, "6" ]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Check for properties named __iterator__. This is a special property
|
||||
// available only in browsers with JavaScript 1.7 implementation, but
|
||||
// it is deprecated for ES6
|
||||
|
||||
linter.on("Identifier", function style_scanIterator(data) {
|
||||
if (linter.getOption("iterator")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.name === "__iterator__") {
|
||||
linter.warn("W103", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.name ]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Check that all identifiers are using camelCase notation.
|
||||
// Exceptions: names like MY_VAR and _myVar.
|
||||
|
||||
linter.on("Identifier", function style_scanCamelCase(data) {
|
||||
if (!linter.getOption("camelcase")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.name.replace(/^_+|_+$/g, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) {
|
||||
linter.warn("W106", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.name ]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Enforce consistency in style of quoting.
|
||||
|
||||
linter.on("String", function style_scanQuotes(data) {
|
||||
var quotmark = linter.getOption("quotmark");
|
||||
var code;
|
||||
|
||||
if (!quotmark) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If quotmark is set to 'single' warn about all double-quotes.
|
||||
|
||||
if (quotmark === "single" && data.quote !== "'") {
|
||||
code = "W109";
|
||||
}
|
||||
|
||||
// If quotmark is set to 'double' warn about all single-quotes.
|
||||
|
||||
if (quotmark === "double" && data.quote !== "\"") {
|
||||
code = "W108";
|
||||
}
|
||||
|
||||
// If quotmark is set to true, remember the first quotation style
|
||||
// and then warn about all others.
|
||||
|
||||
if (quotmark === true) {
|
||||
if (!linter.getCache("quotmark")) {
|
||||
linter.setCache("quotmark", data.quote);
|
||||
}
|
||||
|
||||
if (linter.getCache("quotmark") !== data.quote) {
|
||||
code = "W110";
|
||||
}
|
||||
}
|
||||
|
||||
if (code) {
|
||||
linter.warn(code, {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
linter.on("Number", function style_scanNumbers(data) {
|
||||
if (data.value.charAt(0) === ".") {
|
||||
// Warn about a leading decimal point.
|
||||
linter.warn("W008", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.value ]
|
||||
});
|
||||
}
|
||||
|
||||
if (data.value.substr(data.value.length - 1) === ".") {
|
||||
// Warn about a trailing decimal point.
|
||||
linter.warn("W047", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.value ]
|
||||
});
|
||||
}
|
||||
|
||||
if (/^00+/.test(data.value)) {
|
||||
// Multiple leading zeroes.
|
||||
linter.warn("W046", {
|
||||
line: data.line,
|
||||
char: data.char,
|
||||
data: [ data.value ]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Warn about script URLs.
|
||||
|
||||
linter.on("String", function style_scanJavaScriptURLs(data) {
|
||||
var re = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;
|
||||
|
||||
if (linter.getOption("scripturl")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (re.test(data.value)) {
|
||||
linter.warn("W107", {
|
||||
line: data.line,
|
||||
char: data.char
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
805
project3/node_modules/jshint/src/vars.js
generated
vendored
Normal file
805
project3/node_modules/jshint/src/vars.js
generated
vendored
Normal file
@@ -0,0 +1,805 @@
|
||||
// jshint -W001
|
||||
|
||||
"use strict";
|
||||
|
||||
// Identifiers provided by the ECMAScript standard.
|
||||
|
||||
exports.reservedVars = {
|
||||
NaN : false,
|
||||
undefined : false
|
||||
};
|
||||
|
||||
exports.ecmaIdentifiers = {
|
||||
3: {
|
||||
Array : false,
|
||||
Boolean : false,
|
||||
Date : false,
|
||||
decodeURI : false,
|
||||
decodeURIComponent : false,
|
||||
encodeURI : false,
|
||||
encodeURIComponent : false,
|
||||
Error : false,
|
||||
"eval" : false,
|
||||
EvalError : false,
|
||||
Function : false,
|
||||
hasOwnProperty : false,
|
||||
Infinity : false,
|
||||
isFinite : false,
|
||||
isNaN : 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
|
||||
},
|
||||
5: {
|
||||
JSON : false
|
||||
},
|
||||
6: {
|
||||
ArrayBuffer : false,
|
||||
DataView : false,
|
||||
Float32Array : false,
|
||||
Float64Array : false,
|
||||
Int8Array : false,
|
||||
Int16Array : false,
|
||||
Int32Array : false,
|
||||
Map : false,
|
||||
Promise : false,
|
||||
Proxy : false,
|
||||
Reflect : false,
|
||||
Set : false,
|
||||
Symbol : false,
|
||||
Uint8Array : false,
|
||||
Uint16Array : false,
|
||||
Uint32Array : false,
|
||||
Uint8ClampedArray : false,
|
||||
WeakMap : false,
|
||||
WeakSet : false
|
||||
},
|
||||
8: {
|
||||
Atomics : false,
|
||||
SharedArrayBuffer : false
|
||||
}
|
||||
};
|
||||
|
||||
// Global variables commonly provided by a web browser environment.
|
||||
|
||||
exports.browser = {
|
||||
Audio : false,
|
||||
Blob : false,
|
||||
addEventListener : false, // EventTarget
|
||||
applicationCache : false,
|
||||
atob : false, // WindowOrWorkerGlobalScope
|
||||
blur : false,
|
||||
btoa : false, // WindowOrWorkerGlobalScope
|
||||
cancelAnimationFrame : false,
|
||||
CanvasGradient : false,
|
||||
CanvasPattern : false,
|
||||
CanvasRenderingContext2D: false,
|
||||
CSS : false,
|
||||
CSSImportRule : false,
|
||||
CSSGroupingRule : false,
|
||||
CSSMarginRule : false,
|
||||
CSSMediaRule : false,
|
||||
CSSNamespaceRule : false,
|
||||
CSSPageRule : false,
|
||||
CSSRule : false,
|
||||
CSSRuleList : false,
|
||||
CSSStyleDeclaration : false,
|
||||
CSSStyleRule : false,
|
||||
CSSStyleSheet : false,
|
||||
clearInterval : false, // WindowOrWorkerGlobalScope
|
||||
clearTimeout : false, // WindowOrWorkerGlobalScope
|
||||
close : false,
|
||||
closed : false,
|
||||
Comment : false,
|
||||
CompositionEvent : false,
|
||||
createImageBitmap : false, // WindowOrWorkerGlobalScope
|
||||
CustomEvent : false,
|
||||
DOMParser : false,
|
||||
defaultStatus : false,
|
||||
dispatchEvent : false, // EventTarget
|
||||
Document : false,
|
||||
document : false,
|
||||
DocumentFragment : false,
|
||||
Element : false,
|
||||
ElementTimeControl : false,
|
||||
Event : false,
|
||||
event : false,
|
||||
fetch : false,
|
||||
File : false,
|
||||
FileList : false,
|
||||
FileReader : false,
|
||||
FormData : false,
|
||||
focus : false,
|
||||
frames : false,
|
||||
getComputedStyle : false,
|
||||
Headers : false,
|
||||
HTMLAnchorElement : false,
|
||||
HTMLAreaElement : false,
|
||||
HTMLAudioElement : false,
|
||||
HTMLBaseElement : false,
|
||||
HTMLBlockquoteElement: false,
|
||||
HTMLBodyElement : false,
|
||||
HTMLBRElement : false,
|
||||
HTMLButtonElement : false,
|
||||
HTMLCanvasElement : false,
|
||||
HTMLCollection : false,
|
||||
HTMLDataElement : false,
|
||||
HTMLDataListElement : false,
|
||||
HTMLDetailsElement : false,
|
||||
HTMLDialogElement : false,
|
||||
HTMLDirectoryElement : false,
|
||||
HTMLDivElement : false,
|
||||
HTMLDListElement : false,
|
||||
HTMLElement : false,
|
||||
HTMLEmbedElement : false,
|
||||
HTMLFieldSetElement : false,
|
||||
HTMLFontElement : false,
|
||||
HTMLFormElement : false,
|
||||
HTMLFrameElement : false,
|
||||
HTMLFrameSetElement : false,
|
||||
HTMLHeadElement : false,
|
||||
HTMLHeadingElement : false,
|
||||
HTMLHRElement : false,
|
||||
HTMLHtmlElement : false,
|
||||
HTMLIFrameElement : false,
|
||||
HTMLImageElement : false,
|
||||
HTMLInputElement : false,
|
||||
/* HTMLIsIndexElement was removed from the WHATWG HTML spec;
|
||||
see https://github.com/whatwg/html/pull/1095.
|
||||
HTMLIsIndexElement has been removed from browsers; see:
|
||||
• Chromium Removal: https://codereview.chromium.org/96653004/
|
||||
• Gecko Removal: https://bugzilla.mozilla.org/show_bug.cgi?id=1266495
|
||||
• WebKit Removal: https://bugs.webkit.org/show_bug.cgi?id=7139.
|
||||
See also the discussion at https://github.com/jshint/jshint/pull/3222. */
|
||||
HTMLIsIndexElement : false,
|
||||
HTMLLabelElement : false,
|
||||
HTMLLayerElement : false,
|
||||
HTMLLegendElement : false,
|
||||
HTMLLIElement : false,
|
||||
HTMLLinkElement : false,
|
||||
HTMLMapElement : false,
|
||||
HTMLMarqueeElement : false,
|
||||
HTMLMediaElement : false,
|
||||
HTMLMenuElement : false,
|
||||
HTMLMetaElement : false,
|
||||
HTMLMeterElement : false,
|
||||
HTMLModElement : false,
|
||||
HTMLObjectElement : false,
|
||||
HTMLOListElement : false,
|
||||
HTMLOptGroupElement : false,
|
||||
HTMLOptionElement : false,
|
||||
HTMLParagraphElement : false,
|
||||
HTMLParamElement : false,
|
||||
HTMLPictureElement : false,
|
||||
HTMLPreElement : false,
|
||||
HTMLProgressElement : false,
|
||||
HTMLQuoteElement : false,
|
||||
HTMLScriptElement : false,
|
||||
HTMLSelectElement : false,
|
||||
HTMLSlotElement : false,
|
||||
HTMLSourceElement : false,
|
||||
HTMLStyleElement : false,
|
||||
HTMLTableCaptionElement: false,
|
||||
HTMLTableCellElement : false,
|
||||
HTMLTableColElement : false,
|
||||
HTMLTableElement : false,
|
||||
HTMLTableRowElement : false,
|
||||
HTMLTableSectionElement: false,
|
||||
HTMLTemplateElement : false,
|
||||
HTMLTextAreaElement : false,
|
||||
HTMLTimeElement : false,
|
||||
HTMLTitleElement : false,
|
||||
HTMLTrackElement : false,
|
||||
HTMLUListElement : false,
|
||||
HTMLVideoElement : false,
|
||||
history : false,
|
||||
Image : false,
|
||||
IntersectionObserver : false,
|
||||
Intl : false,
|
||||
length : false,
|
||||
localStorage : false,
|
||||
location : false,
|
||||
matchMedia : false,
|
||||
MediaList : false,
|
||||
MediaRecorder : false,
|
||||
MessageChannel : false,
|
||||
MessageEvent : false,
|
||||
MessagePort : false,
|
||||
MouseEvent : false,
|
||||
moveBy : false,
|
||||
moveTo : false,
|
||||
MutationObserver : false,
|
||||
name : false,
|
||||
Node : false,
|
||||
NodeFilter : false,
|
||||
NodeList : false,
|
||||
Notification : false,
|
||||
navigator : false,
|
||||
onbeforeunload : true,
|
||||
onblur : true,
|
||||
onerror : true,
|
||||
onfocus : true,
|
||||
onload : true,
|
||||
onresize : true,
|
||||
onunload : true,
|
||||
open : false,
|
||||
openDatabase : false,
|
||||
opener : false,
|
||||
Option : false,
|
||||
origin : false, // WindowOrWorkerGlobalScope
|
||||
parent : false,
|
||||
performance : false,
|
||||
print : false,
|
||||
queueMicrotask : false, // WindowOrWorkerGlobalScope
|
||||
Range : false,
|
||||
requestAnimationFrame : false,
|
||||
removeEventListener : false, // EventTarget
|
||||
Request : false,
|
||||
resizeBy : false,
|
||||
resizeTo : false,
|
||||
Response : false,
|
||||
screen : false,
|
||||
scroll : false,
|
||||
scrollBy : false,
|
||||
scrollTo : false,
|
||||
sessionStorage : false,
|
||||
setInterval : false, // WindowOrWorkerGlobalScope
|
||||
setTimeout : false, // WindowOrWorkerGlobalScope
|
||||
SharedWorker : false,
|
||||
status : false,
|
||||
Storage : false,
|
||||
StyleSheet : false,
|
||||
SVGAElement : false,
|
||||
SVGAltGlyphDefElement: false,
|
||||
SVGAltGlyphElement : false,
|
||||
SVGAltGlyphItemElement: false,
|
||||
SVGAngle : false,
|
||||
SVGAnimateColorElement: false,
|
||||
SVGAnimateElement : false,
|
||||
SVGAnimateMotionElement: false,
|
||||
SVGAnimateTransformElement: false,
|
||||
SVGAnimatedAngle : false,
|
||||
SVGAnimatedBoolean : false,
|
||||
SVGAnimatedEnumeration: false,
|
||||
SVGAnimatedInteger : false,
|
||||
SVGAnimatedLength : false,
|
||||
SVGAnimatedLengthList: false,
|
||||
SVGAnimatedNumber : false,
|
||||
SVGAnimatedNumberList: false,
|
||||
SVGAnimatedPathData : false,
|
||||
SVGAnimatedPoints : false,
|
||||
SVGAnimatedPreserveAspectRatio: false,
|
||||
SVGAnimatedRect : false,
|
||||
SVGAnimatedString : false,
|
||||
SVGAnimatedTransformList: false,
|
||||
SVGAnimationElement : false,
|
||||
SVGCSSRule : false,
|
||||
SVGCircleElement : false,
|
||||
SVGClipPathElement : false,
|
||||
SVGColor : false,
|
||||
SVGColorProfileElement: false,
|
||||
SVGColorProfileRule : false,
|
||||
SVGComponentTransferFunctionElement: false,
|
||||
SVGCursorElement : false,
|
||||
SVGDefsElement : false,
|
||||
SVGDescElement : false,
|
||||
SVGDocument : false,
|
||||
SVGElement : false,
|
||||
SVGElementInstance : false,
|
||||
SVGElementInstanceList: false,
|
||||
SVGEllipseElement : false,
|
||||
SVGExternalResourcesRequired: false,
|
||||
SVGFEBlendElement : false,
|
||||
SVGFEColorMatrixElement: false,
|
||||
SVGFEComponentTransferElement: false,
|
||||
SVGFECompositeElement: false,
|
||||
SVGFEConvolveMatrixElement: false,
|
||||
SVGFEDiffuseLightingElement: false,
|
||||
SVGFEDisplacementMapElement: false,
|
||||
SVGFEDistantLightElement: false,
|
||||
SVGFEFloodElement : false,
|
||||
SVGFEFuncAElement : false,
|
||||
SVGFEFuncBElement : false,
|
||||
SVGFEFuncGElement : false,
|
||||
SVGFEFuncRElement : false,
|
||||
SVGFEGaussianBlurElement: false,
|
||||
SVGFEImageElement : false,
|
||||
SVGFEMergeElement : false,
|
||||
SVGFEMergeNodeElement: false,
|
||||
SVGFEMorphologyElement: false,
|
||||
SVGFEOffsetElement : false,
|
||||
SVGFEPointLightElement: false,
|
||||
SVGFESpecularLightingElement: false,
|
||||
SVGFESpotLightElement: false,
|
||||
SVGFETileElement : false,
|
||||
SVGFETurbulenceElement: false,
|
||||
SVGFilterElement : false,
|
||||
SVGFilterPrimitiveStandardAttributes: false,
|
||||
SVGFitToViewBox : false,
|
||||
SVGFontElement : false,
|
||||
SVGFontFaceElement : false,
|
||||
SVGFontFaceFormatElement: false,
|
||||
SVGFontFaceNameElement: false,
|
||||
SVGFontFaceSrcElement: false,
|
||||
SVGFontFaceUriElement: false,
|
||||
SVGForeignObjectElement: false,
|
||||
SVGGElement : false,
|
||||
SVGGlyphElement : false,
|
||||
SVGGlyphRefElement : false,
|
||||
SVGGradientElement : false,
|
||||
SVGHKernElement : false,
|
||||
SVGICCColor : false,
|
||||
SVGImageElement : false,
|
||||
SVGLangSpace : false,
|
||||
SVGLength : false,
|
||||
SVGLengthList : false,
|
||||
SVGLineElement : false,
|
||||
SVGLinearGradientElement: false,
|
||||
SVGLocatable : false,
|
||||
SVGMPathElement : false,
|
||||
SVGMarkerElement : false,
|
||||
SVGMaskElement : false,
|
||||
SVGMatrix : false,
|
||||
SVGMetadataElement : false,
|
||||
SVGMissingGlyphElement: false,
|
||||
SVGNumber : false,
|
||||
SVGNumberList : false,
|
||||
SVGPaint : false,
|
||||
SVGPathElement : false,
|
||||
SVGPathSeg : false,
|
||||
SVGPathSegArcAbs : false,
|
||||
SVGPathSegArcRel : false,
|
||||
SVGPathSegClosePath : false,
|
||||
SVGPathSegCurvetoCubicAbs: false,
|
||||
SVGPathSegCurvetoCubicRel: false,
|
||||
SVGPathSegCurvetoCubicSmoothAbs: false,
|
||||
SVGPathSegCurvetoCubicSmoothRel: false,
|
||||
SVGPathSegCurvetoQuadraticAbs: false,
|
||||
SVGPathSegCurvetoQuadraticRel: false,
|
||||
SVGPathSegCurvetoQuadraticSmoothAbs: false,
|
||||
SVGPathSegCurvetoQuadraticSmoothRel: false,
|
||||
SVGPathSegLinetoAbs : false,
|
||||
SVGPathSegLinetoHorizontalAbs: false,
|
||||
SVGPathSegLinetoHorizontalRel: false,
|
||||
SVGPathSegLinetoRel : false,
|
||||
SVGPathSegLinetoVerticalAbs: false,
|
||||
SVGPathSegLinetoVerticalRel: false,
|
||||
SVGPathSegList : false,
|
||||
SVGPathSegMovetoAbs : false,
|
||||
SVGPathSegMovetoRel : false,
|
||||
SVGPatternElement : false,
|
||||
SVGPoint : false,
|
||||
SVGPointList : false,
|
||||
SVGPolygonElement : false,
|
||||
SVGPolylineElement : false,
|
||||
SVGPreserveAspectRatio: false,
|
||||
SVGRadialGradientElement: false,
|
||||
SVGRect : false,
|
||||
SVGRectElement : false,
|
||||
SVGRenderingIntent : false,
|
||||
SVGSVGElement : false,
|
||||
SVGScriptElement : false,
|
||||
SVGSetElement : false,
|
||||
SVGStopElement : false,
|
||||
SVGStringList : false,
|
||||
SVGStylable : false,
|
||||
SVGStyleElement : false,
|
||||
SVGSwitchElement : false,
|
||||
SVGSymbolElement : false,
|
||||
SVGTRefElement : false,
|
||||
SVGTSpanElement : false,
|
||||
SVGTests : false,
|
||||
SVGTextContentElement: false,
|
||||
SVGTextElement : false,
|
||||
SVGTextPathElement : false,
|
||||
SVGTextPositioningElement: false,
|
||||
SVGTitleElement : false,
|
||||
SVGTransform : false,
|
||||
SVGTransformList : false,
|
||||
SVGTransformable : false,
|
||||
SVGURIReference : false,
|
||||
SVGUnitTypes : false,
|
||||
SVGUseElement : false,
|
||||
SVGVKernElement : false,
|
||||
SVGViewElement : false,
|
||||
SVGViewSpec : false,
|
||||
SVGZoomAndPan : false,
|
||||
Text : false,
|
||||
TextDecoder : false,
|
||||
TextEncoder : false,
|
||||
TimeEvent : false,
|
||||
top : false,
|
||||
URL : false,
|
||||
WebGLActiveInfo : false,
|
||||
WebGLBuffer : false,
|
||||
WebGLContextEvent : false,
|
||||
WebGLFramebuffer : false,
|
||||
WebGLProgram : false,
|
||||
WebGLRenderbuffer : false,
|
||||
WebGLRenderingContext: false,
|
||||
WebGLShader : false,
|
||||
WebGLShaderPrecisionFormat: false,
|
||||
WebGLTexture : false,
|
||||
WebGLUniformLocation : false,
|
||||
WebSocket : false,
|
||||
window : false,
|
||||
Window : false,
|
||||
Worker : false,
|
||||
XDomainRequest : false,
|
||||
XMLDocument : false,
|
||||
XMLHttpRequest : false,
|
||||
XMLSerializer : false,
|
||||
XPathEvaluator : false,
|
||||
XPathException : false,
|
||||
XPathExpression : false,
|
||||
XPathNamespace : false,
|
||||
XPathNSResolver : false,
|
||||
XPathResult : false
|
||||
};
|
||||
|
||||
exports.devel = {
|
||||
alert : false,
|
||||
confirm: false,
|
||||
console: false,
|
||||
Debug : false,
|
||||
opera : false,
|
||||
prompt : false
|
||||
};
|
||||
|
||||
exports.worker = {
|
||||
addEventListener : true, // EventTarget
|
||||
atob : true, // WindowOrWorkerGlobalScope
|
||||
btoa : true, // WindowOrWorkerGlobalScope
|
||||
clearInterval : true, // WindowOrWorkerGlobalScope
|
||||
clearTimeout : true, // WindowOrWorkerGlobalScope
|
||||
createImageBitmap : true, // WindowOrWorkerGlobalScope
|
||||
dispatchEvent : true, // EventTarget
|
||||
importScripts : true,
|
||||
onmessage : true,
|
||||
origin : true, // WindowOrWorkerGlobalScope
|
||||
postMessage : true,
|
||||
queueMicrotask : true, // WindowOrWorkerGlobalScope
|
||||
removeEventListener : true, // EventTarget
|
||||
self : true,
|
||||
setInterval : true, // WindowOrWorkerGlobalScope
|
||||
setTimeout : true, // WindowOrWorkerGlobalScope
|
||||
FileReaderSync : true
|
||||
};
|
||||
|
||||
// Widely adopted global names that are not part of ECMAScript standard
|
||||
exports.nonstandard = {
|
||||
escape : false,
|
||||
unescape: false
|
||||
};
|
||||
|
||||
// Globals provided by popular JavaScript environments.
|
||||
|
||||
exports.couch = {
|
||||
"require" : false,
|
||||
respond : false,
|
||||
getRow : false,
|
||||
emit : false,
|
||||
send : false,
|
||||
start : false,
|
||||
sum : false,
|
||||
log : false,
|
||||
exports : false,
|
||||
module : false,
|
||||
provides : false
|
||||
};
|
||||
|
||||
exports.node = {
|
||||
__filename : false,
|
||||
__dirname : false,
|
||||
arguments : false,
|
||||
GLOBAL : false,
|
||||
global : false,
|
||||
module : false,
|
||||
require : false,
|
||||
|
||||
// These globals are writeable because Node allows the following
|
||||
// usage pattern: var Buffer = require("buffer").Buffer;
|
||||
|
||||
Buffer : true,
|
||||
console : true,
|
||||
exports : true,
|
||||
process : true,
|
||||
setTimeout : true,
|
||||
clearTimeout : true,
|
||||
setInterval : true,
|
||||
clearInterval : true,
|
||||
setImmediate : true, // v0.9.1+
|
||||
clearImmediate: true // v0.9.1+
|
||||
};
|
||||
|
||||
exports.browserify = {
|
||||
__filename : false,
|
||||
__dirname : false,
|
||||
global : false,
|
||||
module : false,
|
||||
require : false,
|
||||
Buffer : true,
|
||||
exports : true,
|
||||
process : true
|
||||
};
|
||||
|
||||
exports.phantom = {
|
||||
phantom : true,
|
||||
require : true,
|
||||
WebPage : true,
|
||||
console : true, // in examples, but undocumented
|
||||
exports : true // v1.7+
|
||||
};
|
||||
|
||||
exports.qunit = {
|
||||
asyncTest : false,
|
||||
deepEqual : false,
|
||||
equal : false,
|
||||
expect : false,
|
||||
module : false,
|
||||
notDeepEqual : false,
|
||||
notEqual : false,
|
||||
notOk : false,
|
||||
notPropEqual : false,
|
||||
notStrictEqual : false,
|
||||
ok : false,
|
||||
propEqual : false,
|
||||
QUnit : false,
|
||||
raises : false,
|
||||
start : false,
|
||||
stop : false,
|
||||
strictEqual : false,
|
||||
test : false,
|
||||
"throws" : false
|
||||
};
|
||||
|
||||
exports.rhino = {
|
||||
arguments : false,
|
||||
defineClass : false,
|
||||
deserialize : false,
|
||||
gc : false,
|
||||
help : false,
|
||||
importClass : false,
|
||||
importPackage: false,
|
||||
"java" : false,
|
||||
load : false,
|
||||
loadClass : false,
|
||||
Packages : false,
|
||||
print : false,
|
||||
quit : false,
|
||||
readFile : false,
|
||||
readUrl : false,
|
||||
runCommand : false,
|
||||
seal : false,
|
||||
serialize : false,
|
||||
spawn : false,
|
||||
sync : false,
|
||||
toint32 : false,
|
||||
version : false
|
||||
};
|
||||
|
||||
exports.shelljs = {
|
||||
target : false,
|
||||
echo : false,
|
||||
exit : false,
|
||||
cd : false,
|
||||
pwd : false,
|
||||
ls : false,
|
||||
find : false,
|
||||
cp : false,
|
||||
rm : false,
|
||||
mv : false,
|
||||
mkdir : false,
|
||||
test : false,
|
||||
cat : false,
|
||||
sed : false,
|
||||
grep : false,
|
||||
which : false,
|
||||
dirs : false,
|
||||
pushd : false,
|
||||
popd : false,
|
||||
env : false,
|
||||
exec : false,
|
||||
chmod : false,
|
||||
config : false,
|
||||
error : false,
|
||||
tempdir : false
|
||||
};
|
||||
|
||||
exports.typed = {
|
||||
ArrayBuffer : false,
|
||||
ArrayBufferView : false,
|
||||
DataView : false,
|
||||
Float32Array : false,
|
||||
Float64Array : false,
|
||||
Int16Array : false,
|
||||
Int32Array : false,
|
||||
Int8Array : false,
|
||||
Uint16Array : false,
|
||||
Uint32Array : false,
|
||||
Uint8Array : false,
|
||||
Uint8ClampedArray : false
|
||||
};
|
||||
|
||||
exports.wsh = {
|
||||
ActiveXObject : true,
|
||||
Enumerator : true,
|
||||
GetObject : true,
|
||||
ScriptEngine : true,
|
||||
ScriptEngineBuildVersion : true,
|
||||
ScriptEngineMajorVersion : true,
|
||||
ScriptEngineMinorVersion : true,
|
||||
VBArray : true,
|
||||
WSH : true,
|
||||
WScript : true,
|
||||
XDomainRequest : true
|
||||
};
|
||||
|
||||
// Globals provided by popular JavaScript libraries.
|
||||
|
||||
exports.dojo = {
|
||||
dojo : false,
|
||||
dijit : false,
|
||||
dojox : false,
|
||||
define : false,
|
||||
"require": false
|
||||
};
|
||||
|
||||
exports.jquery = {
|
||||
"$" : false,
|
||||
jQuery : false
|
||||
};
|
||||
|
||||
exports.mootools = {
|
||||
"$" : false,
|
||||
"$$" : false,
|
||||
Asset : false,
|
||||
Browser : false,
|
||||
Chain : false,
|
||||
Class : false,
|
||||
Color : false,
|
||||
Cookie : false,
|
||||
Core : false,
|
||||
Document : false,
|
||||
DomReady : false,
|
||||
DOMEvent : false,
|
||||
DOMReady : false,
|
||||
Drag : false,
|
||||
Element : false,
|
||||
Elements : false,
|
||||
Event : false,
|
||||
Events : false,
|
||||
Fx : false,
|
||||
Group : false,
|
||||
Hash : false,
|
||||
HtmlTable : false,
|
||||
IFrame : false,
|
||||
IframeShim : false,
|
||||
InputValidator: false,
|
||||
instanceOf : false,
|
||||
Keyboard : false,
|
||||
Locale : false,
|
||||
Mask : false,
|
||||
MooTools : false,
|
||||
Native : false,
|
||||
Options : false,
|
||||
OverText : false,
|
||||
Request : false,
|
||||
Scroller : false,
|
||||
Slick : false,
|
||||
Slider : false,
|
||||
Sortables : false,
|
||||
Spinner : false,
|
||||
Swiff : false,
|
||||
Tips : false,
|
||||
Type : false,
|
||||
typeOf : false,
|
||||
URI : false,
|
||||
Window : false
|
||||
};
|
||||
|
||||
exports.prototypejs = {
|
||||
"$" : false,
|
||||
"$$" : false,
|
||||
"$A" : false,
|
||||
"$F" : false,
|
||||
"$H" : false,
|
||||
"$R" : false,
|
||||
"$break" : false,
|
||||
"$continue" : false,
|
||||
"$w" : false,
|
||||
Abstract : false,
|
||||
Ajax : false,
|
||||
Class : false,
|
||||
Enumerable : false,
|
||||
Element : false,
|
||||
Event : false,
|
||||
Field : false,
|
||||
Form : false,
|
||||
Hash : false,
|
||||
Insertion : false,
|
||||
ObjectRange : false,
|
||||
PeriodicalExecuter: false,
|
||||
Position : false,
|
||||
Prototype : false,
|
||||
Selector : false,
|
||||
Template : false,
|
||||
Toggle : false,
|
||||
Try : false,
|
||||
Autocompleter : false,
|
||||
Builder : false,
|
||||
Control : false,
|
||||
Draggable : false,
|
||||
Draggables : false,
|
||||
Droppables : false,
|
||||
Effect : false,
|
||||
Sortable : false,
|
||||
SortableObserver : false,
|
||||
Sound : false,
|
||||
Scriptaculous : false
|
||||
};
|
||||
|
||||
exports.yui = {
|
||||
YUI : false,
|
||||
Y : false,
|
||||
YUI_config: false
|
||||
};
|
||||
|
||||
exports.mocha = {
|
||||
// Global (for config etc.)
|
||||
mocha : false,
|
||||
// BDD
|
||||
describe : false,
|
||||
xdescribe : false,
|
||||
it : false,
|
||||
xit : false,
|
||||
context : false,
|
||||
xcontext : false,
|
||||
before : false,
|
||||
after : false,
|
||||
beforeEach : false,
|
||||
afterEach : false,
|
||||
// TDD
|
||||
suite : false,
|
||||
test : false,
|
||||
setup : false,
|
||||
teardown : false,
|
||||
suiteSetup : false,
|
||||
suiteTeardown : false
|
||||
};
|
||||
|
||||
exports.jasmine = {
|
||||
jasmine : false,
|
||||
describe : false,
|
||||
xdescribe : false,
|
||||
it : false,
|
||||
xit : false,
|
||||
beforeEach : false,
|
||||
afterEach : false,
|
||||
setFixtures : false,
|
||||
loadFixtures: false,
|
||||
spyOn : false,
|
||||
expect : false,
|
||||
// Jasmine 1.3
|
||||
runs : false,
|
||||
waitsFor : false,
|
||||
waits : false,
|
||||
// Jasmine 2.1
|
||||
beforeAll : false,
|
||||
afterAll : false,
|
||||
fail : false,
|
||||
fdescribe : false,
|
||||
fit : false,
|
||||
pending : false,
|
||||
// Jasmine 2.6
|
||||
spyOnProperty: false
|
||||
};
|
Reference in New Issue
Block a user