Skip to content

Commit 946fb65

Browse files
authored
Baseline changes for ESNext Class Property Transformation (#4)
* Add baselines * Update baselines
1 parent 466906b commit 946fb65

19 files changed

+159
-161
lines changed

tests/baselines/reference/declarationEmitPrivateSymbolCausesVarDeclarationEmit2.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ var C = /** @class */ (function () {
3434
}
3535
return C;
3636
}());
37-
_a = a_1.x;
3837
exports.C = C;
38+
_a = a_1.x;
3939
//// [c.js]
4040
"use strict";
4141
var __extends = (this && this.__extends) || (function () {
@@ -64,8 +64,8 @@ var D = /** @class */ (function (_super) {
6464
}
6565
return D;
6666
}(b_1.C));
67-
_a = a_1.x;
6867
exports.D = D;
68+
_a = a_1.x;
6969

7070

7171
//// [a.d.ts]

tests/baselines/reference/decoratorsOnComputedProperties.js

+73-72
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
196196
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
197197
return c > 3 && r && Object.defineProperty(target, key, r), r;
198198
};
199-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
199+
var _a, _b, _c, _d;
200+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
200201
function x(o, k) { }
201202
let i = 0;
202203
function foo() { return ++i + ""; }
@@ -209,11 +210,11 @@ class A {
209210
this[Symbol.iterator] = null;
210211
this["property4"] = 2;
211212
this[Symbol.match] = null;
212-
this[_b] = null;
213-
this[_d] = null;
213+
this[_f] = null;
214+
this[_h] = null;
214215
}
215216
}
216-
foo(), _a = foo(), _b = foo(), _c = fieldNameB, _d = fieldNameC;
217+
foo(), _e = foo(), _f = foo(), _g = fieldNameB, _h = fieldNameC;
217218
__decorate([
218219
x
219220
], A.prototype, "property", void 0);
@@ -228,42 +229,42 @@ __decorate([
228229
], A.prototype, Symbol.iterator, void 0);
229230
__decorate([
230231
x
231-
], A.prototype, _a, void 0);
232+
], A.prototype, _e, void 0);
232233
__decorate([
233234
x
234-
], A.prototype, _b, void 0);
235+
], A.prototype, _f, void 0);
235236
__decorate([
236237
x
237-
], A.prototype, _c, void 0);
238+
], A.prototype, _g, void 0);
238239
__decorate([
239240
x
240-
], A.prototype, _d, void 0);
241-
void (_j = class B {
241+
], A.prototype, _h, void 0);
242+
void (_a = class B {
242243
constructor() {
243244
this["property2"] = 2;
244245
this[Symbol.iterator] = null;
245246
this["property4"] = 2;
246247
this[Symbol.match] = null;
247-
this[_f] = null;
248-
this[_h] = null;
248+
this[_k] = null;
249+
this[_m] = null;
249250
}
250251
},
251252
foo(),
252-
_e = foo(),
253-
_f = foo(),
254-
_g = fieldNameB,
255-
_h = fieldNameC,
256-
_j);
253+
_j = foo(),
254+
_k = foo(),
255+
_l = fieldNameB,
256+
_m = fieldNameC,
257+
_a);
257258
class C {
258259
constructor() {
259260
this["property2"] = 2;
260261
this[Symbol.iterator] = null;
261262
this["property4"] = 2;
262263
this[Symbol.match] = null;
263-
this[_l] = null;
264-
this[_o] = null;
264+
this[_p] = null;
265+
this[_r] = null;
265266
}
266-
[(foo(), _k = foo(), _l = foo(), _m = fieldNameB, _o = fieldNameC, "some" + "method")]() { }
267+
[(foo(), _o = foo(), _p = foo(), _q = fieldNameB, _r = fieldNameC, "some" + "method")]() { }
267268
}
268269
__decorate([
269270
x
@@ -279,39 +280,39 @@ __decorate([
279280
], C.prototype, Symbol.iterator, void 0);
280281
__decorate([
281282
x
282-
], C.prototype, _k, void 0);
283+
], C.prototype, _o, void 0);
283284
__decorate([
284285
x
285-
], C.prototype, _l, void 0);
286+
], C.prototype, _p, void 0);
286287
__decorate([
287288
x
288-
], C.prototype, _m, void 0);
289+
], C.prototype, _q, void 0);
289290
__decorate([
290291
x
291-
], C.prototype, _o, void 0);
292+
], C.prototype, _r, void 0);
292293
void class D {
293294
constructor() {
294295
this["property2"] = 2;
295296
this[Symbol.iterator] = null;
296297
this["property4"] = 2;
297298
this[Symbol.match] = null;
298-
this[_q] = null;
299-
this[_s] = null;
299+
this[_t] = null;
300+
this[_v] = null;
300301
}
301-
[(foo(), _p = foo(), _q = foo(), _r = fieldNameB, _s = fieldNameC, "some" + "method")]() { }
302+
[(foo(), _s = foo(), _t = foo(), _u = fieldNameB, _v = fieldNameC, "some" + "method")]() { }
302303
};
303304
class E {
304305
constructor() {
305306
this["property2"] = 2;
306307
this[Symbol.iterator] = null;
307308
this["property4"] = 2;
308309
this[Symbol.match] = null;
309-
this[_u] = null;
310-
this[_w] = null;
310+
this[_x] = null;
311+
this[_z] = null;
311312
}
312-
[(foo(), _t = foo(), _u = foo(), "some" + "method")]() { }
313+
[(foo(), _w = foo(), _x = foo(), "some" + "method")]() { }
313314
}
314-
_v = fieldNameB, _w = fieldNameC;
315+
_y = fieldNameB, _z = fieldNameC;
315316
__decorate([
316317
x
317318
], E.prototype, "property", void 0);
@@ -326,43 +327,43 @@ __decorate([
326327
], E.prototype, Symbol.iterator, void 0);
327328
__decorate([
328329
x
329-
], E.prototype, _t, void 0);
330+
], E.prototype, _w, void 0);
330331
__decorate([
331332
x
332-
], E.prototype, _u, void 0);
333+
], E.prototype, _x, void 0);
333334
__decorate([
334335
x
335-
], E.prototype, _v, void 0);
336+
], E.prototype, _y, void 0);
336337
__decorate([
337338
x
338-
], E.prototype, _w, void 0);
339-
void (_1 = class F {
339+
], E.prototype, _z, void 0);
340+
void (_b = class F {
340341
constructor() {
341342
this["property2"] = 2;
342343
this[Symbol.iterator] = null;
343344
this["property4"] = 2;
344345
this[Symbol.match] = null;
345-
this[_y] = null;
346-
this[_0] = null;
346+
this[_1] = null;
347+
this[_3] = null;
347348
}
348-
[(foo(), _x = foo(), _y = foo(), "some" + "method")]() { }
349+
[(foo(), _0 = foo(), _1 = foo(), "some" + "method")]() { }
349350
},
350-
_z = fieldNameB,
351-
_0 = fieldNameC,
352-
_1);
351+
_2 = fieldNameB,
352+
_3 = fieldNameC,
353+
_b);
353354
class G {
354355
constructor() {
355356
this["property2"] = 2;
356357
this[Symbol.iterator] = null;
357358
this["property4"] = 2;
358359
this[Symbol.match] = null;
359-
this[_3] = null;
360360
this[_5] = null;
361+
this[_7] = null;
361362
}
362-
[(foo(), _2 = foo(), _3 = foo(), "some" + "method")]() { }
363-
[(_4 = fieldNameB, "some" + "method2")]() { }
363+
[(foo(), _4 = foo(), _5 = foo(), "some" + "method")]() { }
364+
[(_6 = fieldNameB, "some" + "method2")]() { }
364365
}
365-
_5 = fieldNameC;
366+
_7 = fieldNameC;
366367
__decorate([
367368
x
368369
], G.prototype, "property", void 0);
@@ -377,43 +378,43 @@ __decorate([
377378
], G.prototype, Symbol.iterator, void 0);
378379
__decorate([
379380
x
380-
], G.prototype, _2, void 0);
381+
], G.prototype, _4, void 0);
381382
__decorate([
382383
x
383-
], G.prototype, _3, void 0);
384+
], G.prototype, _5, void 0);
384385
__decorate([
385386
x
386-
], G.prototype, _4, void 0);
387+
], G.prototype, _6, void 0);
387388
__decorate([
388389
x
389-
], G.prototype, _5, void 0);
390-
void (_10 = class H {
390+
], G.prototype, _7, void 0);
391+
void (_c = class H {
391392
constructor() {
392393
this["property2"] = 2;
393394
this[Symbol.iterator] = null;
394395
this["property4"] = 2;
395396
this[Symbol.match] = null;
396-
this[_7] = null;
397397
this[_9] = null;
398+
this[_11] = null;
398399
}
399-
[(foo(), _6 = foo(), _7 = foo(), "some" + "method")]() { }
400-
[(_8 = fieldNameB, "some" + "method2")]() { }
400+
[(foo(), _8 = foo(), _9 = foo(), "some" + "method")]() { }
401+
[(_10 = fieldNameB, "some" + "method2")]() { }
401402
},
402-
_9 = fieldNameC,
403-
_10);
403+
_11 = fieldNameC,
404+
_c);
404405
class I {
405406
constructor() {
406407
this["property2"] = 2;
407408
this[Symbol.iterator] = null;
408409
this["property4"] = 2;
409410
this[Symbol.match] = null;
410-
this[_12] = null;
411-
this[_15] = null;
411+
this[_13] = null;
412+
this[_16] = null;
412413
}
413-
[(foo(), _11 = foo(), _12 = foo(), _13 = "some" + "method")]() { }
414-
[(_14 = fieldNameB, "some" + "method2")]() { }
414+
[(foo(), _12 = foo(), _13 = foo(), _14 = "some" + "method")]() { }
415+
[(_15 = fieldNameB, "some" + "method2")]() { }
415416
}
416-
_15 = fieldNameC;
417+
_16 = fieldNameC;
417418
__decorate([
418419
x
419420
], I.prototype, "property", void 0);
@@ -426,32 +427,32 @@ __decorate([
426427
__decorate([
427428
x
428429
], I.prototype, Symbol.iterator, void 0);
429-
__decorate([
430-
x
431-
], I.prototype, _11, void 0);
432430
__decorate([
433431
x
434432
], I.prototype, _12, void 0);
435433
__decorate([
436434
x
437-
], I.prototype, _13, null);
435+
], I.prototype, _13, void 0);
438436
__decorate([
439437
x
440-
], I.prototype, _14, void 0);
438+
], I.prototype, _14, null);
441439
__decorate([
442440
x
443441
], I.prototype, _15, void 0);
444-
void (_21 = class J {
442+
__decorate([
443+
x
444+
], I.prototype, _16, void 0);
445+
void (_d = class J {
445446
constructor() {
446447
this["property2"] = 2;
447448
this[Symbol.iterator] = null;
448449
this["property4"] = 2;
449450
this[Symbol.match] = null;
450-
this[_17] = null;
451-
this[_20] = null;
451+
this[_18] = null;
452+
this[_21] = null;
452453
}
453-
[(foo(), _16 = foo(), _17 = foo(), _18 = "some" + "method")]() { }
454-
[(_19 = fieldNameB, "some" + "method2")]() { }
454+
[(foo(), _17 = foo(), _18 = foo(), _19 = "some" + "method")]() { }
455+
[(_20 = fieldNameB, "some" + "method2")]() { }
455456
},
456-
_20 = fieldNameC,
457-
_21);
457+
_21 = fieldNameC,
458+
_d);

tests/baselines/reference/dynamicNamesErrors.js

+2
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ const y = Symbol();
7373
const z = Symbol();
7474
const w = Symbol();
7575
class ClassMemberVisibility {
76+
static [x];
7677
static [y]() { return 0; }
7778
static get [z]() { return 0; }
7879
static set [w](value) { }
80+
[x];
7981
[y]() { return 0; }
8082
get [z]() { return 0; }
8183
set [w](value) { }

tests/baselines/reference/importCallExpression4ESNext.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ export function foo() { return "foo"; }
3535
export function backup() { return "backup"; }
3636
//// [2.js]
3737
class C {
38-
constructor() {
39-
this.myModule = import("./0");
40-
}
38+
myModule = import("./0");
4139
method() {
4240
const loadAsync = import("./0");
4341
this.myModule.then(Zero => {

tests/baselines/reference/importCallExpressionAsyncESNext.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ export const obj = {
4343
}
4444
};
4545
export class cl2 {
46-
constructor() {
47-
this.p = {
48-
m: async () => {
49-
const req = await import('./test'); // FOUR
50-
}
51-
};
52-
}
46+
p = {
47+
m: async () => {
48+
const req = await import('./test'); // FOUR
49+
}
50+
};
5351
}
5452
export const l = async () => {
5553
const req = await import('./test'); // FIVE

tests/baselines/reference/importCallExpressionInAMD4.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ define(["require", "exports"], function (require, exports) {
6363
"use strict";
6464
Object.defineProperty(exports, "__esModule", { value: true });
6565
class C {
66-
constructor() {
67-
this.myModule = new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); });
68-
}
66+
myModule = new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); });
6967
method() {
7068
const loadAsync = new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); });
7169
this.myModule.then(Zero => {
@@ -78,9 +76,7 @@ define(["require", "exports"], function (require, exports) {
7876
}
7977
}
8078
class D {
81-
constructor() {
82-
this.myModule = new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); });
83-
}
79+
myModule = new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); });
8480
method() {
8581
const loadAsync = new Promise((resolve_5, reject_5) => { require(["./0"], resolve_5, reject_5); });
8682
this.myModule.then(Zero => {

0 commit comments

Comments
 (0)