asyncResource.bind(fn[, thisArg])
版本历史
| 版本 | 变更 |
|---|---|
| v16.15.0 | 将 |
| v16.0.0 | 添加了可选的 thisArg。 |
| v14.8.0, v12.19.0 | 新增于: v14.8.0, v12.19.0 |
-
fn<Function> 绑定到当前AsyncResource的函数。\
fn<Function> The function to bind to the currentAsyncResource. -
thisArg<any>
将要执行的给定函数绑定到此 AsyncResource 的范围。
\Binds the given function to execute to this AsyncResource's scope.
返回的函数将具有 asyncResource 属性,该属性引用函数绑定到的 AsyncResource。
\The returned function will have an asyncResource property referencing
the AsyncResource to which the function is bound.