JSDOC/ScopeParser.js
authoralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 09:47:50 +0000 (17:47 +0800)
committeralan <alan@alanfast.akbkhome.com>
Mon, 19 Apr 2010 09:47:50 +0000 (17:47 +0800)
JSDOC/ScopeParser.js

index 4242ec6..a412508 100644 (file)
@@ -582,8 +582,8 @@ ScopeParser.prototype = {
                 case 'NAME':
                
                     symbol = token.data;
-                    this.ts.nextTok();
-                    if (this.ts.lookTok(-1).data == "{"  && this.ts.lookTok(1).data == ":") {
+                  
+                    if (this.ts.look(0).data == "{"  && this.ts.lookTok(2).data == ":") {
                         // then we are in an object lit.. -> we need to flag the brace as such...
                         isObjectLitAr.pop();
                         isObjectLitAr.push(true);
@@ -591,11 +591,11 @@ ScopeParser.prototype = {
                         break;
                     }
                     isInObjectLitAr = isObjectLitAr[isObjectLitAr.length-1];
-                    if (isInObjectLitAr && this.ts.lookTok(-1).data == "," && this.ts.lookTok(1).data == ":") {
+                    if (isInObjectLitAr && this.ts.lookTok(0).data == "," && this.ts.lookTok(2).data == ":") {
                         break;
                     }
-                    print(this.ts.lookTok(-1).data);
-                    if (this.ts.lookTok(-1).data == ".") {
+                    print(this.ts.lookTok(0).data);
+                    if (this.ts.lookTok(0).data == ".") {
                         //skip '.'
                         break;
                     }