var name;
var sn;
+ var isGlobal = scope == '_global_';
+
+
while (null != (token = this.next())) {
//'function'
if (token.data == '{' && this.lookTok(-1).data == '=' && this.lookTok(-2).is('NAME')) {
// could be var x = ..
- var jd = this.lookTok(-2).jsdoc ? this.lookTok(-2) : this.lookTok(-3);
- this.walkObject(scope, this.lookTok(-2).data, token.props, jd);
+ var jd = this.lookTok(-2).jsdoc ? this.lookTok(-2) : this.lookTok(-3);
+
+ var isVar = this.lookTok(-3).name == 'VAR';
+
+ // only register names of objects if
+ var name = this.lookTok(-2).data;
+ name = !isGlobal && isVar ? false : name;
+ name = !isGlobal && !name.match(/^this\./) ? false : name;
+
+ this.walkObject(scope, name, token.props, jd);
continue;
}