JSDOC/BuildDocs.js
[gnome.introspection-doc-generator] / JSDOC / TokenReader.js
index 6a71e19..e367849 100644 (file)
@@ -149,7 +149,7 @@ TokenReader = XObject.define(
          */
         read_newline : function(/**JSDOC.TokenStream*/stream, tokens) {
             var found = "";
-            
+            var line = this.line;
             while (!stream.look().eof && Lang.isNewline(stream.look())) {
                 this.line++;
                 found += stream.next();
@@ -164,11 +164,11 @@ TokenReader = XObject.define(
             }
             if (this.keepWhite) {
                 var last = tokens.pop();
-                if (last.name != "WHIT") {
+                if (last && last.name != "WHIT") {
                     tokens.push(last);
                 }
                 
-                tokens.push(new Token(found, "WHIT", "NEWLINE", this.line));
+                tokens.push(new Token(found, "WHIT", "NEWLINE", line));
             }
             return true;
         },