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
|
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(3,3): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(4,3): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(5,7): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(5,7): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(9,3): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(10,3): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(11,7): error TS18016: Private identifiers are not allowed outside class bodies.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(11,7): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js(15,10): error TS2339: Property '#z' does not exist on type 'C'.
==== tests/cases/conformance/classes/members/privateNames/privateNameJsPrototype.js (9 errors) ====
function A() { }
A.prototype = {
#x: 1, // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
#m() {}, // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
get #p() { return "" } // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
}
class B { }
B.prototype = {
#y: 2, // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
#m() {}, // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
get #p() { return "" } // Error
~~
!!! error TS18016: Private identifiers are not allowed outside class bodies.
~~
!!! error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
}
class C {
constructor() {
this.#z = 3;
~~
!!! error TS2339: Property '#z' does not exist on type 'C'.
}
}
|