Skip to content

Commit

Permalink
chore(for-of): fix segments.js remove for of
Browse files Browse the repository at this point in the history
  • Loading branch information
plwalters committed Mar 2, 2016
1 parent adc9e31 commit 4af085d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/route-recognizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function parse(route, names, types) {
let results = [];

let splitRoute = normalizedRoute.split('/');
for (var i = 0; i < splitRoute.length; i++) {
for (let i = 0; i < splitRoute.length; i++) {
let segment = splitRoute[i];
let match = segment.match(/^:([^\/]+)$/);
if (match) {
Expand Down
3 changes: 2 additions & 1 deletion src/segments.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export class StaticSegment {
}

eachChar(callback: (spec: CharSpec) => void): void {
for (let ch of this.string) {
for (let i = 0; i < this.string.length; i++) {
let ch = this.string[i];
callback({ validChars: ch });
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/route-recognizer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ describe('route recognizer', () => {
expect(recognizer.recognize('/b')).toBeTruthy();
});

for (var i = routeTestData.length - 1; i >= 0; i--) {
var routeTest = routeTestData[i]
for (let i = routeTestData.length - 1; i >= 0; i--) {
let routeTest = routeTestData[i];

it(`should recognize ${routeTest.title}`, () => {
let recognizer = new RouteRecognizer();
Expand Down

0 comments on commit 4af085d

Please sign in to comment.