TypeScript/tests/baselines/reference/typeOfThisInStaticMembers13(target=es5).js
Wenlu Wang dc237b317e
Change static fields emits (#43114)
* use emit into iife

* Update emit

* Revert un-related changes

* Allow super in static context

* Allow this and super in static property declaration

* Add more tests

* Avoid errors

* Accept baseline

* Accept baseline

* Add decorated classes test

* Add errors

* Avoid this in emitter

* make lint happy

* Add class expression tests

* Add computed name test

* Avoid super if target below es6

* Adjust function boundary

* Add internal

* Fix minor CR issues

* accept baseline

* Update behavior

* Avoid spaces

* Make lint happy

* Avoid function boundary utils

* Update baseline

* Avoid errors

* Accept baseline

* Accept baseline

* Accept baseline

* Accept baseline

* Use substitutions

* Full coverage for super, this, merge static and private context

* Fix use-before-def in static fields

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
2021-06-25 15:49:27 -07:00

50 lines
1.3 KiB
TypeScript

//// [typeOfThisInStaticMembers13.ts]
class C {
static readonly c: "foo" = "foo"
static bar = class Inner {
static [this.c] = 123;
[this.c] = 123;
}
}
//// [typeOfThisInStaticMembers13.js]
var C = /** @class */ (function () {
function C() {
}
var _a, _b, _c, _d;
_a = C;
Object.defineProperty(C, "c", {
enumerable: true,
configurable: true,
writable: true,
value: "foo"
});
Object.defineProperty(C, "bar", {
enumerable: true,
configurable: true,
writable: true,
value: (_b = /** @class */ (function () {
function Inner() {
Object.defineProperty(this, _d, {
enumerable: true,
configurable: true,
writable: true,
value: 123
});
}
return Inner;
}()),
_c = _a.c,
_d = _a.c,
Object.defineProperty(_b, _c, {
enumerable: true,
configurable: true,
writable: true,
value: 123
}),
_b)
});
return C;
}());