* added syntax sugar for try{...}catch(){...}
This commit is contained in:
parent
823effbe40
commit
93f2bd39de
BIN
lib/groovy.jar
BIN
lib/groovy.jar
Binary file not shown.
|
@ -5,6 +5,7 @@ import java.util.regex.Pattern
|
|||
|
||||
// simplified switch/case pattern matching
|
||||
Object.metaClass.match = { Map cases -> def val = delegate; cases.findResult { switch(val) { case it.key: return it.value} } }
|
||||
def x(c) { try { c.call() } catch (Throwable e) { null } }
|
||||
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue