351 lines
7.7 KiB
Text
351 lines
7.7 KiB
Text
=== tests/cases/compiler/escapedIdentifiers.ts ===
|
|
/*
|
|
0 .. \u0030
|
|
9 .. \u0039
|
|
|
|
A .. \u0041
|
|
Z .. \u005a
|
|
|
|
a .. \u0061
|
|
z .. \u00za
|
|
*/
|
|
|
|
// var decl
|
|
var \u0061 = 1;
|
|
>\u0061 : number
|
|
>1 : number
|
|
|
|
a ++;
|
|
>a ++ : number
|
|
>a : number
|
|
|
|
\u0061 ++;
|
|
>\u0061 ++ : number
|
|
>\u0061 : number
|
|
|
|
var b = 1;
|
|
>b : number
|
|
>1 : number
|
|
|
|
b ++;
|
|
>b ++ : number
|
|
>b : number
|
|
|
|
\u0062 ++;
|
|
>\u0062 ++ : number
|
|
>\u0062 : number
|
|
|
|
// modules
|
|
module moduleType1 {
|
|
>moduleType1 : typeof moduleType1
|
|
|
|
export var baz1: number;
|
|
>baz1 : number
|
|
}
|
|
module moduleType\u0032 {
|
|
>moduleType\u0032 : typeof moduleType\u0032
|
|
|
|
export var baz2: number;
|
|
>baz2 : number
|
|
}
|
|
|
|
moduleType1.baz1 = 3;
|
|
>moduleType1.baz1 = 3 : number
|
|
>moduleType1.baz1 : number
|
|
>moduleType1 : typeof moduleType1
|
|
>baz1 : number
|
|
>3 : number
|
|
|
|
moduleType\u0031.baz1 = 3;
|
|
>moduleType\u0031.baz1 = 3 : number
|
|
>moduleType\u0031.baz1 : number
|
|
>moduleType\u0031 : typeof moduleType1
|
|
>baz1 : number
|
|
>3 : number
|
|
|
|
moduleType2.baz2 = 3;
|
|
>moduleType2.baz2 = 3 : number
|
|
>moduleType2.baz2 : number
|
|
>moduleType2 : typeof moduleType\u0032
|
|
>baz2 : number
|
|
>3 : number
|
|
|
|
moduleType\u0032.baz2 = 3;
|
|
>moduleType\u0032.baz2 = 3 : number
|
|
>moduleType\u0032.baz2 : number
|
|
>moduleType\u0032 : typeof moduleType\u0032
|
|
>baz2 : number
|
|
>3 : number
|
|
|
|
// classes
|
|
|
|
class classType1 {
|
|
>classType1 : classType1
|
|
|
|
public foo1: number;
|
|
>foo1 : number
|
|
}
|
|
class classType\u0032 {
|
|
>classType\u0032 : classType\u0032
|
|
|
|
public foo2: number;
|
|
>foo2 : number
|
|
}
|
|
|
|
var classType1Object1 = new classType1();
|
|
>classType1Object1 : classType1
|
|
>new classType1() : classType1
|
|
>classType1 : typeof classType1
|
|
|
|
classType1Object1.foo1 = 2;
|
|
>classType1Object1.foo1 = 2 : number
|
|
>classType1Object1.foo1 : number
|
|
>classType1Object1 : classType1
|
|
>foo1 : number
|
|
>2 : number
|
|
|
|
var classType1Object2 = new classType\u0031();
|
|
>classType1Object2 : classType1
|
|
>new classType\u0031() : classType1
|
|
>classType\u0031 : typeof classType1
|
|
|
|
classType1Object2.foo1 = 2;
|
|
>classType1Object2.foo1 = 2 : number
|
|
>classType1Object2.foo1 : number
|
|
>classType1Object2 : classType1
|
|
>foo1 : number
|
|
>2 : number
|
|
|
|
var classType2Object1 = new classType2();
|
|
>classType2Object1 : classType\u0032
|
|
>new classType2() : classType\u0032
|
|
>classType2 : typeof classType\u0032
|
|
|
|
classType2Object1.foo2 = 2;
|
|
>classType2Object1.foo2 = 2 : number
|
|
>classType2Object1.foo2 : number
|
|
>classType2Object1 : classType\u0032
|
|
>foo2 : number
|
|
>2 : number
|
|
|
|
var classType2Object2 = new classType\u0032();
|
|
>classType2Object2 : classType\u0032
|
|
>new classType\u0032() : classType\u0032
|
|
>classType\u0032 : typeof classType\u0032
|
|
|
|
classType2Object2.foo2 = 2;
|
|
>classType2Object2.foo2 = 2 : number
|
|
>classType2Object2.foo2 : number
|
|
>classType2Object2 : classType\u0032
|
|
>foo2 : number
|
|
>2 : number
|
|
|
|
// interfaces
|
|
interface interfaceType1 {
|
|
>interfaceType1 : interfaceType1
|
|
|
|
bar1: number;
|
|
>bar1 : number
|
|
}
|
|
interface interfaceType\u0032 {
|
|
>interfaceType\u0032 : interfaceType\u0032
|
|
|
|
bar2: number;
|
|
>bar2 : number
|
|
}
|
|
|
|
var interfaceType1Object1 = <interfaceType1>{ bar1: 0 };
|
|
>interfaceType1Object1 : interfaceType1
|
|
><interfaceType1>{ bar1: 0 } : interfaceType1
|
|
>interfaceType1 : interfaceType1
|
|
>{ bar1: 0 } : { bar1: number; }
|
|
>bar1 : number
|
|
>0 : number
|
|
|
|
interfaceType1Object1.bar1 = 2;
|
|
>interfaceType1Object1.bar1 = 2 : number
|
|
>interfaceType1Object1.bar1 : number
|
|
>interfaceType1Object1 : interfaceType1
|
|
>bar1 : number
|
|
>2 : number
|
|
|
|
var interfaceType1Object2 = <interfaceType\u0031>{ bar1: 0 };
|
|
>interfaceType1Object2 : interfaceType1
|
|
><interfaceType\u0031>{ bar1: 0 } : interfaceType1
|
|
>interfaceType\u0031 : interfaceType1
|
|
>{ bar1: 0 } : { bar1: number; }
|
|
>bar1 : number
|
|
>0 : number
|
|
|
|
interfaceType1Object2.bar1 = 2;
|
|
>interfaceType1Object2.bar1 = 2 : number
|
|
>interfaceType1Object2.bar1 : number
|
|
>interfaceType1Object2 : interfaceType1
|
|
>bar1 : number
|
|
>2 : number
|
|
|
|
var interfaceType2Object1 = <interfaceType2>{ bar2: 0 };
|
|
>interfaceType2Object1 : interfaceType\u0032
|
|
><interfaceType2>{ bar2: 0 } : interfaceType\u0032
|
|
>interfaceType2 : interfaceType\u0032
|
|
>{ bar2: 0 } : { bar2: number; }
|
|
>bar2 : number
|
|
>0 : number
|
|
|
|
interfaceType2Object1.bar2 = 2;
|
|
>interfaceType2Object1.bar2 = 2 : number
|
|
>interfaceType2Object1.bar2 : number
|
|
>interfaceType2Object1 : interfaceType\u0032
|
|
>bar2 : number
|
|
>2 : number
|
|
|
|
var interfaceType2Object2 = <interfaceType\u0032>{ bar2: 0 };
|
|
>interfaceType2Object2 : interfaceType\u0032
|
|
><interfaceType\u0032>{ bar2: 0 } : interfaceType\u0032
|
|
>interfaceType\u0032 : interfaceType\u0032
|
|
>{ bar2: 0 } : { bar2: number; }
|
|
>bar2 : number
|
|
>0 : number
|
|
|
|
interfaceType2Object2.bar2 = 2;
|
|
>interfaceType2Object2.bar2 = 2 : number
|
|
>interfaceType2Object2.bar2 : number
|
|
>interfaceType2Object2 : interfaceType\u0032
|
|
>bar2 : number
|
|
>2 : number
|
|
|
|
|
|
// arguments
|
|
class testClass {
|
|
>testClass : testClass
|
|
|
|
public func(arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) {
|
|
>func : (arg1: number, arg\u0032: string, arg\u0033: boolean, arg4: number) => void
|
|
>arg1 : number
|
|
>arg\u0032 : string
|
|
>arg\u0033 : boolean
|
|
>arg4 : number
|
|
|
|
arg\u0031 = 1;
|
|
>arg\u0031 = 1 : number
|
|
>arg\u0031 : number
|
|
>1 : number
|
|
|
|
arg2 = 'string';
|
|
>arg2 = 'string' : string
|
|
>arg2 : string
|
|
>'string' : string
|
|
|
|
arg\u0033 = true;
|
|
>arg\u0033 = true : boolean
|
|
>arg\u0033 : boolean
|
|
>true : boolean
|
|
|
|
arg4 = 2;
|
|
>arg4 = 2 : number
|
|
>arg4 : number
|
|
>2 : number
|
|
}
|
|
}
|
|
|
|
// constructors
|
|
class constructorTestClass {
|
|
>constructorTestClass : constructorTestClass
|
|
|
|
constructor (public arg1: number,public arg\u0032: string,public arg\u0033: boolean,public arg4: number) {
|
|
>arg1 : number
|
|
>arg\u0032 : string
|
|
>arg\u0033 : boolean
|
|
>arg4 : number
|
|
}
|
|
}
|
|
var constructorTestObject = new constructorTestClass(1, 'string', true, 2);
|
|
>constructorTestObject : constructorTestClass
|
|
>new constructorTestClass(1, 'string', true, 2) : constructorTestClass
|
|
>constructorTestClass : typeof constructorTestClass
|
|
>1 : number
|
|
>'string' : string
|
|
>true : boolean
|
|
>2 : number
|
|
|
|
constructorTestObject.arg\u0031 = 1;
|
|
>constructorTestObject.arg\u0031 = 1 : number
|
|
>constructorTestObject.arg\u0031 : number
|
|
>constructorTestObject : constructorTestClass
|
|
>arg\u0031 : number
|
|
>1 : number
|
|
|
|
constructorTestObject.arg2 = 'string';
|
|
>constructorTestObject.arg2 = 'string' : string
|
|
>constructorTestObject.arg2 : string
|
|
>constructorTestObject : constructorTestClass
|
|
>arg2 : string
|
|
>'string' : string
|
|
|
|
constructorTestObject.arg\u0033 = true;
|
|
>constructorTestObject.arg\u0033 = true : boolean
|
|
>constructorTestObject.arg\u0033 : boolean
|
|
>constructorTestObject : constructorTestClass
|
|
>arg\u0033 : boolean
|
|
>true : boolean
|
|
|
|
constructorTestObject.arg4 = 2;
|
|
>constructorTestObject.arg4 = 2 : number
|
|
>constructorTestObject.arg4 : number
|
|
>constructorTestObject : constructorTestClass
|
|
>arg4 : number
|
|
>2 : number
|
|
|
|
// Lables
|
|
|
|
l\u0061bel1:
|
|
>l\u0061bel1 : any
|
|
|
|
while (false)
|
|
>false : boolean
|
|
{
|
|
while(false)
|
|
>false : boolean
|
|
|
|
continue label1; // it will go to next iteration of outer loop
|
|
>label1 : any
|
|
}
|
|
|
|
label2:
|
|
>label2 : any
|
|
|
|
while (false)
|
|
>false : boolean
|
|
{
|
|
while(false)
|
|
>false : boolean
|
|
|
|
continue l\u0061bel2; // it will go to next iteration of outer loop
|
|
>l\u0061bel2 : any
|
|
}
|
|
|
|
label3:
|
|
>label3 : any
|
|
|
|
while (false)
|
|
>false : boolean
|
|
{
|
|
while(false)
|
|
>false : boolean
|
|
|
|
continue label3; // it will go to next iteration of outer loop
|
|
>label3 : any
|
|
}
|
|
|
|
l\u0061bel4:
|
|
>l\u0061bel4 : any
|
|
|
|
while (false)
|
|
>false : boolean
|
|
{
|
|
while(false)
|
|
>false : boolean
|
|
|
|
continue l\u0061bel4; // it will go to next iteration of outer loop
|
|
>l\u0061bel4 : any
|
|
}
|