|
| 1 | +//// [tests/cases/conformance/classes/members/privateNames/privateNamesEscapeSequences01.ts] //// |
| 2 | + |
| 3 | +//// [IdentifierNameWithEscape1.ts] |
| 4 | +export class IdentifierNameWithEscape1 { |
| 5 | + \u0078: number; |
| 6 | + |
| 7 | + constructor() { |
| 8 | + this.\u0078 = 0; |
| 9 | + } |
| 10 | + |
| 11 | + doThing() { |
| 12 | + this.x = 42; |
| 13 | + } |
| 14 | +} |
| 15 | + |
| 16 | +//// [IdentifierNameWithEscape2.ts] |
| 17 | +export class IdentifierNameWithEscape2 { |
| 18 | + x\u0078: number; |
| 19 | + |
| 20 | + constructor() { |
| 21 | + this.x\u0078 = 0; |
| 22 | + } |
| 23 | + |
| 24 | + doThing() { |
| 25 | + this.xx = 42; |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +//// [IdentifierNameWithExtendedEscape1.ts] |
| 30 | +export class IdentifierNameWithExtendedEscape1 { |
| 31 | + \u{78}: number; |
| 32 | + |
| 33 | + constructor() { |
| 34 | + this.\u{78} = 0; |
| 35 | + } |
| 36 | + |
| 37 | + doThing() { |
| 38 | + this.x = 42; |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +//// [IdentifierNameWithExtendedEscape2.ts] |
| 43 | +export class IdentifierNameWithExtendedEscape2 { |
| 44 | + x\u{78}: number; |
| 45 | + |
| 46 | + constructor() { |
| 47 | + this.x\u{78} = 0; |
| 48 | + } |
| 49 | + |
| 50 | + doThing() { |
| 51 | + this.xx = 42; |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +//// [PrivateIdentifierNameWithEscape1.ts] |
| 56 | +export class PrivateIdentifierWithEscape1 { |
| 57 | + #\u0078: number; |
| 58 | + |
| 59 | + constructor() { |
| 60 | + this.#\u0078 = 0; |
| 61 | + } |
| 62 | + |
| 63 | + doThing() { |
| 64 | + this.#x = 42; |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +//// [PrivateIdentifierNameWithEscape2.ts] |
| 69 | +export class PrivateIdentifierWithEscape2 { |
| 70 | + #x\u0078: number; |
| 71 | + |
| 72 | + constructor() { |
| 73 | + this.#x\u0078 = 0; |
| 74 | + } |
| 75 | + |
| 76 | + doThing() { |
| 77 | + this.#xx = 42; |
| 78 | + } |
| 79 | +} |
| 80 | + |
| 81 | +//// [PrivateIdentifierNameWithExtendedEscape1.ts] |
| 82 | +export class PrivateIdentifierWithExtendedEscape1 { |
| 83 | + #\u{78}: number; |
| 84 | + |
| 85 | + constructor() { |
| 86 | + this.#\u{78} = 0; |
| 87 | + } |
| 88 | + |
| 89 | + doThing() { |
| 90 | + this.#x = 42; |
| 91 | + } |
| 92 | +} |
| 93 | + |
| 94 | +//// [PrivateIdentifierNameWithExtendedEscape2.ts] |
| 95 | +export class PrivateIdentifierWithExtendedEscape2 { |
| 96 | + #x\u{78}: number; |
| 97 | + |
| 98 | + constructor() { |
| 99 | + this.#x\u{78} = 0; |
| 100 | + } |
| 101 | + |
| 102 | + doThing() { |
| 103 | + this.#xx = 42; |
| 104 | + } |
| 105 | +} |
| 106 | + |
| 107 | + |
| 108 | +//// [IdentifierNameWithEscape1.js] |
| 109 | +export class IdentifierNameWithEscape1 { |
| 110 | + constructor() { |
| 111 | + this.\u0078 = 0; |
| 112 | + } |
| 113 | + doThing() { |
| 114 | + this.x = 42; |
| 115 | + } |
| 116 | +} |
| 117 | +//// [IdentifierNameWithEscape2.js] |
| 118 | +export class IdentifierNameWithEscape2 { |
| 119 | + constructor() { |
| 120 | + this.x\u0078 = 0; |
| 121 | + } |
| 122 | + doThing() { |
| 123 | + this.xx = 42; |
| 124 | + } |
| 125 | +} |
| 126 | +//// [IdentifierNameWithExtendedEscape1.js] |
| 127 | +export class IdentifierNameWithExtendedEscape1 { |
| 128 | + constructor() { |
| 129 | + this.\u{78} = 0; |
| 130 | + } |
| 131 | + doThing() { |
| 132 | + this.x = 42; |
| 133 | + } |
| 134 | +} |
| 135 | +//// [IdentifierNameWithExtendedEscape2.js] |
| 136 | +export class IdentifierNameWithExtendedEscape2 { |
| 137 | + constructor() { |
| 138 | + this.x\u{78} = 0; |
| 139 | + } |
| 140 | + doThing() { |
| 141 | + this.xx = 42; |
| 142 | + } |
| 143 | +} |
| 144 | +//// [PrivateIdentifierNameWithEscape1.js] |
| 145 | +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { |
| 146 | + if (kind === "m") throw new TypeError("Private method is not writable"); |
| 147 | + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); |
| 148 | + 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"); |
| 149 | + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; |
| 150 | +}; |
| 151 | +var _PrivateIdentifierWithEscape1_x; |
| 152 | +export class PrivateIdentifierWithEscape1 { |
| 153 | + constructor() { |
| 154 | + _PrivateIdentifierWithEscape1_x.set(this, void 0); |
| 155 | + __classPrivateFieldSet(this, _PrivateIdentifierWithEscape1_x, 0, "f"); |
| 156 | + } |
| 157 | + doThing() { |
| 158 | + __classPrivateFieldSet(this, _PrivateIdentifierWithEscape1_x, 42, "f"); |
| 159 | + } |
| 160 | +} |
| 161 | +_PrivateIdentifierWithEscape1_x = new WeakMap(); |
| 162 | +//// [PrivateIdentifierNameWithEscape2.js] |
| 163 | +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { |
| 164 | + if (kind === "m") throw new TypeError("Private method is not writable"); |
| 165 | + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); |
| 166 | + 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"); |
| 167 | + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; |
| 168 | +}; |
| 169 | +var _PrivateIdentifierWithEscape2_xx; |
| 170 | +export class PrivateIdentifierWithEscape2 { |
| 171 | + constructor() { |
| 172 | + _PrivateIdentifierWithEscape2_xx.set(this, void 0); |
| 173 | + __classPrivateFieldSet(this, _PrivateIdentifierWithEscape2_xx, 0, "f"); |
| 174 | + } |
| 175 | + doThing() { |
| 176 | + __classPrivateFieldSet(this, _PrivateIdentifierWithEscape2_xx, 42, "f"); |
| 177 | + } |
| 178 | +} |
| 179 | +_PrivateIdentifierWithEscape2_xx = new WeakMap(); |
| 180 | +//// [PrivateIdentifierNameWithExtendedEscape1.js] |
| 181 | +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { |
| 182 | + if (kind === "m") throw new TypeError("Private method is not writable"); |
| 183 | + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); |
| 184 | + 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"); |
| 185 | + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; |
| 186 | +}; |
| 187 | +var _PrivateIdentifierWithExtendedEscape1_x; |
| 188 | +export class PrivateIdentifierWithExtendedEscape1 { |
| 189 | + constructor() { |
| 190 | + _PrivateIdentifierWithExtendedEscape1_x.set(this, void 0); |
| 191 | + __classPrivateFieldSet(this, _PrivateIdentifierWithExtendedEscape1_x, 0, "f"); |
| 192 | + } |
| 193 | + doThing() { |
| 194 | + __classPrivateFieldSet(this, _PrivateIdentifierWithExtendedEscape1_x, 42, "f"); |
| 195 | + } |
| 196 | +} |
| 197 | +_PrivateIdentifierWithExtendedEscape1_x = new WeakMap(); |
| 198 | +//// [PrivateIdentifierNameWithExtendedEscape2.js] |
| 199 | +var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { |
| 200 | + if (kind === "m") throw new TypeError("Private method is not writable"); |
| 201 | + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); |
| 202 | + 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"); |
| 203 | + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; |
| 204 | +}; |
| 205 | +var _PrivateIdentifierWithExtendedEscape2_xx; |
| 206 | +export class PrivateIdentifierWithExtendedEscape2 { |
| 207 | + constructor() { |
| 208 | + _PrivateIdentifierWithExtendedEscape2_xx.set(this, void 0); |
| 209 | + __classPrivateFieldSet(this, _PrivateIdentifierWithExtendedEscape2_xx, 0, "f"); |
| 210 | + } |
| 211 | + doThing() { |
| 212 | + __classPrivateFieldSet(this, _PrivateIdentifierWithExtendedEscape2_xx, 42, "f"); |
| 213 | + } |
| 214 | +} |
| 215 | +_PrivateIdentifierWithExtendedEscape2_xx = new WeakMap(); |
0 commit comments