TypeScript/tests/cases/compiler/capturedLetConstInLoop13.ts
2017-02-07 18:23:22 -08:00

22 lines
388 B
TypeScript

class Main {
constructor() {
this.register("a", "b", "c");
}
private register(...names: string[]): void {
for (let name of names) {
this.bar({
[name + ".a"]: () => { this.foo(name); },
});
}
}
private bar(a: any): void { }
private foo(name: string): void { }
}
new Main();