Add test for catch variables with initializers.
This commit is contained in:
parent
9125aa5192
commit
e2d9ea51eb
|
@ -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.
|
||||
}
|
11
tests/baselines/reference/catchClauseWithInitializer1.js
Normal file
11
tests/baselines/reference/catchClauseWithInitializer1.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
//// [catchClauseWithInitializer1.ts]
|
||||
try {
|
||||
}
|
||||
catch (e = 1) {
|
||||
}
|
||||
|
||||
//// [catchClauseWithInitializer1.js]
|
||||
try {
|
||||
}
|
||||
catch (e = 1) {
|
||||
}
|
4
tests/cases/compiler/catchClauseWithInitializer1.ts
Normal file
4
tests/cases/compiler/catchClauseWithInitializer1.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
try {
|
||||
}
|
||||
catch (e = 1) {
|
||||
}
|
Loading…
Reference in a new issue