@ -164,7 +164,7 @@ asyncTest('Catching a promise rejection after setImmediate is not' +
} ) ;
} ) ;
_ reject ( e ) ;
_ reject ( e ) ;
setImmediate ( function ( ) {
setImmediate ( function ( ) {
promise . then ( assert . fail , function ( ) { } ) ;
promise . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -176,7 +176,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the' +
assert . strictEqual ( e2 , reason ) ;
assert . strictEqual ( e2 , reason ) ;
assert . strictEqual ( promise2 , promise ) ;
assert . strictEqual ( promise2 , promise ) ;
} ) ;
} ) ;
var promise2 = Promise . reject ( e ) . then ( assert . fail , function ( reason ) {
var promise2 = Promise . reject ( e ) . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
throw e2 ;
throw e2 ;
} ) ;
} ) ;
@ -206,7 +206,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the ' +
setTimeout ( function ( ) {
setTimeout ( function ( ) {
reject ( e ) ;
reject ( e ) ;
} , 1 ) ;
} , 1 ) ;
} ) . then ( assert . fail , function ( reason ) {
} ) . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
throw e2 ;
throw e2 ;
} ) ;
} ) ;
@ -225,7 +225,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' +
setTimeout ( function ( ) {
setTimeout ( function ( ) {
reject ( e ) ;
reject ( e ) ;
process . nextTick ( function ( ) {
process . nextTick ( function ( ) {
promise2 = promise . then ( assert . fail , function ( reason ) {
promise2 = promise . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
throw e2 ;
throw e2 ;
} ) ;
} ) ;
@ -240,7 +240,7 @@ asyncTest('unhandledRejection should not be triggered if a promise catch is' +
function ( done ) {
function ( done ) {
var e = new Error ( ) ;
var e = new Error ( ) ;
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
Promise . reject ( e ) . then ( assert . fail , function ( ) { } ) ;
Promise . reject ( e ) . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
asyncTest ( 'unhandledRejection should not be triggered if a promise catch is' +
asyncTest ( 'unhandledRejection should not be triggered if a promise catch is' +
@ -250,7 +250,7 @@ asyncTest('unhandledRejection should not be triggered if a promise catch is' +
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
new Promise ( function ( _ , reject ) {
new Promise ( function ( _ , reject ) {
reject ( e ) ;
reject ( e ) ;
} ) . then ( assert . fail , function ( ) { } ) ;
} ) . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
asyncTest ( 'Attaching a promise catch in a process.nextTick is soon enough to' +
asyncTest ( 'Attaching a promise catch in a process.nextTick is soon enough to' +
@ -259,7 +259,7 @@ asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' +
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
var promise = Promise . reject ( e ) ;
var promise = Promise . reject ( e ) ;
process . nextTick ( function ( ) {
process . nextTick ( function ( ) {
promise . then ( assert . fail , function ( ) { } ) ;
promise . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -271,7 +271,7 @@ asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' +
reject ( e ) ;
reject ( e ) ;
} ) ;
} ) ;
process . nextTick ( function ( ) {
process . nextTick ( function ( ) {
promise . then ( assert . fail , function ( ) { } ) ;
promise . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -302,7 +302,7 @@ asyncTest('catching a promise which is asynchronously rejected (via' +
reject ( e ) ;
reject ( e ) ;
} , 1 ) ;
} , 1 ) ;
} ) ;
} ) ;
} ) . then ( assert . fail , function ( reason ) {
} ) . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -313,7 +313,7 @@ asyncTest('Catching a rejected promise derived from throwing in a' +
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
Promise . resolve ( ) . then ( function ( ) {
Promise . resolve ( ) . then ( function ( ) {
throw e ;
throw e ;
} ) . then ( assert . fail , function ( reason ) {
} ) . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -325,7 +325,7 @@ asyncTest('Catching a rejected promise derived from returning a' +
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
Promise . resolve ( ) . then ( function ( ) {
Promise . resolve ( ) . then ( function ( ) {
return Promise . reject ( e ) ;
return Promise . reject ( e ) ;
} ) . then ( assert . fail , function ( reason ) {
} ) . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -380,7 +380,7 @@ asyncTest('Catching the Promise.all() of a collection that includes a' +
'rejected promise prevents unhandledRejection' , function ( done ) {
'rejected promise prevents unhandledRejection' , function ( done ) {
var e = new Error ( ) ;
var e = new Error ( ) ;
onUnhandledFail ( done ) ;
onUnhandledFail ( done ) ;
Promise . all ( [ Promise . reject ( e ) ] ) . then ( assert . fail , function ( ) { } ) ;
Promise . all ( [ Promise . reject ( e ) ] ) . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
asyncTest ( 'Catching the Promise.all() of a collection that includes a ' +
asyncTest ( 'Catching the Promise.all() of a collection that includes a ' +
@ -395,7 +395,7 @@ asyncTest('Catching the Promise.all() of a collection that includes a ' +
} ) ;
} ) ;
p = Promise . all ( [ p ] ) ;
p = Promise . all ( [ p ] ) ;
process . nextTick ( function ( ) {
process . nextTick ( function ( ) {
p . then ( assert . fail , function ( ) { } ) ;
p . then ( common . fail , function ( ) { } ) ;
} ) ;
} ) ;
} ) ;
} ) ;
@ -430,7 +430,7 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' +
throw e ;
throw e ;
} ) ;
} ) ;
setTimeout ( function ( ) {
setTimeout ( function ( ) {
thePromise . then ( assert . fail , function ( reason ) {
thePromise . then ( common . fail , function ( reason ) {
assert . strictEqual ( e , reason ) ;
assert . strictEqual ( e , reason ) ;
} ) ;
} ) ;
} , 10 ) ;
} , 10 ) ;