Skip to content

Commit fdab161

Browse files
committed
chore: test & accept baseline
1 parent c18daa0 commit fdab161

File tree

152 files changed

+3176
-3540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+3176
-3540
lines changed

testdata/baselines/reference/submodule/compiler/constructorWithParameterPropertiesAndPrivateFields.es2015.js

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,41 @@ class B {
3232

3333

3434
//// [constructorWithParameterPropertiesAndPrivateFields.es2015.js]
35+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
36+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
37+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
38+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
39+
};
40+
var _A_privateField, _B_privateField;
3541
// https://github.com/microsoft/TypeScript/issues/48771
3642
class A {
3743
exposedField;
38-
#privateField;
3944
constructor(arg, exposedField) {
45+
_A_privateField.set(this, void 0);
4046
this.exposedField = exposedField;
41-
({ key: this.#privateField } = arg);
47+
({ key: __classPrivateFieldGet(this, _A_privateField, "f") } = arg);
4248
}
4349
log() {
44-
console.log(this.#privateField);
50+
console.log(__classPrivateFieldGet(this, _A_privateField, "f"));
4551
console.log(this.exposedField);
4652
}
4753
}
54+
_A_privateField = new WeakMap( // https://github.com/microsoft/TypeScript/issues/48771
55+
// https://github.com/microsoft/TypeScript/issues/48771
56+
);
4857
class B {
4958
exposedField;
50-
#privateField;
5159
constructor(arg, exposedField) {
52-
"prologue";
60+
_B_privateField.set(this, void 0);
5361
"prologue";
5462
this.exposedField = exposedField;
55-
({ key: this.#privateField } = arg);
63+
({ key: __classPrivateFieldGet(this, _B_privateField, "f") } = arg);
5664
}
5765
log() {
58-
console.log(this.#privateField);
66+
console.log(__classPrivateFieldGet(this, _B_privateField, "f"));
5967
console.log(this.exposedField);
6068
}
6169
}
70+
_B_privateField = new WeakMap( // https://github.com/microsoft/TypeScript/issues/48771
71+
// https://github.com/microsoft/TypeScript/issues/48771
72+
);
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,60 @@
11
--- old.constructorWithParameterPropertiesAndPrivateFields.es2015.js
22
+++ new.constructorWithParameterPropertiesAndPrivateFields.es2015.js
3-
@@= skipped -32, +32 lines =@@
3+
@@= skipped -31, +31 lines =@@
4+
45

56
//// [constructorWithParameterPropertiesAndPrivateFields.es2015.js]
6-
// https://github.com/microsoft/TypeScript/issues/48771
7+
-// https://github.com/microsoft/TypeScript/issues/48771
78
-var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
89
- if (kind === "m") throw new TypeError("Private method is not writable");
910
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
1011
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
1112
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
1213
-};
13-
-var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14-
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15-
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
16-
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17-
-};
18-
-var _A_privateField, _B_privateField;
14+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
15+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
16+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
17+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
18+
};
19+
var _A_privateField, _B_privateField;
20+
+// https://github.com/microsoft/TypeScript/issues/48771
1921
class A {
2022
+ exposedField;
21-
+ #privateField;
2223
constructor(arg, exposedField) {
2324
- var _a;
24-
this.exposedField = exposedField;
25-
- _A_privateField.set(this, void 0);
25+
- this.exposedField = exposedField;
26+
_A_privateField.set(this, void 0);
2627
- (_a = this, { key: ({ set value(_b) { __classPrivateFieldSet(_a, _A_privateField, _b, "f"); } }).value } = arg);
27-
+ ({ key: this.#privateField } = arg);
28+
+ this.exposedField = exposedField;
29+
+ ({ key: __classPrivateFieldGet(this, _A_privateField, "f") } = arg);
2830
}
2931
log() {
30-
- console.log(__classPrivateFieldGet(this, _A_privateField, "f"));
31-
+ console.log(this.#privateField);
32+
console.log(__classPrivateFieldGet(this, _A_privateField, "f"));
3233
console.log(this.exposedField);
3334
}
3435
}
3536
-_A_privateField = new WeakMap();
37+
+_A_privateField = new WeakMap( // https://github.com/microsoft/TypeScript/issues/48771
38+
+// https://github.com/microsoft/TypeScript/issues/48771
39+
+);
3640
class B {
3741
+ exposedField;
38-
+ #privateField;
3942
constructor(arg, exposedField) {
40-
"prologue";
43+
- "prologue";
4144
- var _a;
42-
+ "prologue";
43-
this.exposedField = exposedField;
44-
- _B_privateField.set(this, void 0);
45+
- this.exposedField = exposedField;
46+
_B_privateField.set(this, void 0);
4547
- (_a = this, { key: ({ set value(_b) { __classPrivateFieldSet(_a, _B_privateField, _b, "f"); } }).value } = arg);
46-
+ ({ key: this.#privateField } = arg);
48+
+ "prologue";
49+
+ this.exposedField = exposedField;
50+
+ ({ key: __classPrivateFieldGet(this, _B_privateField, "f") } = arg);
4751
}
4852
log() {
49-
- console.log(__classPrivateFieldGet(this, _B_privateField, "f"));
50-
+ console.log(this.#privateField);
53+
console.log(__classPrivateFieldGet(this, _B_privateField, "f"));
5154
console.log(this.exposedField);
5255
}
5356
}
54-
-_B_privateField = new WeakMap();
57+
-_B_privateField = new WeakMap();
58+
+_B_privateField = new WeakMap( // https://github.com/microsoft/TypeScript/issues/48771
59+
+// https://github.com/microsoft/TypeScript/issues/48771
60+
+);

testdata/baselines/reference/submodule/compiler/extendedUnicodePlaneIdentifiers.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,17 @@ const 𝓮𡚭𓀺ⱱ = "ok";
4646

4747

4848
//// [extendedUnicodePlaneIdentifiers.js]
49+
var _K_𝑚, _K_𝑀;
4950
const 𝑚 = 4;
5051
const 𝑀 = 5;
5152
console.log(𝑀 + 𝑚); // 9
5253
class K {
53-
#𝑚 = 4;
54-
#𝑀 = 5;
54+
constructor() {
55+
_K_𝑚.set(this, 4);
56+
_K_𝑀.set(this, 5);
57+
}
5558
}
59+
_K_𝑚 = new WeakMap(), _K_𝑀 = new WeakMap();
5660
// lower 8 bits look like 'a'
5761
const = 6;
5862
console.log( ** );

testdata/baselines/reference/submodule/compiler/extendedUnicodePlaneIdentifiers.js.diff

Lines changed: 0 additions & 22 deletions
This file was deleted.

testdata/baselines/reference/submodule/compiler/importHelpersES6.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ export declare function __classPrivateFieldIn(a: any, b: any): boolean;
2323

2424

2525
//// [a.js]
26+
import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
27+
var _A_x;
2628
@dec
2729
export class A {
28-
#x = 1;
29-
async f() { this.#x = await this.#x; }
30+
constructor() {
31+
_A_x.set(this, 1);
32+
}
33+
async f() { __classPrivateFieldSet(this, _A_x, await __classPrivateFieldGet(this, _A_x, "f"), "f"); }
3034
g(u) { return #x in u; }
3135
}
36+
_A_x = new WeakMap();
3237
const o = { a: 1 };
3338
const y = Object.assign({}, o);

testdata/baselines/reference/submodule/compiler/importHelpersES6.js.diff

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55

66
//// [a.js]
7-
-var _A_x;
7+
+import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
8+
var _A_x;
89
-import { __awaiter, __classPrivateFieldGet, __classPrivateFieldIn, __classPrivateFieldSet, __decorate } from "tslib";
910
-let A = class A {
10-
- constructor() {
11-
- _A_x.set(this, 1);
12-
- }
11+
+@dec
12+
+export class A {
13+
constructor() {
14+
_A_x.set(this, 1);
15+
}
1316
- f() {
1417
- return __awaiter(this, void 0, void 0, function* () { __classPrivateFieldSet(this, _A_x, yield __classPrivateFieldGet(this, _A_x, "f"), "f"); });
1518
- }
1619
- g(u) { return __classPrivateFieldIn(_A_x, u); }
1720
-};
18-
-_A_x = new WeakMap();
21+
+ async f() { __classPrivateFieldSet(this, _A_x, await __classPrivateFieldGet(this, _A_x, "f"), "f"); }
22+
+ g(u) { return #x in u; }
23+
+}
24+
_A_x = new WeakMap();
1925
-A = __decorate([
2026
- dec
2127
-], A);
2228
-export { A };
23-
+@dec
24-
+export class A {
25-
+ #x = 1;
26-
+ async f() { this.#x = await this.#x; }
27-
+ g(u) { return #x in u; }
28-
+}
2929
const o = { a: 1 };
3030
const y = Object.assign({}, o);

testdata/baselines/reference/submodule/compiler/importHelpersNoHelpersForPrivateFields.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ export {}
1515

1616
//// [main.js]
1717
"use strict";
18+
var _Foo_field;
1819
Object.defineProperty(exports, "__esModule", { value: true });
1920
exports.Foo = void 0;
21+
const tslib_1 = require("tslib");
2022
class Foo {
21-
#field = true;
23+
constructor() {
24+
_Foo_field.set(this, true);
25+
}
2226
f() {
23-
this.#field = this.#field;
27+
tslib_1.__classPrivateFieldSet(this, _Foo_field, tslib_1.__classPrivateFieldGet(this, _Foo_field, "f"), "f");
2428
#field in this;
2529
}
2630
}
2731
exports.Foo = Foo;
32+
_Foo_field = new WeakMap();
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
--- old.importHelpersNoHelpersForPrivateFields.js
22
+++ new.importHelpersNoHelpersForPrivateFields.js
3-
@@= skipped -14, +14 lines =@@
4-
5-
//// [main.js]
6-
"use strict";
7-
-var _Foo_field;
8-
Object.defineProperty(exports, "__esModule", { value: true });
9-
exports.Foo = void 0;
10-
-const tslib_1 = require("tslib");
11-
class Foo {
12-
- constructor() {
13-
- _Foo_field.set(this, true);
14-
- }
15-
+ #field = true;
3+
@@= skipped -24, +24 lines =@@
4+
}
165
f() {
17-
- tslib_1.__classPrivateFieldSet(this, _Foo_field, tslib_1.__classPrivateFieldGet(this, _Foo_field, "f"), "f");
6+
tslib_1.__classPrivateFieldSet(this, _Foo_field, tslib_1.__classPrivateFieldGet(this, _Foo_field, "f"), "f");
187
- tslib_1.__classPrivateFieldIn(_Foo_field, this);
19-
+ this.#field = this.#field;
208
+ #field in this;
219
}
2210
}
23-
exports.Foo = Foo;
24-
-_Foo_field = new WeakMap();
11+
exports.Foo = Foo;

testdata/baselines/reference/submodule/compiler/privateFieldAssignabilityFromUnknown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ const task: Class = {} as unknown;
1010

1111
//// [privateFieldAssignabilityFromUnknown.js]
1212
"use strict";
13+
var _Class_field;
1314
Object.defineProperty(exports, "__esModule", { value: true });
1415
exports.Class = void 0;
1516
class Class {
16-
#field;
17+
constructor() {
18+
_Class_field.set(this, void 0);
19+
}
1720
}
1821
exports.Class = Class;
22+
_Class_field = new WeakMap();
1923
const task = {};

testdata/baselines/reference/submodule/compiler/privateFieldAssignabilityFromUnknown.js.diff

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)