2010-04-03 14:39:32 +00:00
|
|
|
# Basic exception throwing.
|
2010-02-18 00:29:37 +00:00
|
|
|
block: -> (throw 'up')
|
2010-04-03 14:39:32 +00: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
|