Lines Matching refs:stack
128 // Get the stack trace at the point where `domain` was required.
130 const domainRequireStack = new Error('require(`domain`) at this point').stack;
135 err.stack = err.stack + '\n' + '-'.repeat(40) + '\n' + domainRequireStack;
169 // another one. The stack is each entered domain.
170 let stack = [];
171 exports._stack = stack;
175 if (ArrayPrototypeEvery(stack,
191 // the domain stack.
208 stack.length = 0;
251 // Pop all adjacent duplicates of the currently active domain from the stack.
268 if (stack.length === 0) {
301 if (stack.length) {
302 exports.active = process.domain = stack[stack.length - 1];
311 // Exit all domains on the stack. Uncaught exceptions end the
312 // current tick and no domains should be left on the stack
322 // to push it onto the stack so that we can pop it later.
324 ArrayPrototypePush(stack, this);
330 // Don't do anything if this domain is not on the stack.
331 const index = ArrayPrototypeLastIndexOf(stack, this);
335 ArrayPrototypeSplice(stack, index);
337 exports.active = stack.length === 0 ? undefined : stack[stack.length - 1];
361 // e.emit('error', er); // RangeError, stack overflow!
508 // Remove the current domain (and its duplicates) from the domains stack and
513 const origDomainsStack = ArrayPrototypeSlice(stack);
516 // Travel the domains stack from top to bottom to find the first domain
518 let idx = stack.length - 1;
519 while (idx > -1 && process.domain === stack[idx]) {
523 // Change the stack to not contain the current active domain, and only the
524 // domains above it on the stack.
526 stack.length = 0;
528 ArrayPrototypeSplice(stack, idx + 1);
532 if (stack.length > 0) {
533 exports.active = process.domain = stack[stack.length - 1];
543 // stack and the active domain to their original values.
544 exports._stack = stack = origDomainsStack;