diff options
-rw-r--r-- | lib/internal/async_hooks.js | 6 | ||||
-rw-r--r-- | test/parallel/test-domain-http-server.js | 4 | ||||
-rw-r--r-- | test/parallel/test-domain-implicit-binding.js | 2 | ||||
-rw-r--r-- | test/parallel/test-domain-implicit-fs.js | 2 | ||||
-rw-r--r-- | test/parallel/test-domain-multi.js | 2 | ||||
-rw-r--r-- | test/parallel/test-domain-promise.js | 2 |
6 files changed, 14 insertions, 4 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index c2c5f1c46f..d98014c368 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -109,18 +109,18 @@ function useDomainTrampoline(fn) { } function callbackTrampoline(asyncId, cb, ...args) { - if (asyncId && hasHooks(kBefore)) + if (asyncId !== 0 && hasHooks(kBefore)) emitBeforeNative(asyncId); let result; - if (typeof domain_cb === 'function') { + if (asyncId === 0 && typeof domain_cb === 'function') { ArrayPrototypeUnshift(args, cb); result = ReflectApply(domain_cb, this, args); } else { result = ReflectApply(cb, this, args); } - if (asyncId && hasHooks(kAfter)) + if (asyncId !== 0 && hasHooks(kAfter)) emitAfterNative(asyncId); return result; diff --git a/test/parallel/test-domain-http-server.js b/test/parallel/test-domain-http-server.js index 6168566334..2f0c757a99 100644 --- a/test/parallel/test-domain-http-server.js +++ b/test/parallel/test-domain-http-server.js @@ -20,12 +20,14 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -require('../common'); +const common = require('../common'); const domain = require('domain'); const http = require('http'); const assert = require('assert'); const debug = require('util').debuglog('test'); +process.on('warning', common.mustNotCall()); + const objects = { foo: 'bar', baz: {}, num: 42, arr: [1, 2, 3] }; objects.baz.asdf = objects; diff --git a/test/parallel/test-domain-implicit-binding.js b/test/parallel/test-domain-implicit-binding.js index 15f6685df9..9f119a4203 100644 --- a/test/parallel/test-domain-implicit-binding.js +++ b/test/parallel/test-domain-implicit-binding.js @@ -6,6 +6,8 @@ const domain = require('domain'); const fs = require('fs'); const isEnumerable = Function.call.bind(Object.prototype.propertyIsEnumerable); +process.on('warning', common.mustNotCall()); + { const d = new domain.Domain(); diff --git a/test/parallel/test-domain-implicit-fs.js b/test/parallel/test-domain-implicit-fs.js index d5a6e79bc9..c785ff75c6 100644 --- a/test/parallel/test-domain-implicit-fs.js +++ b/test/parallel/test-domain-implicit-fs.js @@ -26,6 +26,8 @@ const common = require('../common'); const assert = require('assert'); const domain = require('domain'); +process.on('warning', common.mustNotCall()); + const d = new domain.Domain(); d.on('error', common.mustCall(function(er) { diff --git a/test/parallel/test-domain-multi.js b/test/parallel/test-domain-multi.js index 63701150f8..072f8e86bb 100644 --- a/test/parallel/test-domain-multi.js +++ b/test/parallel/test-domain-multi.js @@ -26,6 +26,8 @@ const common = require('../common'); const domain = require('domain'); const http = require('http'); +process.on('warning', common.mustNotCall()); + const a = domain.create(); a.enter(); // This will be our "root" domain diff --git a/test/parallel/test-domain-promise.js b/test/parallel/test-domain-promise.js index 7040925223..2a127f3d40 100644 --- a/test/parallel/test-domain-promise.js +++ b/test/parallel/test-domain-promise.js @@ -5,6 +5,8 @@ const domain = require('domain'); const fs = require('fs'); const vm = require('vm'); +process.on('warning', common.mustNotCall()); + { const d = domain.create(); |