David-Sarah Hopwood wrote:
> So, is this a valid self-hosting specification of bind?
>
> (function() {
> use lexical scope;
>
> Function.prototype.bind = function(self, var_args) {
> const thisFunc = this;
> const leftArgs = Array.slice(arguments, 1);
> return function(var_args) {
> const args = leftArgs.concat(Array.slice(arguments, 0));
> return Function.apply(thisFunc, self, args);
> };
> };
> )();
... if the missing } on the last line is corrected.
--
David-Sarah Hopwood
_______________________________________________
Es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss