| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c7c713a commit df592c4
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,18 +109,18 @@ function useDomainTrampoline(fn) { | |||
| 109 | 109 | } | |
| 110 | 110 | ||
| 111 | 111 | function callbackTrampoline(asyncId, cb, ...args) { | |
| 112 | - if (asyncId && hasHooks(kBefore)) | ||
| 112 | + if (asyncId !== 0 && hasHooks(kBefore)) | ||
| 113 | 113 | emitBeforeNative(asyncId); | |
| 114 | 114 | ||
| 115 | 115 | let result; | |
| 116 | - if (typeof domain_cb === 'function') { | ||
| 116 | + if (asyncId === 0 && typeof domain_cb === 'function') { | ||
| 117 | 117 | ArrayPrototypeUnshift(args, cb); | |
| 118 | 118 | result = ReflectApply(domain_cb, this, args); | |
| 119 | 119 | } else { | |
| 120 | 120 | result = ReflectApply(cb, this, args); | |
| 121 | 121 | } | |
| 122 | 122 | ||
| 123 | - if (asyncId && hasHooks(kAfter)) | ||
| 123 | + if (asyncId !== 0 && hasHooks(kAfter)) | ||
| 124 | 124 | emitAfterNative(asyncId); | |
| 125 | 125 | ||
| 126 | 126 | return result; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,12 +20,14 @@ | |||
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | 22 | 'use strict'; | |
| 23 | - require('../common'); | ||
| 23 | + const common = require('../common'); | ||
| 24 | 24 | const domain = require('domain'); | |
| 25 | 25 | const http = require('http'); | |
| 26 | 26 | const assert = require('assert'); | |
| 27 | 27 | const debug = require('util').debuglog('test'); | |
| 28 | 28 | ||
| 29 | + process.on('warning', common.mustNotCall()); | ||
| 30 | + | ||
| 29 | 31 | const objects = { foo: 'bar', baz: {}, num: 42, arr: [1, 2, 3] }; | |
| 30 | 32 | objects.baz.asdf = objects; | |
| 31 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,8 @@ const domain = require('domain'); | |||
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const isEnumerable = Function.call.bind(Object.prototype.propertyIsEnumerable); | |
| 8 | 8 | ||
| 9 | + process.on('warning', common.mustNotCall()); | ||
| 10 | + | ||
| 9 | 11 | { | |
| 10 | 12 | const d = new domain.Domain(); | |
| 11 | 13 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,8 @@ const common = require('../common'); | |||
| 26 | 26 | const assert = require('assert'); | |
| 27 | 27 | const domain = require('domain'); | |
| 28 | 28 | ||
| 29 | + process.on('warning', common.mustNotCall()); | ||
| 30 | + | ||
| 29 | 31 | const d = new domain.Domain(); | |
| 30 | 32 | ||
| 31 | 33 | d.on('error', common.mustCall(function(er) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,6 +26,8 @@ const common = require('../common'); | |||
| 26 | 26 | const domain = require('domain'); | |
| 27 | 27 | const http = require('http'); | |
| 28 | 28 | ||
| 29 | + process.on('warning', common.mustNotCall()); | ||
| 30 | + | ||
| 29 | 31 | const a = domain.create(); | |
| 30 | 32 | a.enter(); // This will be our "root" domain | |
| 31 | 33 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,8 @@ const domain = require('domain'); | |||
| 5 | 5 | const fs = require('fs'); | |
| 6 | 6 | const vm = require('vm'); | |
| 7 | 7 | ||
| 8 | + process.on('warning', common.mustNotCall()); | ||
| 9 | + | ||
| 8 | 10 | { | |
| 9 | 11 | const d = domain.create(); | |
| 10 | 12 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments