diff options
Diffstat (limited to 'test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js')
-rw-r--r-- | test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js index 7ae0c23e3..2a3b37978 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-self.js @@ -25,27 +25,29 @@ flags: [async] ---*/ var reject; -var p1 = new Promise(function(_, _reject) { reject = _reject; }); +var p1 = new Promise(function(_, _reject) { + reject = _reject; +}); var p2; p2 = p1.then(function() {}, function() { - return p2; - }); + return p2; +}); p2.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(reason) { - if (!reason) { - $DONE('The promise should be rejected with a value.'); - return; - } - - if (reason.constructor !== TypeError) { - $DONE('The promise should be rejected with a TypeError instance.'); - return; - } - - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}, function(reason) { + if (!reason) { + $DONE('The promise should be rejected with a value.'); + return; + } + + if (reason.constructor !== TypeError) { + $DONE('The promise should be rejected with a TypeError instance.'); + return; + } + + $DONE(); +}); reject(); |