-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed expression try…catch, fixes #509
- Loading branch information
Showing
10 changed files
with
164 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
test/testcases/sameline/issue_123_return_try_catch_expression_try_next.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"sameLine": { | ||
"expressionTry": "next" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
public static function main() { | ||
return try call(); catch (e:Any) null; | ||
return try {call();} catch (e:Any) {null;} | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
public static function main() { | ||
return try | ||
call(); | ||
catch (e:Any) | ||
null; | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
test/testcases/sameline/issue_123_return_try_catch_expression_try_same.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"sameLine": { | ||
"expressionTry": "same" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
public static function main() { | ||
return try call(); catch (e:Any) null; | ||
return try {call();} catch (e:Any) {null;} | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
public static function main() { | ||
return try call(); catch (e:Any) null; | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
return try { | ||
call(); | ||
} catch (e:Any) { | ||
null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/testcases/sameline/issue_509_try_catch_expression.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"sameLine": { | ||
"tryCatch": "next" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name; | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
test/testcases/sameline/issue_509_try_catch_expression_next.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"sameLine": { | ||
"tryCatch": "next", | ||
"expressionTry": "next" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name; | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try | ||
ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) | ||
catch (_:Dynamic) | ||
project.name; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
test/testcases/sameline/issue_509_try_catch_expression_same.hxtest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"sameLine": { | ||
"tryCatch": "next", | ||
"expressionTry": "same" | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name; | ||
} | ||
} | ||
|
||
--- | ||
|
||
class Main { | ||
static function main() { | ||
var applicationName = try ProjectUtils.getApplicationFile(FileSystem.fullPath(project.projectXmlPath)) catch (_:Dynamic) project.name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters