diff --git a/lib/async_hooks.js b/lib/async_hooks.js index ccf7b5797ab2be..02362973ae1de6 100644 --- a/lib/async_hooks.js +++ b/lib/async_hooks.js @@ -220,12 +220,16 @@ class AsyncResource { const ret = this.runInAsyncScope.bind(this, fn); ObjectDefineProperties(ret, { 'length': { - enumerable: true, + configurable: true, + enumerable: false, value: fn.length, + writable: false, }, 'asyncResource': { + configurable: true, enumerable: true, value: this, + writable: true, } }); return ret;