2018-07-20 12:43:07 -07:00
|
|
|
// Used for `Function.rs` tests
|
|
|
|
exports.get_function_to_bind = function() {
|
|
|
|
return function() { return this.x || 1; }
|
|
|
|
};
|
|
|
|
exports.get_value_to_bind_to = function() {
|
|
|
|
return { x: 2 };
|
|
|
|
};
|
2019-06-28 12:03:45 -06:00
|
|
|
exports.list = function() {
|
2019-06-28 14:14:27 -06:00
|
|
|
return function() {return Array.prototype.slice.call(arguments);}
|
2019-06-28 12:03:45 -06:00
|
|
|
};
|
|
|
|
exports.add_arguments = function() {
|
|
|
|
return function(arg1, arg2) {return arg1 + arg2}
|
|
|
|
};
|
2018-07-20 12:43:07 -07:00
|
|
|
exports.call_function = function(f) {
|
|
|
|
return f();
|
|
|
|
};
|
2019-06-28 12:03:45 -06:00
|
|
|
exports.call_function_arg = function(f, arg1) {
|
|
|
|
return f(arg1);
|
2019-06-28 14:14:27 -06:00
|
|
|
};
|