mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
40 lines
706 B
TypeScript
40 lines
706 B
TypeScript
//// [tests/cases/conformance/classes/propertyMemberDeclarations/instanceMemberInitialization.ts] ////
|
|
|
|
//// [instanceMemberInitialization.ts]
|
|
class C {
|
|
x = 1;
|
|
}
|
|
|
|
var c = new C();
|
|
c.x = 3;
|
|
var c2 = new C();
|
|
var r = c.x === c2.x;
|
|
|
|
// #31792
|
|
|
|
|
|
|
|
class MyMap<K, V> {
|
|
constructor(private readonly Map_: { new<K, V>(): any }) {}
|
|
private readonly store = new this.Map_<K, V>();
|
|
}
|
|
|
|
//// [instanceMemberInitialization.js]
|
|
"use strict";
|
|
class C {
|
|
constructor() {
|
|
this.x = 1;
|
|
}
|
|
}
|
|
var c = new C();
|
|
c.x = 3;
|
|
var c2 = new C();
|
|
var r = c.x === c2.x;
|
|
// #31792
|
|
class MyMap {
|
|
constructor(Map_) {
|
|
this.Map_ = Map_;
|
|
this.store = new this.Map_();
|
|
}
|
|
}
|