96 lines
1.8 KiB
Plaintext
96 lines
1.8 KiB
Plaintext
=== tests/cases/conformance/es6/newTarget/newTarget.es6.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
|
|
|
|
};
|
|
|
|
|