github.com/evanw/esbuild@v0.21.4/internal/bundler_tests/snapshots/snapshots_lower.txt (about) 1 TestClassSuperThisIssue242NoBundle 2 ---------- /out.js ---------- 3 var _e; 4 export class A { 5 } 6 export class B extends A { 7 constructor(c) { 8 var _a; 9 super(); 10 __privateAdd(this, _e); 11 __privateSet(this, _e, (_a = c.d) != null ? _a : "test"); 12 } 13 f() { 14 return __privateGet(this, _e); 15 } 16 } 17 _e = new WeakMap(); 18 19 ================================================================================ 20 TestJavaScriptAutoAccessorES2021 21 ---------- /out/js-define.js ---------- 22 var _a, _b, _one, __two, _Foo_instances, two_get, two_set, _a2, _four, __five, _Foo_static, five_get, five_set, _b2; 23 class Foo { 24 constructor() { 25 __privateAdd(this, _Foo_instances); 26 __privateAdd(this, _one, 1); 27 __privateAdd(this, __two, 2); 28 __privateAdd(this, _a2, 3); 29 } 30 get one() { 31 return __privateGet(this, _one); 32 } 33 set one(_) { 34 __privateSet(this, _one, _); 35 } 36 get [_b = three()]() { 37 return __privateGet(this, _a2); 38 } 39 set [_b](_) { 40 __privateSet(this, _a2, _); 41 } 42 static get four() { 43 return __privateGet(this, _four); 44 } 45 static set four(_) { 46 __privateSet(this, _four, _); 47 } 48 static get [_a = six()]() { 49 return __privateGet(this, _b2); 50 } 51 static set [_a](_) { 52 __privateSet(this, _b2, _); 53 } 54 } 55 _one = new WeakMap(); 56 __two = new WeakMap(); 57 _Foo_instances = new WeakSet(); 58 two_get = function() { 59 return __privateGet(this, __two); 60 }; 61 two_set = function(_) { 62 __privateSet(this, __two, _); 63 }; 64 _a2 = new WeakMap(); 65 _four = new WeakMap(); 66 __five = new WeakMap(); 67 _Foo_static = new WeakSet(); 68 five_get = function() { 69 return __privateGet(this, __five); 70 }; 71 five_set = function(_) { 72 __privateSet(this, __five, _); 73 }; 74 _b2 = new WeakMap(); 75 __privateAdd(Foo, _Foo_static); 76 __privateAdd(Foo, _four, 4); 77 __privateAdd(Foo, __five, 5); 78 __privateAdd(Foo, _b2, 6); 79 80 ---------- /out/ts-define/ts-define.js ---------- 81 var _a, _b, _one, __two, _Foo_instances, two_get, two_set, _a2, _four, __five, _Foo_static, five_get, five_set, _b2, _a3, __a, _Private_instances, a_get, a_set, _a4, __a2, _StaticPrivate_static, a_get2, a_set2; 82 class Foo { 83 constructor() { 84 __privateAdd(this, _Foo_instances); 85 __privateAdd(this, _one, 1); 86 __privateAdd(this, __two, 2); 87 __privateAdd(this, _a2, 3); 88 } 89 get one() { 90 return __privateGet(this, _one); 91 } 92 set one(_) { 93 __privateSet(this, _one, _); 94 } 95 get [_b = three()]() { 96 return __privateGet(this, _a2); 97 } 98 set [_b](_) { 99 __privateSet(this, _a2, _); 100 } 101 static get four() { 102 return __privateGet(this, _four); 103 } 104 static set four(_) { 105 __privateSet(this, _four, _); 106 } 107 static get [_a = six()]() { 108 return __privateGet(this, _b2); 109 } 110 static set [_a](_) { 111 __privateSet(this, _b2, _); 112 } 113 } 114 _one = new WeakMap(); 115 __two = new WeakMap(); 116 _Foo_instances = new WeakSet(); 117 two_get = function() { 118 return __privateGet(this, __two); 119 }; 120 two_set = function(_) { 121 __privateSet(this, __two, _); 122 }; 123 _a2 = new WeakMap(); 124 _four = new WeakMap(); 125 __five = new WeakMap(); 126 _Foo_static = new WeakSet(); 127 five_get = function() { 128 return __privateGet(this, __five); 129 }; 130 five_set = function(_) { 131 __privateSet(this, __five, _); 132 }; 133 _b2 = new WeakMap(); 134 __privateAdd(Foo, _Foo_static); 135 __privateAdd(Foo, _four, 4); 136 __privateAdd(Foo, __five, 5); 137 __privateAdd(Foo, _b2, 6); 138 class Normal { 139 constructor() { 140 __privateAdd(this, _a3, b); 141 __publicField(this, "c", d); 142 } 143 get a() { 144 return __privateGet(this, _a3); 145 } 146 set a(_) { 147 __privateSet(this, _a3, _); 148 } 149 } 150 _a3 = new WeakMap(); 151 class Private { 152 constructor() { 153 __privateAdd(this, _Private_instances); 154 __privateAdd(this, __a, b); 155 __publicField(this, "c", d); 156 } 157 } 158 __a = new WeakMap(); 159 _Private_instances = new WeakSet(); 160 a_get = function() { 161 return __privateGet(this, __a); 162 }; 163 a_set = function(_) { 164 __privateSet(this, __a, _); 165 }; 166 class StaticNormal { 167 static get a() { 168 return __privateGet(this, _a4); 169 } 170 static set a(_) { 171 __privateSet(this, _a4, _); 172 } 173 } 174 _a4 = new WeakMap(); 175 __privateAdd(StaticNormal, _a4, b); 176 __publicField(StaticNormal, "c", d); 177 class StaticPrivate { 178 } 179 __a2 = new WeakMap(); 180 _StaticPrivate_static = new WeakSet(); 181 a_get2 = function() { 182 return __privateGet(this, __a2); 183 }; 184 a_set2 = function(_) { 185 __privateSet(this, __a2, _); 186 }; 187 __privateAdd(StaticPrivate, _StaticPrivate_static); 188 __privateAdd(StaticPrivate, __a2, b); 189 __publicField(StaticPrivate, "c", d); 190 191 ---------- /out/ts-assign/ts-assign.js ---------- 192 var _a, _b, _one, __two, _Foo_instances, two_get, two_set, _a2, _four, __five, _Foo_static, five_get, five_set, _b2, _a3, __a, _Private_instances, a_get, a_set, _a4, __a2, _StaticPrivate_static, a_get2, a_set2; 193 class Foo { 194 constructor() { 195 __privateAdd(this, _Foo_instances); 196 __privateAdd(this, _one, 1); 197 __privateAdd(this, __two, 2); 198 __privateAdd(this, _a2, 3); 199 } 200 get one() { 201 return __privateGet(this, _one); 202 } 203 set one(_) { 204 __privateSet(this, _one, _); 205 } 206 get [_b = three()]() { 207 return __privateGet(this, _a2); 208 } 209 set [_b](_) { 210 __privateSet(this, _a2, _); 211 } 212 static get four() { 213 return __privateGet(this, _four); 214 } 215 static set four(_) { 216 __privateSet(this, _four, _); 217 } 218 static get [_a = six()]() { 219 return __privateGet(this, _b2); 220 } 221 static set [_a](_) { 222 __privateSet(this, _b2, _); 223 } 224 } 225 _one = new WeakMap(); 226 __two = new WeakMap(); 227 _Foo_instances = new WeakSet(); 228 two_get = function() { 229 return __privateGet(this, __two); 230 }; 231 two_set = function(_) { 232 __privateSet(this, __two, _); 233 }; 234 _a2 = new WeakMap(); 235 _four = new WeakMap(); 236 __five = new WeakMap(); 237 _Foo_static = new WeakSet(); 238 five_get = function() { 239 return __privateGet(this, __five); 240 }; 241 five_set = function(_) { 242 __privateSet(this, __five, _); 243 }; 244 _b2 = new WeakMap(); 245 __privateAdd(Foo, _Foo_static); 246 __privateAdd(Foo, _four, 4); 247 __privateAdd(Foo, __five, 5); 248 __privateAdd(Foo, _b2, 6); 249 class Normal { 250 constructor() { 251 __privateAdd(this, _a3, b); 252 this.c = d; 253 } 254 get a() { 255 return __privateGet(this, _a3); 256 } 257 set a(_) { 258 __privateSet(this, _a3, _); 259 } 260 } 261 _a3 = new WeakMap(); 262 class Private { 263 constructor() { 264 __privateAdd(this, _Private_instances); 265 __privateAdd(this, __a, b); 266 this.c = d; 267 } 268 } 269 __a = new WeakMap(); 270 _Private_instances = new WeakSet(); 271 a_get = function() { 272 return __privateGet(this, __a); 273 }; 274 a_set = function(_) { 275 __privateSet(this, __a, _); 276 }; 277 class StaticNormal { 278 static get a() { 279 return __privateGet(this, _a4); 280 } 281 static set a(_) { 282 __privateSet(this, _a4, _); 283 } 284 } 285 _a4 = new WeakMap(); 286 __privateAdd(StaticNormal, _a4, b); 287 StaticNormal.c = d; 288 class StaticPrivate { 289 } 290 __a2 = new WeakMap(); 291 _StaticPrivate_static = new WeakSet(); 292 a_get2 = function() { 293 return __privateGet(this, __a2); 294 }; 295 a_set2 = function(_) { 296 __privateSet(this, __a2, _); 297 }; 298 __privateAdd(StaticPrivate, _StaticPrivate_static); 299 __privateAdd(StaticPrivate, __a2, b); 300 StaticPrivate.c = d; 301 302 ================================================================================ 303 TestJavaScriptAutoAccessorES2022 304 ---------- /out/js-define.js ---------- 305 var _a, _b; 306 class Foo { 307 #one = 1; 308 get one() { 309 return this.#one; 310 } 311 set one(_) { 312 this.#one = _; 313 } 314 #_two = 2; 315 get #two() { 316 return this.#_two; 317 } 318 set #two(_) { 319 this.#_two = _; 320 } 321 #a = 3; 322 get [_b = three()]() { 323 return this.#a; 324 } 325 set [_b](_) { 326 this.#a = _; 327 } 328 static #four = 4; 329 static get four() { 330 return this.#four; 331 } 332 static set four(_) { 333 this.#four = _; 334 } 335 static #_five = 5; 336 static get #five() { 337 return this.#_five; 338 } 339 static set #five(_) { 340 this.#_five = _; 341 } 342 static #b = 6; 343 static get [_a = six()]() { 344 return this.#b; 345 } 346 static set [_a](_) { 347 this.#b = _; 348 } 349 } 350 351 ---------- /out/ts-define/ts-define.js ---------- 352 var _a, _b; 353 class Foo { 354 #one = 1; 355 get one() { 356 return this.#one; 357 } 358 set one(_) { 359 this.#one = _; 360 } 361 #_two = 2; 362 get #two() { 363 return this.#_two; 364 } 365 set #two(_) { 366 this.#_two = _; 367 } 368 #a = 3; 369 get [_b = three()]() { 370 return this.#a; 371 } 372 set [_b](_) { 373 this.#a = _; 374 } 375 static #four = 4; 376 static get four() { 377 return this.#four; 378 } 379 static set four(_) { 380 this.#four = _; 381 } 382 static #_five = 5; 383 static get #five() { 384 return this.#_five; 385 } 386 static set #five(_) { 387 this.#_five = _; 388 } 389 static #b = 6; 390 static get [_a = six()]() { 391 return this.#b; 392 } 393 static set [_a](_) { 394 this.#b = _; 395 } 396 } 397 class Normal { 398 #a = b; 399 get a() { 400 return this.#a; 401 } 402 set a(_) { 403 this.#a = _; 404 } 405 c = d; 406 } 407 class Private { 408 #_a = b; 409 get #a() { 410 return this.#_a; 411 } 412 set #a(_) { 413 this.#_a = _; 414 } 415 c = d; 416 } 417 class StaticNormal { 418 static #a = b; 419 static get a() { 420 return this.#a; 421 } 422 static set a(_) { 423 this.#a = _; 424 } 425 static c = d; 426 } 427 class StaticPrivate { 428 static #_a = b; 429 static get #a() { 430 return this.#_a; 431 } 432 static set #a(_) { 433 this.#_a = _; 434 } 435 static c = d; 436 } 437 438 ---------- /out/ts-assign/ts-assign.js ---------- 439 var _a, _b, _a2, __a; 440 class Foo { 441 #one = 1; 442 get one() { 443 return this.#one; 444 } 445 set one(_) { 446 this.#one = _; 447 } 448 #_two = 2; 449 get #two() { 450 return this.#_two; 451 } 452 set #two(_) { 453 this.#_two = _; 454 } 455 #a = 3; 456 get [_b = three()]() { 457 return this.#a; 458 } 459 set [_b](_) { 460 this.#a = _; 461 } 462 static #four = 4; 463 static get four() { 464 return this.#four; 465 } 466 static set four(_) { 467 this.#four = _; 468 } 469 static #_five = 5; 470 static get #five() { 471 return this.#_five; 472 } 473 static set #five(_) { 474 this.#_five = _; 475 } 476 static #b = 6; 477 static get [_a = six()]() { 478 return this.#b; 479 } 480 static set [_a](_) { 481 this.#b = _; 482 } 483 } 484 class Normal { 485 constructor() { 486 __privateAdd(this, _a2, b); 487 this.c = d; 488 } 489 get a() { 490 return __privateGet(this, _a2); 491 } 492 set a(_) { 493 __privateSet(this, _a2, _); 494 } 495 } 496 _a2 = new WeakMap(); 497 class Private { 498 constructor() { 499 __privateAdd(this, __a, b); 500 this.c = d; 501 } 502 get #a() { 503 return __privateGet(this, __a); 504 } 505 set #a(_) { 506 __privateSet(this, __a, _); 507 } 508 } 509 __a = new WeakMap(); 510 class StaticNormal { 511 static #a = b; 512 static get a() { 513 return this.#a; 514 } 515 static set a(_) { 516 this.#a = _; 517 } 518 static { 519 this.c = d; 520 } 521 } 522 class StaticPrivate { 523 static #_a = b; 524 static get #a() { 525 return this.#_a; 526 } 527 static set #a(_) { 528 this.#_a = _; 529 } 530 static { 531 this.c = d; 532 } 533 } 534 535 ================================================================================ 536 TestJavaScriptAutoAccessorESNext 537 ---------- /out/js-define.js ---------- 538 class Foo { 539 accessor one = 1; 540 accessor #two = 2; 541 accessor [three()] = 3; 542 static accessor four = 4; 543 static accessor #five = 5; 544 static accessor [six()] = 6; 545 } 546 547 ---------- /out/ts-define/ts-define.js ---------- 548 class Foo { 549 accessor one = 1; 550 accessor #two = 2; 551 accessor [three()] = 3; 552 static accessor four = 4; 553 static accessor #five = 5; 554 static accessor [six()] = 6; 555 } 556 class Normal { 557 accessor a = b; 558 c = d; 559 } 560 class Private { 561 accessor #a = b; 562 c = d; 563 } 564 class StaticNormal { 565 static accessor a = b; 566 static c = d; 567 } 568 class StaticPrivate { 569 static accessor #a = b; 570 static c = d; 571 } 572 573 ---------- /out/ts-assign/ts-assign.js ---------- 574 var _a, __a; 575 class Foo { 576 accessor one = 1; 577 accessor #two = 2; 578 accessor [three()] = 3; 579 static accessor four = 4; 580 static accessor #five = 5; 581 static accessor [six()] = 6; 582 } 583 class Normal { 584 constructor() { 585 __privateAdd(this, _a, b); 586 this.c = d; 587 } 588 get a() { 589 return __privateGet(this, _a); 590 } 591 set a(_) { 592 __privateSet(this, _a, _); 593 } 594 } 595 _a = new WeakMap(); 596 class Private { 597 constructor() { 598 __privateAdd(this, __a, b); 599 this.c = d; 600 } 601 get #a() { 602 return __privateGet(this, __a); 603 } 604 set #a(_) { 605 __privateSet(this, __a, _); 606 } 607 } 608 __a = new WeakMap(); 609 class StaticNormal { 610 static accessor a = b; 611 static { 612 this.c = d; 613 } 614 } 615 class StaticPrivate { 616 static accessor #a = b; 617 static { 618 this.c = d; 619 } 620 } 621 622 ================================================================================ 623 TestJavaScriptDecoratorsBundleIssue3768 624 ---------- /out/base-instance-accessor.js ---------- 625 // base-instance-accessor.js 626 var _foo_dec, _init, _foo; 627 _foo_dec = [dec]; 628 var _Foo = class _Foo { 629 constructor() { 630 __privateAdd(this, _foo, __runInitializers(_init, 8, this, _Foo)), __runInitializers(_init, 11, this); 631 } 632 }; 633 _init = __decoratorStart(null); 634 _foo = new WeakMap(); 635 __decorateElement(_init, 4, "foo", _foo_dec, _Foo, _foo); 636 var Foo = _Foo; 637 638 ---------- /out/base-instance-field.js ---------- 639 // base-instance-field.js 640 var _foo_dec, _init; 641 _foo_dec = [dec]; 642 var _Foo = class _Foo { 643 constructor() { 644 __publicField(this, "foo", __runInitializers(_init, 8, this, _Foo)), __runInitializers(_init, 11, this); 645 } 646 }; 647 _init = __decoratorStart(null); 648 __decorateElement(_init, 5, "foo", _foo_dec, _Foo); 649 var Foo = _Foo; 650 651 ---------- /out/base-instance-method.js ---------- 652 // base-instance-method.js 653 var _foo_dec, _init; 654 _foo_dec = [dec]; 655 var _Foo = class _Foo { 656 constructor() { 657 __runInitializers(_init, 5, this); 658 } 659 foo() { 660 return _Foo; 661 } 662 }; 663 _init = __decoratorStart(null); 664 __decorateElement(_init, 1, "foo", _foo_dec, _Foo); 665 var Foo = _Foo; 666 667 ---------- /out/base-static-accessor.js ---------- 668 // base-static-accessor.js 669 var _foo_dec, _init, _foo; 670 _foo_dec = [dec]; 671 var _Foo = class _Foo { 672 }; 673 _init = __decoratorStart(null); 674 _foo = new WeakMap(); 675 __decorateElement(_init, 12, "foo", _foo_dec, _Foo, _foo); 676 __privateAdd(_Foo, _foo, __runInitializers(_init, 8, _Foo, _Foo)), __runInitializers(_init, 11, _Foo); 677 var Foo = _Foo; 678 679 ---------- /out/base-static-field.js ---------- 680 // base-static-field.js 681 var _foo_dec, _init; 682 _foo_dec = [dec]; 683 var _Foo = class _Foo { 684 }; 685 _init = __decoratorStart(null); 686 __decorateElement(_init, 13, "foo", _foo_dec, _Foo); 687 __publicField(_Foo, "foo", __runInitializers(_init, 8, _Foo, _Foo)), __runInitializers(_init, 11, _Foo); 688 var Foo = _Foo; 689 690 ---------- /out/base-static-method.js ---------- 691 // base-static-method.js 692 var _foo_dec, _init; 693 _foo_dec = [dec]; 694 var _Foo = class _Foo { 695 static foo() { 696 return _Foo; 697 } 698 }; 699 _init = __decoratorStart(null); 700 __decorateElement(_init, 9, "foo", _foo_dec, _Foo); 701 __runInitializers(_init, 3, _Foo); 702 var Foo = _Foo; 703 704 ---------- /out/derived-instance-accessor.js ---------- 705 // derived-instance-accessor.js 706 var _foo_dec, _a, _init, _foo; 707 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 708 constructor() { 709 super(...arguments); 710 __privateAdd(this, _foo, __runInitializers(_init, 8, this, _Foo)), __runInitializers(_init, 11, this); 711 } 712 }; 713 _init = __decoratorStart(_a); 714 _foo = new WeakMap(); 715 __decorateElement(_init, 4, "foo", _foo_dec, _Foo, _foo); 716 var Foo = _Foo; 717 718 ---------- /out/derived-instance-field.js ---------- 719 // derived-instance-field.js 720 var _foo_dec, _a, _init; 721 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 722 constructor() { 723 super(...arguments); 724 __publicField(this, "foo", __runInitializers(_init, 8, this, _Foo)), __runInitializers(_init, 11, this); 725 } 726 }; 727 _init = __decoratorStart(_a); 728 __decorateElement(_init, 5, "foo", _foo_dec, _Foo); 729 var Foo = _Foo; 730 731 ---------- /out/derived-instance-method.js ---------- 732 // derived-instance-method.js 733 var _foo_dec, _a, _init; 734 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 735 constructor() { 736 super(...arguments); 737 __runInitializers(_init, 5, this); 738 } 739 foo() { 740 return _Foo; 741 } 742 }; 743 _init = __decoratorStart(_a); 744 __decorateElement(_init, 1, "foo", _foo_dec, _Foo); 745 var Foo = _Foo; 746 747 ---------- /out/derived-static-accessor.js ---------- 748 // derived-static-accessor.js 749 var _foo_dec, _a, _init, _foo; 750 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 751 }; 752 _init = __decoratorStart(_a); 753 _foo = new WeakMap(); 754 __decorateElement(_init, 12, "foo", _foo_dec, _Foo, _foo); 755 __privateAdd(_Foo, _foo, __runInitializers(_init, 8, _Foo, _Foo)), __runInitializers(_init, 11, _Foo); 756 var Foo = _Foo; 757 758 ---------- /out/derived-static-field.js ---------- 759 // derived-static-field.js 760 var _foo_dec, _a, _init; 761 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 762 }; 763 _init = __decoratorStart(_a); 764 __decorateElement(_init, 13, "foo", _foo_dec, _Foo); 765 __publicField(_Foo, "foo", __runInitializers(_init, 8, _Foo, _Foo)), __runInitializers(_init, 11, _Foo); 766 var Foo = _Foo; 767 768 ---------- /out/derived-static-method.js ---------- 769 // derived-static-method.js 770 var _foo_dec, _a, _init; 771 var _Foo = class _Foo extends (_a = Bar, _foo_dec = [dec], _a) { 772 static foo() { 773 return _Foo; 774 } 775 }; 776 _init = __decoratorStart(_a); 777 __decorateElement(_init, 9, "foo", _foo_dec, _Foo); 778 __runInitializers(_init, 3, _Foo); 779 var Foo = _Foo; 780 781 ================================================================================ 782 TestJavaScriptDecoratorsESNext 783 ---------- /out.js ---------- 784 @x.y() 785 @(new y.x()) 786 export default class Foo { 787 @x @y mUndef; 788 @x @y mDef = 1; 789 @x @y method() { 790 return new Foo(); 791 } 792 @x @y static sUndef; 793 @x @y static sDef = new Foo(); 794 @x @y static sMethod() { 795 return new Foo(); 796 } 797 } 798 799 ================================================================================ 800 TestLowerAsync2016NoBundle 801 ---------- /out.js ---------- 802 function foo(_0) { 803 return __async(this, arguments, function* (bar) { 804 yield bar; 805 return [this, arguments]; 806 }); 807 } 808 class Foo { 809 foo() { 810 return __async(this, null, function* () { 811 }); 812 } 813 } 814 export default [ 815 foo, 816 Foo, 817 function() { 818 return __async(this, null, function* () { 819 }); 820 }, 821 () => __async(void 0, null, function* () { 822 }), 823 { foo() { 824 return __async(this, null, function* () { 825 }); 826 } }, 827 class { 828 foo() { 829 return __async(this, null, function* () { 830 }); 831 } 832 }, 833 function() { 834 var _arguments = arguments; 835 return (bar) => __async(this, null, function* () { 836 yield bar; 837 return [this, _arguments]; 838 }); 839 } 840 ]; 841 842 ================================================================================ 843 TestLowerAsync2017NoBundle 844 ---------- /out.js ---------- 845 async function foo(bar) { 846 await bar; 847 return arguments; 848 } 849 class Foo { 850 async foo() { 851 } 852 } 853 export default [ 854 foo, 855 Foo, 856 async function() { 857 }, 858 async () => { 859 }, 860 { async foo() { 861 } }, 862 class { 863 async foo() { 864 } 865 }, 866 function() { 867 return async (bar) => { 868 await bar; 869 return [this, arguments]; 870 }; 871 } 872 ]; 873 874 ================================================================================ 875 TestLowerAsyncArrowSuperES2016 876 ---------- /out.js ---------- 877 // foo1.js 878 var foo1_default = class _foo1_default extends x { 879 foo1() { 880 return () => __async(this, null, function* () { 881 return __superGet(_foo1_default.prototype, this, "foo").call(this, "foo1"); 882 }); 883 } 884 }; 885 886 // foo2.js 887 var foo2_default = class _foo2_default extends x { 888 foo2() { 889 return () => __async(this, null, function* () { 890 return () => __superGet(_foo2_default.prototype, this, "foo").call(this, "foo2"); 891 }); 892 } 893 }; 894 895 // foo3.js 896 var foo3_default = class _foo3_default extends x { 897 foo3() { 898 return () => () => __async(this, null, function* () { 899 return __superGet(_foo3_default.prototype, this, "foo").call(this, "foo3"); 900 }); 901 } 902 }; 903 904 // foo4.js 905 var foo4_default = class _foo4_default extends x { 906 foo4() { 907 return () => __async(this, null, function* () { 908 return () => __async(this, null, function* () { 909 return __superGet(_foo4_default.prototype, this, "foo").call(this, "foo4"); 910 }); 911 }); 912 } 913 }; 914 915 // bar1.js 916 var bar1_default = class _bar1_default extends x { 917 constructor() { 918 super(...arguments); 919 __publicField(this, "bar1", () => __async(this, null, function* () { 920 return __superGet(_bar1_default.prototype, this, "foo").call(this, "bar1"); 921 })); 922 } 923 }; 924 925 // bar2.js 926 var bar2_default = class _bar2_default extends x { 927 constructor() { 928 super(...arguments); 929 __publicField(this, "bar2", () => __async(this, null, function* () { 930 return () => __superGet(_bar2_default.prototype, this, "foo").call(this, "bar2"); 931 })); 932 } 933 }; 934 935 // bar3.js 936 var bar3_default = class _bar3_default extends x { 937 constructor() { 938 super(...arguments); 939 __publicField(this, "bar3", () => () => __async(this, null, function* () { 940 return __superGet(_bar3_default.prototype, this, "foo").call(this, "bar3"); 941 })); 942 } 943 }; 944 945 // bar4.js 946 var bar4_default = class _bar4_default extends x { 947 constructor() { 948 super(...arguments); 949 __publicField(this, "bar4", () => __async(this, null, function* () { 950 return () => __async(this, null, function* () { 951 return __superGet(_bar4_default.prototype, this, "foo").call(this, "bar4"); 952 }); 953 })); 954 } 955 }; 956 957 // baz1.js 958 var baz1_default = class _baz1_default extends x { 959 baz1() { 960 return __async(this, null, function* () { 961 return () => __superGet(_baz1_default.prototype, this, "foo").call(this, "baz1"); 962 }); 963 } 964 }; 965 966 // baz2.js 967 var baz2_default = class _baz2_default extends x { 968 baz2() { 969 return __async(this, null, function* () { 970 return () => () => __superGet(_baz2_default.prototype, this, "foo").call(this, "baz2"); 971 }); 972 } 973 }; 974 975 // outer.js 976 var outer_default = function() { 977 return __async(this, null, function* () { 978 class y extends z { 979 constructor() { 980 super(...arguments); 981 __publicField(this, "foo", () => __async(this, null, function* () { 982 return __superGet(y.prototype, this, "foo").call(this); 983 })); 984 } 985 } 986 yield new y().foo()(); 987 }); 988 }(); 989 export { 990 bar1_default as bar1, 991 bar2_default as bar2, 992 bar3_default as bar3, 993 bar4_default as bar4, 994 baz1_default as baz1, 995 baz2_default as baz2, 996 foo1_default as foo1, 997 foo2_default as foo2, 998 foo3_default as foo3, 999 foo4_default as foo4 1000 }; 1001 1002 ================================================================================ 1003 TestLowerAsyncArrowSuperSetterES2016 1004 ---------- /out.js ---------- 1005 // foo1.js 1006 var foo1_default = class _foo1_default extends x { 1007 foo1() { 1008 return () => __async(this, null, function* () { 1009 return __superSet(_foo1_default.prototype, this, "foo", "foo1"); 1010 }); 1011 } 1012 }; 1013 1014 // foo2.js 1015 var foo2_default = class _foo2_default extends x { 1016 foo2() { 1017 return () => __async(this, null, function* () { 1018 return () => __superSet(_foo2_default.prototype, this, "foo", "foo2"); 1019 }); 1020 } 1021 }; 1022 1023 // foo3.js 1024 var foo3_default = class _foo3_default extends x { 1025 foo3() { 1026 return () => () => __async(this, null, function* () { 1027 return __superSet(_foo3_default.prototype, this, "foo", "foo3"); 1028 }); 1029 } 1030 }; 1031 1032 // foo4.js 1033 var foo4_default = class _foo4_default extends x { 1034 foo4() { 1035 return () => __async(this, null, function* () { 1036 return () => __async(this, null, function* () { 1037 return __superSet(_foo4_default.prototype, this, "foo", "foo4"); 1038 }); 1039 }); 1040 } 1041 }; 1042 1043 // bar1.js 1044 var bar1_default = class _bar1_default extends x { 1045 constructor() { 1046 super(...arguments); 1047 __publicField(this, "bar1", () => __async(this, null, function* () { 1048 return __superSet(_bar1_default.prototype, this, "foo", "bar1"); 1049 })); 1050 } 1051 }; 1052 1053 // bar2.js 1054 var bar2_default = class _bar2_default extends x { 1055 constructor() { 1056 super(...arguments); 1057 __publicField(this, "bar2", () => __async(this, null, function* () { 1058 return () => __superSet(_bar2_default.prototype, this, "foo", "bar2"); 1059 })); 1060 } 1061 }; 1062 1063 // bar3.js 1064 var bar3_default = class _bar3_default extends x { 1065 constructor() { 1066 super(...arguments); 1067 __publicField(this, "bar3", () => () => __async(this, null, function* () { 1068 return __superSet(_bar3_default.prototype, this, "foo", "bar3"); 1069 })); 1070 } 1071 }; 1072 1073 // bar4.js 1074 var bar4_default = class _bar4_default extends x { 1075 constructor() { 1076 super(...arguments); 1077 __publicField(this, "bar4", () => __async(this, null, function* () { 1078 return () => __async(this, null, function* () { 1079 return __superSet(_bar4_default.prototype, this, "foo", "bar4"); 1080 }); 1081 })); 1082 } 1083 }; 1084 1085 // baz1.js 1086 var baz1_default = class _baz1_default extends x { 1087 baz1() { 1088 return __async(this, null, function* () { 1089 return () => __superSet(_baz1_default.prototype, this, "foo", "baz1"); 1090 }); 1091 } 1092 }; 1093 1094 // baz2.js 1095 var baz2_default = class _baz2_default extends x { 1096 baz2() { 1097 return __async(this, null, function* () { 1098 return () => () => __superSet(_baz2_default.prototype, this, "foo", "baz2"); 1099 }); 1100 } 1101 }; 1102 1103 // outer.js 1104 var outer_default = function() { 1105 return __async(this, null, function* () { 1106 class y extends z { 1107 constructor() { 1108 super(...arguments); 1109 __publicField(this, "foo", () => __async(this, null, function* () { 1110 return __superSet(y.prototype, this, "foo", "foo"); 1111 })); 1112 } 1113 } 1114 yield new y().foo()(); 1115 }); 1116 }(); 1117 export { 1118 bar1_default as bar1, 1119 bar2_default as bar2, 1120 bar3_default as bar3, 1121 bar4_default as bar4, 1122 baz1_default as baz1, 1123 baz2_default as baz2, 1124 foo1_default as foo1, 1125 foo2_default as foo2, 1126 foo3_default as foo3, 1127 foo4_default as foo4 1128 }; 1129 1130 ================================================================================ 1131 TestLowerAsyncGenerator 1132 ---------- /out/entry.js ---------- 1133 function foo() { 1134 return __asyncGenerator(this, null, function* () { 1135 var _stack2 = []; 1136 try { 1137 yield; 1138 yield x; 1139 yield* __yieldStar(x); 1140 const x = __using(_stack2, yield new __await(y), true); 1141 try { 1142 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1143 let x2 = temp.value; 1144 } 1145 } catch (temp) { 1146 error = [temp]; 1147 } finally { 1148 try { 1149 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1150 } finally { 1151 if (error) 1152 throw error[0]; 1153 } 1154 } 1155 try { 1156 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1157 var _x = temp2.value; 1158 var _stack = []; 1159 try { 1160 const x2 = __using(_stack, _x, true); 1161 } catch (_) { 1162 var _error = _, _hasError = true; 1163 } finally { 1164 var _promise = __callDispose(_stack, _error, _hasError); 1165 _promise && (yield new __await(_promise)); 1166 } 1167 } 1168 } catch (temp2) { 1169 error2 = [temp2]; 1170 } finally { 1171 try { 1172 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1173 } finally { 1174 if (error2) 1175 throw error2[0]; 1176 } 1177 } 1178 } catch (_2) { 1179 var _error2 = _2, _hasError2 = true; 1180 } finally { 1181 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1182 _promise2 && (yield new __await(_promise2)); 1183 } 1184 }); 1185 } 1186 foo = function() { 1187 return __asyncGenerator(this, null, function* () { 1188 var _stack2 = []; 1189 try { 1190 yield; 1191 yield x; 1192 yield* __yieldStar(x); 1193 const x = __using(_stack2, yield new __await(y), true); 1194 try { 1195 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1196 let x2 = temp.value; 1197 } 1198 } catch (temp) { 1199 error = [temp]; 1200 } finally { 1201 try { 1202 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1203 } finally { 1204 if (error) 1205 throw error[0]; 1206 } 1207 } 1208 try { 1209 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1210 var _x = temp2.value; 1211 var _stack = []; 1212 try { 1213 const x2 = __using(_stack, _x, true); 1214 } catch (_) { 1215 var _error = _, _hasError = true; 1216 } finally { 1217 var _promise = __callDispose(_stack, _error, _hasError); 1218 _promise && (yield new __await(_promise)); 1219 } 1220 } 1221 } catch (temp2) { 1222 error2 = [temp2]; 1223 } finally { 1224 try { 1225 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1226 } finally { 1227 if (error2) 1228 throw error2[0]; 1229 } 1230 } 1231 } catch (_2) { 1232 var _error2 = _2, _hasError2 = true; 1233 } finally { 1234 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1235 _promise2 && (yield new __await(_promise2)); 1236 } 1237 }); 1238 }; 1239 foo = { bar() { 1240 return __asyncGenerator(this, null, function* () { 1241 var _stack2 = []; 1242 try { 1243 yield; 1244 yield x; 1245 yield* __yieldStar(x); 1246 const x = __using(_stack2, yield new __await(y), true); 1247 try { 1248 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1249 let x2 = temp.value; 1250 } 1251 } catch (temp) { 1252 error = [temp]; 1253 } finally { 1254 try { 1255 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1256 } finally { 1257 if (error) 1258 throw error[0]; 1259 } 1260 } 1261 try { 1262 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1263 var _x = temp2.value; 1264 var _stack = []; 1265 try { 1266 const x2 = __using(_stack, _x, true); 1267 } catch (_) { 1268 var _error = _, _hasError = true; 1269 } finally { 1270 var _promise = __callDispose(_stack, _error, _hasError); 1271 _promise && (yield new __await(_promise)); 1272 } 1273 } 1274 } catch (temp2) { 1275 error2 = [temp2]; 1276 } finally { 1277 try { 1278 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1279 } finally { 1280 if (error2) 1281 throw error2[0]; 1282 } 1283 } 1284 } catch (_2) { 1285 var _error2 = _2, _hasError2 = true; 1286 } finally { 1287 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1288 _promise2 && (yield new __await(_promise2)); 1289 } 1290 }); 1291 } }; 1292 class Foo { 1293 bar() { 1294 return __asyncGenerator(this, null, function* () { 1295 var _stack2 = []; 1296 try { 1297 yield; 1298 yield x; 1299 yield* __yieldStar(x); 1300 const x = __using(_stack2, yield new __await(y), true); 1301 try { 1302 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1303 let x2 = temp.value; 1304 } 1305 } catch (temp) { 1306 error = [temp]; 1307 } finally { 1308 try { 1309 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1310 } finally { 1311 if (error) 1312 throw error[0]; 1313 } 1314 } 1315 try { 1316 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1317 var _x = temp2.value; 1318 var _stack = []; 1319 try { 1320 const x2 = __using(_stack, _x, true); 1321 } catch (_) { 1322 var _error = _, _hasError = true; 1323 } finally { 1324 var _promise = __callDispose(_stack, _error, _hasError); 1325 _promise && (yield new __await(_promise)); 1326 } 1327 } 1328 } catch (temp2) { 1329 error2 = [temp2]; 1330 } finally { 1331 try { 1332 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1333 } finally { 1334 if (error2) 1335 throw error2[0]; 1336 } 1337 } 1338 } catch (_2) { 1339 var _error2 = _2, _hasError2 = true; 1340 } finally { 1341 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1342 _promise2 && (yield new __await(_promise2)); 1343 } 1344 }); 1345 } 1346 } 1347 Foo = class { 1348 bar() { 1349 return __asyncGenerator(this, null, function* () { 1350 var _stack2 = []; 1351 try { 1352 yield; 1353 yield x; 1354 yield* __yieldStar(x); 1355 const x = __using(_stack2, yield new __await(y), true); 1356 try { 1357 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1358 let x2 = temp.value; 1359 } 1360 } catch (temp) { 1361 error = [temp]; 1362 } finally { 1363 try { 1364 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1365 } finally { 1366 if (error) 1367 throw error[0]; 1368 } 1369 } 1370 try { 1371 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1372 var _x = temp2.value; 1373 var _stack = []; 1374 try { 1375 const x2 = __using(_stack, _x, true); 1376 } catch (_) { 1377 var _error = _, _hasError = true; 1378 } finally { 1379 var _promise = __callDispose(_stack, _error, _hasError); 1380 _promise && (yield new __await(_promise)); 1381 } 1382 } 1383 } catch (temp2) { 1384 error2 = [temp2]; 1385 } finally { 1386 try { 1387 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1388 } finally { 1389 if (error2) 1390 throw error2[0]; 1391 } 1392 } 1393 } catch (_2) { 1394 var _error2 = _2, _hasError2 = true; 1395 } finally { 1396 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1397 _promise2 && (yield new __await(_promise2)); 1398 } 1399 }); 1400 } 1401 }; 1402 async function bar() { 1403 await using x = await y; 1404 for await (let x2 of y) { 1405 } 1406 for await (await using x2 of y) { 1407 } 1408 } 1409 1410 ================================================================================ 1411 TestLowerAsyncGeneratorNoAwait 1412 ---------- /out/entry.js ---------- 1413 function foo() { 1414 return __asyncGenerator(this, null, function* () { 1415 var _stack2 = []; 1416 try { 1417 yield; 1418 yield x; 1419 yield* __yieldStar(x); 1420 const x = __using(_stack2, yield new __await(y), true); 1421 try { 1422 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1423 let x2 = temp.value; 1424 } 1425 } catch (temp) { 1426 error = [temp]; 1427 } finally { 1428 try { 1429 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1430 } finally { 1431 if (error) 1432 throw error[0]; 1433 } 1434 } 1435 try { 1436 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1437 var _x = temp2.value; 1438 var _stack = []; 1439 try { 1440 const x2 = __using(_stack, _x, true); 1441 } catch (_) { 1442 var _error = _, _hasError = true; 1443 } finally { 1444 var _promise = __callDispose(_stack, _error, _hasError); 1445 _promise && (yield new __await(_promise)); 1446 } 1447 } 1448 } catch (temp2) { 1449 error2 = [temp2]; 1450 } finally { 1451 try { 1452 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1453 } finally { 1454 if (error2) 1455 throw error2[0]; 1456 } 1457 } 1458 } catch (_2) { 1459 var _error2 = _2, _hasError2 = true; 1460 } finally { 1461 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1462 _promise2 && (yield new __await(_promise2)); 1463 } 1464 }); 1465 } 1466 foo = function() { 1467 return __asyncGenerator(this, null, function* () { 1468 var _stack2 = []; 1469 try { 1470 yield; 1471 yield x; 1472 yield* __yieldStar(x); 1473 const x = __using(_stack2, yield new __await(y), true); 1474 try { 1475 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1476 let x2 = temp.value; 1477 } 1478 } catch (temp) { 1479 error = [temp]; 1480 } finally { 1481 try { 1482 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1483 } finally { 1484 if (error) 1485 throw error[0]; 1486 } 1487 } 1488 try { 1489 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1490 var _x = temp2.value; 1491 var _stack = []; 1492 try { 1493 const x2 = __using(_stack, _x, true); 1494 } catch (_) { 1495 var _error = _, _hasError = true; 1496 } finally { 1497 var _promise = __callDispose(_stack, _error, _hasError); 1498 _promise && (yield new __await(_promise)); 1499 } 1500 } 1501 } catch (temp2) { 1502 error2 = [temp2]; 1503 } finally { 1504 try { 1505 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1506 } finally { 1507 if (error2) 1508 throw error2[0]; 1509 } 1510 } 1511 } catch (_2) { 1512 var _error2 = _2, _hasError2 = true; 1513 } finally { 1514 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1515 _promise2 && (yield new __await(_promise2)); 1516 } 1517 }); 1518 }; 1519 foo = { bar() { 1520 return __asyncGenerator(this, null, function* () { 1521 var _stack2 = []; 1522 try { 1523 yield; 1524 yield x; 1525 yield* __yieldStar(x); 1526 const x = __using(_stack2, yield new __await(y), true); 1527 try { 1528 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1529 let x2 = temp.value; 1530 } 1531 } catch (temp) { 1532 error = [temp]; 1533 } finally { 1534 try { 1535 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1536 } finally { 1537 if (error) 1538 throw error[0]; 1539 } 1540 } 1541 try { 1542 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1543 var _x = temp2.value; 1544 var _stack = []; 1545 try { 1546 const x2 = __using(_stack, _x, true); 1547 } catch (_) { 1548 var _error = _, _hasError = true; 1549 } finally { 1550 var _promise = __callDispose(_stack, _error, _hasError); 1551 _promise && (yield new __await(_promise)); 1552 } 1553 } 1554 } catch (temp2) { 1555 error2 = [temp2]; 1556 } finally { 1557 try { 1558 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1559 } finally { 1560 if (error2) 1561 throw error2[0]; 1562 } 1563 } 1564 } catch (_2) { 1565 var _error2 = _2, _hasError2 = true; 1566 } finally { 1567 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1568 _promise2 && (yield new __await(_promise2)); 1569 } 1570 }); 1571 } }; 1572 class Foo { 1573 bar() { 1574 return __asyncGenerator(this, null, function* () { 1575 var _stack2 = []; 1576 try { 1577 yield; 1578 yield x; 1579 yield* __yieldStar(x); 1580 const x = __using(_stack2, yield new __await(y), true); 1581 try { 1582 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1583 let x2 = temp.value; 1584 } 1585 } catch (temp) { 1586 error = [temp]; 1587 } finally { 1588 try { 1589 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1590 } finally { 1591 if (error) 1592 throw error[0]; 1593 } 1594 } 1595 try { 1596 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1597 var _x = temp2.value; 1598 var _stack = []; 1599 try { 1600 const x2 = __using(_stack, _x, true); 1601 } catch (_) { 1602 var _error = _, _hasError = true; 1603 } finally { 1604 var _promise = __callDispose(_stack, _error, _hasError); 1605 _promise && (yield new __await(_promise)); 1606 } 1607 } 1608 } catch (temp2) { 1609 error2 = [temp2]; 1610 } finally { 1611 try { 1612 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1613 } finally { 1614 if (error2) 1615 throw error2[0]; 1616 } 1617 } 1618 } catch (_2) { 1619 var _error2 = _2, _hasError2 = true; 1620 } finally { 1621 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1622 _promise2 && (yield new __await(_promise2)); 1623 } 1624 }); 1625 } 1626 } 1627 Foo = class { 1628 bar() { 1629 return __asyncGenerator(this, null, function* () { 1630 var _stack2 = []; 1631 try { 1632 yield; 1633 yield x; 1634 yield* __yieldStar(x); 1635 const x = __using(_stack2, yield new __await(y), true); 1636 try { 1637 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { 1638 let x2 = temp.value; 1639 } 1640 } catch (temp) { 1641 error = [temp]; 1642 } finally { 1643 try { 1644 more && (temp = iter.return) && (yield new __await(temp.call(iter))); 1645 } finally { 1646 if (error) 1647 throw error[0]; 1648 } 1649 } 1650 try { 1651 for (var iter2 = __forAwait(y), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) { 1652 var _x = temp2.value; 1653 var _stack = []; 1654 try { 1655 const x2 = __using(_stack, _x, true); 1656 } catch (_) { 1657 var _error = _, _hasError = true; 1658 } finally { 1659 var _promise = __callDispose(_stack, _error, _hasError); 1660 _promise && (yield new __await(_promise)); 1661 } 1662 } 1663 } catch (temp2) { 1664 error2 = [temp2]; 1665 } finally { 1666 try { 1667 more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2))); 1668 } finally { 1669 if (error2) 1670 throw error2[0]; 1671 } 1672 } 1673 } catch (_2) { 1674 var _error2 = _2, _hasError2 = true; 1675 } finally { 1676 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1677 _promise2 && (yield new __await(_promise2)); 1678 } 1679 }); 1680 } 1681 }; 1682 function bar() { 1683 return __async(this, null, function* () { 1684 var _stack2 = []; 1685 try { 1686 const x = __using(_stack2, yield y, true); 1687 for await (let x2 of y) { 1688 } 1689 for await (var _x of y) { 1690 var _stack = []; 1691 try { 1692 const x2 = __using(_stack, _x, true); 1693 } catch (_) { 1694 var _error = _, _hasError = true; 1695 } finally { 1696 var _promise = __callDispose(_stack, _error, _hasError); 1697 _promise && (yield _promise); 1698 } 1699 } 1700 } catch (_2) { 1701 var _error2 = _2, _hasError2 = true; 1702 } finally { 1703 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 1704 _promise2 && (yield _promise2); 1705 } 1706 }); 1707 } 1708 1709 ================================================================================ 1710 TestLowerAsyncSuperES2016NoBundle 1711 ---------- /out.js ---------- 1712 class Derived extends Base { 1713 test(key) { 1714 return __async(this, null, function* () { 1715 var _a, _b, _c, _d; 1716 return [ 1717 yield __superGet(Derived.prototype, this, "foo"), 1718 yield __superGet(Derived.prototype, this, key), 1719 yield [__superWrapper(Derived.prototype, this, "foo")._] = [0], 1720 yield [__superWrapper(Derived.prototype, this, key)._] = [0], 1721 yield __superSet(Derived.prototype, this, "foo", 1), 1722 yield __superSet(Derived.prototype, this, key, 1), 1723 yield __superSet(Derived.prototype, this, "foo", __superGet(Derived.prototype, this, "foo") + 2), 1724 yield __superSet(Derived.prototype, this, key, __superGet(Derived.prototype, this, key) + 2), 1725 yield ++__superWrapper(Derived.prototype, this, "foo")._, 1726 yield ++__superWrapper(Derived.prototype, this, key)._, 1727 yield __superWrapper(Derived.prototype, this, "foo")._++, 1728 yield __superWrapper(Derived.prototype, this, key)._++, 1729 yield __superGet(Derived.prototype, this, "foo").name, 1730 yield __superGet(Derived.prototype, this, key).name, 1731 yield (_a = __superGet(Derived.prototype, this, "foo")) == null ? void 0 : _a.name, 1732 yield (_b = __superGet(Derived.prototype, this, key)) == null ? void 0 : _b.name, 1733 yield __superGet(Derived.prototype, this, "foo").call(this, 1, 2), 1734 yield __superGet(Derived.prototype, this, key).call(this, 1, 2), 1735 yield (_c = __superGet(Derived.prototype, this, "foo")) == null ? void 0 : _c.call(this, 1, 2), 1736 yield (_d = __superGet(Derived.prototype, this, key)) == null ? void 0 : _d.call(this, 1, 2), 1737 yield (() => __superGet(Derived.prototype, this, "foo"))(), 1738 yield (() => __superGet(Derived.prototype, this, key))(), 1739 yield (() => __superGet(Derived.prototype, this, "foo").call(this))(), 1740 yield (() => __superGet(Derived.prototype, this, key).call(this))(), 1741 yield __superGet(Derived.prototype, this, "foo").bind(this)``, 1742 yield __superGet(Derived.prototype, this, key).bind(this)`` 1743 ]; 1744 }); 1745 } 1746 } 1747 let fn = () => __async(this, null, function* () { 1748 return class extends Base { 1749 constructor() { 1750 super(...arguments); 1751 __publicField(this, "a", super.a); 1752 __publicField(this, "b", () => super.b); 1753 } 1754 c() { 1755 return super.c; 1756 } 1757 d() { 1758 return () => super.d; 1759 } 1760 }; 1761 }); 1762 class Derived2 extends Base { 1763 constructor() { 1764 super(...arguments); 1765 __publicField(this, "b", () => __async(this, null, function* () { 1766 var _a; 1767 return _a = __superGet(Derived2.prototype, this, "foo"), class { 1768 constructor() { 1769 __publicField(this, _a, 123); 1770 } 1771 }; 1772 })); 1773 } 1774 a() { 1775 return __async(this, null, function* () { 1776 var _a; 1777 return _a = __superGet(Derived2.prototype, this, "foo"), class { 1778 constructor() { 1779 __publicField(this, _a, 123); 1780 } 1781 }; 1782 }); 1783 } 1784 } 1785 for (let i = 0; i < 3; i++) { 1786 let _a; 1787 objs.push(_a = { 1788 __proto__: { 1789 foo() { 1790 return i; 1791 } 1792 }, 1793 bar() { 1794 return __async(this, null, function* () { 1795 return __superGet(_a, this, "foo").call(this); 1796 }); 1797 } 1798 }); 1799 } 1800 1801 ================================================================================ 1802 TestLowerAsyncSuperES2017NoBundle 1803 ---------- /out.js ---------- 1804 class Derived extends Base { 1805 async test(key) { 1806 var _a, _b, _c, _d; 1807 return [ 1808 await super.foo, 1809 await super[key], 1810 await ([super.foo] = [0]), 1811 await ([super[key]] = [0]), 1812 await (super.foo = 1), 1813 await (super[key] = 1), 1814 await (super.foo += 2), 1815 await (super[key] += 2), 1816 await ++super.foo, 1817 await ++super[key], 1818 await super.foo++, 1819 await super[key]++, 1820 await super.foo.name, 1821 await super[key].name, 1822 await ((_a = super.foo) == null ? void 0 : _a.name), 1823 await ((_b = super[key]) == null ? void 0 : _b.name), 1824 await super.foo(1, 2), 1825 await super[key](1, 2), 1826 await ((_c = super.foo) == null ? void 0 : _c.call(this, 1, 2)), 1827 await ((_d = super[key]) == null ? void 0 : _d.call(this, 1, 2)), 1828 await (() => super.foo)(), 1829 await (() => super[key])(), 1830 await (() => super.foo())(), 1831 await (() => super[key]())(), 1832 await super.foo``, 1833 await super[key]`` 1834 ]; 1835 } 1836 } 1837 let fn = async () => class extends Base { 1838 constructor() { 1839 super(...arguments); 1840 __publicField(this, "a", super.a); 1841 __publicField(this, "b", () => super.b); 1842 } 1843 c() { 1844 return super.c; 1845 } 1846 d() { 1847 return () => super.d; 1848 } 1849 }; 1850 class Derived2 extends Base { 1851 constructor() { 1852 super(...arguments); 1853 __publicField(this, "b", async () => { 1854 var _a; 1855 return _a = super.foo, class { 1856 constructor() { 1857 __publicField(this, _a, 123); 1858 } 1859 }; 1860 }); 1861 } 1862 async a() { 1863 var _a; 1864 return _a = super.foo, class { 1865 constructor() { 1866 __publicField(this, _a, 123); 1867 } 1868 }; 1869 } 1870 } 1871 for (let i = 0; i < 3; i++) { 1872 objs.push({ 1873 __proto__: { 1874 foo() { 1875 return i; 1876 } 1877 }, 1878 async bar() { 1879 return super.foo(); 1880 } 1881 }); 1882 } 1883 1884 ================================================================================ 1885 TestLowerAsyncThis2016CommonJS 1886 ---------- /out.js ---------- 1887 // entry.js 1888 var require_entry = __commonJS({ 1889 "entry.js"(exports) { 1890 exports.foo = () => __async(exports, null, function* () { 1891 return exports; 1892 }); 1893 } 1894 }); 1895 export default require_entry(); 1896 1897 ================================================================================ 1898 TestLowerAsyncThis2016ES6 1899 ---------- /out.js ---------- 1900 // other.js 1901 var bar = () => __async(void 0, null, function* () { 1902 }); 1903 1904 // entry.js 1905 var foo = () => __async(void 0, null, function* () { 1906 return void 0; 1907 }); 1908 export { 1909 bar, 1910 foo 1911 }; 1912 1913 ================================================================================ 1914 TestLowerClassField2020NoBundle 1915 ---------- /out.js ---------- 1916 var _foo, _bar, _s_foo, _s_bar; 1917 class Foo { 1918 constructor() { 1919 __privateAdd(this, _foo, 123); 1920 __privateAdd(this, _bar); 1921 __publicField(this, "foo", 123); 1922 __publicField(this, "bar"); 1923 } 1924 } 1925 _foo = new WeakMap(); 1926 _bar = new WeakMap(); 1927 _s_foo = new WeakMap(); 1928 _s_bar = new WeakMap(); 1929 __privateAdd(Foo, _s_foo, 123); 1930 __privateAdd(Foo, _s_bar); 1931 __publicField(Foo, "s_foo", 123); 1932 __publicField(Foo, "s_bar"); 1933 1934 ================================================================================ 1935 TestLowerClassFieldNextNoBundle 1936 ---------- /out.js ---------- 1937 class Foo { 1938 #foo = 123; 1939 #bar; 1940 foo = 123; 1941 bar; 1942 static #s_foo = 123; 1943 static #s_bar; 1944 static s_foo = 123; 1945 static s_bar; 1946 } 1947 1948 ================================================================================ 1949 TestLowerClassFieldStrictTsconfigJson2020 1950 ---------- /out.js ---------- 1951 // loose/index.js 1952 var loose_default = class { 1953 constructor() { 1954 __publicField(this, "foo"); 1955 } 1956 }; 1957 1958 // strict/index.js 1959 var strict_default = class { 1960 constructor() { 1961 __publicField(this, "foo"); 1962 } 1963 }; 1964 1965 // entry.js 1966 console.log(loose_default, strict_default); 1967 1968 ================================================================================ 1969 TestLowerExportStarAsNameCollision 1970 ---------- /out.js ---------- 1971 // nested.js 1972 import * as foo from "path2"; 1973 var foo2 = 123; 1974 1975 // entry.js 1976 import * as ns from "path1"; 1977 console.log(foo, foo2); 1978 var ns2 = 123; 1979 export { 1980 ns, 1981 ns2 as sn 1982 }; 1983 1984 ================================================================================ 1985 TestLowerExportStarAsNameCollisionNoBundle 1986 ---------- /out.js ---------- 1987 import * as ns from "path"; 1988 export { ns }; 1989 let ns2 = 123; 1990 export { ns2 as sn }; 1991 1992 ================================================================================ 1993 TestLowerForAwait2015 1994 ---------- /out.js ---------- 1995 export default [ 1996 () => __async(void 0, null, function* () { 1997 try { 1998 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 1999 x = temp.value; 2000 z(x); 2001 } 2002 } catch (temp) { 2003 error = [temp]; 2004 } finally { 2005 try { 2006 more && (temp = iter.return) && (yield temp.call(iter)); 2007 } finally { 2008 if (error) 2009 throw error[0]; 2010 } 2011 } 2012 }), 2013 () => __async(void 0, null, function* () { 2014 try { 2015 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 2016 x.y = temp.value; 2017 z(x); 2018 } 2019 } catch (temp) { 2020 error = [temp]; 2021 } finally { 2022 try { 2023 more && (temp = iter.return) && (yield temp.call(iter)); 2024 } finally { 2025 if (error) 2026 throw error[0]; 2027 } 2028 } 2029 }), 2030 () => __async(void 0, null, function* () { 2031 try { 2032 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 2033 let x2 = temp.value; 2034 z(x2); 2035 } 2036 } catch (temp) { 2037 error = [temp]; 2038 } finally { 2039 try { 2040 more && (temp = iter.return) && (yield temp.call(iter)); 2041 } finally { 2042 if (error) 2043 throw error[0]; 2044 } 2045 } 2046 }), 2047 () => __async(void 0, null, function* () { 2048 try { 2049 for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 2050 const x2 = temp.value; 2051 z(x2); 2052 } 2053 } catch (temp) { 2054 error = [temp]; 2055 } finally { 2056 try { 2057 more && (temp = iter.return) && (yield temp.call(iter)); 2058 } finally { 2059 if (error) 2060 throw error[0]; 2061 } 2062 } 2063 }), 2064 () => __async(void 0, null, function* () { 2065 try { 2066 label: for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 2067 const x2 = temp.value; 2068 break label; 2069 } 2070 } catch (temp) { 2071 error = [temp]; 2072 } finally { 2073 try { 2074 more && (temp = iter.return) && (yield temp.call(iter)); 2075 } finally { 2076 if (error) 2077 throw error[0]; 2078 } 2079 } 2080 }), 2081 () => __async(void 0, null, function* () { 2082 try { 2083 label: for (var iter = __forAwait(y), more, temp, error; more = !(temp = yield iter.next()).done; more = false) { 2084 const x2 = temp.value; 2085 continue label; 2086 } 2087 } catch (temp) { 2088 error = [temp]; 2089 } finally { 2090 try { 2091 more && (temp = iter.return) && (yield temp.call(iter)); 2092 } finally { 2093 if (error) 2094 throw error[0]; 2095 } 2096 } 2097 }) 2098 ]; 2099 2100 ================================================================================ 2101 TestLowerForAwait2017 2102 ---------- /out.js ---------- 2103 export default [ 2104 async () => { 2105 try { 2106 for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2107 x = temp.value; 2108 z(x); 2109 } 2110 } catch (temp) { 2111 error = [temp]; 2112 } finally { 2113 try { 2114 more && (temp = iter.return) && await temp.call(iter); 2115 } finally { 2116 if (error) 2117 throw error[0]; 2118 } 2119 } 2120 }, 2121 async () => { 2122 try { 2123 for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2124 x.y = temp.value; 2125 z(x); 2126 } 2127 } catch (temp) { 2128 error = [temp]; 2129 } finally { 2130 try { 2131 more && (temp = iter.return) && await temp.call(iter); 2132 } finally { 2133 if (error) 2134 throw error[0]; 2135 } 2136 } 2137 }, 2138 async () => { 2139 try { 2140 for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2141 let x2 = temp.value; 2142 z(x2); 2143 } 2144 } catch (temp) { 2145 error = [temp]; 2146 } finally { 2147 try { 2148 more && (temp = iter.return) && await temp.call(iter); 2149 } finally { 2150 if (error) 2151 throw error[0]; 2152 } 2153 } 2154 }, 2155 async () => { 2156 try { 2157 for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2158 const x2 = temp.value; 2159 z(x2); 2160 } 2161 } catch (temp) { 2162 error = [temp]; 2163 } finally { 2164 try { 2165 more && (temp = iter.return) && await temp.call(iter); 2166 } finally { 2167 if (error) 2168 throw error[0]; 2169 } 2170 } 2171 }, 2172 async () => { 2173 try { 2174 label: for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2175 const x2 = temp.value; 2176 break label; 2177 } 2178 } catch (temp) { 2179 error = [temp]; 2180 } finally { 2181 try { 2182 more && (temp = iter.return) && await temp.call(iter); 2183 } finally { 2184 if (error) 2185 throw error[0]; 2186 } 2187 } 2188 }, 2189 async () => { 2190 try { 2191 label: for (var iter = __forAwait(y), more, temp, error; more = !(temp = await iter.next()).done; more = false) { 2192 const x2 = temp.value; 2193 continue label; 2194 } 2195 } catch (temp) { 2196 error = [temp]; 2197 } finally { 2198 try { 2199 more && (temp = iter.return) && await temp.call(iter); 2200 } finally { 2201 if (error) 2202 throw error[0]; 2203 } 2204 } 2205 } 2206 ]; 2207 2208 ================================================================================ 2209 TestLowerNestedFunctionDirectEval 2210 ---------- /out/1.js ---------- 2211 if (foo) { 2212 let x2 = function() { 2213 }; 2214 var x = x2; 2215 } 2216 2217 ---------- /out/2.js ---------- 2218 if (foo) { 2219 function x() { 2220 } 2221 eval(""); 2222 } 2223 2224 ---------- /out/3.js ---------- 2225 if (foo) { 2226 function x() { 2227 } 2228 if (bar) { 2229 eval(""); 2230 } 2231 } 2232 2233 ---------- /out/4.js ---------- 2234 if (foo) { 2235 function x() { 2236 } 2237 eval(""); 2238 } 2239 2240 ---------- /out/5.js ---------- 2241 "use strict"; 2242 if (foo) { 2243 let x = function() { 2244 }; 2245 } 2246 2247 ---------- /out/6.js ---------- 2248 "use strict"; 2249 if (foo) { 2250 function x() { 2251 } 2252 eval(""); 2253 } 2254 2255 ---------- /out/7.js ---------- 2256 "use strict"; 2257 if (foo) { 2258 function x() { 2259 } 2260 if (bar) { 2261 eval(""); 2262 } 2263 } 2264 2265 ---------- /out/8.js ---------- 2266 "use strict"; 2267 if (foo) { 2268 function x() { 2269 } 2270 eval(""); 2271 } 2272 2273 ================================================================================ 2274 TestLowerNullishCoalescingAssignmentIssue1493 2275 ---------- /out.js ---------- 2276 // entry.js 2277 var A = class { 2278 #a; 2279 f() { 2280 this.#a ?? (this.#a = 1); 2281 } 2282 }; 2283 export { 2284 A 2285 }; 2286 2287 ================================================================================ 2288 TestLowerObjectSpreadNoBundle 2289 ---------- /out.js ---------- 2290 let tests = [ 2291 __spreadValues(__spreadValues({}, a), b), 2292 __spreadValues({ a, b }, c), 2293 __spreadProps(__spreadValues({}, a), { b, c }), 2294 __spreadProps(__spreadValues({ a }, b), { c }), 2295 __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues({ a, b }, c), d), { e, f }), g), h), { i, j }) 2296 ]; 2297 let jsx = [ 2298 /* @__PURE__ */ React.createElement("div", __spreadValues(__spreadValues({}, a), b)), 2299 /* @__PURE__ */ React.createElement("div", __spreadValues({ a: true, b: true }, c)), 2300 /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({}, a), { b: true, c: true })), 2301 /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues({ a: true }, b), { c: true })), 2302 /* @__PURE__ */ React.createElement("div", __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues({ a: true, b: true }, c), d), { e: true, f: true }), g), h), { i: true, j: true })) 2303 ]; 2304 2305 ================================================================================ 2306 TestLowerOptionalCatchNameCollisionNoBundle 2307 ---------- /out.js ---------- 2308 try { 2309 } catch (e4) { 2310 var e, e2; 2311 } 2312 var e3; 2313 2314 ================================================================================ 2315 TestLowerPrivateClassAccessorOrder 2316 ---------- /out.js ---------- 2317 var _Foo_instances, foo_get; 2318 class Foo { 2319 constructor() { 2320 __privateAdd(this, _Foo_instances); 2321 __publicField(this, "bar", __privateGet(this, _Foo_instances, foo_get)); 2322 } 2323 // This must be set before "bar" is initialized 2324 } 2325 _Foo_instances = new WeakSet(); 2326 foo_get = function() { 2327 return 123; 2328 }; 2329 console.log(new Foo().bar === 123); 2330 2331 ================================================================================ 2332 TestLowerPrivateClassBrandCheckSupported 2333 ---------- /out.js ---------- 2334 class Foo { 2335 #foo; 2336 #bar; 2337 baz() { 2338 return [ 2339 this.#foo, 2340 this.#bar, 2341 #foo in this 2342 ]; 2343 } 2344 } 2345 2346 ================================================================================ 2347 TestLowerPrivateClassBrandCheckUnsupported 2348 ---------- /out.js ---------- 2349 var _foo; 2350 class Foo { 2351 constructor() { 2352 __privateAdd(this, _foo); 2353 this.#bar = void 0; 2354 } 2355 #bar; 2356 baz() { 2357 return [ 2358 __privateGet(this, _foo), 2359 this.#bar, 2360 __privateIn(_foo, this) 2361 ]; 2362 } 2363 } 2364 _foo = new WeakMap(); 2365 2366 ================================================================================ 2367 TestLowerPrivateClassExpr2020NoBundle 2368 ---------- /out.js ---------- 2369 var _field, _Foo_instances, method_fn, _a, _staticField, _Foo_static, staticMethod_fn; 2370 export let Foo = (_a = class { 2371 constructor() { 2372 __privateAdd(this, _Foo_instances); 2373 __privateAdd(this, _field); 2374 } 2375 foo() { 2376 var _a2; 2377 __privateSet(this, _field, __privateMethod(this, _Foo_instances, method_fn).call(this)); 2378 __privateSet(Foo, _staticField, __privateMethod(_a2 = Foo, _Foo_static, staticMethod_fn).call(_a2)); 2379 } 2380 }, _field = new WeakMap(), _Foo_instances = new WeakSet(), method_fn = function() { 2381 }, _staticField = new WeakMap(), _Foo_static = new WeakSet(), staticMethod_fn = function() { 2382 }, __privateAdd(_a, _Foo_static), __privateAdd(_a, _staticField), _a); 2383 2384 ================================================================================ 2385 TestLowerPrivateClassFieldOrder 2386 ---------- /out.js ---------- 2387 var _foo; 2388 class Foo { 2389 constructor() { 2390 __privateAdd(this, _foo, 123); 2391 // This must be set before "bar" is initialized 2392 __publicField(this, "bar", __privateGet(this, _foo)); 2393 } 2394 } 2395 _foo = new WeakMap(); 2396 console.log(new Foo().bar === 123); 2397 2398 ================================================================================ 2399 TestLowerPrivateClassFieldStaticIssue1424 2400 ---------- /out.js ---------- 2401 // entry.js 2402 var _T_instances, a_fn, b_fn; 2403 var T = class { 2404 constructor() { 2405 __privateAdd(this, _T_instances); 2406 } 2407 d() { 2408 console.log(__privateMethod(this, _T_instances, a_fn).call(this)); 2409 } 2410 }; 2411 _T_instances = new WeakSet(); 2412 a_fn = function() { 2413 return "a"; 2414 }; 2415 b_fn = function() { 2416 return "b"; 2417 }; 2418 __publicField(T, "c"); 2419 new T().d(); 2420 2421 ================================================================================ 2422 TestLowerPrivateClassMethodOrder 2423 ---------- /out.js ---------- 2424 var _Foo_instances, foo_fn; 2425 class Foo { 2426 constructor() { 2427 __privateAdd(this, _Foo_instances); 2428 __publicField(this, "bar", __privateMethod(this, _Foo_instances, foo_fn).call(this)); 2429 } 2430 // This must be set before "bar" is initialized 2431 } 2432 _Foo_instances = new WeakSet(); 2433 foo_fn = function() { 2434 return 123; 2435 }; 2436 console.log(new Foo().bar === 123); 2437 2438 ================================================================================ 2439 TestLowerPrivateClassStaticAccessorOrder 2440 ---------- /out.js ---------- 2441 var _Foo_static, foo_get, _FooThis_static, foo_get2; 2442 const _Foo = class _Foo { 2443 // This must be set before "bar" is initialized 2444 }; 2445 _Foo_static = new WeakSet(); 2446 foo_get = function() { 2447 return 123; 2448 }; 2449 __privateAdd(_Foo, _Foo_static); 2450 __publicField(_Foo, "bar", __privateGet(_Foo, _Foo_static, foo_get)); 2451 let Foo = _Foo; 2452 console.log(Foo.bar === 123); 2453 const _FooThis = class _FooThis { 2454 // This must be set before "bar" is initialized 2455 }; 2456 _FooThis_static = new WeakSet(); 2457 foo_get2 = function() { 2458 return 123; 2459 }; 2460 __privateAdd(_FooThis, _FooThis_static); 2461 __publicField(_FooThis, "bar", __privateGet(_FooThis, _FooThis_static, foo_get2)); 2462 let FooThis = _FooThis; 2463 console.log(FooThis.bar === 123); 2464 2465 ================================================================================ 2466 TestLowerPrivateClassStaticFieldOrder 2467 ---------- /out.js ---------- 2468 var _foo, _foo2; 2469 const _Foo = class _Foo { 2470 }; 2471 _foo = new WeakMap(); 2472 __privateAdd(_Foo, _foo, 123); 2473 // This must be set before "bar" is initialized 2474 __publicField(_Foo, "bar", __privateGet(_Foo, _foo)); 2475 let Foo = _Foo; 2476 console.log(Foo.bar === 123); 2477 const _FooThis = class _FooThis { 2478 }; 2479 _foo2 = new WeakMap(); 2480 __privateAdd(_FooThis, _foo2, 123); 2481 // This must be set before "bar" is initialized 2482 __publicField(_FooThis, "bar", __privateGet(_FooThis, _foo2)); 2483 let FooThis = _FooThis; 2484 console.log(FooThis.bar === 123); 2485 2486 ================================================================================ 2487 TestLowerPrivateClassStaticMethodOrder 2488 ---------- /out.js ---------- 2489 var _a, _Foo_static, foo_fn, _b, _FooThis_static, foo_fn2; 2490 const _Foo = class _Foo { 2491 // This must be set before "bar" is initialized 2492 }; 2493 _Foo_static = new WeakSet(); 2494 foo_fn = function() { 2495 return 123; 2496 }; 2497 __privateAdd(_Foo, _Foo_static); 2498 __publicField(_Foo, "bar", __privateMethod(_a = _Foo, _Foo_static, foo_fn).call(_a)); 2499 let Foo = _Foo; 2500 console.log(Foo.bar === 123); 2501 const _FooThis = class _FooThis { 2502 // This must be set before "bar" is initialized 2503 }; 2504 _FooThis_static = new WeakSet(); 2505 foo_fn2 = function() { 2506 return 123; 2507 }; 2508 __privateAdd(_FooThis, _FooThis_static); 2509 __publicField(_FooThis, "bar", __privateMethod(_b = _FooThis, _FooThis_static, foo_fn2).call(_b)); 2510 let FooThis = _FooThis; 2511 console.log(FooThis.bar === 123); 2512 2513 ================================================================================ 2514 TestLowerPrivateFieldAssignments2015NoBundle 2515 ---------- /out.js ---------- 2516 var _x; 2517 class Foo { 2518 constructor() { 2519 __privateAdd(this, _x); 2520 } 2521 unary() { 2522 __privateWrapper(this, _x)._++; 2523 __privateWrapper(this, _x)._--; 2524 ++__privateWrapper(this, _x)._; 2525 --__privateWrapper(this, _x)._; 2526 } 2527 binary() { 2528 var _a; 2529 __privateSet(this, _x, 1); 2530 __privateSet(this, _x, __privateGet(this, _x) + 1); 2531 __privateSet(this, _x, __privateGet(this, _x) - 1); 2532 __privateSet(this, _x, __privateGet(this, _x) * 1); 2533 __privateSet(this, _x, __privateGet(this, _x) / 1); 2534 __privateSet(this, _x, __privateGet(this, _x) % 1); 2535 __privateSet(this, _x, __pow(__privateGet(this, _x), 1)); 2536 __privateSet(this, _x, __privateGet(this, _x) << 1); 2537 __privateSet(this, _x, __privateGet(this, _x) >> 1); 2538 __privateSet(this, _x, __privateGet(this, _x) >>> 1); 2539 __privateSet(this, _x, __privateGet(this, _x) & 1); 2540 __privateSet(this, _x, __privateGet(this, _x) | 1); 2541 __privateSet(this, _x, __privateGet(this, _x) ^ 1); 2542 __privateGet(this, _x) && __privateSet(this, _x, 1); 2543 __privateGet(this, _x) || __privateSet(this, _x, 1); 2544 (_a = __privateGet(this, _x)) != null ? _a : __privateSet(this, _x, 1); 2545 } 2546 } 2547 _x = new WeakMap(); 2548 2549 ================================================================================ 2550 TestLowerPrivateFieldAssignments2019NoBundle 2551 ---------- /out.js ---------- 2552 var _x; 2553 class Foo { 2554 constructor() { 2555 __privateAdd(this, _x); 2556 } 2557 unary() { 2558 __privateWrapper(this, _x)._++; 2559 __privateWrapper(this, _x)._--; 2560 ++__privateWrapper(this, _x)._; 2561 --__privateWrapper(this, _x)._; 2562 } 2563 binary() { 2564 var _a; 2565 __privateSet(this, _x, 1); 2566 __privateSet(this, _x, __privateGet(this, _x) + 1); 2567 __privateSet(this, _x, __privateGet(this, _x) - 1); 2568 __privateSet(this, _x, __privateGet(this, _x) * 1); 2569 __privateSet(this, _x, __privateGet(this, _x) / 1); 2570 __privateSet(this, _x, __privateGet(this, _x) % 1); 2571 __privateSet(this, _x, __privateGet(this, _x) ** 1); 2572 __privateSet(this, _x, __privateGet(this, _x) << 1); 2573 __privateSet(this, _x, __privateGet(this, _x) >> 1); 2574 __privateSet(this, _x, __privateGet(this, _x) >>> 1); 2575 __privateSet(this, _x, __privateGet(this, _x) & 1); 2576 __privateSet(this, _x, __privateGet(this, _x) | 1); 2577 __privateSet(this, _x, __privateGet(this, _x) ^ 1); 2578 __privateGet(this, _x) && __privateSet(this, _x, 1); 2579 __privateGet(this, _x) || __privateSet(this, _x, 1); 2580 (_a = __privateGet(this, _x)) != null ? _a : __privateSet(this, _x, 1); 2581 } 2582 } 2583 _x = new WeakMap(); 2584 2585 ================================================================================ 2586 TestLowerPrivateFieldAssignments2020NoBundle 2587 ---------- /out.js ---------- 2588 var _x; 2589 class Foo { 2590 constructor() { 2591 __privateAdd(this, _x); 2592 } 2593 unary() { 2594 __privateWrapper(this, _x)._++; 2595 __privateWrapper(this, _x)._--; 2596 ++__privateWrapper(this, _x)._; 2597 --__privateWrapper(this, _x)._; 2598 } 2599 binary() { 2600 __privateSet(this, _x, 1); 2601 __privateSet(this, _x, __privateGet(this, _x) + 1); 2602 __privateSet(this, _x, __privateGet(this, _x) - 1); 2603 __privateSet(this, _x, __privateGet(this, _x) * 1); 2604 __privateSet(this, _x, __privateGet(this, _x) / 1); 2605 __privateSet(this, _x, __privateGet(this, _x) % 1); 2606 __privateSet(this, _x, __privateGet(this, _x) ** 1); 2607 __privateSet(this, _x, __privateGet(this, _x) << 1); 2608 __privateSet(this, _x, __privateGet(this, _x) >> 1); 2609 __privateSet(this, _x, __privateGet(this, _x) >>> 1); 2610 __privateSet(this, _x, __privateGet(this, _x) & 1); 2611 __privateSet(this, _x, __privateGet(this, _x) | 1); 2612 __privateSet(this, _x, __privateGet(this, _x) ^ 1); 2613 __privateGet(this, _x) && __privateSet(this, _x, 1); 2614 __privateGet(this, _x) || __privateSet(this, _x, 1); 2615 __privateGet(this, _x) ?? __privateSet(this, _x, 1); 2616 } 2617 } 2618 _x = new WeakMap(); 2619 2620 ================================================================================ 2621 TestLowerPrivateFieldAssignmentsNextNoBundle 2622 ---------- /out.js ---------- 2623 class Foo { 2624 #x; 2625 unary() { 2626 this.#x++; 2627 this.#x--; 2628 ++this.#x; 2629 --this.#x; 2630 } 2631 binary() { 2632 this.#x = 1; 2633 this.#x += 1; 2634 this.#x -= 1; 2635 this.#x *= 1; 2636 this.#x /= 1; 2637 this.#x %= 1; 2638 this.#x **= 1; 2639 this.#x <<= 1; 2640 this.#x >>= 1; 2641 this.#x >>>= 1; 2642 this.#x &= 1; 2643 this.#x |= 1; 2644 this.#x ^= 1; 2645 this.#x &&= 1; 2646 this.#x ||= 1; 2647 this.#x ??= 1; 2648 } 2649 } 2650 2651 ================================================================================ 2652 TestLowerPrivateFieldOptionalChain2019NoBundle 2653 ---------- /out.js ---------- 2654 var _x; 2655 class Foo { 2656 constructor() { 2657 __privateAdd(this, _x); 2658 } 2659 foo() { 2660 var _a; 2661 this == null ? void 0 : __privateGet(this, _x).y; 2662 this == null ? void 0 : __privateGet(this.y, _x); 2663 (_a = __privateGet(this, _x)) == null ? void 0 : _a.y; 2664 } 2665 } 2666 _x = new WeakMap(); 2667 2668 ================================================================================ 2669 TestLowerPrivateFieldOptionalChain2020NoBundle 2670 ---------- /out.js ---------- 2671 var _x; 2672 class Foo { 2673 constructor() { 2674 __privateAdd(this, _x); 2675 } 2676 foo() { 2677 this == null ? void 0 : __privateGet(this, _x).y; 2678 this == null ? void 0 : __privateGet(this.y, _x); 2679 __privateGet(this, _x)?.y; 2680 } 2681 } 2682 _x = new WeakMap(); 2683 2684 ================================================================================ 2685 TestLowerPrivateFieldOptionalChainNextNoBundle 2686 ---------- /out.js ---------- 2687 class Foo { 2688 #x; 2689 foo() { 2690 this?.#x.y; 2691 this?.y.#x; 2692 this.#x?.y; 2693 } 2694 } 2695 2696 ================================================================================ 2697 TestLowerPrivateGetterSetter2015 2698 ---------- /out.js ---------- 2699 // entry.js 2700 var _Foo_instances, foo_get, bar_set, prop_get, prop_set; 2701 var Foo = class { 2702 constructor() { 2703 __privateAdd(this, _Foo_instances); 2704 } 2705 foo(fn) { 2706 __privateGet(fn(), _Foo_instances, foo_get); 2707 __privateSet(fn(), _Foo_instances, 1, bar_set); 2708 __privateGet(fn(), _Foo_instances, prop_get); 2709 __privateSet(fn(), _Foo_instances, 2, prop_set); 2710 } 2711 unary(fn) { 2712 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._++; 2713 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._--; 2714 ++__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2715 --__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2716 } 2717 binary(fn) { 2718 var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; 2719 __privateSet(fn(), _Foo_instances, 1, prop_set); 2720 __privateSet(_a = fn(), _Foo_instances, __privateGet(_a, _Foo_instances, prop_get) + 1, prop_set); 2721 __privateSet(_b = fn(), _Foo_instances, __privateGet(_b, _Foo_instances, prop_get) - 1, prop_set); 2722 __privateSet(_c = fn(), _Foo_instances, __privateGet(_c, _Foo_instances, prop_get) * 1, prop_set); 2723 __privateSet(_d = fn(), _Foo_instances, __privateGet(_d, _Foo_instances, prop_get) / 1, prop_set); 2724 __privateSet(_e = fn(), _Foo_instances, __privateGet(_e, _Foo_instances, prop_get) % 1, prop_set); 2725 __privateSet(_f = fn(), _Foo_instances, __pow(__privateGet(_f, _Foo_instances, prop_get), 1), prop_set); 2726 __privateSet(_g = fn(), _Foo_instances, __privateGet(_g, _Foo_instances, prop_get) << 1, prop_set); 2727 __privateSet(_h = fn(), _Foo_instances, __privateGet(_h, _Foo_instances, prop_get) >> 1, prop_set); 2728 __privateSet(_i = fn(), _Foo_instances, __privateGet(_i, _Foo_instances, prop_get) >>> 1, prop_set); 2729 __privateSet(_j = fn(), _Foo_instances, __privateGet(_j, _Foo_instances, prop_get) & 1, prop_set); 2730 __privateSet(_k = fn(), _Foo_instances, __privateGet(_k, _Foo_instances, prop_get) | 1, prop_set); 2731 __privateSet(_l = fn(), _Foo_instances, __privateGet(_l, _Foo_instances, prop_get) ^ 1, prop_set); 2732 __privateGet(_m = fn(), _Foo_instances, prop_get) && __privateSet(_m, _Foo_instances, 1, prop_set); 2733 __privateGet(_n = fn(), _Foo_instances, prop_get) || __privateSet(_n, _Foo_instances, 1, prop_set); 2734 (_p = __privateGet(_o = fn(), _Foo_instances, prop_get)) != null ? _p : __privateSet(_o, _Foo_instances, 1, prop_set); 2735 } 2736 }; 2737 _Foo_instances = new WeakSet(); 2738 foo_get = function() { 2739 return this.foo; 2740 }; 2741 bar_set = function(val) { 2742 this.bar = val; 2743 }; 2744 prop_get = function() { 2745 return this.prop; 2746 }; 2747 prop_set = function(val) { 2748 this.prop = val; 2749 }; 2750 export { 2751 Foo 2752 }; 2753 2754 ================================================================================ 2755 TestLowerPrivateGetterSetter2019 2756 ---------- /out.js ---------- 2757 // entry.js 2758 var _Foo_instances, foo_get, bar_set, prop_get, prop_set; 2759 var Foo = class { 2760 constructor() { 2761 __privateAdd(this, _Foo_instances); 2762 } 2763 foo(fn) { 2764 __privateGet(fn(), _Foo_instances, foo_get); 2765 __privateSet(fn(), _Foo_instances, 1, bar_set); 2766 __privateGet(fn(), _Foo_instances, prop_get); 2767 __privateSet(fn(), _Foo_instances, 2, prop_set); 2768 } 2769 unary(fn) { 2770 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._++; 2771 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._--; 2772 ++__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2773 --__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2774 } 2775 binary(fn) { 2776 var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; 2777 __privateSet(fn(), _Foo_instances, 1, prop_set); 2778 __privateSet(_a = fn(), _Foo_instances, __privateGet(_a, _Foo_instances, prop_get) + 1, prop_set); 2779 __privateSet(_b = fn(), _Foo_instances, __privateGet(_b, _Foo_instances, prop_get) - 1, prop_set); 2780 __privateSet(_c = fn(), _Foo_instances, __privateGet(_c, _Foo_instances, prop_get) * 1, prop_set); 2781 __privateSet(_d = fn(), _Foo_instances, __privateGet(_d, _Foo_instances, prop_get) / 1, prop_set); 2782 __privateSet(_e = fn(), _Foo_instances, __privateGet(_e, _Foo_instances, prop_get) % 1, prop_set); 2783 __privateSet(_f = fn(), _Foo_instances, __privateGet(_f, _Foo_instances, prop_get) ** 1, prop_set); 2784 __privateSet(_g = fn(), _Foo_instances, __privateGet(_g, _Foo_instances, prop_get) << 1, prop_set); 2785 __privateSet(_h = fn(), _Foo_instances, __privateGet(_h, _Foo_instances, prop_get) >> 1, prop_set); 2786 __privateSet(_i = fn(), _Foo_instances, __privateGet(_i, _Foo_instances, prop_get) >>> 1, prop_set); 2787 __privateSet(_j = fn(), _Foo_instances, __privateGet(_j, _Foo_instances, prop_get) & 1, prop_set); 2788 __privateSet(_k = fn(), _Foo_instances, __privateGet(_k, _Foo_instances, prop_get) | 1, prop_set); 2789 __privateSet(_l = fn(), _Foo_instances, __privateGet(_l, _Foo_instances, prop_get) ^ 1, prop_set); 2790 __privateGet(_m = fn(), _Foo_instances, prop_get) && __privateSet(_m, _Foo_instances, 1, prop_set); 2791 __privateGet(_n = fn(), _Foo_instances, prop_get) || __privateSet(_n, _Foo_instances, 1, prop_set); 2792 (_p = __privateGet(_o = fn(), _Foo_instances, prop_get)) != null ? _p : __privateSet(_o, _Foo_instances, 1, prop_set); 2793 } 2794 }; 2795 _Foo_instances = new WeakSet(); 2796 foo_get = function() { 2797 return this.foo; 2798 }; 2799 bar_set = function(val) { 2800 this.bar = val; 2801 }; 2802 prop_get = function() { 2803 return this.prop; 2804 }; 2805 prop_set = function(val) { 2806 this.prop = val; 2807 }; 2808 export { 2809 Foo 2810 }; 2811 2812 ================================================================================ 2813 TestLowerPrivateGetterSetter2020 2814 ---------- /out.js ---------- 2815 // entry.js 2816 var _Foo_instances, foo_get, bar_set, prop_get, prop_set; 2817 var Foo = class { 2818 constructor() { 2819 __privateAdd(this, _Foo_instances); 2820 } 2821 foo(fn) { 2822 __privateGet(fn(), _Foo_instances, foo_get); 2823 __privateSet(fn(), _Foo_instances, 1, bar_set); 2824 __privateGet(fn(), _Foo_instances, prop_get); 2825 __privateSet(fn(), _Foo_instances, 2, prop_set); 2826 } 2827 unary(fn) { 2828 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._++; 2829 __privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._--; 2830 ++__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2831 --__privateWrapper(fn(), _Foo_instances, prop_set, prop_get)._; 2832 } 2833 binary(fn) { 2834 var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o; 2835 __privateSet(fn(), _Foo_instances, 1, prop_set); 2836 __privateSet(_a = fn(), _Foo_instances, __privateGet(_a, _Foo_instances, prop_get) + 1, prop_set); 2837 __privateSet(_b = fn(), _Foo_instances, __privateGet(_b, _Foo_instances, prop_get) - 1, prop_set); 2838 __privateSet(_c = fn(), _Foo_instances, __privateGet(_c, _Foo_instances, prop_get) * 1, prop_set); 2839 __privateSet(_d = fn(), _Foo_instances, __privateGet(_d, _Foo_instances, prop_get) / 1, prop_set); 2840 __privateSet(_e = fn(), _Foo_instances, __privateGet(_e, _Foo_instances, prop_get) % 1, prop_set); 2841 __privateSet(_f = fn(), _Foo_instances, __privateGet(_f, _Foo_instances, prop_get) ** 1, prop_set); 2842 __privateSet(_g = fn(), _Foo_instances, __privateGet(_g, _Foo_instances, prop_get) << 1, prop_set); 2843 __privateSet(_h = fn(), _Foo_instances, __privateGet(_h, _Foo_instances, prop_get) >> 1, prop_set); 2844 __privateSet(_i = fn(), _Foo_instances, __privateGet(_i, _Foo_instances, prop_get) >>> 1, prop_set); 2845 __privateSet(_j = fn(), _Foo_instances, __privateGet(_j, _Foo_instances, prop_get) & 1, prop_set); 2846 __privateSet(_k = fn(), _Foo_instances, __privateGet(_k, _Foo_instances, prop_get) | 1, prop_set); 2847 __privateSet(_l = fn(), _Foo_instances, __privateGet(_l, _Foo_instances, prop_get) ^ 1, prop_set); 2848 __privateGet(_m = fn(), _Foo_instances, prop_get) && __privateSet(_m, _Foo_instances, 1, prop_set); 2849 __privateGet(_n = fn(), _Foo_instances, prop_get) || __privateSet(_n, _Foo_instances, 1, prop_set); 2850 __privateGet(_o = fn(), _Foo_instances, prop_get) ?? __privateSet(_o, _Foo_instances, 1, prop_set); 2851 } 2852 }; 2853 _Foo_instances = new WeakSet(); 2854 foo_get = function() { 2855 return this.foo; 2856 }; 2857 bar_set = function(val) { 2858 this.bar = val; 2859 }; 2860 prop_get = function() { 2861 return this.prop; 2862 }; 2863 prop_set = function(val) { 2864 this.prop = val; 2865 }; 2866 export { 2867 Foo 2868 }; 2869 2870 ================================================================================ 2871 TestLowerPrivateGetterSetterNext 2872 ---------- /out.js ---------- 2873 // entry.js 2874 var Foo = class { 2875 get #foo() { 2876 return this.foo; 2877 } 2878 set #bar(val) { 2879 this.bar = val; 2880 } 2881 get #prop() { 2882 return this.prop; 2883 } 2884 set #prop(val) { 2885 this.prop = val; 2886 } 2887 foo(fn) { 2888 fn().#foo; 2889 fn().#bar = 1; 2890 fn().#prop; 2891 fn().#prop = 2; 2892 } 2893 unary(fn) { 2894 fn().#prop++; 2895 fn().#prop--; 2896 ++fn().#prop; 2897 --fn().#prop; 2898 } 2899 binary(fn) { 2900 fn().#prop = 1; 2901 fn().#prop += 1; 2902 fn().#prop -= 1; 2903 fn().#prop *= 1; 2904 fn().#prop /= 1; 2905 fn().#prop %= 1; 2906 fn().#prop **= 1; 2907 fn().#prop <<= 1; 2908 fn().#prop >>= 1; 2909 fn().#prop >>>= 1; 2910 fn().#prop &= 1; 2911 fn().#prop |= 1; 2912 fn().#prop ^= 1; 2913 fn().#prop &&= 1; 2914 fn().#prop ||= 1; 2915 fn().#prop ??= 1; 2916 } 2917 }; 2918 export { 2919 Foo 2920 }; 2921 2922 ================================================================================ 2923 TestLowerPrivateMethod2019 2924 ---------- /out.js ---------- 2925 // entry.js 2926 var _field, _Foo_instances, method_fn; 2927 var Foo = class { 2928 constructor() { 2929 __privateAdd(this, _Foo_instances); 2930 __privateAdd(this, _field); 2931 } 2932 baseline() { 2933 var _a, _b, _c, _d, _e; 2934 a().foo; 2935 b().foo(x); 2936 (_a = c()) == null ? void 0 : _a.foo(x); 2937 (_c = (_b = d()).foo) == null ? void 0 : _c.call(_b, x); 2938 (_e = (_d = e()) == null ? void 0 : _d.foo) == null ? void 0 : _e.call(_d, x); 2939 } 2940 privateField() { 2941 var _a, _b, _c, _d, _e, _f, _g, _h; 2942 __privateGet(a(), _field); 2943 __privateGet(_a = b(), _field).call(_a, x); 2944 (_b = c()) == null ? void 0 : __privateGet(_b, _field).call(_b, x); 2945 (_d = __privateGet(_c = d(), _field)) == null ? void 0 : _d.call(_c, x); 2946 (_f = (_e = e()) == null ? void 0 : __privateGet(_e, _field)) == null ? void 0 : _f.call(_e, x); 2947 (_g = f()) == null ? void 0 : __privateGet(_h = _g.foo, _field).call(_h, x).bar(); 2948 } 2949 privateMethod() { 2950 var _a, _b, _c, _d, _e, _f, _g, _h; 2951 __privateMethod(a(), _Foo_instances, method_fn); 2952 __privateMethod(_a = b(), _Foo_instances, method_fn).call(_a, x); 2953 (_b = c()) == null ? void 0 : __privateMethod(_b, _Foo_instances, method_fn).call(_b, x); 2954 (_d = __privateMethod(_c = d(), _Foo_instances, method_fn)) == null ? void 0 : _d.call(_c, x); 2955 (_f = (_e = e()) == null ? void 0 : __privateMethod(_e, _Foo_instances, method_fn)) == null ? void 0 : _f.call(_e, x); 2956 (_g = f()) == null ? void 0 : __privateMethod(_h = _g.foo, _Foo_instances, method_fn).call(_h, x).bar(); 2957 } 2958 }; 2959 _field = new WeakMap(); 2960 _Foo_instances = new WeakSet(); 2961 method_fn = function() { 2962 }; 2963 export { 2964 Foo 2965 }; 2966 2967 ================================================================================ 2968 TestLowerPrivateMethod2020 2969 ---------- /out.js ---------- 2970 // entry.js 2971 var _field, _Foo_instances, method_fn; 2972 var Foo = class { 2973 constructor() { 2974 __privateAdd(this, _Foo_instances); 2975 __privateAdd(this, _field); 2976 } 2977 baseline() { 2978 a().foo; 2979 b().foo(x); 2980 c()?.foo(x); 2981 d().foo?.(x); 2982 e()?.foo?.(x); 2983 } 2984 privateField() { 2985 var _a, _b, _c, _d, _e, _f, _g; 2986 __privateGet(a(), _field); 2987 __privateGet(_a = b(), _field).call(_a, x); 2988 (_b = c()) == null ? void 0 : __privateGet(_b, _field).call(_b, x); 2989 (_d = __privateGet(_c = d(), _field)) == null ? void 0 : _d.call(_c, x); 2990 ((_e = e()) == null ? void 0 : __privateGet(_e, _field))?.(x); 2991 (_f = f()) == null ? void 0 : __privateGet(_g = _f.foo, _field).call(_g, x).bar(); 2992 } 2993 privateMethod() { 2994 var _a, _b, _c, _d, _e, _f, _g; 2995 __privateMethod(a(), _Foo_instances, method_fn); 2996 __privateMethod(_a = b(), _Foo_instances, method_fn).call(_a, x); 2997 (_b = c()) == null ? void 0 : __privateMethod(_b, _Foo_instances, method_fn).call(_b, x); 2998 (_d = __privateMethod(_c = d(), _Foo_instances, method_fn)) == null ? void 0 : _d.call(_c, x); 2999 ((_e = e()) == null ? void 0 : __privateMethod(_e, _Foo_instances, method_fn))?.(x); 3000 (_f = f()) == null ? void 0 : __privateMethod(_g = _f.foo, _Foo_instances, method_fn).call(_g, x).bar(); 3001 } 3002 }; 3003 _field = new WeakMap(); 3004 _Foo_instances = new WeakSet(); 3005 method_fn = function() { 3006 }; 3007 export { 3008 Foo 3009 }; 3010 3011 ================================================================================ 3012 TestLowerPrivateMethodNext 3013 ---------- /out.js ---------- 3014 // entry.js 3015 var Foo = class { 3016 #field; 3017 #method() { 3018 } 3019 baseline() { 3020 a().foo; 3021 b().foo(x); 3022 c()?.foo(x); 3023 d().foo?.(x); 3024 e()?.foo?.(x); 3025 } 3026 privateField() { 3027 a().#field; 3028 b().#field(x); 3029 c()?.#field(x); 3030 d().#field?.(x); 3031 e()?.#field?.(x); 3032 f()?.foo.#field(x).bar(); 3033 } 3034 privateMethod() { 3035 a().#method; 3036 b().#method(x); 3037 c()?.#method(x); 3038 d().#method?.(x); 3039 e()?.#method?.(x); 3040 f()?.foo.#method(x).bar(); 3041 } 3042 }; 3043 export { 3044 Foo 3045 }; 3046 3047 ================================================================================ 3048 TestLowerPrivateMethodWithModifiers2020 3049 ---------- /out.js ---------- 3050 // entry.js 3051 var _Foo_instances, g_fn, a_fn, ag_fn, _Foo_static, sg_fn, sa_fn, sag_fn; 3052 var Foo = class { 3053 constructor() { 3054 __privateAdd(this, _Foo_instances); 3055 } 3056 }; 3057 _Foo_instances = new WeakSet(); 3058 g_fn = function* () { 3059 }; 3060 a_fn = async function() { 3061 }; 3062 ag_fn = async function* () { 3063 }; 3064 _Foo_static = new WeakSet(); 3065 sg_fn = function* () { 3066 }; 3067 sa_fn = async function() { 3068 }; 3069 sag_fn = async function* () { 3070 }; 3071 __privateAdd(Foo, _Foo_static); 3072 export { 3073 Foo 3074 }; 3075 3076 ================================================================================ 3077 TestLowerPrivateSuperES2021 3078 ---------- /out.js ---------- 3079 // foo1.js 3080 var _default_instances, foo_fn; 3081 var _foo1_default = class _foo1_default extends x { 3082 constructor() { 3083 super(...arguments); 3084 __privateAdd(this, _default_instances); 3085 } 3086 }; 3087 _default_instances = new WeakSet(); 3088 foo_fn = function() { 3089 __superGet(_foo1_default.prototype, this, "foo").call(this); 3090 }; 3091 var foo1_default = _foo1_default; 3092 3093 // foo2.js 3094 var _default_instances2, foo_fn2; 3095 var _foo2_default = class _foo2_default extends x { 3096 constructor() { 3097 super(...arguments); 3098 __privateAdd(this, _default_instances2); 3099 } 3100 }; 3101 _default_instances2 = new WeakSet(); 3102 foo_fn2 = function() { 3103 __superWrapper(_foo2_default.prototype, this, "foo")._++; 3104 }; 3105 var foo2_default = _foo2_default; 3106 3107 // foo3.js 3108 var _default_static, foo_fn3; 3109 var _foo3_default = class _foo3_default extends x { 3110 }; 3111 _default_static = new WeakSet(); 3112 foo_fn3 = function() { 3113 __superGet(_foo3_default, this, "foo").call(this); 3114 }; 3115 __privateAdd(_foo3_default, _default_static); 3116 var foo3_default = _foo3_default; 3117 3118 // foo4.js 3119 var _default_static2, foo_fn4; 3120 var _foo4_default = class _foo4_default extends x { 3121 }; 3122 _default_static2 = new WeakSet(); 3123 foo_fn4 = function() { 3124 __superWrapper(_foo4_default, this, "foo")._++; 3125 }; 3126 __privateAdd(_foo4_default, _default_static2); 3127 var foo4_default = _foo4_default; 3128 3129 // foo5.js 3130 var _foo; 3131 var foo5_default = class extends x { 3132 constructor() { 3133 super(...arguments); 3134 __privateAdd(this, _foo, () => { 3135 super.foo(); 3136 }); 3137 } 3138 }; 3139 _foo = new WeakMap(); 3140 3141 // foo6.js 3142 var _foo2; 3143 var foo6_default = class extends x { 3144 constructor() { 3145 super(...arguments); 3146 __privateAdd(this, _foo2, () => { 3147 super.foo++; 3148 }); 3149 } 3150 }; 3151 _foo2 = new WeakMap(); 3152 3153 // foo7.js 3154 var _foo3; 3155 var _foo7_default = class _foo7_default extends x { 3156 }; 3157 _foo3 = new WeakMap(); 3158 __privateAdd(_foo7_default, _foo3, () => { 3159 __superGet(_foo7_default, _foo7_default, "foo").call(this); 3160 }); 3161 var foo7_default = _foo7_default; 3162 3163 // foo8.js 3164 var _foo4; 3165 var _foo8_default = class _foo8_default extends x { 3166 }; 3167 _foo4 = new WeakMap(); 3168 __privateAdd(_foo8_default, _foo4, () => { 3169 __superWrapper(_foo8_default, _foo8_default, "foo")._++; 3170 }); 3171 var foo8_default = _foo8_default; 3172 export { 3173 foo1_default as foo1, 3174 foo2_default as foo2, 3175 foo3_default as foo3, 3176 foo4_default as foo4, 3177 foo5_default as foo5, 3178 foo6_default as foo6, 3179 foo7_default as foo7, 3180 foo8_default as foo8 3181 }; 3182 3183 ================================================================================ 3184 TestLowerPrivateSuperES2022 3185 ---------- /out.js ---------- 3186 // foo1.js 3187 var foo1_default = class extends x { 3188 #foo() { 3189 super.foo(); 3190 } 3191 }; 3192 3193 // foo2.js 3194 var foo2_default = class extends x { 3195 #foo() { 3196 super.foo++; 3197 } 3198 }; 3199 3200 // foo3.js 3201 var foo3_default = class extends x { 3202 static #foo() { 3203 super.foo(); 3204 } 3205 }; 3206 3207 // foo4.js 3208 var foo4_default = class extends x { 3209 static #foo() { 3210 super.foo++; 3211 } 3212 }; 3213 3214 // foo5.js 3215 var foo5_default = class extends x { 3216 #foo = () => { 3217 super.foo(); 3218 }; 3219 }; 3220 3221 // foo6.js 3222 var foo6_default = class extends x { 3223 #foo = () => { 3224 super.foo++; 3225 }; 3226 }; 3227 3228 // foo7.js 3229 var foo7_default = class extends x { 3230 static #foo = () => { 3231 super.foo(); 3232 }; 3233 }; 3234 3235 // foo8.js 3236 var foo8_default = class extends x { 3237 static #foo = () => { 3238 super.foo++; 3239 }; 3240 }; 3241 export { 3242 foo1_default as foo1, 3243 foo2_default as foo2, 3244 foo3_default as foo3, 3245 foo4_default as foo4, 3246 foo5_default as foo5, 3247 foo6_default as foo6, 3248 foo7_default as foo7, 3249 foo8_default as foo8 3250 }; 3251 3252 ================================================================================ 3253 TestLowerPrivateSuperStaticBundleIssue2158 3254 ---------- /out.js ---------- 3255 // entry.js 3256 var Foo = class extends Object { 3257 static FOO; 3258 constructor() { 3259 super(); 3260 } 3261 #foo; 3262 }; 3263 export { 3264 Foo 3265 }; 3266 3267 ================================================================================ 3268 TestLowerRegExpNameCollision 3269 ---------- /out.js ---------- 3270 // entry.js 3271 function foo(RegExp2) { 3272 return new RegExp2(new RegExp(".", "d"), "d"); 3273 } 3274 export { 3275 foo 3276 }; 3277 3278 ================================================================================ 3279 TestLowerStaticAsyncArrowSuperES2016 3280 ---------- /out.js ---------- 3281 // foo1.js 3282 var foo1_default = class _foo1_default extends x { 3283 static foo1() { 3284 return () => __async(this, null, function* () { 3285 return __superGet(_foo1_default, this, "foo").call(this, "foo1"); 3286 }); 3287 } 3288 }; 3289 3290 // foo2.js 3291 var foo2_default = class _foo2_default extends x { 3292 static foo2() { 3293 return () => __async(this, null, function* () { 3294 return () => __superGet(_foo2_default, this, "foo").call(this, "foo2"); 3295 }); 3296 } 3297 }; 3298 3299 // foo3.js 3300 var foo3_default = class _foo3_default extends x { 3301 static foo3() { 3302 return () => () => __async(this, null, function* () { 3303 return __superGet(_foo3_default, this, "foo").call(this, "foo3"); 3304 }); 3305 } 3306 }; 3307 3308 // foo4.js 3309 var foo4_default = class _foo4_default extends x { 3310 static foo4() { 3311 return () => __async(this, null, function* () { 3312 return () => __async(this, null, function* () { 3313 return __superGet(_foo4_default, this, "foo").call(this, "foo4"); 3314 }); 3315 }); 3316 } 3317 }; 3318 3319 // bar1.js 3320 var _bar1_default = class _bar1_default extends x { 3321 }; 3322 __publicField(_bar1_default, "bar1", () => __async(_bar1_default, null, function* () { 3323 return __superGet(_bar1_default, _bar1_default, "foo").call(this, "bar1"); 3324 })); 3325 var bar1_default = _bar1_default; 3326 3327 // bar2.js 3328 var _bar2_default = class _bar2_default extends x { 3329 }; 3330 __publicField(_bar2_default, "bar2", () => __async(_bar2_default, null, function* () { 3331 return () => __superGet(_bar2_default, _bar2_default, "foo").call(this, "bar2"); 3332 })); 3333 var bar2_default = _bar2_default; 3334 3335 // bar3.js 3336 var _bar3_default = class _bar3_default extends x { 3337 }; 3338 __publicField(_bar3_default, "bar3", () => () => __async(_bar3_default, null, function* () { 3339 return __superGet(_bar3_default, _bar3_default, "foo").call(this, "bar3"); 3340 })); 3341 var bar3_default = _bar3_default; 3342 3343 // bar4.js 3344 var _bar4_default = class _bar4_default extends x { 3345 }; 3346 __publicField(_bar4_default, "bar4", () => __async(_bar4_default, null, function* () { 3347 return () => __async(_bar4_default, null, function* () { 3348 return __superGet(_bar4_default, _bar4_default, "foo").call(this, "bar4"); 3349 }); 3350 })); 3351 var bar4_default = _bar4_default; 3352 3353 // baz1.js 3354 var baz1_default = class _baz1_default extends x { 3355 static baz1() { 3356 return __async(this, null, function* () { 3357 return () => __superGet(_baz1_default, this, "foo").call(this, "baz1"); 3358 }); 3359 } 3360 }; 3361 3362 // baz2.js 3363 var baz2_default = class _baz2_default extends x { 3364 static baz2() { 3365 return __async(this, null, function* () { 3366 return () => () => __superGet(_baz2_default, this, "foo").call(this, "baz2"); 3367 }); 3368 } 3369 }; 3370 3371 // outer.js 3372 var outer_default = function() { 3373 return __async(this, null, function* () { 3374 const _y = class _y extends z { 3375 }; 3376 __publicField(_y, "foo", () => __async(_y, null, function* () { 3377 return __superGet(_y, _y, "foo").call(this); 3378 })); 3379 let y = _y; 3380 yield y.foo()(); 3381 }); 3382 }(); 3383 export { 3384 bar1_default as bar1, 3385 bar2_default as bar2, 3386 bar3_default as bar3, 3387 bar4_default as bar4, 3388 baz1_default as baz1, 3389 baz2_default as baz2, 3390 foo1_default as foo1, 3391 foo2_default as foo2, 3392 foo3_default as foo3, 3393 foo4_default as foo4 3394 }; 3395 3396 ================================================================================ 3397 TestLowerStaticAsyncArrowSuperSetterES2016 3398 ---------- /out.js ---------- 3399 // foo1.js 3400 var foo1_default = class _foo1_default extends x { 3401 static foo1() { 3402 return () => __async(this, null, function* () { 3403 return __superSet(_foo1_default, this, "foo", "foo1"); 3404 }); 3405 } 3406 }; 3407 3408 // foo2.js 3409 var foo2_default = class _foo2_default extends x { 3410 static foo2() { 3411 return () => __async(this, null, function* () { 3412 return () => __superSet(_foo2_default, this, "foo", "foo2"); 3413 }); 3414 } 3415 }; 3416 3417 // foo3.js 3418 var foo3_default = class _foo3_default extends x { 3419 static foo3() { 3420 return () => () => __async(this, null, function* () { 3421 return __superSet(_foo3_default, this, "foo", "foo3"); 3422 }); 3423 } 3424 }; 3425 3426 // foo4.js 3427 var foo4_default = class _foo4_default extends x { 3428 static foo4() { 3429 return () => __async(this, null, function* () { 3430 return () => __async(this, null, function* () { 3431 return __superSet(_foo4_default, this, "foo", "foo4"); 3432 }); 3433 }); 3434 } 3435 }; 3436 3437 // bar1.js 3438 var _bar1_default = class _bar1_default extends x { 3439 }; 3440 __publicField(_bar1_default, "bar1", () => __async(_bar1_default, null, function* () { 3441 return __superSet(_bar1_default, _bar1_default, "foo", "bar1"); 3442 })); 3443 var bar1_default = _bar1_default; 3444 3445 // bar2.js 3446 var _bar2_default = class _bar2_default extends x { 3447 }; 3448 __publicField(_bar2_default, "bar2", () => __async(_bar2_default, null, function* () { 3449 return () => __superSet(_bar2_default, _bar2_default, "foo", "bar2"); 3450 })); 3451 var bar2_default = _bar2_default; 3452 3453 // bar3.js 3454 var _bar3_default = class _bar3_default extends x { 3455 }; 3456 __publicField(_bar3_default, "bar3", () => () => __async(_bar3_default, null, function* () { 3457 return __superSet(_bar3_default, _bar3_default, "foo", "bar3"); 3458 })); 3459 var bar3_default = _bar3_default; 3460 3461 // bar4.js 3462 var _bar4_default = class _bar4_default extends x { 3463 }; 3464 __publicField(_bar4_default, "bar4", () => __async(_bar4_default, null, function* () { 3465 return () => __async(_bar4_default, null, function* () { 3466 return __superSet(_bar4_default, _bar4_default, "foo", "bar4"); 3467 }); 3468 })); 3469 var bar4_default = _bar4_default; 3470 3471 // baz1.js 3472 var baz1_default = class _baz1_default extends x { 3473 static baz1() { 3474 return __async(this, null, function* () { 3475 return () => __superSet(_baz1_default, this, "foo", "baz1"); 3476 }); 3477 } 3478 }; 3479 3480 // baz2.js 3481 var baz2_default = class _baz2_default extends x { 3482 static baz2() { 3483 return __async(this, null, function* () { 3484 return () => () => __superSet(_baz2_default, this, "foo", "baz2"); 3485 }); 3486 } 3487 }; 3488 3489 // outer.js 3490 var outer_default = function() { 3491 return __async(this, null, function* () { 3492 const _y = class _y extends z { 3493 }; 3494 __publicField(_y, "foo", () => __async(_y, null, function* () { 3495 return __superSet(_y, _y, "foo", "foo"); 3496 })); 3497 let y = _y; 3498 yield y.foo()(); 3499 }); 3500 }(); 3501 export { 3502 bar1_default as bar1, 3503 bar2_default as bar2, 3504 bar3_default as bar3, 3505 bar4_default as bar4, 3506 baz1_default as baz1, 3507 baz2_default as baz2, 3508 foo1_default as foo1, 3509 foo2_default as foo2, 3510 foo3_default as foo3, 3511 foo4_default as foo4 3512 }; 3513 3514 ================================================================================ 3515 TestLowerStaticAsyncSuperES2016NoBundle 3516 ---------- /out.js ---------- 3517 const _Derived = class _Derived extends Base { 3518 }; 3519 __publicField(_Derived, "test", (key) => __async(_Derived, null, function* () { 3520 var _a, _b, _c, _d; 3521 return [ 3522 yield __superGet(_Derived, _Derived, "foo"), 3523 yield __superGet(_Derived, _Derived, key), 3524 yield [__superWrapper(_Derived, _Derived, "foo")._] = [0], 3525 yield [__superWrapper(_Derived, _Derived, key)._] = [0], 3526 yield __superSet(_Derived, _Derived, "foo", 1), 3527 yield __superSet(_Derived, _Derived, key, 1), 3528 yield __superSet(_Derived, _Derived, "foo", __superGet(_Derived, _Derived, "foo") + 2), 3529 yield __superSet(_Derived, _Derived, key, __superGet(_Derived, _Derived, key) + 2), 3530 yield ++__superWrapper(_Derived, _Derived, "foo")._, 3531 yield ++__superWrapper(_Derived, _Derived, key)._, 3532 yield __superWrapper(_Derived, _Derived, "foo")._++, 3533 yield __superWrapper(_Derived, _Derived, key)._++, 3534 yield __superGet(_Derived, _Derived, "foo").name, 3535 yield __superGet(_Derived, _Derived, key).name, 3536 yield (_a = __superGet(_Derived, _Derived, "foo")) == null ? void 0 : _a.name, 3537 yield (_b = __superGet(_Derived, _Derived, key)) == null ? void 0 : _b.name, 3538 yield __superGet(_Derived, _Derived, "foo").call(this, 1, 2), 3539 yield __superGet(_Derived, _Derived, key).call(this, 1, 2), 3540 yield (_c = __superGet(_Derived, _Derived, "foo")) == null ? void 0 : _c.call(this, 1, 2), 3541 yield (_d = __superGet(_Derived, _Derived, key)) == null ? void 0 : _d.call(this, 1, 2), 3542 yield (() => __superGet(_Derived, _Derived, "foo"))(), 3543 yield (() => __superGet(_Derived, _Derived, key))(), 3544 yield (() => __superGet(_Derived, _Derived, "foo").call(this))(), 3545 yield (() => __superGet(_Derived, _Derived, key).call(this))(), 3546 yield __superGet(_Derived, _Derived, "foo").bind(this)``, 3547 yield __superGet(_Derived, _Derived, key).bind(this)`` 3548 ]; 3549 })); 3550 let Derived = _Derived; 3551 let fn = () => __async(this, null, function* () { 3552 var _a; 3553 return _a = class extends Base { 3554 static c() { 3555 return super.c; 3556 } 3557 static d() { 3558 return () => super.d; 3559 } 3560 }, __publicField(_a, "a", __superGet(_a, _a, "a")), __publicField(_a, "b", () => __superGet(_a, _a, "b")), _a; 3561 }); 3562 const _Derived2 = class _Derived2 extends Base { 3563 static a() { 3564 return __async(this, null, function* () { 3565 var _a; 3566 return _a = __superGet(_Derived2, this, "foo"), class { 3567 constructor() { 3568 __publicField(this, _a, 123); 3569 } 3570 }; 3571 }); 3572 } 3573 }; 3574 __publicField(_Derived2, "b", () => __async(_Derived2, null, function* () { 3575 var _a; 3576 return _a = __superGet(_Derived2, _Derived2, "foo"), class { 3577 constructor() { 3578 __publicField(this, _a, 123); 3579 } 3580 }; 3581 })); 3582 let Derived2 = _Derived2; 3583 3584 ================================================================================ 3585 TestLowerStaticAsyncSuperES2021NoBundle 3586 ---------- /out.js ---------- 3587 const _Derived = class _Derived extends Base { 3588 }; 3589 __publicField(_Derived, "test", async (key) => { 3590 return [ 3591 await __superGet(_Derived, _Derived, "foo"), 3592 await __superGet(_Derived, _Derived, key), 3593 await ([__superWrapper(_Derived, _Derived, "foo")._] = [0]), 3594 await ([__superWrapper(_Derived, _Derived, key)._] = [0]), 3595 await __superSet(_Derived, _Derived, "foo", 1), 3596 await __superSet(_Derived, _Derived, key, 1), 3597 await __superSet(_Derived, _Derived, "foo", __superGet(_Derived, _Derived, "foo") + 2), 3598 await __superSet(_Derived, _Derived, key, __superGet(_Derived, _Derived, key) + 2), 3599 await ++__superWrapper(_Derived, _Derived, "foo")._, 3600 await ++__superWrapper(_Derived, _Derived, key)._, 3601 await __superWrapper(_Derived, _Derived, "foo")._++, 3602 await __superWrapper(_Derived, _Derived, key)._++, 3603 await __superGet(_Derived, _Derived, "foo").name, 3604 await __superGet(_Derived, _Derived, key).name, 3605 await __superGet(_Derived, _Derived, "foo")?.name, 3606 await __superGet(_Derived, _Derived, key)?.name, 3607 await __superGet(_Derived, _Derived, "foo").call(this, 1, 2), 3608 await __superGet(_Derived, _Derived, key).call(this, 1, 2), 3609 await super.foo?.(1, 2), 3610 await super[key]?.(1, 2), 3611 await (() => __superGet(_Derived, _Derived, "foo"))(), 3612 await (() => __superGet(_Derived, _Derived, key))(), 3613 await (() => __superGet(_Derived, _Derived, "foo").call(this))(), 3614 await (() => __superGet(_Derived, _Derived, key).call(this))(), 3615 await __superGet(_Derived, _Derived, "foo").bind(this)``, 3616 await __superGet(_Derived, _Derived, key).bind(this)`` 3617 ]; 3618 }); 3619 let Derived = _Derived; 3620 let fn = async () => { 3621 var _a; 3622 return _a = class extends Base { 3623 static c() { 3624 return super.c; 3625 } 3626 static d() { 3627 return () => super.d; 3628 } 3629 }, __publicField(_a, "a", __superGet(_a, _a, "a")), __publicField(_a, "b", () => __superGet(_a, _a, "b")), _a; 3630 }; 3631 const _Derived2 = class _Derived2 extends Base { 3632 static async a() { 3633 var _a; 3634 return _a = super.foo, class { 3635 constructor() { 3636 __publicField(this, _a, 123); 3637 } 3638 }; 3639 } 3640 }; 3641 __publicField(_Derived2, "b", async () => { 3642 var _a; 3643 return _a = __superGet(_Derived2, _Derived2, "foo"), class { 3644 constructor() { 3645 __publicField(this, _a, 123); 3646 } 3647 }; 3648 }); 3649 let Derived2 = _Derived2; 3650 3651 ================================================================================ 3652 TestLowerStaticSuperES2016NoBundle 3653 ---------- /out.js ---------- 3654 const _Derived = class _Derived extends Base { 3655 }; 3656 __publicField(_Derived, "test", (key) => { 3657 var _a, _b, _c, _d; 3658 return [ 3659 __superGet(_Derived, _Derived, "foo"), 3660 __superGet(_Derived, _Derived, key), 3661 [__superWrapper(_Derived, _Derived, "foo")._] = [0], 3662 [__superWrapper(_Derived, _Derived, key)._] = [0], 3663 __superSet(_Derived, _Derived, "foo", 1), 3664 __superSet(_Derived, _Derived, key, 1), 3665 __superSet(_Derived, _Derived, "foo", __superGet(_Derived, _Derived, "foo") + 2), 3666 __superSet(_Derived, _Derived, key, __superGet(_Derived, _Derived, key) + 2), 3667 ++__superWrapper(_Derived, _Derived, "foo")._, 3668 ++__superWrapper(_Derived, _Derived, key)._, 3669 __superWrapper(_Derived, _Derived, "foo")._++, 3670 __superWrapper(_Derived, _Derived, key)._++, 3671 __superGet(_Derived, _Derived, "foo").name, 3672 __superGet(_Derived, _Derived, key).name, 3673 (_a = __superGet(_Derived, _Derived, "foo")) == null ? void 0 : _a.name, 3674 (_b = __superGet(_Derived, _Derived, key)) == null ? void 0 : _b.name, 3675 __superGet(_Derived, _Derived, "foo").call(this, 1, 2), 3676 __superGet(_Derived, _Derived, key).call(this, 1, 2), 3677 (_c = __superGet(_Derived, _Derived, "foo")) == null ? void 0 : _c.call(this, 1, 2), 3678 (_d = __superGet(_Derived, _Derived, key)) == null ? void 0 : _d.call(this, 1, 2), 3679 (() => __superGet(_Derived, _Derived, "foo"))(), 3680 (() => __superGet(_Derived, _Derived, key))(), 3681 (() => __superGet(_Derived, _Derived, "foo").call(this))(), 3682 (() => __superGet(_Derived, _Derived, key).call(this))(), 3683 __superGet(_Derived, _Derived, "foo").bind(this)``, 3684 __superGet(_Derived, _Derived, key).bind(this)`` 3685 ]; 3686 }); 3687 let Derived = _Derived; 3688 3689 ================================================================================ 3690 TestLowerStaticSuperES2021NoBundle 3691 ---------- /out.js ---------- 3692 const _Derived = class _Derived extends Base { 3693 }; 3694 __publicField(_Derived, "test", (key) => { 3695 return [ 3696 __superGet(_Derived, _Derived, "foo"), 3697 __superGet(_Derived, _Derived, key), 3698 [__superWrapper(_Derived, _Derived, "foo")._] = [0], 3699 [__superWrapper(_Derived, _Derived, key)._] = [0], 3700 __superSet(_Derived, _Derived, "foo", 1), 3701 __superSet(_Derived, _Derived, key, 1), 3702 __superSet(_Derived, _Derived, "foo", __superGet(_Derived, _Derived, "foo") + 2), 3703 __superSet(_Derived, _Derived, key, __superGet(_Derived, _Derived, key) + 2), 3704 ++__superWrapper(_Derived, _Derived, "foo")._, 3705 ++__superWrapper(_Derived, _Derived, key)._, 3706 __superWrapper(_Derived, _Derived, "foo")._++, 3707 __superWrapper(_Derived, _Derived, key)._++, 3708 __superGet(_Derived, _Derived, "foo").name, 3709 __superGet(_Derived, _Derived, key).name, 3710 __superGet(_Derived, _Derived, "foo")?.name, 3711 __superGet(_Derived, _Derived, key)?.name, 3712 __superGet(_Derived, _Derived, "foo").call(this, 1, 2), 3713 __superGet(_Derived, _Derived, key).call(this, 1, 2), 3714 super.foo?.(1, 2), 3715 super[key]?.(1, 2), 3716 (() => __superGet(_Derived, _Derived, "foo"))(), 3717 (() => __superGet(_Derived, _Derived, key))(), 3718 (() => __superGet(_Derived, _Derived, "foo").call(this))(), 3719 (() => __superGet(_Derived, _Derived, key).call(this))(), 3720 __superGet(_Derived, _Derived, "foo").bind(this)``, 3721 __superGet(_Derived, _Derived, key).bind(this)`` 3722 ]; 3723 }); 3724 let Derived = _Derived; 3725 3726 ================================================================================ 3727 TestLowerStrictModeSyntax 3728 ---------- /out.js ---------- 3729 // for-in.js 3730 if (test) { 3731 a = b; 3732 for (a in {}) ; 3733 } 3734 var a; 3735 x = y; 3736 for (x in {}) ; 3737 var x; 3738 3739 ================================================================================ 3740 TestLowerTemplateObject 3741 ---------- /out.js ---------- 3742 var _a, _b, _c, _d, _e, _f, _g, _h; 3743 x = () => [ 3744 tag(_a || (_a = __template(["x"]))), 3745 tag(_b || (_b = __template(["ÿ"], ["\\xFF"]))), 3746 tag(_c || (_c = __template([void 0], ["\\x"]))), 3747 tag(_d || (_d = __template([void 0], ["\\u"]))) 3748 ]; 3749 y = () => [ 3750 tag(_e || (_e = __template(["x", "z"])), y), 3751 tag(_f || (_f = __template(["ÿ", "z"], ["\\xFF", "z"])), y), 3752 tag(_g || (_g = __template(["x", "z"], ["x", "\\z"])), y), 3753 tag(_h || (_h = __template(["x", void 0], ["x", "\\u"])), y) 3754 ]; 3755 3756 ================================================================================ 3757 TestLowerUsing 3758 ---------- /out/entry.js ---------- 3759 function foo() { 3760 var _stack4 = []; 3761 try { 3762 const a2 = __using(_stack4, b); 3763 if (nested) { 3764 var _stack3 = []; 3765 try { 3766 const x = __using(_stack3, 1); 3767 } catch (_3) { 3768 var _error3 = _3, _hasError3 = true; 3769 } finally { 3770 __callDispose(_stack3, _error3, _hasError3); 3771 } 3772 } 3773 } catch (_4) { 3774 var _error4 = _4, _hasError4 = true; 3775 } finally { 3776 __callDispose(_stack4, _error4, _hasError4); 3777 } 3778 } 3779 async function bar() { 3780 var _stack4 = []; 3781 try { 3782 const a2 = __using(_stack4, b); 3783 const c2 = __using(_stack4, d, true); 3784 if (nested) { 3785 var _stack3 = []; 3786 try { 3787 const x = __using(_stack3, 1); 3788 const y = __using(_stack3, 2, true); 3789 } catch (_3) { 3790 var _error3 = _3, _hasError3 = true; 3791 } finally { 3792 var _promise3 = __callDispose(_stack3, _error3, _hasError3); 3793 _promise3 && await _promise3; 3794 } 3795 } 3796 } catch (_4) { 3797 var _error4 = _4, _hasError4 = true; 3798 } finally { 3799 var _promise4 = __callDispose(_stack4, _error4, _hasError4); 3800 _promise4 && await _promise4; 3801 } 3802 } 3803 var _stack2 = []; 3804 try { 3805 var a = __using(_stack2, b); 3806 var c = __using(_stack2, d, true); 3807 if (nested) { 3808 var _stack = []; 3809 try { 3810 const x = __using(_stack, 1); 3811 const y = __using(_stack, 2, true); 3812 } catch (_) { 3813 var _error = _, _hasError = true; 3814 } finally { 3815 var _promise = __callDispose(_stack, _error, _hasError); 3816 _promise && await _promise; 3817 } 3818 } 3819 } catch (_2) { 3820 var _error2 = _2, _hasError2 = true; 3821 } finally { 3822 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 3823 _promise2 && await _promise2; 3824 } 3825 3826 ---------- /out/loops.js ---------- 3827 for (var _a of b) { 3828 var _stack = []; 3829 try { 3830 const a = __using(_stack, _a); 3831 c(() => a); 3832 } catch (_) { 3833 var _error = _, _hasError = true; 3834 } finally { 3835 __callDispose(_stack, _error, _hasError); 3836 } 3837 } 3838 for (var _d of e) { 3839 var _stack2 = []; 3840 try { 3841 const d = __using(_stack2, _d, true); 3842 f(() => d); 3843 } catch (_2) { 3844 var _error2 = _2, _hasError2 = true; 3845 } finally { 3846 var _promise = __callDispose(_stack2, _error2, _hasError2); 3847 _promise && await _promise; 3848 } 3849 } 3850 for await (var _g of h) { 3851 var _stack3 = []; 3852 try { 3853 const g = __using(_stack3, _g); 3854 i(() => g); 3855 } catch (_3) { 3856 var _error3 = _3, _hasError3 = true; 3857 } finally { 3858 __callDispose(_stack3, _error3, _hasError3); 3859 } 3860 } 3861 for await (var _j of k) { 3862 var _stack4 = []; 3863 try { 3864 const j = __using(_stack4, _j, true); 3865 l(() => j); 3866 } catch (_4) { 3867 var _error4 = _4, _hasError4 = true; 3868 } finally { 3869 var _promise2 = __callDispose(_stack4, _error4, _hasError4); 3870 _promise2 && await _promise2; 3871 } 3872 } 3873 if (nested) { 3874 for (var _a of b) { 3875 var _stack5 = []; 3876 try { 3877 const a = __using(_stack5, _a); 3878 c(() => a); 3879 } catch (_5) { 3880 var _error5 = _5, _hasError5 = true; 3881 } finally { 3882 __callDispose(_stack5, _error5, _hasError5); 3883 } 3884 } 3885 for (var _d of e) { 3886 var _stack6 = []; 3887 try { 3888 const d = __using(_stack6, _d, true); 3889 f(() => d); 3890 } catch (_6) { 3891 var _error6 = _6, _hasError6 = true; 3892 } finally { 3893 var _promise3 = __callDispose(_stack6, _error6, _hasError6); 3894 _promise3 && await _promise3; 3895 } 3896 } 3897 for await (var _g of h) { 3898 var _stack7 = []; 3899 try { 3900 const g = __using(_stack7, _g); 3901 i(() => g); 3902 } catch (_7) { 3903 var _error7 = _7, _hasError7 = true; 3904 } finally { 3905 __callDispose(_stack7, _error7, _hasError7); 3906 } 3907 } 3908 for await (var _j of k) { 3909 var _stack8 = []; 3910 try { 3911 const j = __using(_stack8, _j, true); 3912 l(() => j); 3913 } catch (_8) { 3914 var _error8 = _8, _hasError8 = true; 3915 } finally { 3916 var _promise4 = __callDispose(_stack8, _error8, _hasError8); 3917 _promise4 && await _promise4; 3918 } 3919 } 3920 } 3921 function foo() { 3922 for (var _a of b) { 3923 var _stack9 = []; 3924 try { 3925 const a = __using(_stack9, _a); 3926 c(() => a); 3927 } catch (_9) { 3928 var _error9 = _9, _hasError9 = true; 3929 } finally { 3930 __callDispose(_stack9, _error9, _hasError9); 3931 } 3932 } 3933 } 3934 async function bar() { 3935 for (var _a of b) { 3936 var _stack9 = []; 3937 try { 3938 const a = __using(_stack9, _a); 3939 c(() => a); 3940 } catch (_9) { 3941 var _error9 = _9, _hasError9 = true; 3942 } finally { 3943 __callDispose(_stack9, _error9, _hasError9); 3944 } 3945 } 3946 for (var _d of e) { 3947 var _stack10 = []; 3948 try { 3949 const d = __using(_stack10, _d, true); 3950 f(() => d); 3951 } catch (_10) { 3952 var _error10 = _10, _hasError10 = true; 3953 } finally { 3954 var _promise5 = __callDispose(_stack10, _error10, _hasError10); 3955 _promise5 && await _promise5; 3956 } 3957 } 3958 for await (var _g of h) { 3959 var _stack11 = []; 3960 try { 3961 const g = __using(_stack11, _g); 3962 i(() => g); 3963 } catch (_11) { 3964 var _error11 = _11, _hasError11 = true; 3965 } finally { 3966 __callDispose(_stack11, _error11, _hasError11); 3967 } 3968 } 3969 for await (var _j of k) { 3970 var _stack12 = []; 3971 try { 3972 const j = __using(_stack12, _j, true); 3973 l(() => j); 3974 } catch (_12) { 3975 var _error12 = _12, _hasError12 = true; 3976 } finally { 3977 var _promise6 = __callDispose(_stack12, _error12, _hasError12); 3978 _promise6 && await _promise6; 3979 } 3980 } 3981 } 3982 3983 ---------- /out/switch.js ---------- 3984 async function foo() { 3985 var _stack6 = []; 3986 try { 3987 const x2 = __using(_stack6, y); 3988 var _stack4 = []; 3989 try { 3990 switch (foo) { 3991 case 0: 3992 const c = __using(_stack4, d); 3993 default: 3994 const e = __using(_stack4, f); 3995 } 3996 } catch (_4) { 3997 var _error4 = _4, _hasError4 = true; 3998 } finally { 3999 __callDispose(_stack4, _error4, _hasError4); 4000 } 4001 var _stack5 = []; 4002 try { 4003 switch (foo) { 4004 case 0: 4005 const c = __using(_stack5, d, true); 4006 default: 4007 const e = __using(_stack5, f); 4008 } 4009 } catch (_5) { 4010 var _error5 = _5, _hasError5 = true; 4011 } finally { 4012 var _promise2 = __callDispose(_stack5, _error5, _hasError5); 4013 _promise2 && await _promise2; 4014 } 4015 } catch (_6) { 4016 var _error6 = _6, _hasError6 = true; 4017 } finally { 4018 __callDispose(_stack6, _error6, _hasError6); 4019 } 4020 } 4021 var _stack3 = []; 4022 try { 4023 var x = __using(_stack3, y); 4024 var _stack = []; 4025 try { 4026 switch (foo) { 4027 case 0: 4028 var c = __using(_stack, d); 4029 default: 4030 var e = __using(_stack, f); 4031 } 4032 } catch (_) { 4033 var _error = _, _hasError = true; 4034 } finally { 4035 __callDispose(_stack, _error, _hasError); 4036 } 4037 var _stack2 = []; 4038 try { 4039 switch (foo) { 4040 case 0: 4041 var c = __using(_stack2, d, true); 4042 default: 4043 var e = __using(_stack2, f); 4044 } 4045 } catch (_2) { 4046 var _error2 = _2, _hasError2 = true; 4047 } finally { 4048 var _promise = __callDispose(_stack2, _error2, _hasError2); 4049 _promise && await _promise; 4050 } 4051 } catch (_3) { 4052 var _error3 = _3, _hasError3 = true; 4053 } finally { 4054 __callDispose(_stack3, _error3, _hasError3); 4055 } 4056 4057 ================================================================================ 4058 TestLowerUsingHoisting 4059 ---------- /out/hoist-use-strict.js ---------- 4060 "use strict"; 4061 function foo() { 4062 "use strict"; 4063 var _stack2 = []; 4064 try { 4065 const a2 = __using(_stack2, b); 4066 } catch (_2) { 4067 var _error2 = _2, _hasError2 = true; 4068 } finally { 4069 __callDispose(_stack2, _error2, _hasError2); 4070 } 4071 } 4072 var _stack = []; 4073 try { 4074 var a = __using(_stack, b); 4075 } catch (_) { 4076 var _error = _, _hasError = true; 4077 } finally { 4078 __callDispose(_stack, _error, _hasError); 4079 } 4080 4081 ---------- /out/hoist-directive.js ---------- 4082 "use wtf"; 4083 function foo() { 4084 "use wtf"; 4085 var _stack2 = []; 4086 try { 4087 const a2 = __using(_stack2, b); 4088 } catch (_2) { 4089 var _error2 = _2, _hasError2 = true; 4090 } finally { 4091 __callDispose(_stack2, _error2, _hasError2); 4092 } 4093 } 4094 var _stack = []; 4095 try { 4096 var a = __using(_stack, b); 4097 } catch (_) { 4098 var _error = _, _hasError = true; 4099 } finally { 4100 __callDispose(_stack, _error, _hasError); 4101 } 4102 4103 ---------- /out/hoist-import.js ---------- 4104 import "./foo"; 4105 var _stack = []; 4106 try { 4107 var a = __using(_stack, b); 4108 var c = __using(_stack, d); 4109 } catch (_) { 4110 var _error = _, _hasError = true; 4111 } finally { 4112 __callDispose(_stack, _error, _hasError); 4113 } 4114 4115 ---------- /out/hoist-export-star.js ---------- 4116 export * from "./foo"; 4117 var _stack = []; 4118 try { 4119 var a = __using(_stack, b); 4120 var c = __using(_stack, d); 4121 } catch (_) { 4122 var _error = _, _hasError = true; 4123 } finally { 4124 __callDispose(_stack, _error, _hasError); 4125 } 4126 4127 ---------- /out/hoist-export-from.js ---------- 4128 export { x, y } from "./foo"; 4129 var _stack = []; 4130 try { 4131 var a = __using(_stack, b); 4132 var c = __using(_stack, d); 4133 } catch (_) { 4134 var _error = _, _hasError = true; 4135 } finally { 4136 __callDispose(_stack, _error, _hasError); 4137 } 4138 4139 ---------- /out/hoist-export-clause.js ---------- 4140 var _stack = []; 4141 try { 4142 var a = __using(_stack, b); 4143 var c = __using(_stack, d); 4144 } catch (_) { 4145 var _error = _, _hasError = true; 4146 } finally { 4147 __callDispose(_stack, _error, _hasError); 4148 } 4149 export { 4150 a, 4151 c as "c!" 4152 }; 4153 4154 ---------- /out/hoist-export-local-direct.js ---------- 4155 var _stack = []; 4156 try { 4157 var a = __using(_stack, b); 4158 var ac1 = [a, c], { x: [x1] } = foo; 4159 var a1 = a, { y: [y1] } = foo; 4160 var c1 = c, { z: [z1] } = foo; 4161 var ac2 = [a, c], { x: [x2] } = foo; 4162 var a2 = a, { y: [y2] } = foo; 4163 var c2 = c, { z: [z2] } = foo; 4164 var c = __using(_stack, d); 4165 } catch (_) { 4166 var _error = _, _hasError = true; 4167 } finally { 4168 __callDispose(_stack, _error, _hasError); 4169 } 4170 export { 4171 ac1, 4172 x1, 4173 a1, 4174 y1, 4175 c1, 4176 z1 4177 }; 4178 4179 ---------- /out/hoist-export-local-indirect.js ---------- 4180 var _stack = []; 4181 try { 4182 var a = __using(_stack, b); 4183 var ac1 = [a, c], { x: [x1] } = foo; 4184 var a1 = a, { y: [y1] } = foo; 4185 var c1 = c, { z: [z1] } = foo; 4186 var ac2 = [a, c], { x: [x2] } = foo; 4187 var a2 = a, { y: [y2] } = foo; 4188 var c2 = c, { z: [z2] } = foo; 4189 var c = __using(_stack, d); 4190 } catch (_) { 4191 var _error = _, _hasError = true; 4192 } finally { 4193 __callDispose(_stack, _error, _hasError); 4194 } 4195 export { 4196 x1, 4197 y1, 4198 z1 4199 }; 4200 4201 ---------- /out/hoist-export-class-direct.js ---------- 4202 var _stack = []; 4203 try { 4204 var a = __using(_stack, b); 4205 var Foo1 = class { 4206 ac = [a, c]; 4207 }; 4208 var Bar1 = class _Bar1 { 4209 ac = [a, c, _Bar1]; 4210 }; 4211 var Foo2 = class { 4212 ac = [a, c]; 4213 }; 4214 var Bar2 = class _Bar2 { 4215 ac = [a, c, _Bar2]; 4216 }; 4217 var c = __using(_stack, d); 4218 } catch (_) { 4219 var _error = _, _hasError = true; 4220 } finally { 4221 __callDispose(_stack, _error, _hasError); 4222 } 4223 export { 4224 Foo1, 4225 Bar1 4226 }; 4227 4228 ---------- /out/hoist-export-class-indirect.js ---------- 4229 var _stack = []; 4230 try { 4231 var a = __using(_stack, b); 4232 var Foo1 = class { 4233 ac = [a, c]; 4234 }; 4235 var Bar1 = class _Bar1 { 4236 ac = [a, c, _Bar1]; 4237 }; 4238 var Foo2 = class { 4239 ac = [a, c]; 4240 }; 4241 var Bar2 = class _Bar2 { 4242 ac = [a, c, _Bar2]; 4243 }; 4244 var c = __using(_stack, d); 4245 } catch (_) { 4246 var _error = _, _hasError = true; 4247 } finally { 4248 __callDispose(_stack, _error, _hasError); 4249 } 4250 export { 4251 Foo1, 4252 Bar1 4253 }; 4254 4255 ---------- /out/hoist-export-function-direct.js ---------- 4256 export function foo1() { 4257 return [a, c]; 4258 } 4259 export function bar1() { 4260 return [a, c, bar1]; 4261 } 4262 function foo2() { 4263 return [a, c]; 4264 } 4265 function bar2() { 4266 return [a, c, bar2]; 4267 } 4268 var _stack = []; 4269 try { 4270 var a = __using(_stack, b); 4271 var c = __using(_stack, d); 4272 } catch (_) { 4273 var _error = _, _hasError = true; 4274 } finally { 4275 __callDispose(_stack, _error, _hasError); 4276 } 4277 4278 ---------- /out/hoist-export-function-indirect.js ---------- 4279 function foo1() { 4280 return [a, c]; 4281 } 4282 function bar1() { 4283 return [a, c, bar1]; 4284 } 4285 function foo2() { 4286 return [a, c]; 4287 } 4288 function bar2() { 4289 return [a, c, bar2]; 4290 } 4291 var _stack = []; 4292 try { 4293 var a = __using(_stack, b); 4294 var c = __using(_stack, d); 4295 } catch (_) { 4296 var _error = _, _hasError = true; 4297 } finally { 4298 __callDispose(_stack, _error, _hasError); 4299 } 4300 export { 4301 foo1, 4302 bar1 4303 }; 4304 4305 ---------- /out/hoist-export-default-class-name-unused.js ---------- 4306 var _stack = []; 4307 try { 4308 var a = __using(_stack, b); 4309 var Foo = class { 4310 ac = [a, c]; 4311 }; 4312 var c = __using(_stack, d); 4313 } catch (_) { 4314 var _error = _, _hasError = true; 4315 } finally { 4316 __callDispose(_stack, _error, _hasError); 4317 } 4318 export { 4319 Foo as default 4320 }; 4321 4322 ---------- /out/hoist-export-default-class-name-used.js ---------- 4323 var _stack = []; 4324 try { 4325 var a = __using(_stack, b); 4326 var Foo = class _Foo { 4327 ac = [a, c, _Foo]; 4328 }; 4329 var c = __using(_stack, d); 4330 } catch (_) { 4331 var _error = _, _hasError = true; 4332 } finally { 4333 __callDispose(_stack, _error, _hasError); 4334 } 4335 export { 4336 Foo as default 4337 }; 4338 4339 ---------- /out/hoist-export-default-class-anonymous.js ---------- 4340 var _stack = []; 4341 try { 4342 var a = __using(_stack, b); 4343 var hoist_export_default_class_anonymous_default = class { 4344 ac = [a, c]; 4345 }; 4346 var c = __using(_stack, d); 4347 } catch (_) { 4348 var _error = _, _hasError = true; 4349 } finally { 4350 __callDispose(_stack, _error, _hasError); 4351 } 4352 export { 4353 hoist_export_default_class_anonymous_default as default 4354 }; 4355 4356 ---------- /out/hoist-export-default-function-name-unused.js ---------- 4357 export default function foo() { 4358 return [a, c]; 4359 } 4360 var _stack = []; 4361 try { 4362 var a = __using(_stack, b); 4363 var c = __using(_stack, d); 4364 } catch (_) { 4365 var _error = _, _hasError = true; 4366 } finally { 4367 __callDispose(_stack, _error, _hasError); 4368 } 4369 4370 ---------- /out/hoist-export-default-function-name-used.js ---------- 4371 export default function foo() { 4372 return [a, c, foo]; 4373 } 4374 var _stack = []; 4375 try { 4376 var a = __using(_stack, b); 4377 var c = __using(_stack, d); 4378 } catch (_) { 4379 var _error = _, _hasError = true; 4380 } finally { 4381 __callDispose(_stack, _error, _hasError); 4382 } 4383 4384 ---------- /out/hoist-export-default-function-anonymous.js ---------- 4385 export default function() { 4386 return [a, c]; 4387 } 4388 var _stack = []; 4389 try { 4390 var a = __using(_stack, b); 4391 var c = __using(_stack, d); 4392 } catch (_) { 4393 var _error = _, _hasError = true; 4394 } finally { 4395 __callDispose(_stack, _error, _hasError); 4396 } 4397 4398 ---------- /out/hoist-export-default-expr.js ---------- 4399 var _stack = []; 4400 try { 4401 var a = __using(_stack, b); 4402 var hoist_export_default_expr_default = [a, c]; 4403 var c = __using(_stack, d); 4404 } catch (_) { 4405 var _error = _, _hasError = true; 4406 } finally { 4407 __callDispose(_stack, _error, _hasError); 4408 } 4409 export { 4410 hoist_export_default_expr_default as default 4411 }; 4412 4413 ================================================================================ 4414 TestLowerUsingInsideTSNamespace 4415 ---------- /out/entry.js ---------- 4416 var ns; 4417 ((ns2) => { 4418 var _stack = []; 4419 try { 4420 ns2.a = b; 4421 const c = __using(_stack, d); 4422 ns2.e = f; 4423 } catch (_) { 4424 var _error = _, _hasError = true; 4425 } finally { 4426 __callDispose(_stack, _error, _hasError); 4427 } 4428 })(ns || (ns = {})); 4429 4430 ================================================================================ 4431 TestLowerUsingUnsupportedAsync 4432 ---------- /out/entry.js ---------- 4433 function foo() { 4434 using a = b; 4435 if (nested) { 4436 using x = 1; 4437 } 4438 } 4439 function bar() { 4440 return __async(this, null, function* () { 4441 var _stack2 = []; 4442 try { 4443 const a = __using(_stack2, b); 4444 const c = __using(_stack2, d, true); 4445 if (nested) { 4446 var _stack = []; 4447 try { 4448 const x = __using(_stack, 1); 4449 const y = __using(_stack, 2, true); 4450 } catch (_) { 4451 var _error = _, _hasError = true; 4452 } finally { 4453 var _promise = __callDispose(_stack, _error, _hasError); 4454 _promise && (yield _promise); 4455 } 4456 } 4457 } catch (_2) { 4458 var _error2 = _2, _hasError2 = true; 4459 } finally { 4460 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 4461 _promise2 && (yield _promise2); 4462 } 4463 }); 4464 } 4465 4466 ---------- /out/loops.js ---------- 4467 for (using a of b) c(() => a); 4468 if (nested) { 4469 for (using a of b) c(() => a); 4470 } 4471 function foo() { 4472 for (using a of b) c(() => a); 4473 } 4474 function bar() { 4475 return __async(this, null, function* () { 4476 for (using a of b) c(() => a); 4477 for (var _d of e) { 4478 var _stack = []; 4479 try { 4480 const d = __using(_stack, _d, true); 4481 f(() => d); 4482 } catch (_) { 4483 var _error = _, _hasError = true; 4484 } finally { 4485 var _promise = __callDispose(_stack, _error, _hasError); 4486 _promise && (yield _promise); 4487 } 4488 } 4489 }); 4490 } 4491 4492 ---------- /out/switch.js ---------- 4493 using x = y; 4494 switch (foo) { 4495 case 0: 4496 using c = d; 4497 default: 4498 using e = f; 4499 } 4500 function foo() { 4501 return __async(this, null, function* () { 4502 using x2 = y; 4503 switch (foo) { 4504 case 0: 4505 using c = d; 4506 default: 4507 using e = f; 4508 } 4509 var _stack = []; 4510 try { 4511 switch (foo) { 4512 case 0: 4513 const c = __using(_stack, d, true); 4514 default: 4515 const e = __using(_stack, f); 4516 } 4517 } catch (_) { 4518 var _error = _, _hasError = true; 4519 } finally { 4520 var _promise = __callDispose(_stack, _error, _hasError); 4521 _promise && (yield _promise); 4522 } 4523 }); 4524 } 4525 4526 ================================================================================ 4527 TestLowerUsingUnsupportedUsingAndAsync 4528 ---------- /out/entry.js ---------- 4529 function foo() { 4530 var _stack2 = []; 4531 try { 4532 const a = __using(_stack2, b); 4533 if (nested) { 4534 var _stack = []; 4535 try { 4536 const x = __using(_stack, 1); 4537 } catch (_) { 4538 var _error = _, _hasError = true; 4539 } finally { 4540 __callDispose(_stack, _error, _hasError); 4541 } 4542 } 4543 } catch (_2) { 4544 var _error2 = _2, _hasError2 = true; 4545 } finally { 4546 __callDispose(_stack2, _error2, _hasError2); 4547 } 4548 } 4549 function bar() { 4550 return __async(this, null, function* () { 4551 var _stack2 = []; 4552 try { 4553 const a = __using(_stack2, b); 4554 const c = __using(_stack2, d, true); 4555 if (nested) { 4556 var _stack = []; 4557 try { 4558 const x = __using(_stack, 1); 4559 const y = __using(_stack, 2, true); 4560 } catch (_) { 4561 var _error = _, _hasError = true; 4562 } finally { 4563 var _promise = __callDispose(_stack, _error, _hasError); 4564 _promise && (yield _promise); 4565 } 4566 } 4567 } catch (_2) { 4568 var _error2 = _2, _hasError2 = true; 4569 } finally { 4570 var _promise2 = __callDispose(_stack2, _error2, _hasError2); 4571 _promise2 && (yield _promise2); 4572 } 4573 }); 4574 } 4575 4576 ---------- /out/loops.js ---------- 4577 for (var _a of b) { 4578 var _stack = []; 4579 try { 4580 const a = __using(_stack, _a); 4581 c(() => a); 4582 } catch (_) { 4583 var _error = _, _hasError = true; 4584 } finally { 4585 __callDispose(_stack, _error, _hasError); 4586 } 4587 } 4588 if (nested) { 4589 for (var _a of b) { 4590 var _stack2 = []; 4591 try { 4592 const a = __using(_stack2, _a); 4593 c(() => a); 4594 } catch (_2) { 4595 var _error2 = _2, _hasError2 = true; 4596 } finally { 4597 __callDispose(_stack2, _error2, _hasError2); 4598 } 4599 } 4600 } 4601 function foo() { 4602 for (var _a of b) { 4603 var _stack3 = []; 4604 try { 4605 const a = __using(_stack3, _a); 4606 c(() => a); 4607 } catch (_3) { 4608 var _error3 = _3, _hasError3 = true; 4609 } finally { 4610 __callDispose(_stack3, _error3, _hasError3); 4611 } 4612 } 4613 } 4614 function bar() { 4615 return __async(this, null, function* () { 4616 for (var _a of b) { 4617 var _stack3 = []; 4618 try { 4619 const a = __using(_stack3, _a); 4620 c(() => a); 4621 } catch (_3) { 4622 var _error3 = _3, _hasError3 = true; 4623 } finally { 4624 __callDispose(_stack3, _error3, _hasError3); 4625 } 4626 } 4627 for (var _d of e) { 4628 var _stack4 = []; 4629 try { 4630 const d = __using(_stack4, _d, true); 4631 f(() => d); 4632 } catch (_4) { 4633 var _error4 = _4, _hasError4 = true; 4634 } finally { 4635 var _promise = __callDispose(_stack4, _error4, _hasError4); 4636 _promise && (yield _promise); 4637 } 4638 } 4639 }); 4640 } 4641 4642 ---------- /out/switch.js ---------- 4643 function foo() { 4644 return __async(this, null, function* () { 4645 var _stack5 = []; 4646 try { 4647 const x2 = __using(_stack5, y); 4648 var _stack3 = []; 4649 try { 4650 switch (foo) { 4651 case 0: 4652 const c = __using(_stack3, d); 4653 default: 4654 const e = __using(_stack3, f); 4655 } 4656 } catch (_3) { 4657 var _error3 = _3, _hasError3 = true; 4658 } finally { 4659 __callDispose(_stack3, _error3, _hasError3); 4660 } 4661 var _stack4 = []; 4662 try { 4663 switch (foo) { 4664 case 0: 4665 const c = __using(_stack4, d, true); 4666 default: 4667 const e = __using(_stack4, f); 4668 } 4669 } catch (_4) { 4670 var _error4 = _4, _hasError4 = true; 4671 } finally { 4672 var _promise = __callDispose(_stack4, _error4, _hasError4); 4673 _promise && (yield _promise); 4674 } 4675 } catch (_5) { 4676 var _error5 = _5, _hasError5 = true; 4677 } finally { 4678 __callDispose(_stack5, _error5, _hasError5); 4679 } 4680 }); 4681 } 4682 var _stack2 = []; 4683 try { 4684 var x = __using(_stack2, y); 4685 var _stack = []; 4686 try { 4687 switch (foo) { 4688 case 0: 4689 var c = __using(_stack, d); 4690 default: 4691 var e = __using(_stack, f); 4692 } 4693 } catch (_) { 4694 var _error = _, _hasError = true; 4695 } finally { 4696 __callDispose(_stack, _error, _hasError); 4697 } 4698 } catch (_2) { 4699 var _error2 = _2, _hasError2 = true; 4700 } finally { 4701 __callDispose(_stack2, _error2, _hasError2); 4702 } 4703 4704 ================================================================================ 4705 TestStaticClassBlockES2021 4706 ---------- /out.js ---------- 4707 // entry.js 4708 var _A = class _A { 4709 }; 4710 _A.thisField++; 4711 _A.classField++; 4712 __superSet(_A, _A, "superField", __superGet(_A, _A, "superField") + 1); 4713 __superWrapper(_A, _A, "superField")._++; 4714 var A = _A; 4715 var _a; 4716 var B = (_a = class { 4717 }, _a.thisField++, __superSet(_a, _a, "superField", __superGet(_a, _a, "superField") + 1), __superWrapper(_a, _a, "superField")._++, _a); 4718 4719 ================================================================================ 4720 TestStaticClassBlockESNext 4721 ---------- /out.js ---------- 4722 // entry.js 4723 var A = class _A { 4724 static { 4725 } 4726 static { 4727 this.thisField++; 4728 _A.classField++; 4729 super.superField = super.superField + 1; 4730 super.superField++; 4731 } 4732 }; 4733 var B = class { 4734 static { 4735 } 4736 static { 4737 this.thisField++; 4738 super.superField = super.superField + 1; 4739 super.superField++; 4740 } 4741 }; 4742 4743 ================================================================================ 4744 TestTSLowerClassField2020NoBundle 4745 ---------- /out.js ---------- 4746 var _foo, _bar, _s_foo, _s_bar; 4747 class Foo { 4748 constructor() { 4749 __privateAdd(this, _foo, 123); 4750 __privateAdd(this, _bar); 4751 this.foo = 123; 4752 } 4753 } 4754 _foo = new WeakMap(); 4755 _bar = new WeakMap(); 4756 _s_foo = new WeakMap(); 4757 _s_bar = new WeakMap(); 4758 __privateAdd(Foo, _s_foo, 123); 4759 __privateAdd(Foo, _s_bar); 4760 Foo.s_foo = 123; 4761 4762 ================================================================================ 4763 TestTSLowerClassFieldStrictTsconfigJson2020 4764 ---------- /out.js ---------- 4765 // loose/index.ts 4766 var loose_default = class { 4767 }; 4768 4769 // strict/index.ts 4770 var strict_default = class { 4771 constructor() { 4772 __publicField(this, "foo"); 4773 } 4774 }; 4775 4776 // entry.js 4777 console.log(loose_default, strict_default); 4778 4779 ================================================================================ 4780 TestTSLowerClassPrivateFieldNextNoBundle 4781 ---------- /out.js ---------- 4782 class Foo { 4783 constructor() { 4784 this.#foo = 123; 4785 this.foo = 123; 4786 } 4787 #foo; 4788 #bar; 4789 static #s_foo = 123; 4790 static #s_bar; 4791 static { 4792 this.s_foo = 123; 4793 } 4794 } 4795 4796 ================================================================================ 4797 TestTSLowerObjectRest2017NoBundle 4798 ---------- /out.js ---------- 4799 var _q, _r, _t, _u, _v, _w, _x; 4800 const local_const = __objRest({}, []); 4801 let local_let = __objRest({}, []); 4802 var local_var = __objRest({}, []); 4803 let arrow_fn = (_a) => { 4804 var x2 = __objRest(_a, []); 4805 }; 4806 let fn_expr = function(_b = default_value) { 4807 var x2 = __objRest(_b, []); 4808 }; 4809 let class_expr = class { 4810 method(x2, ..._c) { 4811 var [y, _d] = _c, z = __objRest(_d, []); 4812 } 4813 }; 4814 function fn_stmt(_e, _g) { 4815 var _f = _e, { a = b() } = _f, x2 = __objRest(_f, ["a"]); 4816 var _h = _g, { c = d() } = _h, y = __objRest(_h, ["c"]); 4817 } 4818 class class_stmt { 4819 method(_i) { 4820 var x2 = __objRest(_i, []); 4821 } 4822 } 4823 var ns; 4824 ((ns2) => { 4825 ns2.x = __objRest({}, []); 4826 })(ns || (ns = {})); 4827 try { 4828 } catch (_j) { 4829 let catch_clause = __objRest(_j, []); 4830 } 4831 for (const _k in { abc }) { 4832 const for_in_const = __objRest(_k, []); 4833 } 4834 for (let _l in { abc }) { 4835 let for_in_let = __objRest(_l, []); 4836 } 4837 for (var _m in { abc }) { 4838 var for_in_var = __objRest(_m, []); 4839 ; 4840 } 4841 for (const _n of [{}]) { 4842 const for_of_const = __objRest(_n, []); 4843 ; 4844 } 4845 for (let _o of [{}]) { 4846 let for_of_let = __objRest(_o, []); 4847 x(); 4848 } 4849 for (var _p of [{}]) { 4850 var for_of_var = __objRest(_p, []); 4851 x(); 4852 } 4853 for (const for_const = __objRest({}, []); x; x = null) { 4854 } 4855 for (let for_let = __objRest({}, []); x; x = null) { 4856 } 4857 for (var for_var = __objRest({}, []); x; x = null) { 4858 } 4859 for (_q in { abc }) { 4860 x = __objRest(_q, []); 4861 } 4862 for (_r of [{}]) { 4863 x = __objRest(_r, []); 4864 } 4865 for (x = __objRest({}, []); x; x = null) { 4866 } 4867 assign = __objRest({}, []); 4868 ({ obj_method(_s) { 4869 var x2 = __objRest(_s, []); 4870 } }); 4871 x = __objRest(x, []); 4872 for (x = __objRest(x, []); 0; ) ; 4873 console.log((x = __objRest(_t = x, []), _t)); 4874 console.log((_v = _u = { x }, { x } = _v, xx = __objRest(_v, ["x"]), _u)); 4875 console.log(({ x: _x } = _w = { x }, xx = __objRest(_x, []), _w)); 4876 4877 ================================================================================ 4878 TestTSLowerObjectRest2018NoBundle 4879 ---------- /out.js ---------- 4880 const { ...local_const } = {}; 4881 let { ...local_let } = {}; 4882 var { ...local_var } = {}; 4883 let arrow_fn = ({ ...x2 }) => { 4884 }; 4885 let fn_expr = function({ ...x2 } = default_value) { 4886 }; 4887 let class_expr = class { 4888 method(x2, ...[y, { ...z }]) { 4889 } 4890 }; 4891 function fn_stmt({ a = b(), ...x2 }, { c = d(), ...y }) { 4892 } 4893 class class_stmt { 4894 method({ ...x2 }) { 4895 } 4896 } 4897 var ns; 4898 ((ns2) => { 4899 ({ ...ns2.x } = {}); 4900 })(ns || (ns = {})); 4901 try { 4902 } catch ({ ...catch_clause }) { 4903 } 4904 for (const { ...for_in_const } in { abc }) { 4905 } 4906 for (let { ...for_in_let } in { abc }) { 4907 } 4908 for (var { ...for_in_var } in { abc }) ; 4909 for (const { ...for_of_const } of [{}]) ; 4910 for (let { ...for_of_let } of [{}]) x(); 4911 for (var { ...for_of_var } of [{}]) x(); 4912 for (const { ...for_const } = {}; x; x = null) { 4913 } 4914 for (let { ...for_let } = {}; x; x = null) { 4915 } 4916 for (var { ...for_var } = {}; x; x = null) { 4917 } 4918 for ({ ...x } in { abc }) { 4919 } 4920 for ({ ...x } of [{}]) { 4921 } 4922 for ({ ...x } = {}; x; x = null) { 4923 } 4924 ({ ...assign } = {}); 4925 ({ obj_method({ ...x2 }) { 4926 } }); 4927 ({ ...x } = x); 4928 for ({ ...x } = x; 0; ) ; 4929 console.log({ ...x } = x); 4930 console.log({ x, ...xx } = { x }); 4931 console.log({ x: { ...xx } } = { x }); 4932 4933 ================================================================================ 4934 TestTSLowerPrivateFieldAndMethodAvoidNameCollision2015 4935 ---------- /out.js ---------- 4936 // entry.ts 4937 var _x; 4938 var WeakMap2 = class { 4939 constructor() { 4940 __privateAdd(this, _x); 4941 } 4942 }; 4943 _x = new WeakMap(); 4944 var _WeakSet_instances, y_fn; 4945 var WeakSet2 = class { 4946 constructor() { 4947 __privateAdd(this, _WeakSet_instances); 4948 } 4949 }; 4950 _WeakSet_instances = new WeakSet(); 4951 y_fn = function() { 4952 }; 4953 export { 4954 WeakMap2 as WeakMap, 4955 WeakSet2 as WeakSet 4956 }; 4957 4958 ================================================================================ 4959 TestTSLowerPrivateFieldOptionalChain2015NoBundle 4960 ---------- /out.js ---------- 4961 var _x; 4962 class Foo { 4963 constructor() { 4964 __privateAdd(this, _x); 4965 } 4966 foo() { 4967 var _a; 4968 this == null ? void 0 : __privateGet(this, _x).y; 4969 this == null ? void 0 : __privateGet(this.y, _x); 4970 (_a = __privateGet(this, _x)) == null ? void 0 : _a.y; 4971 } 4972 } 4973 _x = new WeakMap(); 4974 4975 ================================================================================ 4976 TestTSLowerPrivateStaticMembers2015NoBundle 4977 ---------- /out.js ---------- 4978 var _x, _Foo_static, y_get, y_set, z_fn; 4979 const _Foo = class _Foo { 4980 foo() { 4981 var _a; 4982 __privateSet(_Foo, _x, __privateGet(_Foo, _x) + 1); 4983 __privateSet(_Foo, _Foo_static, __privateGet(_Foo, _Foo_static, y_get) + 1, y_set); 4984 __privateMethod(_a = _Foo, _Foo_static, z_fn).call(_a); 4985 } 4986 }; 4987 _x = new WeakMap(); 4988 _Foo_static = new WeakSet(); 4989 y_get = function() { 4990 }; 4991 y_set = function(x) { 4992 }; 4993 z_fn = function() { 4994 }; 4995 __privateAdd(_Foo, _Foo_static); 4996 __privateAdd(_Foo, _x); 4997 let Foo = _Foo;