- package
- {
- // end() is executed after the return statement but before the function returns!
- public function aop(method:Function, begin:Function, end:Function):Function
- {
- return function(...args):*
- {
- try
- {
- begin();
- return method.apply(null, args);
- }
- finally
- {
- end();
- }
- }
- }
- }