diff options
Diffstat (limited to 'test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js')
-rw-r--r-- | test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js index 16afaee98..f27f9034d 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-self.js @@ -24,29 +24,27 @@ flags: [async] ---*/ var resolve; -var p1 = new Promise(function(_resolve) { - resolve = _resolve; -}); +var p1 = new Promise(function(_resolve) { resolve = _resolve; }); var p2; p2 = p1.then(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(); + }); resolve(); |