Add test for catch variables with initializers.

This commit is contained in:
Cyrus Najmabadi 2015-02-26 17:27:18 -08:00
parent 9125aa5192
commit e2d9ea51eb
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,10 @@
tests/cases/compiler/catchClauseWithInitializer1.ts(3,12): error TS1197: Catch clause variable cannot have an initializer.
==== tests/cases/compiler/catchClauseWithInitializer1.ts (1 errors) ====
try {
}
catch (e = 1) {
~
!!! error TS1197: Catch clause variable cannot have an initializer.
}

View file

@ -0,0 +1,11 @@
//// [catchClauseWithInitializer1.ts]
try {
}
catch (e = 1) {
}
//// [catchClauseWithInitializer1.js]
try {
}
catch (e = 1) {
}

View file

@ -0,0 +1,4 @@
try {
}
catch (e = 1) {
}