This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
var domain = require('domain'); | |
var Promise = require('bluebird'); | |
console.log('This is a demonstration of a bug in Bluebird when Domains are involved.'); | |
console.log('If a then() throws an exception, the domain does not exit() and remains on the stack.'); | |
function reportDomainDepth(state) { | |
console.log(state + ', current domain depth is ' + domain._stack.length); |