20 lines
486 B
JavaScript
Raw Normal View History

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() {
return Array.prototype.slice.call(arguments);
};
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);
};