File: escapedIdentifiers.ts

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 (122 lines) | stat: -rw-r--r-- 2,665 bytes parent folder | download | duplicates (7)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// @allowUnusedLabels: true
// @allowUnreachableCode: true

/*
    0 .. \u0030
    9 .. \u0039

    A .. \u0041
    Z .. \u005a

    a .. \u0061
    z .. \u00za
*/

// var decl
var \u0061 = 1;
a ++;
\u0061 ++;

var b = 1;
b ++;
\u0062 ++;

// modules
module moduleType1 { 
    export var baz1: number;
}
module moduleType\u0032 { 
    export var baz2: number;
}

moduleType1.baz1 = 3;
moduleType\u0031.baz1 = 3;
moduleType2.baz2 = 3;
moduleType\u0032.baz2 = 3;

// classes

class classType1 { 
    public foo1: number;
}
class classType\u0032 { 
    public foo2: number;
}

var classType1Object1 = new classType1();
classType1Object1.foo1 = 2;
var classType1Object2 = new classType\u0031();
classType1Object2.foo1 = 2;
var classType2Object1 = new classType2();
classType2Object1.foo2 = 2;
var classType2Object2 = new classType\u0032();
classType2Object2.foo2 = 2;

// interfaces
interface interfaceType1 { 
    bar1: number;
}
interface interfaceType\u0032 { 
    bar2: number;
}

var interfaceType1Object1 = <interfaceType1>{ bar1: 0 };
interfaceType1Object1.bar1 = 2;
var interfaceType1Object2 = <interfaceType\u0031>{ bar1: 0 };
interfaceType1Object2.bar1 = 2;
var interfaceType2Object1 = <interfaceType2>{ bar2: 0 };
interfaceType2Object1.bar2 = 2;
var interfaceType2Object2 = <interfaceType\u0032>{ bar2: 0 };
interfaceType2Object2.bar2 = 2;


// arguments
class testClass { 
    public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) { 
        arg\u0031 = 1;
        arg2 = 'string';
        arg\u0033 = true;
        arg4 = 2;
    }
}

// constructors
class constructorTestClass { 
    constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) { 
    }
}
var constructorTestObject = new constructorTestClass(1, 'string', true, 2);
constructorTestObject.arg\u0031 = 1;
constructorTestObject.arg2 = 'string';
constructorTestObject.arg\u0033 = true;
constructorTestObject.arg4 = 2;

// Lables

l\u0061bel1: 
    while (false)
    {  
       while(false)
           continue label1;  // it will go to next iteration of outer loop 
    } 

label2: 
    while (false)
    {  
       while(false)
           continue l\u0061bel2;  // it will go to next iteration of outer loop 
    } 

label3: 
    while (false)
    {  
       while(false)
           continue label3;  // it will go to next iteration of outer loop 
    } 

l\u0061bel4: 
    while (false)
    {  
       while(false)
           continue l\u0061bel4;  // it will go to next iteration of outer loop 
    }