Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.30 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package
  2. {
  3.         // end() is executed after the return statement but before the function returns!
  4.         public function aop(method:Function, begin:Function, end:Function):Function
  5.         {
  6.                 return function(...args):*
  7.                 {
  8.                         try
  9.                         {
  10.                                 begin();
  11.                                 return method.apply(null, args);
  12.                         }
  13.                         finally
  14.                         {
  15.                                 end();
  16.                         }
  17.                 }
  18.         }
  19. }