0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/addons
Anna Henningsen af1a551965
async_hooks: proper id stacking for Promises
Until now, the async_hooks PromiseHook did not register the Promise’s
async id and trigger id on the id stack, so inside the `.then()` handler
those ids would be invalid.

To fix this, add push and pop calls to its `before` and `after` parts,
respectively. Some care needs to be taken for the cases that the
Promise hook is being disabled or enabled during the execution
of a Promise handler; in the former case, actually removing the hook
is delayed by adding another task to the microtask queue, in the latter
case popping the id off the async id stack is skipped if the ids don’t
match.

Fixes: https://github.com/nodejs/node/issues/13583
PR-URL: https://github.com/nodejs/node/pull/13585
Reviewed-By: Trevor Norris <trevnorris@gmail.com>
2017-06-16 19:27:29 +02:00
..
async-hello-world addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
async-hooks-promise async_hooks: proper id stacking for Promises 2017-06-16 19:27:29 +02:00
async-resource async_hooks: rename currentId and triggerId 2017-06-14 12:39:53 +02:00
at-exit addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
buffer-free-callback addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
heap-profiler test: add not-called check to heap-profiler test 2017-05-14 20:04:20 -07:00
hello-world addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
hello-world-function-export addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
load-long-path addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
make-callback test,lib,doc: use function declarations 2017-05-01 15:56:58 -07:00
make-callback-recurse test: add a second argument to assert.throws() 2017-04-07 16:22:55 +03:00
new-target
node-module-version tools: add unescaped regexp dot rule to linter 2017-03-29 10:53:28 +02:00
null-buffer-neuter addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
openssl-binding
parse-encoding addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
repl-domain-abort addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
stringbytes-external-exceed-max addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
symlinked-module addons: remove semicolons from after module definition 2017-05-15 20:33:06 +02:00
zlib-binding
.gitignore
testcfg.py