We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc29ddb commit 5500ae9Copy full SHA for 5500ae9
lib/domain.js
@@ -36,6 +36,7 @@ const {
36
Error,
37
FunctionPrototypeCall,
38
ObjectDefineProperty,
39
+ Promise,
40
ReflectApply,
41
SafeMap,
42
Symbol,
@@ -73,12 +74,14 @@ const asyncHook = createHook({
73
74
if (process.domain !== null && process.domain !== undefined) {
75
// If this operation is created while in a domain, let's mark it
76
pairing.set(asyncId, process.domain[kWeak]);
- ObjectDefineProperty(resource, 'domain', {
77
- configurable: true,
78
- enumerable: false,
79
- value: process.domain,
80
- writable: true
81
- });
+ if (type !== 'PROMISE' || resource instanceof Promise) {
+ ObjectDefineProperty(resource, 'domain', {
+ configurable: true,
+ enumerable: false,
+ value: process.domain,
82
+ writable: true
83
+ });
84
+ }
85
}
86
},
87
before(asyncId) {
0 commit comments