JSDOC/Packer.js
[gnome.introspection-doc-generator] / JSDOC / TokenStream.js
index 831a99a..b5385a6 100644 (file)
@@ -34,7 +34,9 @@ TokenStream = Object.define(
             if (typeof n == "undefined") n = 0;
 
             if (considerWhitespace == true) {
-                if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
+                if (this.cursor+n < 0 || this.cursor+n > (this.tokens.length -1)) {
+                    return new Token("", "VOID", "START_OF_STREAM");
+                }
                 return this.tokens[this.cursor+n];
             }
             else {