Skip to content

Commit 6565c4b

Browse files
Use for-of in the parser.
1 parent 62cbe97 commit 6565c4b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/compiler/parser.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module ts {
2727

2828
function visitEachNode<T>(cbNode: (node: Node) => T, nodes: Node[]) {
2929
if (nodes) {
30-
for (var i = 0, len = nodes.length; i < len; i++) {
31-
var result = cbNode(nodes[i]);
30+
for (let node of nodes) {
31+
var result = cbNode(node);
3232
if (result) {
3333
return result;
3434
}
@@ -436,8 +436,8 @@ module ts {
436436
array.pos += delta;
437437
array.end += delta;
438438

439-
for (var i = 0, n = array.length; i < n; i++) {
440-
visitNode(array[i]);
439+
for (let node of array) {
440+
visitNode(node);
441441
}
442442
}
443443
}
@@ -589,8 +589,8 @@ module ts {
589589

590590
// Adjust the pos or end (or both) of the intersecting array accordingly.
591591
adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
592-
for (var i = 0, n = array.length; i < n; i++) {
593-
visitNode(array[i]);
592+
for (let node of array) {
593+
visitNode(node);
594594
}
595595
return;
596596
}
@@ -948,7 +948,7 @@ module ts {
948948
if (position >= array.pos && position < array.end) {
949949
// position was in this array. Search through this array to see if we find a
950950
// viable element.
951-
for (var i = 0, n = array.length; i < n; i++) {
951+
for (let i = 0, n = array.length; i < n; i++) {
952952
var child = array[i];
953953
if (child) {
954954
if (child.pos === position) {

0 commit comments

Comments
 (0)