jsface.pointcut.js
function restore(fn, advisor) {
    var origin, index, len;

    if (fn && fn === fn[WRAPPER]) {
      if ( !advisor) {
        origin = fn[ORIGIN];
        delete fn[ORIGIN];
        delete fn[ADVISOR];
        delete fn[BEFORE];
        delete fn[AFTER];
        delete fn[WRAPPER];
      } else {
        index = len = fn[ADVISOR].length;
        while (index--) {
          if (fn[ADVISOR][index] === advisor) { break; }
        }
        if (index >= 0) {
          if (len === 1) { return restore(fn); }
          fn[ADVISOR].splice(index, 1);
          fn[BEFORE].splice(index, 1);
          fn[AFTER].splice(index, 1);
        }
      }
    }
    return origin;
  }
function restore(fn, advisor) {
    var origin, index, len;

    if (fn && fn === fn[WRAPPER]) {
      if ( !advisor) {
        origin = fn[ORIGIN];
        delete fn[ORIGIN];
        delete fn[ADVISOR];
        delete fn[BEFORE];
        delete fn[AFTER];
        delete fn[WRAPPER];
      } else {
        index = len = fn[ADVISOR].length;
        while (index--) {
          if (fn[ADVISOR][index] === advisor) { break; }
        }
        if (index >= 0) {
          if (len === 1) { return restore(fn); }
          fn[ADVISOR].splice(index, 1);
          fn[BEFORE].splice(index, 1);
          fn[AFTER].splice(index, 1);
        }
      }
    }
    return origin;
  }
function restore ( fn , advisor ) { var origin , index , len ; if ( fn && fn === fn [ WRAPPER ] ) { if ( ! advisor ) { origin = fn [ ORIGIN ] ; delete fn [ ORIGIN ] ; delete fn [ ADVISOR ] ; delete fn [ BEFORE ] ; delete fn [ AFTER ] ; delete fn [ WRAPPER ] ; } else { index = len = fn [ ADVISOR ] . length ; while ( index -- ) { if ( fn [ ADVISOR ] [ index ] === advisor ) { break ; } } if ( index >= 0 ) { if ( len === 1 ) { return restore ( fn ) ; } fn [ ADVISOR ] . splice ( index , 1 ) ; fn [ BEFORE ] . splice ( index , 1 ) ; fn [ AFTER ] . splice ( index , 1 ) ; } } } return origin ; }
Restore a function to its origin state.
@return function's origin state
Restore a function to its origin state .