lib/mixin.js
function setupEmulateDynamicDispatch (baseFn, overrideFn) {
  // If the override function does not call _super, then we need to return
  // the override function. If the base function does not exist, then we need
  // to return the override function.
  const callsBaseMethod = METHOD_CALLS_SUPER_REGEXP.test (overrideFn);

  if (!callsBaseMethod)
    return overrideFn;

  // Make sure the base method exists, even if it is a no-op method.
  baseFn = baseFn || function __baseFn () {};

  function __override () {
    let original = this._super;
    this._super = baseFn;

    // Call the method override. The override method will call _super, which
    // will call the base method.
    let ret = overrideFn.call (this, ...arguments);

    this._super = original;

    return ret;
  }

  __override.__baseMethod = baseFn;

  return __override;
}
function setupEmulateDynamicDispatch (baseFn, overrideFn) {
  // If the override function does not call _super, then we need to return
  // the override function. If the base function does not exist, then we need
  // to return the override function.
  const callsBaseMethod = METHOD_CALLS_SUPER_REGEXP.test (overrideFn);

  if (!callsBaseMethod)
    return overrideFn;

  // Make sure the base method exists, even if it is a no-op method.
  baseFn = baseFn || function __baseFn () {};

  function __override () {
    let original = this._super;
    this._super = baseFn;

    // Call the method override. The override method will call _super, which
    // will call the base method.
    let ret = overrideFn.call (this, ...arguments);

    this._super = original;

    return ret;
  }

  __override.__baseMethod = baseFn;

  return __override;
}
function setupEmulateDynamicDispatch ( baseFn , overrideFn ) { // If the override function does not call _super, then we need to return // the override function. If the base function does not exist, then we need // to return the override function. const callsBaseMethod = METHOD_CALLS_SUPER_REGEXP . test ( overrideFn ) ; if ( ! callsBaseMethod ) return overrideFn ; // Make sure the base method exists, even if it is a no-op method. baseFn = baseFn || function __baseFn ( ) { } ; function __override ( ) { let original = this . _super ; this . _super = baseFn ; // Call the method override. The override method will call _super, which // will call the base method. let ret = overrideFn . call ( this , ... arguments ) ; this . _super = original ; return ret ; } __override . __baseMethod = baseFn ; return __override ; }
Emulate the polymorphic behavior between the base function and the
override function.

@param baseFn
@param overrideFn
@returns {*}
Emulate the polymorphic behavior between the base function and the override function .