mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
54 lines
665 B
TypeScript
54 lines
665 B
TypeScript
//// [tests/cases/compiler/autoLift2.ts] ////
|
|
|
|
//// [autoLift2.ts]
|
|
class A
|
|
|
|
{
|
|
constructor() {
|
|
this.foo: any;
|
|
this.bar: any;
|
|
}
|
|
|
|
|
|
baz() {
|
|
|
|
this.foo = "foo";
|
|
|
|
this.bar = "bar";
|
|
|
|
[1, 2].forEach((p) => this.foo);
|
|
|
|
[1, 2].forEach((p) => this.bar);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
var a = new A();
|
|
|
|
a.baz();
|
|
|
|
|
|
|
|
|
|
//// [autoLift2.js]
|
|
"use strict";
|
|
class A {
|
|
constructor() {
|
|
this.foo;
|
|
any;
|
|
this.bar;
|
|
any;
|
|
}
|
|
baz() {
|
|
this.foo = "foo";
|
|
this.bar = "bar";
|
|
[1, 2].forEach((p) => this.foo);
|
|
[1, 2].forEach((p) => this.bar);
|
|
}
|
|
}
|
|
var a = new A();
|
|
a.baz();
|