clean up redundant code

This commit is contained in:
Jeff Williams 2013-05-02 19:46:36 -07:00
parent 6edb4a1817
commit d78b10a890

View File

@ -379,11 +379,9 @@ exports.Parser.prototype._makeEvent = function(node, extras) {
}
// make sure the result includes extras that don't have default values
for (var prop in extras) {
if ( hasOwnProp.call(extras, prop) ) {
Object.keys(extras).forEach(function(prop) {
result[prop] = extras[prop];
}
}
});
return result;
};
@ -602,12 +600,8 @@ exports.Parser.prototype.astnodeToMemberof = function(node) {
while(scope.enclosingFunction) {
id = 'astnode' + scope.enclosingFunction.hashCode();
doclet = this.refs[id];
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];
}
if ( doclet && doclet.meta.vars && hasOwnProp.call(doclet.meta.vars, basename) ) {
return [doclet.meta.vars[basename], basename];
}
// move up
scope = scope.enclosingFunction;
@ -615,10 +609,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) ) {
alias = doclet.meta.vars[basename];
if (alias !== false) {
return [alias, basename];
}
return [doclet.meta.vars[basename], basename];
}
id = 'astnode' + node.parent.hashCode();