diff options
author | Ali Ijaz Sheikh <ofrobots@google.com> | 2018-02-07 17:46:49 -0800 |
---|---|---|
committer | Ali Ijaz Sheikh <ofrobots@google.com> | 2018-02-12 07:13:52 -0500 |
commit | 9f6a56590129370f8b17c133f15a63e3832fa3cc (patch) | |
tree | 5c2b50af8c530fbc05b6977bd05870aa15a0832b /doc | |
parent | bd4773a0431da9c846c3b4a2f6459db1f151c115 (diff) | |
download | android-node-v8-9f6a56590129370f8b17c133f15a63e3832fa3cc.tar.gz android-node-v8-9f6a56590129370f8b17c133f15a63e3832fa3cc.tar.bz2 android-node-v8-9f6a56590129370f8b17c133f15a63e3832fa3cc.zip |
async_hooks: rename PromiseWrap.parentId
Rename the `parentId` property on the PromiseWrap object to a
`isChainedPromise` property. The former wasn't quite useful as it was
always defined to be the same value as the trigger id available in the
init hook. Instead rename the property to be closer to the information
it communicates: whether the promise is a chained promise or not.
PR-URL: https://github.com/nodejs/node/pull/18633
Fixes: https://github.com/nodejs/node/issues/18470
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/async_hooks.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/async_hooks.md b/doc/api/async_hooks.md index 4813169bfd..a96fd04293 100644 --- a/doc/api/async_hooks.md +++ b/doc/api/async_hooks.md @@ -301,10 +301,10 @@ and document their own resource objects. For example, such a resource object could contain the SQL query being executed. In the case of Promises, the `resource` object will have `promise` property -that refers to the Promise that is being initialized, and a `parentId` property -set to the `asyncId` of a parent Promise, if there is one, and `undefined` +that refers to the Promise that is being initialized, and a `isChainedPromise` +property, set to `true` if the promise has a parent promise, and `false` otherwise. For example, in the case of `b = a.then(handler)`, `a` is considered -a parent Promise of `b`. +a parent Promise of `b`. Here, `b` is considered a chained promise. In some cases the resource object is reused for performance reasons, it is thus not safe to use it as a key in a `WeakMap` or add properties to it. |