diff --git a/lib/domain.js b/lib/domain.js index 74cd59c54e705b..e73850bbdba5c8 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -73,12 +73,14 @@ const asyncHook = createHook({ if (process.domain !== null && process.domain !== undefined) { // If this operation is created while in a domain, let's mark it pairing.set(asyncId, process.domain[kWeak]); - ObjectDefineProperty(resource, 'domain', { - configurable: true, - enumerable: false, - value: process.domain, - writable: true - }); + if (type !== 'PROMISE' || resource instanceof Promise) { + ObjectDefineProperty(resource, 'domain', { + configurable: true, + enumerable: false, + value: process.domain, + writable: true + }); + } } }, before(asyncId) {