mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
clean up redundant code
This commit is contained in:
parent
6edb4a1817
commit
d78b10a890
@ -379,11 +379,9 @@ exports.Parser.prototype._makeEvent = function(node, extras) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure the result includes extras that don't have default values
|
// make sure the result includes extras that don't have default values
|
||||||
for (var prop in extras) {
|
Object.keys(extras).forEach(function(prop) {
|
||||||
if ( hasOwnProp.call(extras, prop) ) {
|
|
||||||
result[prop] = extras[prop];
|
result[prop] = extras[prop];
|
||||||
}
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
@ -602,12 +600,8 @@ exports.Parser.prototype.astnodeToMemberof = function(node) {
|
|||||||
while(scope.enclosingFunction) {
|
while(scope.enclosingFunction) {
|
||||||
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 && hasOwnProp.call(doclet.meta.vars, basename) ) {
|
||||||
alias = hasOwnProp.call(doclet.meta.vars, basename) ?
|
return [doclet.meta.vars[basename], basename];
|
||||||
doclet.meta.vars[basename] : false;
|
|
||||||
if (alias !== false) {
|
|
||||||
return [alias, basename];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// move up
|
// move up
|
||||||
scope = scope.enclosingFunction;
|
scope = scope.enclosingFunction;
|
||||||
@ -615,10 +609,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) ) {
|
||||||
alias = doclet.meta.vars[basename];
|
return [doclet.meta.vars[basename], basename];
|
||||||
if (alias !== false) {
|
|
||||||
return [alias, basename];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
id = 'astnode' + node.parent.hashCode();
|
id = 'astnode' + node.parent.hashCode();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user