@@ -81,6 +81,10 @@ addToLibrary({
8181
8282 // Returns a tokenized array of the given string expression, i.e. "FOO > BAR && BAZ" -> ["FOO", ">", "BAR", "&&", "BAZ"]
8383 // Optionally keeps whitespace as tokens to be able to reconstruct the original input string.
84+ /**
85+ * @param {string } exprString
86+ * @param {(number|boolean)= } keepWhitespace Optional, can be omitted. Defaults to false.
87+ */
8488 function tokenize ( exprString , keepWhitespace ) {
8589 var out = [ ] , len = exprString . length ;
8690 for ( var i = 0 ; i <= len ; ++ i ) {
@@ -109,8 +113,12 @@ addToLibrary({
109113 }
110114
111115 // Expands preprocessing macros on substring str[lineStart...lineEnd]
112- function expandMacros ( str , lineStart , lineEnd ) {
113- if ( lineEnd === undefined ) lineEnd = str . length ;
116+ /**
117+ * @param {string } str
118+ * @param {number } lineStart
119+ * @param {number= } lineEnd Optional, may be omitted.
120+ */
121+ function expandMacros ( str , lineStart , lineEnd = str . length ) {
114122 var len = str . length ;
115123 var out = '' ;
116124 for ( var i = lineStart ; i < lineEnd ; ++ i ) {
@@ -168,7 +176,7 @@ addToLibrary({
168176
169177 if ( operatorAndPriority == 13 /* parens '(' */ ) {
170178 // Find the closing parens position
171- var j = find_closing_parens_index ( tokens , i ) ;
179+ j = find_closing_parens_index ( tokens , i ) ;
172180 if ( j ) {
173181 tokens . splice ( i , j + 1 - i , buildExprTree ( tokens . slice ( i + 1 , j ) ) ) ;
174182 return tokens ;
@@ -224,7 +232,7 @@ addToLibrary({
224232 if ( i < 0 ) i = len ;
225233
226234 // Find the first non-whitespace character on the line.
227- for ( var j = lineStart ; j < i && isWhitespace ( code , j ) ; ++ j ) ;
235+ for ( var j = lineStart ; j < i && isWhitespace ( code , j ) ; ) ++ j ;
228236
229237 // Is this a non-preprocessor directive line?
230238 var thisLineIsInActivePreprocessingBlock = stack [ stack . length - 1 ] ;
0 commit comments