Files
tsgo/testdata/baselines/reference/submodule/compiler/destructuringAssignment_private.js

34 lines
735 B
TypeScript

//// [tests/cases/compiler/destructuringAssignment_private.ts] ////
//// [destructuringAssignment_private.ts]
class C {
private x = 0;
private o = [{ a: 1 }];
}
let x: number;
([{ a: { x } }] = [{ a: new C() }]);
({ o: [{ a: x }]} = new C());
const nameX = "x";
([{ a: { [nameX]: x } }] = [{ a: new C() }]);
const nameO = "o";
({ [nameO]: [{ a: x }]} = new C());
//// [destructuringAssignment_private.js]
"use strict";
class C {
constructor() {
this.x = 0;
this.o = [{ a: 1 }];
}
}
let x;
([{ a: { x } }] = [{ a: new C() }]);
({ o: [{ a: x }] } = new C());
const nameX = "x";
([{ a: { [nameX]: x } }] = [{ a: new C() }]);
const nameO = "o";
({ [nameO]: [{ a: x }] } = new C());