Skip to content

Commit 9877de0

Browse files
authored
Docs: Guide CustomRegistries to maintain properties on tasks (fixes #2561) (#2565)
1 parent f91c388 commit 9877de0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/advanced/creating-custom-registries.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,11 @@ function ConfigRegistry(config){
169169
util.inherits(ConfigRegistry, DefaultRegistry);
170170

171171
ConfigRegistry.prototype.set = function set(name, fn) {
172+
var bound = fn.bind(this.config);
173+
// Preserve internal properties and task metadata.
174+
var task = Object.assign(bound, fn);
172175
// The `DefaultRegistry` uses `this._tasks` for storage.
173-
var task = this._tasks[name] = fn.bind(this.config);
176+
this._tasks[name] = task;
174177
return task;
175178
};
176179

0 commit comments

Comments
 (0)