Better support try/catch comments (#607)

Uses the same technique as for if/then/else. Added a helper function to make it easier.

Fixes #601
This commit is contained in:
Christopher Chedeau authored and James Long committed 2017-02-04 21:25:29 -05:00
1 parent 91087e1e84
commit fb9629ca7f
3 files changed
+106 -6

No files matched your search

@@ -747,3 +747,59 @@ exports[`test jsx.js 2`] = `
</div>;
"
`;
exports[`test try.js 1`] = `
"// comment 1
try {
// comment 2
}
// comment 3
catch(e) {
// comment 4
}
// comment 5
finally // comment 6
{
// comment 7
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// comment 1
try {
// comment 2
} catch (e) {
// comment 3
// comment 4
} finally { // comment 6
// comment 5
// comment 7
}
"
`;
exports[`test try.js 2`] = `
"// comment 1
try {
// comment 2
}
// comment 3
catch(e) {
// comment 4
}
// comment 5
finally // comment 6
{
// comment 7
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// comment 1
try {
// comment 2
} catch (e) {
// comment 3
// comment 4
} finally { // comment 6
// comment 5
// comment 7
}
"
`;
+13
View File
@@ -0,0 +1,13 @@
// comment 1
try {
// comment 2
}
// comment 3
catch(e) {
// comment 4
}
// comment 5
finally // comment 6
{
// comment 7
}