File: literals.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (59 lines) | stat: -rw-r--r-- 2,205 bytes parent folder | download | duplicates (3)
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
tests/cases/conformance/expressions/literals/literals.ts(8,10): error TS2531: Object is possibly 'null'.
tests/cases/conformance/expressions/literals/literals.ts(8,17): error TS2531: Object is possibly 'null'.
tests/cases/conformance/expressions/literals/literals.ts(9,9): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/expressions/literals/literals.ts(9,21): error TS2532: Object is possibly 'undefined'.
tests/cases/conformance/expressions/literals/literals.ts(19,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'.
tests/cases/conformance/expressions/literals/literals.ts(24,9): error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o3'.


==== tests/cases/conformance/expressions/literals/literals.ts (6 errors) ====
    //typeof null is Null
    //typeof true is Boolean
    //typeof false is Boolean
    //typeof numeric literal is Number
    //typeof string literal is String
    //typeof regex literal is Regex
    
    var nu = null / null;
             ~~~~
!!! error TS2531: Object is possibly 'null'.
                    ~~~~
!!! error TS2531: Object is possibly 'null'.
    var u = undefined / undefined;
            ~~~~~~~~~
!!! error TS2532: Object is possibly 'undefined'.
                        ~~~~~~~~~
!!! error TS2532: Object is possibly 'undefined'.
    
    var b: boolean;
    var b = true;
    var b = false;
    
    var n: number;
    var n = 1;
    var n = 1.0;
    var n = 1e4;
    var n = 001; // Error in ES5
            ~~~
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '0o1'.
    var n = 0x1;
    var n = -1;
    var n = -1.0;
    var n = -1e-4;
    var n = -003; // Error in ES5
            ~~~~
!!! error TS1085: Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '-0o3'.
    var n = -0x1;
    
    var s: string;
    var s = '';
    var s = "";
    var s = 'foo\
        bar';
    var s = "foo\
        bar";
    
    var r: RegExp;
    var r = /what/;
    var r = /\\\\/;