|
| 1 | +=== tests/cases/compiler/shadowedReservedCompilerDeclarationsWithNoEmit.ts === |
| 2 | +// Shadowed captured this and super |
| 3 | +class Base { } |
| 4 | +>Base : Symbol(Base, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 0, 0)) |
| 5 | + |
| 6 | +class C extends Base { |
| 7 | +>C : Symbol(C, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 1, 14)) |
| 8 | +>Base : Symbol(Base, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 0, 0)) |
| 9 | + |
| 10 | + constructor() { |
| 11 | + super(); |
| 12 | +>super : Symbol(Base, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 0, 0)) |
| 13 | + } |
| 14 | + |
| 15 | + foo() { |
| 16 | +>foo : Symbol(C.foo, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 5, 5)) |
| 17 | + |
| 18 | + let _this = this; |
| 19 | +>_this : Symbol(_this, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 8, 11)) |
| 20 | +>this : Symbol(C, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 1, 14)) |
| 21 | + |
| 22 | + () => { |
| 23 | + _this; |
| 24 | +>_this : Symbol(_this, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 8, 11)) |
| 25 | + |
| 26 | + }; |
| 27 | + } |
| 28 | + |
| 29 | + bar() { |
| 30 | +>bar : Symbol(C.bar, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 13, 5)) |
| 31 | + |
| 32 | + let _super = this; |
| 33 | +>_super : Symbol(_super, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 16, 11)) |
| 34 | +>this : Symbol(C, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 1, 14)) |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | + |
| 39 | +/// shadowed arguments |
| 40 | +function f1(arguments, ...a) { |
| 41 | +>f1 : Symbol(f1, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 18, 1)) |
| 42 | +>arguments : Symbol(arguments, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 22, 12)) |
| 43 | +>a : Symbol(a, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 22, 22)) |
| 44 | +} |
| 45 | + |
| 46 | +class C2 extends Base { |
| 47 | +>C2 : Symbol(C2, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 23, 1)) |
| 48 | +>Base : Symbol(Base, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 0, 0)) |
| 49 | + |
| 50 | + constructor() { |
| 51 | + super(); |
| 52 | +>super : Symbol(Base, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 0, 0)) |
| 53 | + |
| 54 | + var _newTarget = ""; |
| 55 | +>_newTarget : Symbol(_newTarget, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 28, 11)) |
| 56 | + |
| 57 | + var t = new.target; |
| 58 | +>t : Symbol(t, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 29, 11)) |
| 59 | + |
| 60 | + var y = _newTarget; |
| 61 | +>y : Symbol(y, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 30, 11)) |
| 62 | +>_newTarget : Symbol(_newTarget, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 28, 11)) |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | + |
| 67 | +// Shadowed Promise |
| 68 | +var Promise = null; |
| 69 | +>Promise : Symbol(Promise, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 36, 3)) |
| 70 | + |
| 71 | +async function f4() { |
| 72 | +>f4 : Symbol(f4, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 36, 19)) |
| 73 | + |
| 74 | + return 0; |
| 75 | +} |
| 76 | + |
| 77 | + |
| 78 | +// shadowed require |
| 79 | +var require = 0; |
| 80 | +>require : Symbol(require, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 43, 3)) |
| 81 | + |
| 82 | +// shadowed exports |
| 83 | +var exports = 0; |
| 84 | +>exports : Symbol(exports, Decl(shadowedReservedCompilerDeclarationsWithNoEmit.ts, 46, 3)) |
| 85 | + |
| 86 | + |
| 87 | +export { }; |
0 commit comments