mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
613 B
TypeScript
26 lines
613 B
TypeScript
//// [tests/cases/compiler/classExpressionWithStaticProperties3.ts] ////
|
|
|
|
//// [classExpressionWithStaticProperties3.ts]
|
|
declare var console: any;
|
|
const arr: {y(): number}[] = [];
|
|
for (let i = 0; i < 3; i++) {
|
|
arr.push(class C {
|
|
static x = i;
|
|
static y = () => C.x * 2;
|
|
});
|
|
}
|
|
arr.forEach(C => console.log(C.y()));
|
|
|
|
//// [classExpressionWithStaticProperties3.js]
|
|
"use strict";
|
|
var _a;
|
|
const arr = [];
|
|
for (let i = 0; i < 3; i++) {
|
|
arr.push((_a = class C {
|
|
},
|
|
_a.x = i,
|
|
_a.y = () => _a.x * 2,
|
|
_a));
|
|
}
|
|
arr.forEach(C => console.log(C.y()));
|