All Downloads are FREE. Search and download functionalities are using the official Maven repository.

flash.utils.applyWithRestParameters.as Maven / Gradle / Ivy

There is a newer version: 4.1.8
Show newest version
package flash.utils {

internal function applyWithRestParameters(closure:Function, parameters:Array):Function {
  switch (parameters.length) {
    case 0: return closure;
    case 1: return function():* {
      return closure(parameters[0]);
    };
    case 2: return function():* {
      return closure(parameters[0], parameters[1]);
    };
    case 3: return function():* {
      return closure(parameters[0], parameters[1], parameters[2]);
    };
    default: return function():* {
      closure.apply(null, parameters);
    };
  }
}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy