2010-04-03 10:39:32 -04:00
|
|
|
# Basic exception throwing.
|
2010-02-17 19:29:37 -05:00
|
|
|
block: -> (throw 'up')
|
2010-04-03 10:39:32 -04:00
|
|
|
throws block, 'up'
|
|
|
|
|
|
|
|
|
|
|
|
# Basic try/catch.
|
|
|
|
result: try
|
|
|
|
10
|
|
|
|
finally
|
|
|
|
15
|
|
|
|
|
|
|
|
ok result is 10
|
|
|
|
|
|
|
|
result: try
|
|
|
|
throw 'up'
|
|
|
|
catch err
|
|
|
|
err.length
|
|
|
|
|
|
|
|
ok result is 2
|