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
|
=== tests/cases/conformance/es6/newTarget/newTarget.es5.ts ===
class A {
>A : A
constructor() {
const a = new.target;
>a : typeof A
>new.target : typeof A
>target : any
const b = () => new.target;
>b : () => typeof A
>() => new.target : () => typeof A
>new.target : typeof A
>target : any
}
static c = function () { return new.target; }
>c : () => any
>function () { return new.target; } : () => any
>new.target : () => any
>target : any
d = function () { return new.target; }
>d : () => any
>function () { return new.target; } : () => any
>new.target : () => any
>target : any
}
class B extends A {
>B : B
>A : A
constructor() {
super();
>super() : void
>super : typeof A
const e = new.target;
>e : typeof B
>new.target : typeof B
>target : any
const f = () => new.target;
>f : () => typeof B
>() => new.target : () => typeof B
>new.target : typeof B
>target : any
}
}
function f1() {
>f1 : () => void
const g = new.target;
>g : () => void
>new.target : () => void
>target : any
const h = () => new.target;
>h : () => () => void
>() => new.target : () => () => void
>new.target : () => void
>target : any
}
const f2 = function () {
>f2 : () => void
>function () { const i = new.target; const j = () => new.target;} : () => void
const i = new.target;
>i : () => void
>new.target : () => void
>target : any
const j = () => new.target;
>j : () => () => void
>() => new.target : () => () => void
>new.target : () => void
>target : any
}
const O = {
>O : { k: () => any; }
>{ k: function () { return new.target; }} : { k: () => any; }
k: function () { return new.target; }
>k : () => any
>function () { return new.target; } : () => any
>new.target : () => any
>target : any
};
|