src/eva.js
function closure(action, paramList, context, settings) {
    if (! settings) {
        settings = {};
    }
    var bUseArgs = ! settings.ignoreArgs,
        bAppendArgs = ! settings.prependArgs;
    
    return function() {
        var params;
        if (bUseArgs) {
            params = paramList ? Array.prototype.slice.call(paramList, 0) : [];
            if (bAppendArgs) {
                params.push.apply(params, arguments);
            }
            else {
                params = Array.prototype.slice.call(arguments, 0).concat(params);
            }
        }
        else {
            params = paramList || [];
        }
        return action.apply(context || null, params);
    };
}
function closure(action, paramList, context, settings) {
    if (! settings) {
        settings = {};
    }
    var bUseArgs = ! settings.ignoreArgs,
        bAppendArgs = ! settings.prependArgs;
    
    return function() {
        var params;
        if (bUseArgs) {
            params = paramList ? Array.prototype.slice.call(paramList, 0) : [];
            if (bAppendArgs) {
                params.push.apply(params, arguments);
            }
            else {
                params = Array.prototype.slice.call(arguments, 0).concat(params);
            }
        }
        else {
            params = paramList || [];
        }
        return action.apply(context || null, params);
    };
}
function closure ( action , paramList , context , settings ) { if ( ! settings ) { settings = { } ; } var bUseArgs = ! settings . ignoreArgs , bAppendArgs = ! settings . prependArgs ; return function ( ) { var params ; if ( bUseArgs ) { params = paramList ? Array . prototype . slice . call ( paramList , 0 ) : [ ] ; if ( bAppendArgs ) { params . push . apply ( params , arguments ) ; } else { params = Array . prototype . slice . call ( arguments , 0 ) . concat ( params ) ; } } else { params = paramList || [ ] ; } return action . apply ( context || null , params ) ; } ; }
Create function that executes specified function with given parameters and context and returns result of call.

@param {Function} action
Target function that will be executed when created function is called.
@param {Array} [paramList]
Array-like object representing parameters that should be passed into the target function specified in `action` argument.
@param {Object} [context]
Object that will be used as `this` value when calling the target function specified in `action` argument.
Default value is `null`.
@param {Object} [settings]
Operation settings. Keys are settings names, values are corresponding settings values.
The following settings are supported:

* `ignoreArgs`: `Boolean` - Whether arguments passed into the created function should be ignored.
Default value is `false` and means that arguments will be included in parameters list for the target function
depending of the value of `prependArgs` setting.
* `prependArgs`: `Boolean` - Whether arguments passed into the created function should be passed into the target function
before parameters specified in `paramList` argument. Default value is `false` and means that parameters list
for the target function will contain values from `paramList` argument followed by arguments passed into the created function
(this is similar to `Function.prototype.bind` behavior).
@return {Function}
Created function.
@alias module:eva.closure
Create function that executes specified function with given parameters and context and returns result of call .