Address code review

This commit is contained in:
Kanchalai Tanglertsampan 2017-03-21 07:26:47 -07:00
parent 028c41b951
commit a8ffb5cad9
8 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,15 @@
//// [classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts]
function f() {
new C2(); // OK
}
class C2 { }
//// [classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.js]
function f() {
new C2(); // OK
}
var C2 = (function () {
function C2() {
}
return C2;
}());

View file

@ -0,0 +1,10 @@
=== tests/cases/compiler/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts ===
function f() {
>f : Symbol(f, Decl(classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts, 0, 0))
new C2(); // OK
>C2 : Symbol(C2, Decl(classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts, 2, 1))
}
class C2 { }
>C2 : Symbol(C2, Decl(classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts, 2, 1))

View file

@ -0,0 +1,11 @@
=== tests/cases/compiler/classDeclarationCheckUsedBeforeDefinitionInFunctionDeclaration.ts ===
function f() {
>f : () => void
new C2(); // OK
>new C2() : C2
>C2 : typeof C2
}
class C2 { }
>C2 : C2

View file

@ -0,0 +1,9 @@
//// [classDeclarationCheckUsedBeforeDefinitionInItself.ts]
class C3 {
static intance = new C3(); // ok
}
//// [classDeclarationCheckUsedBeforeDefinitionInItself.js]
class C3 {
}
C3.intance = new C3(); // ok

View file

@ -0,0 +1,8 @@
=== tests/cases/compiler/classDeclarationCheckUsedBeforeDefinitionInItself.ts ===
class C3 {
>C3 : Symbol(C3, Decl(classDeclarationCheckUsedBeforeDefinitionInItself.ts, 0, 0))
static intance = new C3(); // ok
>intance : Symbol(C3.intance, Decl(classDeclarationCheckUsedBeforeDefinitionInItself.ts, 0, 10))
>C3 : Symbol(C3, Decl(classDeclarationCheckUsedBeforeDefinitionInItself.ts, 0, 0))
}

View file

@ -0,0 +1,9 @@
=== tests/cases/compiler/classDeclarationCheckUsedBeforeDefinitionInItself.ts ===
class C3 {
>C3 : C3
static intance = new C3(); // ok
>intance : C3
>new C3() : C3
>C3 : typeof C3
}

View file

@ -0,0 +1,4 @@
function f() {
new C2(); // OK
}
class C2 { }

View file

@ -0,0 +1,4 @@
// @target: es6
class C3 {
static intance = new C3(); // ok
}