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