File: privateNameJsBadDeclaration.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (47 lines) | stat: -rw-r--r-- 2,789 bytes parent folder | download
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'.
      }
    }