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
|
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(1,11): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(2,17): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(5,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(6,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(7,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(8,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(9,15): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(11,13): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(12,25): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(13,29): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(14,27): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(15,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(19,6): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(20,18): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(21,22): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(22,20): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts(23,8): error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
==== tests/cases/conformance/es6/newTarget/invalidNewTarget.es6.ts (17 errors) ====
const a = new.target;
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
const b = () => new.target;
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
class C {
[new.target]() { }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
c() { return new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
get d() { return new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
set e(_) { _ = new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
f = () => new.target;
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
static [new.target]() { }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
static g() { return new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
static get h() { return new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
static set i(_) { _ = new.target; }
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
static j = () => new.target;
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
}
const O = {
[new.target]: undefined,
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
k() { return new.target; },
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
get l() { return new.target; },
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
set m(_) { _ = new.target; },
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
n: new.target,
~~~~~~~~~~
!!! error TS17013: Meta-property 'new.target' is only allowed in the body of a function declaration, function expression, or constructor.
};
|