mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
disable JSHint's "shadow" relaxing option
This commit is contained in:
parent
6c5ad30c79
commit
ff62a9099d
@ -35,7 +35,7 @@
|
||||
"proto": false,
|
||||
"regexdash": false,
|
||||
"scripturl": true,
|
||||
"shadow": true,
|
||||
"shadow": false,
|
||||
"smarttabs": true,
|
||||
"sub": true,
|
||||
"supernew": true,
|
||||
|
||||
@ -131,7 +131,7 @@ exports.copyFile = function(inFile, outDir, fileName) {
|
||||
|
||||
outDir = toDir(outDir);
|
||||
|
||||
var inFile = new java.io.File(inFile);
|
||||
inFile = new java.io.File(inFile);
|
||||
var outFile = new java.io.File(outDir+'/'+fileName);
|
||||
|
||||
var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096);
|
||||
|
||||
@ -27,7 +27,7 @@ const defaults = {
|
||||
@param {string} [json] - The contents of config.json.
|
||||
*/
|
||||
function Config(json) {
|
||||
var json = JSON.parse( (json || "{}") );
|
||||
json = JSON.parse( (json || "{}") );
|
||||
|
||||
this._config = util.mergeRecurse(defaults, json);
|
||||
}
|
||||
|
||||
@ -123,8 +123,8 @@ RegExp.escape = RegExp.escape || function(str) {
|
||||
*/
|
||||
exports.applyNamespace = function(longname, ns) {
|
||||
var nameParts = exports.shorten(longname),
|
||||
name = nameParts.name,
|
||||
longname = nameParts.longname;
|
||||
name = nameParts.name;
|
||||
longname = nameParts.longname;
|
||||
|
||||
if ( !/^[a-zA-Z]+?:.+$/i.test(name) ) {
|
||||
longname = longname.replace( new RegExp(RegExp.escape(name)+'$'), ns + ':' + name );
|
||||
@ -161,21 +161,22 @@ exports.shorten = function(longname, forcedMemberof) {
|
||||
var name = '',
|
||||
scope = '', // ., ~, or #
|
||||
memberof = '',
|
||||
parts,
|
||||
variation;
|
||||
|
||||
longname = longname.replace( /\.prototype\.?/g, '#' );
|
||||
|
||||
if (typeof forcedMemberof !== 'undefined') {
|
||||
name = longname.substr(forcedMemberof.length);
|
||||
var parts = forcedMemberof.match(/^(.*?)([#.~]?)$/);
|
||||
parts = forcedMemberof.match(/^(.*?)([#.~]?)$/);
|
||||
|
||||
if (parts[1]) { memberof = parts[1] || forcedMemberof; }
|
||||
if (parts[2]) { scope = parts[2]; }
|
||||
}
|
||||
else {
|
||||
var parts = longname?
|
||||
(longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse()
|
||||
: [''];
|
||||
parts = longname?
|
||||
(longname.match( /^(:?(.+)([#.~]))?(.+?)$/ ) || []).reverse()
|
||||
: [''];
|
||||
|
||||
name = parts[0] || ''; // ensure name is always initialised to avoid error being thrown when calling replace on undefined [gh-24]
|
||||
scope = parts[1] || ''; // ., ~, or #
|
||||
|
||||
@ -303,6 +303,9 @@ function visitNode(node) {
|
||||
nodeComments,
|
||||
comment,
|
||||
commentSrc,
|
||||
basename,
|
||||
func,
|
||||
funcDoc,
|
||||
i,
|
||||
l;
|
||||
|
||||
@ -342,7 +345,7 @@ function visitNode(node) {
|
||||
finishers: [currentParser.addDocletRef]
|
||||
};
|
||||
|
||||
var basename = getBasename(e.code.name);
|
||||
basename = getBasename(e.code.name);
|
||||
|
||||
if (basename !== 'this') {
|
||||
e.code.funcscope = currentParser.resolveVar(node, basename);
|
||||
@ -384,8 +387,8 @@ function visitNode(node) {
|
||||
};
|
||||
|
||||
// keep track of vars in a function or global scope
|
||||
var func = "__global__",
|
||||
funcDoc = null;
|
||||
func = "__global__";
|
||||
funcDoc = null;
|
||||
if (node.enclosingFunction) {
|
||||
func = 'astnode'+node.enclosingFunction.hashCode();
|
||||
}
|
||||
@ -412,8 +415,8 @@ function visitNode(node) {
|
||||
//console.log(':: e.code.name is', e.code.name);
|
||||
|
||||
// keep track of vars in a function or global scope
|
||||
var func = "__global__",
|
||||
funcDoc = null;
|
||||
func = "__global__";
|
||||
funcDoc = null;
|
||||
if (node.enclosingFunction) {
|
||||
func = 'astnode'+node.enclosingFunction.hashCode();
|
||||
}
|
||||
@ -424,12 +427,12 @@ function visitNode(node) {
|
||||
e.finishers.push(makeVarsFinisher(funcDoc));
|
||||
}
|
||||
|
||||
var basename = getBasename(e.code.name);
|
||||
basename = getBasename(e.code.name);
|
||||
e.code.funcscope = currentParser.resolveVar(node, basename);
|
||||
}
|
||||
|
||||
if (!e) { e = {finishers: []}; }
|
||||
for(var i = 0, l = currentParser._visitors.length; i < l; i++) {
|
||||
for(i = 0, l = currentParser._visitors.length; i < l; i++) {
|
||||
currentParser._visitors[i].visitNode(node, e, currentParser, currentSourceName);
|
||||
if (e.stopPropagation) { break; }
|
||||
}
|
||||
@ -438,7 +441,7 @@ function visitNode(node) {
|
||||
currentParser.fire(e.event, e, currentParser);
|
||||
}
|
||||
|
||||
for (var i = 0, l = e.finishers.length; i < l; i++) {
|
||||
for (i = 0, l = e.finishers.length; i < l; i++) {
|
||||
e.finishers[i].call(currentParser, e);
|
||||
}
|
||||
|
||||
@ -478,7 +481,8 @@ exports.Parser.prototype._parseSourceCode = function(sourceCode, sourceName) {
|
||||
*/
|
||||
exports.Parser.prototype.astnodeToMemberof = function(node) {
|
||||
var id,
|
||||
doclet;
|
||||
doclet,
|
||||
alias;
|
||||
|
||||
if (node.type === Token.VAR || node.type === Token.FUNCTION || node.type == tkn.NAMEDFUNCTIONSTATEMENT) {
|
||||
if (node.enclosingFunction) { // an inner var or func
|
||||
@ -498,7 +502,7 @@ exports.Parser.prototype.astnodeToMemberof = function(node) {
|
||||
id = 'astnode'+scope.enclosingFunction.hashCode();
|
||||
doclet = this.refs[id];
|
||||
if (doclet && doclet.meta.vars && basename in doclet.meta.vars) {
|
||||
var alias = hasOwnProp.call(doclet.meta.vars, basename)? doclet.meta.vars[basename] : false;
|
||||
alias = hasOwnProp.call(doclet.meta.vars, basename)? doclet.meta.vars[basename] : false;
|
||||
if (alias !== false) {
|
||||
return [alias, basename];
|
||||
}
|
||||
@ -509,7 +513,7 @@ exports.Parser.prototype.astnodeToMemberof = function(node) {
|
||||
//First check to see if we have a global scope alias
|
||||
doclet = this.refs["__global__"];
|
||||
if (doclet && doclet.meta.vars && hasOwnProp.call(doclet.meta.vars, basename)) {
|
||||
var alias = doclet.meta.vars[basename];
|
||||
alias = doclet.meta.vars[basename];
|
||||
if (alias !== false) {
|
||||
return [alias, basename];
|
||||
}
|
||||
|
||||
@ -70,8 +70,8 @@ function parseParamText(tagText) {
|
||||
@param {object=} meta
|
||||
*/
|
||||
exports.Tag = function(tagTitle, tagBody, meta) {
|
||||
var tagDef = jsdoc.tag.dictionary.lookUp(tagTitle),
|
||||
meta = meta || {};
|
||||
var tagDef = jsdoc.tag.dictionary.lookUp(tagTitle);
|
||||
meta = meta || {};
|
||||
|
||||
this.originalTitle = trim(tagTitle);
|
||||
|
||||
|
||||
@ -129,17 +129,19 @@ exports.resolveLinks = function(str) {
|
||||
|
||||
/** Turn a doclet into a URL. */
|
||||
exports.createLink = function(doclet) {
|
||||
var url = '';
|
||||
var url = '',
|
||||
longname,
|
||||
filename;
|
||||
|
||||
if (containers.indexOf(doclet.kind) < 0) {
|
||||
var longname = doclet.longname,
|
||||
filename = strToFilename(doclet.memberof || exports.globalName);
|
||||
longname = doclet.longname;
|
||||
filename = strToFilename(doclet.memberof || exports.globalName);
|
||||
|
||||
url = filename + exports.fileExtension + '#' + getNamespace(doclet.kind) + doclet.name;
|
||||
}
|
||||
else {
|
||||
var longname = doclet.longname,
|
||||
filename = strToFilename(longname);
|
||||
longname = doclet.longname;
|
||||
filename = strToFilename(longname);
|
||||
|
||||
url = filename + exports.fileExtension;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user