summaryrefslogtreecommitdiff
path: root/test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js')
-rw-r--r--test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js30
1 files changed, 17 insertions, 13 deletions
diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js
index 68f661a11..babecd9e1 100644
--- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js
+++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-prms-cstm-then.js
@@ -36,8 +36,12 @@ flags: [async]
---*/
var value = {};
-var thenable = new Promise(function(resolve) { resolve(); });
-var p1 = new Promise(function(_, reject) { reject(); });
+var thenable = new Promise(function(resolve) {
+ resolve();
+});
+var p1 = new Promise(function(_, reject) {
+ reject();
+});
var p2;
thenable.then = function(resolve) {
@@ -45,16 +49,16 @@ thenable.then = function(resolve) {
};
p2 = p1.then(function() {}, function() {
- return thenable;
- });
+ return thenable;
+});
p2.then(function(x) {
- if (x !== value) {
- $DONE('The promise should be fulfilled with the resolution value of the provided promise.');
- return;
- }
-
- $DONE();
- }, function() {
- $DONE('The promise should not be rejected.');
- });
+ if (x !== value) {
+ $DONE('The promise should be fulfilled with the resolution value of the provided promise.');
+ return;
+ }
+
+ $DONE();
+}, function() {
+ $DONE('The promise should not be rejected.');
+});