22 lines
No EOL
388 B
TypeScript
22 lines
No EOL
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(); |