File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ const {
36
36
Error,
37
37
FunctionPrototypeCall,
38
38
ObjectDefineProperty,
39
+ Promise,
39
40
ReflectApply,
40
41
SafeMap,
41
42
Symbol,
@@ -73,12 +74,14 @@ const asyncHook = createHook({
73
74
if ( process . domain !== null && process . domain !== undefined ) {
74
75
// If this operation is created while in a domain, let's mark it
75
76
pairing . set ( asyncId , process . domain [ kWeak ] ) ;
76
- ObjectDefineProperty ( resource , 'domain' , {
77
- configurable : true ,
78
- enumerable : false ,
79
- value : process . domain ,
80
- writable : true
81
- } ) ;
77
+ if ( type !== 'PROMISE' || resource instanceof Promise ) {
78
+ ObjectDefineProperty ( resource , 'domain' , {
79
+ configurable : true ,
80
+ enumerable : false ,
81
+ value : process . domain ,
82
+ writable : true
83
+ } ) ;
84
+ }
82
85
}
83
86
} ,
84
87
before ( asyncId ) {
You can’t perform that action at this time.
0 commit comments