-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Task functions medata are lost when using fn.bind
as in:
ConfigRegistry.prototype.set = function set(name, fn) {
// The `DefaultRegistry` uses `this._tasks` for storage.
var task = this._tasks[name] = fn.bind(this.config);
return task;
};
Updating the example with the following would preserve metadata:
ConfigRegistry.prototype.set = function set(name, fn) {
// The `DefaultRegistry` uses `this._tasks` for storage.
var task = this._tasks[name] = Object.assign(fn.bind(this.config), fn);
return task;
};
It's not a big deal but it would definitely save some times to devs wondering why metadata aren't displaying suddenly :).
Metadata
Metadata
Assignees
Labels
No labels