Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07968ac

Browse filesBrowse files
Flarnaaddaleax
authored andcommitted
async_hooks: improve property descriptors in als.bind
The length property should be non enumerable to match behavior of normal functions. The asyncResource property is enumerable and therefore it should be also writable to avoid issues like there: #30932 (comment) Both properties should be configurable. Refs: #34574 PR-URL: #34620 Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 45d2f4d commit 07968ac
Copy full SHA for 07968ac

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎lib/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/async_hooks.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,16 @@ class AsyncResource {
217217
const ret = this.runInAsyncScope.bind(this, fn);
218218
ObjectDefineProperties(ret, {
219219
'length': {
220-
enumerable: true,
220+
configurable: true,
221+
enumerable: false,
221222
value: fn.length,
223+
writable: false,
222224
},
223225
'asyncResource': {
226+
configurable: true,
224227
enumerable: true,
225228
value: this,
229+
writable: true,
226230
}
227231
});
228232
return ret;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.