[traverseAllChildren] fix out-of-scope var use.

Dear ES6 gods, bring us `let` soon.

This fixes an issue where non-keyed iterables are used as children and the value of `i` would be undefined because its used out of scope. This adds a separately scoped iteration index value and appropriately increments it as iteration continues. Doi.

While I'm in there, make the usage of falsey `nameSoFar` more obvious and more consistent with the existing usage on L115

Test plan: first wrote a test covering this previously untested path. Saw an identical issue as was experienced in development environment. Then ensured test passed after this diff.
The JSX should call createElement which does the validation.

> On Nov 3, 2014, at 6:41 PM, Lee Byron <notifications@github.com> wrote:
> 
> In src/utils/__tests__/traverseAllChildren-test.js:
> 
> > +            }
> > +          }
> > +        };
> > +      }
> > +    };
> > +
> > +    var traverseContext = [];
> > +    var traverseFn =
> > +      jasmine.createSpy().andCallFake(function(context, kid, key, index) {
> > +        context.push(kid);
> > +      });
> > +
> > +    var instance = (
> > +      <div>
> > +        {threeDivIterable}
> > +      </div>
> I'm wrong below. No warning because it doesn't hit that code path. This is a unit test of traverseAllChildren which is self-contained. The warning is in ReactElementValidator, not a dependency here.
> 
> —
> Reply to this email directly or view it on GitHub.