Add type annotations for Whitespace._findToken
This commit is contained in:
parent
993c5a572b
commit
d11a2e3d48
@ -82,9 +82,9 @@ export default class Whitespace {
|
||||
* Find a token between start and end.
|
||||
*/
|
||||
|
||||
_findToken(test, start, end) {
|
||||
_findToken(test: Function, start: number, end: number): ?number {
|
||||
const middle = (start + end) >>> 1;
|
||||
const match = test(this.tokens[middle]);
|
||||
const match: number = test(this.tokens[middle]);
|
||||
if (match < 0 && end > middle) {
|
||||
return this._findToken(test, middle + 1, end);
|
||||
} else if (match > 0 && start < middle) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user