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