mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Add test for catch variables with initializers.
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
Reference in New Issue
Block a user