JSDOC/TokenStream.vala
authorAlan Knowles <alan@roojs.com>
Wed, 30 Sep 2015 10:01:42 +0000 (18:01 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 30 Sep 2015 10:01:42 +0000 (18:01 +0800)
JSDOC/TokenStream.vala

index fb2f884..096e954 100644 (file)
@@ -161,8 +161,9 @@ namespace JSDOC {
            public Gee.ArrayList<Token> nextM(uint howMany) {
                
                    //if (typeof howMany == "undefined") howMany = 1;
-                   // if (howMany < 1) { return  null;                 }
-                   
+                   if (howMany < 1) { 
+                               throw new JSDOC.TokenStreamError("nextM called with wrong number : %d",howMany);
+                   }
                    var got = new Gee.ArrayList<Token>();
 
                    for (var i = 1; i <= howMany; i++) {