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