async_hooks: move asyncResource property on bound function to EOL

PR-URL: https://github.com/nodejs/node/pull/58618
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
James M Snell 2025-06-09 08:20:30 -07:00 committed by GitHub
parent 2eeb65fa81
commit 308b6bc6de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 17 deletions

View file

@ -20,7 +20,6 @@ const {
ERR_INVALID_ASYNC_ID,
} = require('internal/errors').codes;
const {
deprecate,
kEmptyObject,
} = require('internal/util');
const {
@ -247,7 +246,6 @@ class AsyncResource {
} else {
bound = FunctionPrototypeBind(this.runInAsyncScope, this, fn, thisArg);
}
let self = this;
ObjectDefineProperties(bound, {
'length': {
__proto__: null,
@ -256,17 +254,6 @@ class AsyncResource {
value: fn.length,
writable: false,
},
'asyncResource': {
__proto__: null,
configurable: true,
enumerable: true,
get: deprecate(function() {
return self;
}, 'The asyncResource property on bound functions is deprecated', 'DEP0172'),
set: deprecate(function(val) {
self = val;
}, 'The asyncResource property on bound functions is deprecated', 'DEP0172'),
},
});
return bound;
}