aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-domain-promise.js
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2017-09-29 22:15:24 -0700
committerTimothy Gu <timothygu99@gmail.com>2017-10-04 12:27:08 -0700
commit806857712f76398a786874d77aa65e2f3cbf7dab (patch)
treefd11121ba67c9ddae36991bab3cb8b50d8e946e9 /test/parallel/test-domain-promise.js
parenta3cd8ed1681d39e9ce65b90f52ee6d67fc7d3fdc (diff)
downloadandroid-node-v8-806857712f76398a786874d77aa65e2f3cbf7dab.tar.gz
android-node-v8-806857712f76398a786874d77aa65e2f3cbf7dab.tar.bz2
android-node-v8-806857712f76398a786874d77aa65e2f3cbf7dab.zip
src: do not add .domain to promises in VM contexts
The promises are still tracked, and their handlers will still execute in the correct domain. The creation domain is simply hidden. PR-URL: https://github.com/nodejs/node/pull/15695 Fixes: https://github.com/nodejs/node/issues/15673 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/parallel/test-domain-promise.js')
-rw-r--r--test/parallel/test-domain-promise.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/parallel/test-domain-promise.js b/test/parallel/test-domain-promise.js
index 8bae75eb63..f1c966d4af 100644
--- a/test/parallel/test-domain-promise.js
+++ b/test/parallel/test-domain-promise.js
@@ -31,9 +31,13 @@ common.crashOnUnhandledRejection();
const d = domain.create();
d.run(common.mustCall(() => {
- vm.runInNewContext(`Promise.resolve().then(common.mustCall(() => {
- assert.strictEqual(process.domain, d);
- }));`, { common, assert, process, d });
+ vm.runInNewContext(`
+ const promise = Promise.resolve();
+ assert.strictEqual(promise.domain, undefined);
+ promise.then(common.mustCall(() => {
+ assert.strictEqual(process.domain, d);
+ }));
+ `, { common, assert, process, d });
}));
}