Skip to content

Commit

Permalink
Added try...catch, try...catch...finally, try...finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Cédric Malard committed Jul 13, 2016
1 parent fbe9395 commit b5412bd
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,41 @@ setInterval(function () {
```
### [tryc] try...catch
```js
try {
${1:// body...}
} catch (e) {
${0:// body...}
}
```
### [trycf] try...catch...finally
```js
try {
${1:// body...}
} catch (e) {
${2:// body...}
} finally {
${0:// body...}
}
```
### [tryf] try...finally
```js
try {
${1:// body...}
} finally {
${0:// body...}
}
```
### [us] use strict
```js
Expand Down
10 changes: 10 additions & 0 deletions vanilla.try_catch.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[try {
${1:// body...}
} catch (e) {
${0:// body...}
}]]></content>
<tabTrigger>tryc</tabTrigger>
<scope>source.js,source.ts</scope>
<description>try...catch</description>
</snippet>
12 changes: 12 additions & 0 deletions vanilla.try_catch_finally.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<snippet>
<content><![CDATA[try {
${1:// body...}
} catch (e) {
${2:// body...}
} finally {
${0:// body...}
}]]></content>
<tabTrigger>trycf</tabTrigger>
<scope>source.js,source.ts</scope>
<description>try...catch...finally</description>
</snippet>
10 changes: 10 additions & 0 deletions vanilla.try_finally.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<snippet>
<content><![CDATA[try {
${1:// body...}
} finally {
${0:// body...}
}]]></content>
<tabTrigger>tryf</tabTrigger>
<scope>source.js,source.ts</scope>
<description>try...finally</description>
</snippet>

0 comments on commit b5412bd

Please sign in to comment.