You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implicit binders would have it if it was possible to look into the result of Function.prototype.bind
I suggest replacing the binding-getter calls like
Bar.prototype.foo$getter = function () {
return this.foo.bind(this);
}
with
Bar.prototype.foo$getter = function () {
return $bind$N(this.foo, this);
}
or
Bar.prototype.foo$getter = function () {
return $bind$N$optional(this.foo, this);
}
where N is the natural arity, and the ...$optional variants copy the $optional from the function to the result of binding.
This works:
foo(arg, [optional]) => print(arg); // <- Function, not method.
invoke(callback, arg) => callback(arg);
main() => invoke(foo, 'function');
So does this:
invoke(callback, arg) => callback(arg);
class Bar {
foo(arg) => print(arg); // <- No optional param.
bar() => invoke(foo, 'method');
}
main() => new Bar().bar();
But this does not:
invoke(callback, arg) => callback(arg);
class Bar {
foo(arg, [optional]) => print(arg);
bar() => invoke(foo, 'method');
}
main() => new Bar().bar();
It raises:
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: ClosureArgumentMismatchException is not defined
The text was updated successfully, but these errors were encountered: