diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2018-02-09 11:35:37 -0500 |
---|---|---|
committer | Leo Balter <leonardo.balter@gmail.com> | 2018-02-09 11:35:37 -0500 |
commit | a01de4a722d088055a7d84d8c691ddd7109edb34 (patch) | |
tree | f583c8efd40a3b699261f1166da75a9861d83e7b /test/built-ins/Promise | |
parent | 7b01f9799f99851955f23c18c12e6651c1941022 (diff) | |
download | qtdeclarative-testsuites-a01de4a722d088055a7d84d8c691ddd7109edb34.tar.gz |
js-beautify: make all indentation consistent (depth & character) (#1409)
Diffstat (limited to 'test/built-ins/Promise')
223 files changed, 1797 insertions, 1542 deletions
diff --git a/test/built-ins/Promise/S25.4.3.1_A1.1_T1.js b/test/built-ins/Promise/S25.4.3.1_A1.1_T1.js index 6292c438e..06f9f6fb6 100644 --- a/test/built-ins/Promise/S25.4.3.1_A1.1_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A1.1_T1.js @@ -12,5 +12,5 @@ description: Promise === global.Promise var global = this; if (Promise !== global.Promise) { - $ERROR("Expected Promise === global.Promise."); + $ERROR("Expected Promise === global.Promise."); } diff --git a/test/built-ins/Promise/S25.4.3.1_A2.1_T1.js b/test/built-ins/Promise/S25.4.3.1_A2.1_T1.js index 8da80d846..afbef52ee 100644 --- a/test/built-ins/Promise/S25.4.3.1_A2.1_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A2.1_T1.js @@ -10,5 +10,5 @@ description: Promise.call("non-object") throws TypeError ---*/ assert.throws(TypeError, function() { - Promise.call("non-object", function () {}); + Promise.call("non-object", function() {}); }); diff --git a/test/built-ins/Promise/S25.4.3.1_A2.2_T1.js b/test/built-ins/Promise/S25.4.3.1_A2.2_T1.js index 0e969f652..855595e76 100644 --- a/test/built-ins/Promise/S25.4.3.1_A2.2_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A2.2_T1.js @@ -11,6 +11,6 @@ description: Promise.call(new Promise()) throws TypeError var p = new Promise(function() {}); -assert.throws(TypeError, function () { - Promise.call(p, function () {}); +assert.throws(TypeError, function() { + Promise.call(p, function() {}); }); diff --git a/test/built-ins/Promise/S25.4.3.1_A2.3_T1.js b/test/built-ins/Promise/S25.4.3.1_A2.3_T1.js index 341dd6417..424b1a7f1 100644 --- a/test/built-ins/Promise/S25.4.3.1_A2.3_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A2.3_T1.js @@ -10,14 +10,16 @@ description: Promise.call(resolved Promise) throws TypeError flags: [async] ---*/ -var p = new Promise(function(resolve) { resolve(1); }); +var p = new Promise(function(resolve) { + resolve(1); +}); -p.then(function () { - Promise.call(p, function () {}); -}).then(function () { - $ERROR("Unexpected resolution - expected TypeError"); -}, function (err) { - if (!(err instanceof TypeError)) { - $ERROR("Expected TypeError, got " + err); - } +p.then(function() { + Promise.call(p, function() {}); +}).then(function() { + $ERROR("Unexpected resolution - expected TypeError"); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR("Expected TypeError, got " + err); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/S25.4.3.1_A2.4_T1.js b/test/built-ins/Promise/S25.4.3.1_A2.4_T1.js index 4b3e452e2..e852b0274 100644 --- a/test/built-ins/Promise/S25.4.3.1_A2.4_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A2.4_T1.js @@ -10,14 +10,16 @@ description: Promise.call(rejected Promise) throws TypeError flags: [async] ---*/ -var p = new Promise(function(resolve, reject) { reject(1) }); +var p = new Promise(function(resolve, reject) { + reject(1) +}); -p.catch(function () { - Promise.call(p, function () {}); -}).then(function () { - $ERROR("Unexpected resolution - expected TypeError"); -}, function (err) { - if (!(err instanceof TypeError)) { - $ERROR("Expected TypeError, got " + err); - } +p.catch(function() { + Promise.call(p, function() {}); +}).then(function() { + $ERROR("Unexpected resolution - expected TypeError"); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR("Expected TypeError, got " + err); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/S25.4.3.1_A4.1_T1.js b/test/built-ins/Promise/S25.4.3.1_A4.1_T1.js index d990b5448..26d1cb0ce 100644 --- a/test/built-ins/Promise/S25.4.3.1_A4.1_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A4.1_T1.js @@ -12,15 +12,14 @@ flags: [async] ---*/ var errorObject = {}, - p = new Promise(function () { - throw errorObject; - }); + p = new Promise(function() { + throw errorObject; + }); p.then(function() { - $ERROR("Unexpected fulfill -- promise should reject."); -}, function (err) { - if (err !== errorObject) { - $ERROR("Expected promise rejection reason to be thrown errorObject, actually " + err); - } + $ERROR("Unexpected fulfill -- promise should reject."); +}, function(err) { + if (err !== errorObject) { + $ERROR("Expected promise rejection reason to be thrown errorObject, actually " + err); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/S25.4.3.1_A5.1_T1.js b/test/built-ins/Promise/S25.4.3.1_A5.1_T1.js index 418f94069..da4221c47 100644 --- a/test/built-ins/Promise/S25.4.3.1_A5.1_T1.js +++ b/test/built-ins/Promise/S25.4.3.1_A5.1_T1.js @@ -14,10 +14,10 @@ flags: [async, noStrict] var expectedThis = this; -var p = new Promise(function (resolve) { - if (this !== expectedThis) { - $ERROR("'this' must be global object, got " + this); - } +var p = new Promise(function(resolve) { + if (this !== expectedThis) { + $ERROR("'this' must be global object, got " + this); + } - resolve(); + resolve(); }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/S25.4.3.1_A5.1_T2.js b/test/built-ins/Promise/S25.4.3.1_A5.1_T2.js index 3c0548704..58cdb04d1 100644 --- a/test/built-ins/Promise/S25.4.3.1_A5.1_T2.js +++ b/test/built-ins/Promise/S25.4.3.1_A5.1_T2.js @@ -14,10 +14,10 @@ flags: [async, onlyStrict] var expectedThis = undefined; -var p = new Promise(function (resolve) { - if (this !== expectedThis) { - $ERROR("'this' must be undefined, got " + this); - } +var p = new Promise(function(resolve) { + if (this !== expectedThis) { + $ERROR("'this' must be undefined, got " + this); + } - resolve(); + resolve(); }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A1.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A1.1_T1.js index 597b68aa9..02c7922d3 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A1.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A1.1_T1.js @@ -9,5 +9,5 @@ description: Promise.all is callable ---*/ if ((typeof Promise.all) !== "function") { - $ERROR('Expected Promise.all to be a function'); + $ERROR('Expected Promise.all to be a function'); } diff --git a/test/built-ins/Promise/all/S25.4.4.1_A2.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A2.1_T1.js index 92149f2aa..e542fadf4 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A2.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A2.1_T1.js @@ -10,5 +10,5 @@ description: Promise.all returns a Promise var p = Promise.all([]); if (!(p instanceof Promise)) { - $ERROR('Expected p to be a Promise'); + $ERROR('Expected p to be a Promise'); } diff --git a/test/built-ins/Promise/all/S25.4.4.1_A2.2_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A2.2_T1.js index ddeea876d..8ab599632 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A2.2_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A2.2_T1.js @@ -12,15 +12,15 @@ flags: [async] var sequence = []; -Promise.all([]).then(function () { - sequence.push(2); +Promise.all([]).then(function() { + sequence.push(2); }).catch($DONE); Promise.resolve().then(function() { - sequence.push(3); -}).then(function () { - sequence.push(4); - checkSequence(sequence, "Promises resolved in unexpected sequence"); + sequence.push(3); +}).then(function() { + sequence.push(4); + checkSequence(sequence, "Promises resolved in unexpected sequence"); }).then($DONE, $DONE); sequence.push(1); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T1.js index 1b61ede66..6c893b331 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T1.js @@ -11,8 +11,8 @@ flags: [async] var arg = []; -Promise.all(arg).then(function (result) { - if(!(result instanceof Array)) { - $ERROR("expected an array from Promise.all, got " + result); - } +Promise.all(arg).then(function(result) { + if (!(result instanceof Array)) { + $ERROR("expected an array from Promise.all, got " + result); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T2.js b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T2.js index 77cd2628e..568aae475 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T2.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T2.js @@ -11,8 +11,8 @@ flags: [async] var arg = []; -Promise.all(arg).then(function (result) { - if(result.length !== 0) { - $ERROR("expected an empty array from Promise.all([]), got " + result); - } +Promise.all(arg).then(function(result) { + if (result.length !== 0) { + $ERROR("expected an empty array from Promise.all([]), got " + result); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T3.js b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T3.js index 5dc1568eb..1573e1cf2 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A2.3_T3.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A2.3_T3.js @@ -11,8 +11,8 @@ flags: [async] var arg = []; -Promise.all(arg).then(function (result) { - if(result === arg) { - $ERROR("expected a new array from Promise.all but argument was re-used"); - } +Promise.all(arg).then(function(result) { + if (result === arg) { + $ERROR("expected a new array from Promise.all but argument was re-used"); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T1.js index 805a05525..9c5887f28 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T1.js @@ -14,10 +14,10 @@ flags: [async] var nonIterable = 3; -Promise.all(nonIterable).then(function () { - $ERROR('Promise unexpectedly resolved: Promise.all(nonIterable) should throw TypeError'); -},function (err) { - if (!(err instanceof TypeError)) { - $ERROR('Expected TypeError, got ' + err); - } +Promise.all(nonIterable).then(function() { + $ERROR('Promise unexpectedly resolved: Promise.all(nonIterable) should throw TypeError'); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR('Expected TypeError, got ' + err); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js index 88e7acb72..e838c9898 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js @@ -13,10 +13,10 @@ description: Promise.all(new Error()) returns Promise rejected with TypeError flags: [async] ---*/ -Promise.all(new Error("abrupt")).then(function () { - $ERROR('Promise unexpectedly resolved: Promise.all(abruptCompletion) should throw TypeError'); -},function (err) { - if (!(err instanceof TypeError)) { - $ERROR('Expected TypeError, got ' + err); - } -}).then($DONE,$DONE); +Promise.all(new Error("abrupt")).then(function() { + $ERROR('Promise unexpectedly resolved: Promise.all(abruptCompletion) should throw TypeError'); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR('Expected TypeError, got ' + err); + } +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T3.js b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T3.js index 9dcabfadd..0f92a96c0 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A3.1_T3.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A3.1_T3.js @@ -14,15 +14,15 @@ flags: [async] var iterThrows = {}; Object.defineProperty(iterThrows, Symbol.iterator, { - get: function () { - throw new Error("abrupt completion"); - } + get: function() { + throw new Error("abrupt completion"); + } }); -Promise.all(iterThrows).then(function () { - $ERROR('Promise unexpectedly fulfilled: Promise.all(iterThrows) should throw TypeError'); -},function (err) { - if (!(err instanceof Error)) { - $ERROR('Expected promise to be rejected with error, got ' + err); - } -}).then($DONE,$DONE); +Promise.all(iterThrows).then(function() { + $ERROR('Promise unexpectedly fulfilled: Promise.all(iterThrows) should throw TypeError'); +}, function(err) { + if (!(err instanceof Error)) { + $ERROR('Expected promise to be rejected with error, got ' + err); + } +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A4.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A4.1_T1.js index e2ad6eee7..a594a579b 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A4.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A4.1_T1.js @@ -9,8 +9,7 @@ description: this must conform to Promise constructor in Promise.all author: Sam Mikes ---*/ -function ZeroArgConstructor() { -} +function ZeroArgConstructor() {} assert.throws(TypeError, function() { Promise.all.call(ZeroArgConstructor, []); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A5.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A5.1_T1.js index 2428711a6..18ef595bf 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A5.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A5.1_T1.js @@ -15,15 +15,15 @@ flags: [async] var iterThrows = {}; var error = new Test262Error(); iterThrows[Symbol.iterator] = function() { - return { - next: function () { - throw error; - } - }; + return { + next: function() { + throw error; + } + }; }; -Promise.all(iterThrows).then(function () { - $ERROR('Promise unexpectedly resolved: Promise.all(iterThrows) should throw TypeError'); -},function (reason) { - assert.sameValue(reason, error); -}).then($DONE,$DONE); +Promise.all(iterThrows).then(function() { + $ERROR('Promise unexpectedly resolved: Promise.all(iterThrows) should throw TypeError'); +}, function(reason) { + assert.sameValue(reason, error); +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A6.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A6.1_T1.js index a3ba1d7a8..5621dc927 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A6.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A6.1_T1.js @@ -12,5 +12,5 @@ description: Promise.all([]) produces a promise var p = Promise.all([]); if (!(p instanceof Promise)) { - $ERROR('Expected Promise.all([]) to be instanceof Promise' + err); + $ERROR('Expected Promise.all([]) to be instanceof Promise' + err); } diff --git a/test/built-ins/Promise/all/S25.4.4.1_A6.1_T2.js b/test/built-ins/Promise/all/S25.4.4.1_A6.1_T2.js index 73a47330b..baf2bba25 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A6.1_T2.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A6.1_T2.js @@ -13,11 +13,11 @@ flags: [async] var p = Promise.all([]); -p.then(function (result) { - if (!(result instanceof Array)) { - $ERROR("Expected Promise.all([]) to be Array, actually " + result); - } - if (result.length !== 0) { - $ERROR("Expected Promise.all([]) to be empty Array, actually " + result); - } +p.then(function(result) { + if (!(result instanceof Array)) { + $ERROR("Expected Promise.all([]) to be Array, actually " + result); + } + if (result.length !== 0) { + $ERROR("Expected Promise.all([]) to be empty Array, actually " + result); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A7.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A7.1_T1.js index 7eb81e9ce..e8cc200f7 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A7.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A7.1_T1.js @@ -15,17 +15,17 @@ var p1 = Promise.resolve(3); var pAll = Promise.all([p1]); -pAll.then(function (result) { - if (!(pAll instanceof Promise)) { - $ERROR("Expected Promise.all() to be promise, actually " + pAll); - } - if (!(result instanceof Array)) { - $ERROR("Expected Promise.all() to be promise for an Array, actually " + result); - } - if (result.length !== 1) { - $ERROR("Expected Promise.all([p1]) to be a promise for one-element Array, actually " + result); - } - if (result[0] !== 3) { - $ERROR("Expected result[0] to be 3, actually " + result[0]); - } +pAll.then(function(result) { + if (!(pAll instanceof Promise)) { + $ERROR("Expected Promise.all() to be promise, actually " + pAll); + } + if (!(result instanceof Array)) { + $ERROR("Expected Promise.all() to be promise for an Array, actually " + result); + } + if (result.length !== 1) { + $ERROR("Expected Promise.all([p1]) to be a promise for one-element Array, actually " + result); + } + if (result[0] !== 3) { + $ERROR("Expected result[0] to be 3, actually " + result[0]); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js index 480147423..546c47254 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js @@ -14,21 +14,23 @@ flags: [async] var sequence = []; -var p1 = new Promise(function (resolve) { resolve({}); } ); +var p1 = new Promise(function(resolve) { + resolve({}); +}); sequence.push(1); -Promise.all([p1]).then(function (resolved) { - sequence.push(4); - checkSequence(sequence, "Expected Promise.all().then to queue second"); +Promise.all([p1]).then(function(resolved) { + sequence.push(4); + checkSequence(sequence, "Expected Promise.all().then to queue second"); }).catch($DONE); -p1.then(function () { - sequence.push(3); - checkSequence(sequence, "Expected p1.then to queue first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "Expected final then to queue last"); +p1.then(function() { + sequence.push(3); + checkSequence(sequence, "Expected p1.then to queue first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "Expected final then to queue last"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A8.1_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A8.1_T1.js index 7a6d917d0..4115767c5 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A8.1_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A8.1_T1.js @@ -11,24 +11,28 @@ flags: [async] var sequence = []; -var p1 = new Promise(function (resolve) { resolve(1); } ); -var p2 = new Promise(function (resolve) { resolve(2); } ); +var p1 = new Promise(function(resolve) { + resolve(1); +}); +var p2 = new Promise(function(resolve) { + resolve(2); +}); sequence.push(1); -p1.then(function () { - sequence.push(3); - checkSequence(sequence, "Expected to be called first."); +p1.then(function() { + sequence.push(3); + checkSequence(sequence, "Expected to be called first."); }).catch($DONE); -Promise.all([p1, p2]).then(function () { - sequence.push(5); - checkSequence(sequence, "Expected to be called third."); +Promise.all([p1, p2]).then(function() { + sequence.push(5); + checkSequence(sequence, "Expected to be called third."); }).then($DONE, $DONE); -p2.then(function () { - sequence.push(4); - checkSequence(sequence, "Expected to be called second."); +p2.then(function() { + sequence.push(4); + checkSequence(sequence, "Expected to be called second."); }).catch($DONE); sequence.push(2); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A8.2_T1.js b/test/built-ins/Promise/all/S25.4.4.1_A8.2_T1.js index 77d087034..b726f5879 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A8.2_T1.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A8.2_T1.js @@ -11,17 +11,17 @@ flags: [async] ---*/ var rejectP1, - p1 = new Promise(function (resolve, reject) { - rejectP1 = reject; - }), - p2 = Promise.resolve(2); + p1 = new Promise(function(resolve, reject) { + rejectP1 = reject; + }), + p2 = Promise.resolve(2); -Promise.all([p1, p2]).then(function (resolve) { - $ERROR("Did not expect promise to be fulfilled."); -}, function (rejected) { - if (rejected !== 1) { - $ERROR("Expected promise to be rejected with 1, actually " + rejected); - } +Promise.all([p1, p2]).then(function(resolve) { + $ERROR("Did not expect promise to be fulfilled."); +}, function(rejected) { + if (rejected !== 1) { + $ERROR("Expected promise to be rejected with 1, actually " + rejected); + } }).then($DONE, $DONE); rejectP1(1); diff --git a/test/built-ins/Promise/all/S25.4.4.1_A8.2_T2.js b/test/built-ins/Promise/all/S25.4.4.1_A8.2_T2.js index bb700ae46..128375aae 100644 --- a/test/built-ins/Promise/all/S25.4.4.1_A8.2_T2.js +++ b/test/built-ins/Promise/all/S25.4.4.1_A8.2_T2.js @@ -11,17 +11,17 @@ flags: [async] ---*/ var rejectP2, - p1 = Promise.resolve(1), - p2 = new Promise(function (resolve, reject) { - rejectP2 = reject; - }); + p1 = Promise.resolve(1), + p2 = new Promise(function(resolve, reject) { + rejectP2 = reject; + }); -Promise.all([p1, p2]).then(function () { - $ERROR("Did not expect promise to be fulfilled."); -}, function (rejected) { - if (rejected !== 2) { - $ERROR("Expected promise to be rejected with 2, actually " + rejected); - } +Promise.all([p1, p2]).then(function() { + $ERROR("Did not expect promise to be fulfilled."); +}, function(rejected) { + if (rejected !== 2) { + $ERROR("Expected promise to be rejected with 2, actually " + rejected); + } }).then($DONE, $DONE); rejectP2(2); diff --git a/test/built-ins/Promise/all/call-resolve-element-after-return.js b/test/built-ins/Promise/all/call-resolve-element-after-return.js index 6b85ec15e..c644abeb8 100644 --- a/test/built-ins/Promise/all/call-resolve-element-after-return.js +++ b/test/built-ins/Promise/all/call-resolve-element-after-return.js @@ -27,7 +27,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1OnFulfilled; diff --git a/test/built-ins/Promise/all/call-resolve-element-items.js b/test/built-ins/Promise/all/call-resolve-element-items.js index 97e7541c3..3cf7629a4 100644 --- a/test/built-ins/Promise/all/call-resolve-element-items.js +++ b/test/built-ins/Promise/all/call-resolve-element-items.js @@ -26,7 +26,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1 = { then: function(onFulfilled, onRejected) { diff --git a/test/built-ins/Promise/all/call-resolve-element.js b/test/built-ins/Promise/all/call-resolve-element.js index fc600d459..37be4b02d 100644 --- a/test/built-ins/Promise/all/call-resolve-element.js +++ b/test/built-ins/Promise/all/call-resolve-element.js @@ -25,7 +25,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1 = { then: function(onFulfilled, onRejected) { diff --git a/test/built-ins/Promise/all/capability-executor-called-twice.js b/test/built-ins/Promise/all/capability-executor-called-twice.js index 580483b33..7f9427dbc 100644 --- a/test/built-ins/Promise/all/capability-executor-called-twice.js +++ b/test/built-ins/Promise/all/capability-executor-called-twice.js @@ -27,7 +27,7 @@ Promise.all.call(function(executor) { checkPoint += "a"; executor(); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); assert.sameValue(checkPoint, "abc", "executor initially called with no arguments"); @@ -37,7 +37,7 @@ Promise.all.call(function(executor) { checkPoint += "a"; executor(undefined, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); assert.sameValue(checkPoint, "abc", "executor initially called with (undefined, undefined)"); @@ -46,9 +46,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.all.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (undefined, function)"); @@ -58,9 +58,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.all.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (function, undefined)"); @@ -72,7 +72,7 @@ assert.throws(TypeError, function() { checkPoint += "a"; executor("invalid value", 123); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (String, Number)"); diff --git a/test/built-ins/Promise/all/capability-executor-not-callable.js b/test/built-ins/Promise/all/capability-executor-not-callable.js index 91ed10864..db4092e66 100644 --- a/test/built-ins/Promise/all/capability-executor-not-callable.js +++ b/test/built-ins/Promise/all/capability-executor-not-callable.js @@ -56,7 +56,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.all.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; }, []); }, "executor called with (undefined, function)"); @@ -66,7 +66,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.all.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; }, []); }, "executor called with (function, undefined)"); diff --git a/test/built-ins/Promise/all/capability-resolve-throws-no-close.js b/test/built-ins/Promise/all/capability-resolve-throws-no-close.js index 9124a3a56..390bf8d25 100644 --- a/test/built-ins/Promise/all/capability-resolve-throws-no-close.js +++ b/test/built-ins/Promise/all/capability-resolve-throws-no-close.js @@ -50,7 +50,9 @@ var iter = {}; iter[Symbol.iterator] = function() { return { next: function() { - return { done: true }; + return { + done: true + }; }, return: function() { returnCount += 1; @@ -60,7 +62,9 @@ iter[Symbol.iterator] = function() { }; var P = function(executor) { return new Promise(function(_, reject) { - executor(function() { throw new Test262Error(); }, reject); + executor(function() { + throw new Test262Error(); + }, reject); }); }; diff --git a/test/built-ins/Promise/all/capability-resolve-throws-reject.js b/test/built-ins/Promise/all/capability-resolve-throws-reject.js index 3ad3affde..57f3e2755 100644 --- a/test/built-ins/Promise/all/capability-resolve-throws-reject.js +++ b/test/built-ins/Promise/all/capability-resolve-throws-reject.js @@ -48,7 +48,9 @@ flags: [async] var thrown = new Test262Error(); var P = function(executor) { return new Promise(function(_, reject) { - executor(function() { throw thrown; }, reject); + executor(function() { + throw thrown; + }, reject); }); }; diff --git a/test/built-ins/Promise/all/does-not-invoke-array-setters.js b/test/built-ins/Promise/all/does-not-invoke-array-setters.js index 19db5a8be..54c332a02 100644 --- a/test/built-ins/Promise/all/does-not-invoke-array-setters.js +++ b/test/built-ins/Promise/all/does-not-invoke-array-setters.js @@ -33,4 +33,6 @@ Object.defineProperty(Array.prototype, 0, { } }); -Promise.all([42]).then(function(){ $DONE(); }, $DONE); +Promise.all([42]).then(function() { + $DONE(); +}, $DONE); diff --git a/test/built-ins/Promise/all/invoke-resolve-error-close.js b/test/built-ins/Promise/all/invoke-resolve-error-close.js index ac2ca2824..aead2b647 100644 --- a/test/built-ins/Promise/all/invoke-resolve-error-close.js +++ b/test/built-ins/Promise/all/invoke-resolve-error-close.js @@ -30,7 +30,10 @@ var callCount = 0; iterDoneSpy[Symbol.iterator] = function() { return { next: function() { - return { value: null, done: false }; + return { + value: null, + done: false + }; }, return: function() { callCount += 1; diff --git a/test/built-ins/Promise/all/invoke-resolve-get-error-close.js b/test/built-ins/Promise/all/invoke-resolve-get-error-close.js index ce43d8ab1..22e75e0df 100644 --- a/test/built-ins/Promise/all/invoke-resolve-get-error-close.js +++ b/test/built-ins/Promise/all/invoke-resolve-get-error-close.js @@ -30,7 +30,9 @@ var returnCount = 0; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false }; + return { + done: false + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/all/invoke-then-error-close.js b/test/built-ins/Promise/all/invoke-then-error-close.js index 6786b3188..fe683d91e 100644 --- a/test/built-ins/Promise/all/invoke-then-error-close.js +++ b/test/built-ins/Promise/all/invoke-then-error-close.js @@ -31,7 +31,10 @@ var iter = {}; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false, value: promise }; + return { + done: false, + value: promise + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/all/invoke-then-get-error-close.js b/test/built-ins/Promise/all/invoke-then-get-error-close.js index a200b752a..5023c3d4f 100644 --- a/test/built-ins/Promise/all/invoke-then-get-error-close.js +++ b/test/built-ins/Promise/all/invoke-then-get-error-close.js @@ -31,7 +31,10 @@ var iter = {}; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false, value: promise }; + return { + done: false, + value: promise + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/all/new-resolve-function.js b/test/built-ins/Promise/all/new-resolve-function.js index 383148f44..b4778a914 100644 --- a/test/built-ins/Promise/all/new-resolve-function.js +++ b/test/built-ins/Promise/all/new-resolve-function.js @@ -15,14 +15,17 @@ info: | ... ---*/ -function resolveFunction() { } +function resolveFunction() {} function Constructor(executor) { executor(resolveFunction, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; -var callCount1 = 0, callCount2 = 0; +var callCount1 = 0, + callCount2 = 0; var p1OnFulfilled; var p1 = { diff --git a/test/built-ins/Promise/all/reject-deferred.js b/test/built-ins/Promise/all/reject-deferred.js index 40d282135..bd4280ec1 100644 --- a/test/built-ins/Promise/all/reject-deferred.js +++ b/test/built-ins/Promise/all/reject-deferred.js @@ -25,7 +25,9 @@ flags: [async] var thenable = { then: function(_, reject) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { reject(); }); diff --git a/test/built-ins/Promise/all/reject-ignored-deferred.js b/test/built-ins/Promise/all/reject-ignored-deferred.js index 2913ba760..6303836d5 100644 --- a/test/built-ins/Promise/all/reject-ignored-deferred.js +++ b/test/built-ins/Promise/all/reject-ignored-deferred.js @@ -30,7 +30,9 @@ flags: [async] var fulfiller = { then: function(resolve) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { resolve(); }); @@ -38,7 +40,9 @@ var fulfiller = { }; var rejector = { then: function(resolve, reject) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { resolve(); reject(); diff --git a/test/built-ins/Promise/all/resolve-before-loop-exit-from-same.js b/test/built-ins/Promise/all/resolve-before-loop-exit-from-same.js index 3294503da..0c8d848f2 100644 --- a/test/built-ins/Promise/all/resolve-before-loop-exit-from-same.js +++ b/test/built-ins/Promise/all/resolve-before-loop-exit-from-same.js @@ -39,7 +39,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1OnFulfilled; diff --git a/test/built-ins/Promise/all/resolve-before-loop-exit.js b/test/built-ins/Promise/all/resolve-before-loop-exit.js index 0ecb2a179..3f09d3ceb 100644 --- a/test/built-ins/Promise/all/resolve-before-loop-exit.js +++ b/test/built-ins/Promise/all/resolve-before-loop-exit.js @@ -39,7 +39,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1OnFulfilled; diff --git a/test/built-ins/Promise/all/resolve-element-function-extensible.js b/test/built-ins/Promise/all/resolve-element-function-extensible.js index fff03cde8..570222b0f 100644 --- a/test/built-ins/Promise/all/resolve-element-function-extensible.js +++ b/test/built-ins/Promise/all/resolve-element-function-extensible.js @@ -16,10 +16,13 @@ var thenable = { resolveElementFunction = fulfill; } }; + function NotPromise(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } -NotPromise.resolve = function(v) { return v; }; +NotPromise.resolve = function(v) { + return v; +}; Promise.all.call(NotPromise, [thenable]); assert(Object.isExtensible(resolveElementFunction)); diff --git a/test/built-ins/Promise/all/resolve-element-function-length.js b/test/built-ins/Promise/all/resolve-element-function-length.js index 6b1570582..87938eb4d 100644 --- a/test/built-ins/Promise/all/resolve-element-function-length.js +++ b/test/built-ins/Promise/all/resolve-element-function-length.js @@ -20,10 +20,13 @@ var thenable = { resolveElementFunction = fulfill; } }; + function NotPromise(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } -NotPromise.resolve = function(v) { return v; }; +NotPromise.resolve = function(v) { + return v; +}; Promise.all.call(NotPromise, [thenable]); assert.sameValue(resolveElementFunction.length, 1); diff --git a/test/built-ins/Promise/all/resolve-element-function-name.js b/test/built-ins/Promise/all/resolve-element-function-name.js index f975ef3ac..2af12b808 100644 --- a/test/built-ins/Promise/all/resolve-element-function-name.js +++ b/test/built-ins/Promise/all/resolve-element-function-name.js @@ -19,10 +19,13 @@ var thenable = { resolveElementFunction = fulfill; } }; + function NotPromise(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } -NotPromise.resolve = function(v) { return v; }; +NotPromise.resolve = function(v) { + return v; +}; Promise.all.call(NotPromise, [thenable]); assert.sameValue(Object.prototype.hasOwnProperty.call(resolveElementFunction, "name"), false); diff --git a/test/built-ins/Promise/all/resolve-element-function-nonconstructor.js b/test/built-ins/Promise/all/resolve-element-function-nonconstructor.js index 4c329a4b0..7da037347 100644 --- a/test/built-ins/Promise/all/resolve-element-function-nonconstructor.js +++ b/test/built-ins/Promise/all/resolve-element-function-nonconstructor.js @@ -17,11 +17,16 @@ var thenable = { resolveElementFunction = fulfill; } }; + function NotPromise(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } -NotPromise.resolve = function(v) { return v; }; +NotPromise.resolve = function(v) { + return v; +}; Promise.all.call(NotPromise, [thenable]); assert.sameValue(Object.prototype.hasOwnProperty.call(resolveElementFunction, "prototype"), false); -assert.throws(TypeError, function() { new resolveElementFunction(); }); +assert.throws(TypeError, function() { + new resolveElementFunction(); +}); diff --git a/test/built-ins/Promise/all/resolve-element-function-prototype.js b/test/built-ins/Promise/all/resolve-element-function-prototype.js index c809e78c6..f7c66f97c 100644 --- a/test/built-ins/Promise/all/resolve-element-function-prototype.js +++ b/test/built-ins/Promise/all/resolve-element-function-prototype.js @@ -18,10 +18,13 @@ var thenable = { resolveElementFunction = fulfill; } }; + function NotPromise(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } -NotPromise.resolve = function(v) { return v; }; +NotPromise.resolve = function(v) { + return v; +}; Promise.all.call(NotPromise, [thenable]); assert.sameValue(Object.getPrototypeOf(resolveElementFunction), Function.prototype); diff --git a/test/built-ins/Promise/all/resolve-from-same-thenable.js b/test/built-ins/Promise/all/resolve-from-same-thenable.js index 02cc9b982..430026ff8 100644 --- a/test/built-ins/Promise/all/resolve-from-same-thenable.js +++ b/test/built-ins/Promise/all/resolve-from-same-thenable.js @@ -39,7 +39,9 @@ function Constructor(executor) { } executor(resolve, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; var p1OnFulfilled, p2OnFulfilled, p3OnFulfilled; diff --git a/test/built-ins/Promise/all/resolve-poisoned-then.js b/test/built-ins/Promise/all/resolve-poisoned-then.js index 53de258c7..191175a69 100644 --- a/test/built-ins/Promise/all/resolve-poisoned-then.js +++ b/test/built-ins/Promise/all/resolve-poisoned-then.js @@ -60,12 +60,12 @@ try { } promise.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(val) { - if (val !== value) { - $DONE('The promise should be rejected with the expected value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(val) { + if (val !== value) { + $DONE('The promise should be rejected with the expected value.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/all/resolve-thenable.js b/test/built-ins/Promise/all/resolve-thenable.js index c39de44bb..905eff387 100644 --- a/test/built-ins/Promise/all/resolve-thenable.js +++ b/test/built-ins/Promise/all/resolve-thenable.js @@ -62,12 +62,12 @@ try { } promise.then(function(val) { - if (val !== value) { - $DONE('The promise should be resolved with the expected value.'); - return; - } + if (val !== value) { + $DONE('The promise should be resolved with the expected value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/all/same-reject-function.js b/test/built-ins/Promise/all/same-reject-function.js index 0e0db97c4..9c8107532 100644 --- a/test/built-ins/Promise/all/same-reject-function.js +++ b/test/built-ins/Promise/all/same-reject-function.js @@ -13,14 +13,17 @@ info: | ... ---*/ -function rejectFunction() { } +function rejectFunction() {} function Constructor(executor) { executor($ERROR, rejectFunction); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; -var callCount1 = 0, callCount2 = 0; +var callCount1 = 0, + callCount2 = 0; var p1 = { then: function(onFulfilled, onRejected) { diff --git a/test/built-ins/Promise/all/species-get-error.js b/test/built-ins/Promise/all/species-get-error.js index 0311392b0..43ed463d6 100644 --- a/test/built-ins/Promise/all/species-get-error.js +++ b/test/built-ins/Promise/all/species-get-error.js @@ -14,7 +14,7 @@ features: [Symbol.species] ---*/ function C(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Object.defineProperty(C, Symbol.species, { get: function() { diff --git a/test/built-ins/Promise/executor-function-extensible.js b/test/built-ins/Promise/executor-function-extensible.js index d15764391..67b539538 100644 --- a/test/built-ins/Promise/executor-function-extensible.js +++ b/test/built-ins/Promise/executor-function-extensible.js @@ -11,9 +11,10 @@ info: | ---*/ var executorFunction; + function NotPromise(executor) { executorFunction = executor; - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Promise.resolve.call(NotPromise); diff --git a/test/built-ins/Promise/executor-function-length.js b/test/built-ins/Promise/executor-function-length.js index 01fdedcaa..0558e97b5 100644 --- a/test/built-ins/Promise/executor-function-length.js +++ b/test/built-ins/Promise/executor-function-length.js @@ -15,9 +15,10 @@ includes: [propertyHelper.js] ---*/ var executorFunction; + function NotPromise(executor) { executorFunction = executor; - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Promise.resolve.call(NotPromise); diff --git a/test/built-ins/Promise/executor-function-name.js b/test/built-ins/Promise/executor-function-name.js index ceb4aa98d..f571504fc 100644 --- a/test/built-ins/Promise/executor-function-name.js +++ b/test/built-ins/Promise/executor-function-name.js @@ -14,9 +14,10 @@ info: | ---*/ var executorFunction; + function NotPromise(executor) { executorFunction = executor; - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Promise.resolve.call(NotPromise); diff --git a/test/built-ins/Promise/executor-function-nonconstructor.js b/test/built-ins/Promise/executor-function-nonconstructor.js index 53c1c4595..e8686c60e 100644 --- a/test/built-ins/Promise/executor-function-nonconstructor.js +++ b/test/built-ins/Promise/executor-function-nonconstructor.js @@ -12,11 +12,14 @@ info: | ---*/ var executorFunction; + function NotPromise(executor) { executorFunction = executor; - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Promise.resolve.call(NotPromise); assert.sameValue(Object.prototype.hasOwnProperty.call(executorFunction, "prototype"), false); -assert.throws(TypeError, function() { new executorFunction(); }); +assert.throws(TypeError, function() { + new executorFunction(); +}); diff --git a/test/built-ins/Promise/executor-function-prototype.js b/test/built-ins/Promise/executor-function-prototype.js index 83d84e46e..c334f4f5b 100644 --- a/test/built-ins/Promise/executor-function-prototype.js +++ b/test/built-ins/Promise/executor-function-prototype.js @@ -13,9 +13,10 @@ info: | ---*/ var executorFunction; + function NotPromise(executor) { executorFunction = executor; - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Promise.resolve.call(NotPromise); diff --git a/test/built-ins/Promise/prototype/S25.4.4.2_A1.1_T1.js b/test/built-ins/Promise/prototype/S25.4.4.2_A1.1_T1.js index 2ac312176..139ed3a1b 100644 --- a/test/built-ins/Promise/prototype/S25.4.4.2_A1.1_T1.js +++ b/test/built-ins/Promise/prototype/S25.4.4.2_A1.1_T1.js @@ -11,5 +11,5 @@ description: Promise prototype exists ---*/ if (Promise.prototype === undefined) { - $ERROR("Expected Promise.prototype to be defined."); + $ERROR("Expected Promise.prototype to be defined."); } diff --git a/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js b/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js index c8719d738..23e3452d8 100644 --- a/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js +++ b/test/built-ins/Promise/prototype/S25.4.5_A3.1_T1.js @@ -10,6 +10,5 @@ description: Promise.prototype.constructor is the Promise constructor ---*/ if (Promise.prototype.constructor !== Promise) { - $ERROR("Expected Promise.prototype.constructor to be Promise"); + $ERROR("Expected Promise.prototype.constructor to be Promise"); } - diff --git a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A1.1_T1.js b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A1.1_T1.js index abd62d615..958bb552e 100644 --- a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A1.1_T1.js +++ b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A1.1_T1.js @@ -10,5 +10,5 @@ description: Promise.prototype.catch is a function ---*/ if (!(Promise.prototype.catch instanceof Function)) { - $ERROR("Expected Promise.prototype.catch to be a function"); + $ERROR("Expected Promise.prototype.catch to be a function"); } diff --git a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A2.1_T1.js b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A2.1_T1.js index 1dfed96c3..20e81c5ac 100644 --- a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A2.1_T1.js +++ b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A2.1_T1.js @@ -12,5 +12,5 @@ description: catch is a method on a Promise var p = Promise.resolve(3); if (!(p.catch instanceof Function)) { - $ERROR("Expected p.catch to be a function"); + $ERROR("Expected p.catch to be a function"); } diff --git a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T1.js b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T1.js index a13171c31..6606fdcdc 100644 --- a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T1.js +++ b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T1.js @@ -14,11 +14,10 @@ var obj = {}; var p = Promise.resolve(obj); -p.catch(function () { - $ERROR("Should not be called - promise is fulfilled"); -}).then(function (arg) { - if (arg !== obj) { - $ERROR("Expected promise to be fulfilled with obj, got " + arg); - } +p.catch(function() { + $ERROR("Should not be called - promise is fulfilled"); +}).then(function(arg) { + if (arg !== obj) { + $ERROR("Expected promise to be fulfilled with obj, got " + arg); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T2.js b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T2.js index b04fbf630..e0194fc4a 100644 --- a/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T2.js +++ b/test/built-ins/Promise/prototype/catch/S25.4.5.1_A3.1_T2.js @@ -14,11 +14,10 @@ var obj = {}; var p = Promise.reject(obj); -p.then(function () { - $ERROR("Should not be called: did not expect promise to be fulfilled"); -}).catch(function (arg) { - if (arg !== obj) { - $ERROR("Should have been rejected with reason obj, got " + arg); - } +p.then(function() { + $ERROR("Should not be called: did not expect promise to be fulfilled"); +}).catch(function(arg) { + if (arg !== obj) { + $ERROR("Should have been rejected with reason obj, got " + arg); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/prototype/catch/this-value-obj-coercible.js b/test/built-ins/Promise/prototype/catch/this-value-obj-coercible.js index 905dd966a..70f9f418a 100644 --- a/test/built-ins/Promise/prototype/catch/this-value-obj-coercible.js +++ b/test/built-ins/Promise/prototype/catch/this-value-obj-coercible.js @@ -24,21 +24,29 @@ features: [Symbol] ---*/ var booleanCount = 0; -Boolean.prototype.then = function() { booleanCount += 1; }; +Boolean.prototype.then = function() { + booleanCount += 1; +}; Promise.prototype.catch.call(true); assert.sameValue(booleanCount, 1, 'boolean'); var numberCount = 0; -Number.prototype.then = function() { numberCount += 1; }; +Number.prototype.then = function() { + numberCount += 1; +}; Promise.prototype.catch.call(34); assert.sameValue(numberCount, 1, 'number'); var stringCount = 0; -String.prototype.then = function() { stringCount += 1; }; +String.prototype.then = function() { + stringCount += 1; +}; Promise.prototype.catch.call(''); assert.sameValue(stringCount, 1, 'string'); var symbolCount = 0; -Symbol.prototype.then = function() { symbolCount += 1; }; +Symbol.prototype.then = function() { + symbolCount += 1; +}; Promise.prototype.catch.call(Symbol()); assert.sameValue(symbolCount, 1, 'symbol'); diff --git a/test/built-ins/Promise/prototype/catch/this-value-then-not-callable.js b/test/built-ins/Promise/prototype/catch/this-value-then-not-callable.js index 1feffa35b..20c29cfe6 100644 --- a/test/built-ins/Promise/prototype/catch/this-value-then-not-callable.js +++ b/test/built-ins/Promise/prototype/catch/this-value-then-not-callable.js @@ -38,25 +38,37 @@ assert.throws(TypeError, function() { }, 'undefined'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: null }); + Promise.prototype.catch.call({ + then: null + }); }, 'null'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: 1 }); + Promise.prototype.catch.call({ + then: 1 + }); }, 'number'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: '' }); + Promise.prototype.catch.call({ + then: '' + }); }, 'string'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: true }); + Promise.prototype.catch.call({ + then: true + }); }, 'boolean'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: symbol }); + Promise.prototype.catch.call({ + then: symbol + }); }, 'symbol'); assert.throws(TypeError, function() { - Promise.prototype.catch.call({ then: {} }); + Promise.prototype.catch.call({ + then: {} + }); }, 'ordinary object'); diff --git a/test/built-ins/Promise/prototype/finally/invokes-then-with-function.js b/test/built-ins/Promise/prototype/finally/invokes-then-with-function.js index 648b7dd6f..697bea0b3 100644 --- a/test/built-ins/Promise/prototype/finally/invokes-then-with-function.js +++ b/test/built-ins/Promise/prototype/finally/invokes-then-with-function.js @@ -7,7 +7,7 @@ esid: sec-promise.prototype.finally features: [Promise.prototype.finally] ---*/ -var target = new Promise(function () {}); +var target = new Promise(function() {}); var returnValue = {}; var callCount = 0; var thisValue = null; @@ -26,8 +26,8 @@ target.then = function(a, b) { return returnValue; }; -var originalFinallyHandler = function () {}; -var anonName = Object(function () {}).name; +var originalFinallyHandler = function() {}; +var anonName = Object(function() {}).name; var result = Promise.prototype.finally.call(target, originalFinallyHandler, 2, 3); diff --git a/test/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js b/test/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js index 1193119fb..b8e57281c 100644 --- a/test/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js +++ b/test/built-ins/Promise/prototype/finally/invokes-then-with-non-function.js @@ -7,7 +7,7 @@ esid: sec-promise.prototype.finally features: [Promise.prototype.finally] ---*/ -var target = new Promise(function () {}); +var target = new Promise(function() {}); var returnValue = {}; var callCount = 0; var thisValue = null; diff --git a/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js b/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js index 794677b57..ed75b1687 100644 --- a/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js +++ b/test/built-ins/Promise/prototype/finally/rejected-observable-then-calls.js @@ -11,29 +11,29 @@ includes: [promiseHelper.js] var sequence = []; var noReason = {}; var no = Promise.reject(noReason); -no.then = function () { +no.then = function() { sequence.push(1); return Promise.prototype.then.apply(this, arguments); }; var yesValue = {}; var yes = Promise.resolve(yesValue); -yes.then = function () { +yes.then = function() { sequence.push(4); return Promise.prototype.then.apply(this, arguments); }; -no.catch(function (e) { +no.catch(function(e) { sequence.push(2); assert.sameValue(e, noReason); throw e; -}).finally(function () { +}).finally(function() { sequence.push(3); return yes; -}).catch(function (e) { +}).catch(function(e) { sequence.push(5); assert.sameValue(e, noReason); -}).then(function () { +}).then(function() { checkSequence(sequence, "All expected callbacks called in correct order"); $DONE(); }).catch($ERROR); diff --git a/test/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js b/test/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js index eb82103da..1390a523f 100644 --- a/test/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js +++ b/test/built-ins/Promise/prototype/finally/rejection-reason-override-with-throw.js @@ -14,13 +14,13 @@ var thrown = {}; var p = Promise.reject(original); -p.finally(function () { +p.finally(function() { sequence.push(1); assert.sameValue(arguments.length, 0, 'onFinally receives zero args'); throw thrown; -}).then(function () { +}).then(function() { $ERROR('promise is rejected; onFulfill should not be called'); -}).catch(function (reason) { +}).catch(function(reason) { sequence.push(2); assert.sameValue(reason, thrown, 'onFinally can override the rejection reason by throwing'); }).then(function() { diff --git a/test/built-ins/Promise/prototype/finally/resolution-value-no-override.js b/test/built-ins/Promise/prototype/finally/resolution-value-no-override.js index 262f1be84..02e539b6f 100644 --- a/test/built-ins/Promise/prototype/finally/resolution-value-no-override.js +++ b/test/built-ins/Promise/prototype/finally/resolution-value-no-override.js @@ -12,11 +12,11 @@ var sequence = []; var obj = {}; var p = Promise.resolve(obj); -p.finally(function () { +p.finally(function() { sequence.push(1); assert.sameValue(arguments.length, 0, 'onFinally receives zero args'); return {}; -}).then(function (x) { +}).then(function(x) { sequence.push(2); assert.sameValue(x, obj, 'onFinally can not override the resolution value'); }).then(function() { diff --git a/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js b/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js index 6e583527c..1fb248ac9 100644 --- a/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js +++ b/test/built-ins/Promise/prototype/finally/resolved-observable-then-calls.js @@ -11,30 +11,29 @@ includes: [promiseHelper.js] var sequence = []; var yesValue = {}; var yes = Promise.resolve(yesValue); -yes.then = function () { +yes.then = function() { sequence.push(1); return Promise.prototype.then.apply(this, arguments); }; var noReason = {}; var no = Promise.reject(noReason); -no.then = function () { +no.then = function() { sequence.push(4); return Promise.prototype.then.apply(this, arguments); }; -yes.then(function (x) { +yes.then(function(x) { sequence.push(2); assert.sameValue(x, yesValue); return x; -}).finally(function () { +}).finally(function() { sequence.push(3); return no; -}).catch(function (e) { +}).catch(function(e) { sequence.push(5); assert.sameValue(e, noReason); -}).then(function () { +}).then(function() { checkSequence(sequence, "All expected callbacks called in correct order"); $DONE(); }).catch($ERROR); - diff --git a/test/built-ins/Promise/prototype/finally/species-symbol.js b/test/built-ins/Promise/prototype/finally/species-symbol.js index 15a8eac64..0a8de6365 100644 --- a/test/built-ins/Promise/prototype/finally/species-symbol.js +++ b/test/built-ins/Promise/prototype/finally/species-symbol.js @@ -9,12 +9,14 @@ features: [Promise.prototype.finally] class MyPromise extends Promise { - static get [Symbol.species]() { return Promise; } + static get[Symbol.species]() { + return Promise; + } } var p = Promise - .resolve() - .finally(() => MyPromise.resolve()); + .resolve() + .finally(() => MyPromise.resolve()); assert.sameValue(p instanceof Promise, true); assert.sameValue(p instanceof MyPromise, false); diff --git a/test/built-ins/Promise/prototype/finally/subclass-species-constructor-reject-count.js b/test/built-ins/Promise/prototype/finally/subclass-species-constructor-reject-count.js index 5db1a5f49..ca812c499 100644 --- a/test/built-ins/Promise/prototype/finally/subclass-species-constructor-reject-count.js +++ b/test/built-ins/Promise/prototype/finally/subclass-species-constructor-reject-count.js @@ -8,7 +8,9 @@ features: [Promise.prototype.finally] ---*/ class FooPromise extends Promise { - static get [Symbol.species]() { return Promise; } + static get[Symbol.species]() { + return Promise; + } } var p = Promise.reject().finally(() => FooPromise.reject()); diff --git a/test/built-ins/Promise/prototype/finally/subclass-species-constructor-resolve-count.js b/test/built-ins/Promise/prototype/finally/subclass-species-constructor-resolve-count.js index db1b151cd..8e80ab43d 100644 --- a/test/built-ins/Promise/prototype/finally/subclass-species-constructor-resolve-count.js +++ b/test/built-ins/Promise/prototype/finally/subclass-species-constructor-resolve-count.js @@ -8,7 +8,9 @@ features: [Promise.prototype.finally] ---*/ class FooPromise extends Promise { - static get [Symbol.species]() { return Promise; } + static get[Symbol.species]() { + return Promise; + } } var p = Promise.resolve().finally(() => FooPromise.resolve()); diff --git a/test/built-ins/Promise/prototype/finally/this-value-non-promise.js b/test/built-ins/Promise/prototype/finally/this-value-non-promise.js index 16d9f8d76..6bed146e0 100644 --- a/test/built-ins/Promise/prototype/finally/this-value-non-promise.js +++ b/test/built-ins/Promise/prototype/finally/this-value-non-promise.js @@ -11,7 +11,9 @@ features: [Promise.prototype.finally] var called = false; var p = new Proxy(Promise.resolve(), {}); var oldThen = Promise.prototype.then; -Promise.prototype.then = () => { called = true; }; +Promise.prototype.then = () => { + called = true; +}; Promise.prototype.finally.call(p); assert.sameValue(called, true); Promise.prototype.then = oldThen; diff --git a/test/built-ins/Promise/prototype/finally/this-value-then-not-callable.js b/test/built-ins/Promise/prototype/finally/this-value-then-not-callable.js index cdeccdadd..253e22fe3 100644 --- a/test/built-ins/Promise/prototype/finally/this-value-then-not-callable.js +++ b/test/built-ins/Promise/prototype/finally/this-value-then-not-callable.js @@ -11,9 +11,11 @@ features: [Symbol, Promise.prototype.finally] var symbol = Symbol(); -var thrower = function () { throw new Test262Error('this should never happen'); }; +var thrower = function() { + throw new Test262Error('this should never happen'); +}; -var p = new Promise(function () {}); +var p = new Promise(function() {}); p.then = undefined; assert.throws(TypeError, function() { diff --git a/test/built-ins/Promise/prototype/finally/this-value-then-poisoned.js b/test/built-ins/Promise/prototype/finally/this-value-then-poisoned.js index d8afd2612..99e124db0 100644 --- a/test/built-ins/Promise/prototype/finally/this-value-then-poisoned.js +++ b/test/built-ins/Promise/prototype/finally/this-value-then-poisoned.js @@ -9,7 +9,7 @@ esid: sec-promise.prototype.finally features: [Promise.prototype.finally] ---*/ -var poisonedThen = Object.defineProperty(new Promise(function () {}), 'then', { +var poisonedThen = Object.defineProperty(new Promise(function() {}), 'then', { get: function() { throw new Test262Error(); } diff --git a/test/built-ins/Promise/prototype/finally/this-value-then-throws.js b/test/built-ins/Promise/prototype/finally/this-value-then-throws.js index 7fff8d51a..e8603f88e 100644 --- a/test/built-ins/Promise/prototype/finally/this-value-then-throws.js +++ b/test/built-ins/Promise/prototype/finally/this-value-then-throws.js @@ -9,7 +9,7 @@ esid: sec-promise.prototype.finally features: [Promise.prototype.finally] ---*/ -var thrower = new Promise(function () {}); +var thrower = new Promise(function() {}); thrower.then = function() { throw new Test262Error(); }; diff --git a/test/built-ins/Promise/prototype/then/S25.4.4_A1.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.4_A1.1_T1.js index fd1519766..78aa38e01 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.4_A1.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.4_A1.1_T1.js @@ -14,27 +14,27 @@ flags: [async] var sequence = []; -var p = new Promise(function(resolve, reject){ - sequence.push(1); - resolve(""); +var p = new Promise(function(resolve, reject) { + sequence.push(1); + resolve(""); }); -p.then(function () { - sequence.push(3); -}).then(function () { - sequence.push(5); -}).then(function () { - sequence.push(7); +p.then(function() { + sequence.push(3); +}).then(function() { + sequence.push(5); +}).then(function() { + sequence.push(7); }); -p.then(function () { - sequence.push(4); -}).then(function () { - sequence.push(6); -}).then(function () { - sequence.push(8); -}).then(function () { - checkSequence(sequence, "Sequence should be as expected"); +p.then(function() { + sequence.push(4); +}).then(function() { + sequence.push(6); +}).then(function() { + sequence.push(8); +}).then(function() { + checkSequence(sequence, "Sequence should be as expected"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T1.js index cb02aa58a..971c411f9 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T1.js @@ -15,18 +15,18 @@ flags: [async] var resolveP1, rejectP2, sequence = []; -(new Promise(function (resolve, reject) { - resolveP1 = resolve; -})).then(function (msg) { - sequence.push(msg); -}).then(function () { - checkSequence(sequence, "Expected 1,2,3"); +(new Promise(function(resolve, reject) { + resolveP1 = resolve; +})).then(function(msg) { + sequence.push(msg); +}).then(function() { + checkSequence(sequence, "Expected 1,2,3"); }).then($DONE, $DONE); -(new Promise(function (resolve, reject) { - rejectP2 = reject; -})).catch(function (msg) { - sequence.push(msg); +(new Promise(function(resolve, reject) { + rejectP2 = reject; +})).catch(function(msg) { + sequence.push(msg); }); rejectP2(2); diff --git a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T2.js b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T2.js index 5c099d775..4f02681ab 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T2.js +++ b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T2.js @@ -14,26 +14,26 @@ flags: [async] ---*/ var resolveP1, rejectP2, p1, p2, - sequence = []; + sequence = []; -p1 = new Promise(function (resolve, reject) { - resolveP1 = resolve; +p1 = new Promise(function(resolve, reject) { + resolveP1 = resolve; }); -p2 = new Promise(function (resolve, reject) { - rejectP2 = reject; +p2 = new Promise(function(resolve, reject) { + rejectP2 = reject; }); rejectP2(3); resolveP1(2); -p1.then(function (msg) { - sequence.push(msg); +p1.then(function(msg) { + sequence.push(msg); }); -p2.catch(function (msg) { - sequence.push(msg); -}).then(function () { - checkSequence(sequence, "Expected 1,2,3"); +p2.catch(function(msg) { + sequence.push(msg); +}).then(function() { + checkSequence(sequence, "Expected 1,2,3"); }).then($DONE, $DONE); sequence.push(1); diff --git a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T3.js b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T3.js index 1b430f281..1208cdb89 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T3.js +++ b/test/built-ins/Promise/prototype/then/S25.4.4_A2.1_T3.js @@ -14,30 +14,28 @@ flags: [async] ---*/ var resolveP1, rejectP2, p1, p2, - sequence = []; + sequence = []; -p1 = new Promise(function (resolve, reject) { - resolveP1 = resolve; +p1 = new Promise(function(resolve, reject) { + resolveP1 = resolve; }); -p2 = new Promise(function (resolve, reject) { - rejectP2 = reject; +p2 = new Promise(function(resolve, reject) { + rejectP2 = reject; }); rejectP2(3); resolveP1(2); -Promise.resolve().then(function () { - p1.then(function (msg) { - sequence.push(msg); - }); +Promise.resolve().then(function() { + p1.then(function(msg) { + sequence.push(msg); + }); - p2.catch(function (msg) { - sequence.push(msg); - }).then(function () { - checkSequence(sequence, "Expected 1,2,3"); - }).then($DONE, $DONE); + p2.catch(function(msg) { + sequence.push(msg); + }).then(function() { + checkSequence(sequence, "Expected 1,2,3"); + }).then($DONE, $DONE); }); sequence.push(1); - - diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T1.js index 79d7906b5..f7ce622d9 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T1.js @@ -10,5 +10,5 @@ description: Promise.prototype.then is a function of two arguments ---*/ if (!(Promise.prototype.then instanceof Function)) { - $ERROR("Expected Promise.prototype.then to be a function"); + $ERROR("Expected Promise.prototype.then to be a function"); } diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T2.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T2.js index b22c332d4..0d07a720b 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T2.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A1.1_T2.js @@ -9,14 +9,12 @@ author: Sam Mikes description: Promise.prototype.then is a function of two arguments ---*/ -var p = new Promise(function () {}); +var p = new Promise(function() {}); if (!(p.then instanceof Function)) { - $ERROR("Expected p.then to be a function"); + $ERROR("Expected p.then to be a function"); } if (p.then.length !== 2) { - $ERROR("Expected p.then to be a function of two arguments"); + $ERROR("Expected p.then to be a function of two arguments"); } - - diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T1.js index b05925ef5..723ff6aac 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T1.js @@ -9,8 +9,8 @@ author: Sam Mikes description: Promise.prototype.then throw if 'this' is non-Object ---*/ -var p = new Promise(function () {}); +var p = new Promise(function() {}); assert.throws(TypeError, function() { - p.then.call(3, function () {}, function () {}); + p.then.call(3, function() {}, function() {}); }); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T2.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T2.js index bcaa7e48d..13b4bf050 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T2.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A2.1_T2.js @@ -9,11 +9,10 @@ author: Sam Mikes description: Promise.prototype.then throw if 'this' is non-Promise Object ---*/ -function ZeroArgConstructor() { -} +function ZeroArgConstructor() {} var z = new ZeroArgConstructor(); assert.throws(TypeError, function() { - Promise.then.call(z, function () {}, function () {}); + Promise.then.call(z, function() {}, function() {}); }); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T1.js index ee43a0a4a..244c9105b 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T1.js @@ -15,8 +15,8 @@ var obj = {}; var p = Promise.resolve(obj); p.then(undefined, undefined) - .then(function (arg) { - if (arg !== obj) { - $ERROR("Expected resolution object to be passed through, got " + arg); - } - }).then($DONE, $DONE); + .then(function(arg) { + if (arg !== obj) { + $ERROR("Expected resolution object to be passed through, got " + arg); + } + }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T2.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T2.js index 2032211c2..5a8bf136e 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T2.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.1_T2.js @@ -14,10 +14,10 @@ flags: [async] var obj = {}; var p = Promise.reject(obj); -p.then(undefined, undefined).then(function () { - $ERROR("Should not be called -- promise was rejected."); -}, function (arg) { - if (arg !== obj) { - $ERROR("Expected resolution object to be passed through, got " + arg); - } - }).then($DONE, $DONE); +p.then(undefined, undefined).then(function() { + $ERROR("Should not be called -- promise was rejected."); +}, function(arg) { + if (arg !== obj) { + $ERROR("Expected resolution object to be passed through, got " + arg); + } +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T1.js index eecbe9af8..a4198cde0 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T1.js @@ -15,8 +15,8 @@ var obj = {}; var p = Promise.resolve(obj); p.then(3, 5) - .then(function (arg) { - if (arg !== obj) { - $ERROR("Expected resolution object to be passed through, got " + arg); - } - }).then($DONE, $DONE); + .then(function(arg) { + if (arg !== obj) { + $ERROR("Expected resolution object to be passed through, got " + arg); + } + }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T2.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T2.js index e4b503df0..b802575c5 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T2.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T2.js @@ -14,10 +14,10 @@ flags: [async] var obj = {}; var p = Promise.reject(obj); -p.then(3, 5).then(function () { - $ERROR("Should not be called -- promise was rejected."); -}, function (arg) { - if (arg !== obj) { - $ERROR("Expected resolution object to be passed through, got " + arg); - } +p.then(3, 5).then(function() { + $ERROR("Should not be called -- promise was rejected."); +}, function(arg) { + if (arg !== obj) { + $ERROR("Expected resolution object to be passed through, got " + arg); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.1_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.1_T1.js index 7a9f02a5e..51fd71dad 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.1_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.1_T1.js @@ -13,27 +13,27 @@ flags: [async] ---*/ var sequence = [], - pResolve, - p = new Promise(function (resolve, reject) { - pResolve = resolve; - }); + pResolve, + p = new Promise(function(resolve, reject) { + pResolve = resolve; + }); sequence.push(1); -p.then(function () { - sequence.push(3); - checkSequence(sequence, "Should be second"); +p.then(function() { + sequence.push(3); + checkSequence(sequence, "Should be second"); }).catch($DONE); -Promise.resolve().then(function () { - // enqueue another then-handler - p.then(function () { - sequence.push(4); - checkSequence(sequence, "Should be third"); - }).then($DONE, $DONE); +Promise.resolve().then(function() { + // enqueue another then-handler + p.then(function() { + sequence.push(4); + checkSequence(sequence, "Should be third"); + }).then($DONE, $DONE); - sequence.push(2); - checkSequence(sequence, "Should be first"); + sequence.push(2); + checkSequence(sequence, "Should be first"); - pResolve(); + pResolve(); }).catch($DONE); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.2_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.2_T1.js index fdf1105bc..4b4d801e0 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.2_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.2_T1.js @@ -13,29 +13,29 @@ flags: [async] ---*/ var sequence = [], - pResolve, - p = new Promise(function (resolve, reject) { - pResolve = resolve; - }); + pResolve, + p = new Promise(function(resolve, reject) { + pResolve = resolve; + }); sequence.push(1); pResolve(); -p.then(function () { - sequence.push(3); - checkSequence(sequence, "Should be first"); +p.then(function() { + sequence.push(3); + checkSequence(sequence, "Should be first"); }).catch($DONE); -Promise.resolve().then(function () { - // enqueue another then-handler - p.then(function () { - sequence.push(5); - checkSequence(sequence, "Should be third"); - }).then($DONE, $DONE); +Promise.resolve().then(function() { + // enqueue another then-handler + p.then(function() { + sequence.push(5); + checkSequence(sequence, "Should be third"); + }).then($DONE, $DONE); - sequence.push(4); - checkSequence(sequence, "Should be second"); + sequence.push(4); + checkSequence(sequence, "Should be second"); }).catch($DONE); sequence.push(2); diff --git a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.3_T1.js b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.3_T1.js index 7af732e0b..1455350ad 100644 --- a/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.3_T1.js +++ b/test/built-ins/Promise/prototype/then/S25.4.5.3_A5.3_T1.js @@ -13,33 +13,33 @@ flags: [async] ---*/ var sequence = [], - pReject, - p = new Promise(function (resolve, reject) { - pReject = reject; - }); + pReject, + p = new Promise(function(resolve, reject) { + pReject = reject; + }); sequence.push(1); pReject(); -p.then(function () { - $ERROR("Should not be called -- Promise rejected."); -}, function () { - sequence.push(3); - checkSequence(sequence, "Should be first"); +p.then(function() { + $ERROR("Should not be called -- Promise rejected."); +}, function() { + sequence.push(3); + checkSequence(sequence, "Should be first"); }).catch($DONE); -Promise.resolve().then(function () { - // enqueue another then-handler - p.then(function () { - $ERROR("Should not be called (2) -- Promise rejected."); - }, function () { - sequence.push(5); - checkSequence(sequence, "Should be third"); - }).then($DONE, $DONE); - - sequence.push(4); - checkSequence(sequence, "Should be second"); +Promise.resolve().then(function() { + // enqueue another then-handler + p.then(function() { + $ERROR("Should not be called (2) -- Promise rejected."); + }, function() { + sequence.push(5); + checkSequence(sequence, "Should be third"); + }).then($DONE, $DONE); + + sequence.push(4); + checkSequence(sequence, "Should be second"); }).catch($DONE); sequence.push(2); diff --git a/test/built-ins/Promise/prototype/then/capability-executor-called-twice.js b/test/built-ins/Promise/prototype/then/capability-executor-called-twice.js index 5006c282d..f72869ba3 100644 --- a/test/built-ins/Promise/prototype/then/capability-executor-called-twice.js +++ b/test/built-ins/Promise/prototype/then/capability-executor-called-twice.js @@ -33,14 +33,14 @@ var promise = new class extends Promise { } return super(executor); } -}(function(){}); +}(function() {}); var checkPoint = ""; constructorFunction = function(executor) { checkPoint += "a"; executor(); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }; promise.then(); @@ -51,7 +51,7 @@ constructorFunction = function(executor) { checkPoint += "a"; executor(undefined, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }; promise.then(); @@ -61,9 +61,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { constructorFunction = function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }; promise.then(); @@ -74,9 +74,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { constructorFunction = function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }; promise.then(); @@ -89,7 +89,7 @@ assert.throws(TypeError, function() { checkPoint += "a"; executor("invalid value", 123); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }; promise.then(); diff --git a/test/built-ins/Promise/prototype/then/capability-executor-not-callable.js b/test/built-ins/Promise/prototype/then/capability-executor-not-callable.js index d230947d6..28f4b15b6 100644 --- a/test/built-ins/Promise/prototype/then/capability-executor-not-callable.js +++ b/test/built-ins/Promise/prototype/then/capability-executor-not-callable.js @@ -35,7 +35,7 @@ var promise = new class extends Promise { } return super(executor); } -}(function(){}); +}(function() {}); var checkPoint = ""; assert.throws(TypeError, function() { @@ -72,7 +72,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { constructorFunction = function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; }; promise.then(); @@ -83,7 +83,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { constructorFunction = function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; }; promise.then(); diff --git a/test/built-ins/Promise/prototype/then/ctor-access-count.js b/test/built-ins/Promise/prototype/then/ctor-access-count.js index 51e00ad78..585850ed9 100644 --- a/test/built-ins/Promise/prototype/then/ctor-access-count.js +++ b/test/built-ins/Promise/prototype/then/ctor-access-count.js @@ -29,7 +29,9 @@ flags: [async] ---*/ var callCount = 0; -var prms = new Promise(function(resolve) { resolve(); }); +var prms = new Promise(function(resolve) { + resolve(); +}); Object.defineProperty(prms, 'constructor', { get: function() { callCount += 1; @@ -38,12 +40,12 @@ Object.defineProperty(prms, 'constructor', { }); prms.then(function() { - if (callCount !== 1) { - $DONE('Expected constructor access count: 1. Actual: ' + callCount); - return; - } + if (callCount !== 1) { + $DONE('Expected constructor access count: 1. Actual: ' + callCount); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/ctor-poisoned.js b/test/built-ins/Promise/prototype/then/ctor-poisoned.js index 080d26a1c..d41a71a15 100644 --- a/test/built-ins/Promise/prototype/then/ctor-poisoned.js +++ b/test/built-ins/Promise/prototype/then/ctor-poisoned.js @@ -13,9 +13,9 @@ description: Promise.prototype.then throws if Get(promise, "constructor") throws var p = Promise.resolve("foo"); Object.defineProperty(p, "constructor", { - get: function () { - throw new Test262Error(); - } + get: function() { + throw new Test262Error(); + } }); assert.throws(Test262Error, function() { diff --git a/test/built-ins/Promise/prototype/then/ctor-throws.js b/test/built-ins/Promise/prototype/then/ctor-throws.js index c6b52cb40..1532089f7 100644 --- a/test/built-ins/Promise/prototype/then/ctor-throws.js +++ b/test/built-ins/Promise/prototype/then/ctor-throws.js @@ -26,10 +26,14 @@ var BadCtor = function() { }; var originalSpecies = Object.getOwnPropertyDescriptor(Promise, Symbol.species); -Object.defineProperty(Promise, Symbol.species, { value: BadCtor }); +Object.defineProperty(Promise, Symbol.species, { + value: BadCtor +}); try { - var p = new Promise(function(resolve) { resolve(); }); + var p = new Promise(function(resolve) { + resolve(); + }); assert.throws(Test262Error, function() { p.then(); diff --git a/test/built-ins/Promise/prototype/then/prfm-fulfilled.js b/test/built-ins/Promise/prototype/then/prfm-fulfilled.js index 3db69300a..285e12f9c 100644 --- a/test/built-ins/Promise/prototype/then/prfm-fulfilled.js +++ b/test/built-ins/Promise/prototype/then/prfm-fulfilled.js @@ -20,14 +20,16 @@ flags: [async] ---*/ var value = {}; -var p = new Promise(function(resolve) { resolve(value); }); +var p = new Promise(function(resolve) { + resolve(value); +}); p.then(function(x) { - if (x !== value) { - $DONE('The `onFulfilled` handler should be invoked with the promise result.'); - return; - } - $DONE(); - }, function() { - $DONE('The `onRejected` handler should not be invoked.'); - }); + if (x !== value) { + $DONE('The `onFulfilled` handler should be invoked with the promise result.'); + return; + } + $DONE(); +}, function() { + $DONE('The `onRejected` handler should not be invoked.'); +}); diff --git a/test/built-ins/Promise/prototype/then/prfm-pending-fulfulled.js b/test/built-ins/Promise/prototype/then/prfm-pending-fulfulled.js index 64c3542a4..b0251ddfe 100644 --- a/test/built-ins/Promise/prototype/then/prfm-pending-fulfulled.js +++ b/test/built-ins/Promise/prototype/then/prfm-pending-fulfulled.js @@ -21,16 +21,18 @@ flags: [async] var value = {}; var resolve; -var p = new Promise(function(_resolve) { resolve = _resolve; }); +var p = new Promise(function(_resolve) { + resolve = _resolve; +}); p.then(function(x) { - if (x !== value) { - $DONE('The `onFulfilled` handler should be invoked with the promise result.'); - return; - } - $DONE(); - }, function() { - $DONE('The `onRejected` handler should not be invoked.'); - }); + if (x !== value) { + $DONE('The `onFulfilled` handler should be invoked with the promise result.'); + return; + } + $DONE(); +}, function() { + $DONE('The `onRejected` handler should not be invoked.'); +}); resolve(value); diff --git a/test/built-ins/Promise/prototype/then/prfm-pending-rejected.js b/test/built-ins/Promise/prototype/then/prfm-pending-rejected.js index 062acafc2..998ecae2e 100644 --- a/test/built-ins/Promise/prototype/then/prfm-pending-rejected.js +++ b/test/built-ins/Promise/prototype/then/prfm-pending-rejected.js @@ -21,16 +21,18 @@ flags: [async] var value = {}; var reject; -var p = new Promise(function(_, _reject) { reject = _reject; }); +var p = new Promise(function(_, _reject) { + reject = _reject; +}); p.then(function() { - $DONE('The `onFulfilled` handler should not be invoked.'); - }, function(x) { - if (x !== value) { - $DONE('The `onRejected` handler should be invoked with the promise result.'); - return; - } - $DONE(); - }); + $DONE('The `onFulfilled` handler should not be invoked.'); +}, function(x) { + if (x !== value) { + $DONE('The `onRejected` handler should be invoked with the promise result.'); + return; + } + $DONE(); +}); reject(value); diff --git a/test/built-ins/Promise/prototype/then/prfm-rejected.js b/test/built-ins/Promise/prototype/then/prfm-rejected.js index 22e3b81b5..de59061bc 100644 --- a/test/built-ins/Promise/prototype/then/prfm-rejected.js +++ b/test/built-ins/Promise/prototype/then/prfm-rejected.js @@ -20,14 +20,16 @@ flags: [async] ---*/ var value = {}; -var p = new Promise(function(_, reject) { reject(value); }); +var p = new Promise(function(_, reject) { + reject(value); +}); p.then(function() { - $DONE('The `onFulfilled` handler should not be invoked.'); - }, function(x) { - if (x !== value) { - $DONE('The `onRejected` handler should be invoked with the promise result.'); - return; - } - $DONE(); - }); + $DONE('The `onFulfilled` handler should not be invoked.'); +}, function(x) { + if (x !== value) { + $DONE('The `onRejected` handler should be invoked with the promise result.'); + return; + } + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/reject-pending-fulfilled.js b/test/built-ins/Promise/prototype/then/reject-pending-fulfilled.js index 985591977..5fce956c1 100644 --- a/test/built-ins/Promise/prototype/then/reject-pending-fulfilled.js +++ b/test/built-ins/Promise/prototype/then/reject-pending-fulfilled.js @@ -22,23 +22,27 @@ flags: [async] ---*/ var resolve; -var thenable = new Promise(function(_resolve) { resolve = _resolve; }); -var p1 = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(_resolve) { + resolve = _resolve; +}); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(function() { - throw thenable; - }); + throw thenable; +}); p2.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value of the provided promise.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value of the provided promise.'); + return; + } - $DONE(); - }); + $DONE(); +}); resolve(); diff --git a/test/built-ins/Promise/prototype/then/reject-pending-rejected.js b/test/built-ins/Promise/prototype/then/reject-pending-rejected.js index 7d881d19e..03ff2902b 100644 --- a/test/built-ins/Promise/prototype/then/reject-pending-rejected.js +++ b/test/built-ins/Promise/prototype/then/reject-pending-rejected.js @@ -23,23 +23,27 @@ flags: [async] ---*/ var reject; -var thenable = new Promise(function(resolve) { resolve(); }); -var p1 = new Promise(function(_, _reject) { reject = _reject; }); +var thenable = new Promise(function(resolve) { + resolve(); +}); +var p1 = new Promise(function(_, _reject) { + reject = _reject; +}); var p2; p2 = p1.then(function() {}, function() { - throw thenable; - }); + throw thenable; +}); p2.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value of the provided promise.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value of the provided promise.'); + return; + } - $DONE(); - }); + $DONE(); +}); reject(); diff --git a/test/built-ins/Promise/prototype/then/reject-settled-fulfilled.js b/test/built-ins/Promise/prototype/then/reject-settled-fulfilled.js index 8845061ad..97876bec0 100644 --- a/test/built-ins/Promise/prototype/then/reject-settled-fulfilled.js +++ b/test/built-ins/Promise/prototype/then/reject-settled-fulfilled.js @@ -29,21 +29,25 @@ info: | flags: [async] ---*/ -var thenable = new Promise(function(resolve) { resolve(); }); -var p1 = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(function() { - throw thenable; - }); + throw thenable; +}); p2.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value of the provided promise.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value of the provided promise.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/reject-settled-rejected.js b/test/built-ins/Promise/prototype/then/reject-settled-rejected.js index 8cfa17fb3..3b0ae8f1c 100644 --- a/test/built-ins/Promise/prototype/then/reject-settled-rejected.js +++ b/test/built-ins/Promise/prototype/then/reject-settled-rejected.js @@ -29,21 +29,25 @@ info: | flags: [async] ---*/ -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; p2 = p1.then(function() {}, function() { - throw thenable; - }); + throw thenable; +}); p2.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value of the provided promise.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value of the provided promise.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-obj.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-obj.js index afd23f08a..1866a7c0e 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-obj.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-obj.js @@ -22,22 +22,24 @@ 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 23; - }); + return 23; +}); p2.then(function(value) { - if (value !== 23) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 23) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); resolve(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-thenable.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-thenable.js index 72daa6189..f67aae302 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-non-thenable.js @@ -26,24 +26,28 @@ info: | flags: [async] ---*/ -var nonThenable = { then: null }; +var nonThenable = { + then: null +}; 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 nonThenable; - }); + return nonThenable; +}); p2.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); resolve(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-poisoned-then.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-poisoned-then.js index 7b2147f4d..bf5912812 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-poisoned-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-poisoned-then.js @@ -30,22 +30,24 @@ var poisonedThen = Object.defineProperty({}, 'then', { throw value; } }); -var p1 = new Promise(function(_resolve) { resolve = _resolve; }); +var p1 = new Promise(function(_resolve) { + resolve = _resolve; +}); var p2; p2 = p1.then(function() { - return poisonedThen; - }); + return poisonedThen; +}); p2.then(function(x) { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== value) { - $DONE('The promise should be rejected with the thrown exception.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== value) { + $DONE('The promise should be rejected with the thrown exception.'); + return; + } - $DONE(); - }); + $DONE(); +}); resolve(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-prms-cstm-then.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-prms-cstm-then.js index 299bd5467..0a1f979c4 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-prms-cstm-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-prms-cstm-then.js @@ -30,8 +30,12 @@ flags: [async] var value = {}; var resolve; -var thenable = new Promise(function(resolve) { resolve(); }); -var p1 = new Promise(function(_resolve) { resolve = _resolve; }); +var thenable = new Promise(function(resolve) { + resolve(); +}); +var p1 = new Promise(function(_resolve) { + resolve = _resolve; +}); var p2; thenable.then = function(resolve) { @@ -39,18 +43,18 @@ thenable.then = function(resolve) { }; p2 = p1.then(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.'); +}); resolve(); 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 f27f9034d..16afaee98 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,27 +24,29 @@ 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(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-thenable.js b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-thenable.js index 9df8932aa..1d32eca24 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-fulfilled-thenable.js @@ -30,23 +30,27 @@ flags: [async] var value = {}; var resolve; -var thenable = new Promise(function(resolve) { resolve(value); }); -var p1 = new Promise(function(_resolve) { resolve = _resolve; }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); +var p1 = new Promise(function(_resolve) { + resolve = _resolve; +}); var p2; p2 = p1.then(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; - } + 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.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); resolve(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-obj.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-obj.js index 27ba9746f..01f09f241 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-obj.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-obj.js @@ -23,22 +23,24 @@ 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 23; - }); + return 23; +}); p2.then(function(value) { - if (value !== 23) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 23) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); reject(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-thenable.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-thenable.js index 85178a822..61bc8613c 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-non-thenable.js @@ -27,24 +27,28 @@ info: | flags: [async] ---*/ -var nonThenable = { then: null }; +var nonThenable = { + then: null +}; 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 nonThenable; - }); + return nonThenable; +}); p2.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); reject(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-poisoned-then.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-poisoned-then.js index 83e53f804..800d11004 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-poisoned-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-poisoned-then.js @@ -31,22 +31,24 @@ var poisonedThen = Object.defineProperty({}, 'then', { throw value; } }); -var p1 = new Promise(function(_, _reject) { reject = _reject; }); +var p1 = new Promise(function(_, _reject) { + reject = _reject; +}); var p2; p2 = p1.then(function() {}, function() { - return poisonedThen; - }); + return poisonedThen; +}); p2.then(function(x) { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== value) { - $DONE('The promise should be rejected with the thrown exception.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== value) { + $DONE('The promise should be rejected with the thrown exception.'); + return; + } - $DONE(); - }); + $DONE(); +}); reject(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-prms-cstm-then.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-prms-cstm-then.js index 2d4e1c011..d1bbd6737 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-prms-cstm-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-prms-cstm-then.js @@ -31,8 +31,12 @@ flags: [async] var value = {}; var reject; -var thenable = new Promise(function(resolve) { resolve(); }); -var p1 = new Promise(function(_, _reject) { reject = _reject; }); +var thenable = new Promise(function(resolve) { + resolve(); +}); +var p1 = new Promise(function(_, _reject) { + reject = _reject; +}); var p2; thenable.then = function(resolve) { @@ -40,18 +44,18 @@ 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.'); +}); reject(); 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(); diff --git a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-thenable.js b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-thenable.js index 933ce34ec..94cc16e86 100644 --- a/test/built-ins/Promise/prototype/then/resolve-pending-rejected-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-pending-rejected-thenable.js @@ -31,23 +31,27 @@ flags: [async] var value = {}; var reject; -var thenable = new Promise(function(resolve) { resolve(value); }); -var p1 = new Promise(function(_, _reject) { reject = _reject; }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); +var p1 = new Promise(function(_, _reject) { + reject = _reject; +}); var p2; 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; - } + 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.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); reject(); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-obj.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-obj.js index 003d0ee61..f57576ee8 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-obj.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-obj.js @@ -28,20 +28,22 @@ info: | flags: [async] ---*/ -var p1 = new Promise(function(resolve) { resolve(); }); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(function() { - return 23; - }); + return 23; +}); p2.then(function(value) { - if (value !== 23) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 23) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-thenable.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-thenable.js index 484c6f6aa..5065cd131 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-non-thenable.js @@ -33,21 +33,25 @@ info: | flags: [async] ---*/ -var nonThenable = { then: null }; -var p1 = new Promise(function(resolve) { resolve(); }); +var nonThenable = { + then: null +}; +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(function() { - return nonThenable; - }); + return nonThenable; +}); p2.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-poisoned-then.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-poisoned-then.js index 303044a53..8ac375540 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-poisoned-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-poisoned-then.js @@ -36,20 +36,22 @@ var poisonedThen = Object.defineProperty({}, 'then', { throw value; } }); -var p1 = new Promise(function(resolve) { resolve(); }); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(function() { - return poisonedThen; - }); + return poisonedThen; +}); p2.then(function(x) { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== value) { - $DONE('The promise should be rejected with the thrown exception.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== value) { + $DONE('The promise should be rejected with the thrown exception.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-prms-cstm-then.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-prms-cstm-then.js index f3d108dfa..abcea8a24 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-prms-cstm-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-prms-cstm-then.js @@ -36,8 +36,12 @@ flags: [async] ---*/ var value = {}; -var thenable = new Promise(function(resolve) { resolve(); }); -var p1 = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; thenable.then = function(resolve) { @@ -45,16 +49,16 @@ thenable.then = function(resolve) { }; p2 = p1.then(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.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-self.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-self.js index 99f1d05a4..1091fe75d 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-self.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-self.js @@ -30,25 +30,27 @@ info: | flags: [async] ---*/ -var p1 = new Promise(function(resolve) { resolve(); }); +var p1 = new Promise(function(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(); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-thenable.js b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-thenable.js index 0baaa5c0d..98a718bf2 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-fulfilled-thenable.js @@ -36,21 +36,25 @@ flags: [async] ---*/ var value = {}; -var thenable = new Promise(function(resolve) { resolve(value); }); -var p1 = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); +var p1 = new Promise(function(resolve) { + resolve(); +}); var p2; p2 = p1.then(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; - } + 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.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-obj.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-obj.js index 3a8992d39..a4828310a 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-obj.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-obj.js @@ -28,20 +28,22 @@ info: | flags: [async] ---*/ -var p1 = new Promise(function(_, reject) { reject(); }); +var p1 = new Promise(function(_, reject) { + reject(); +}); var p2; p2 = p1.then(function() {}, function() { - return 23; - }); + return 23; +}); p2.then(function(value) { - if (value !== 23) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 23) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-thenable.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-thenable.js index 8e4b424fd..13e72aba0 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-non-thenable.js @@ -33,21 +33,25 @@ info: | flags: [async] ---*/ -var nonThenable = { then: null }; -var p1 = new Promise(function(_, reject) { reject(); }); +var nonThenable = { + then: null +}; +var p1 = new Promise(function(_, reject) { + reject(); +}); var p2; p2 = p1.then(function() {}, function() { - return nonThenable; - }); + return nonThenable; +}); p2.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-poisoned-then.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-poisoned-then.js index 6087049a9..a60f1b10c 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-poisoned-then.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-poisoned-then.js @@ -36,20 +36,22 @@ var poisonedThen = Object.defineProperty({}, 'then', { throw value; } }); -var p1 = new Promise(function(_, reject) { reject(); }); +var p1 = new Promise(function(_, reject) { + reject(); +}); var p2; p2 = p1.then(function() {}, function() { - return poisonedThen; - }); + return poisonedThen; +}); p2.then(function(x) { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== value) { - $DONE('The promise should be rejected with the thrown exception.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== value) { + $DONE('The promise should be rejected with the thrown exception.'); + return; + } - $DONE(); - }); + $DONE(); +}); 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.'); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-self.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-self.js index 877edfc7d..9d7f13693 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-self.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-self.js @@ -30,25 +30,27 @@ info: | flags: [async] ---*/ -var p1 = new Promise(function(_, reject) { reject(); }); +var p1 = new Promise(function(_, 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(); +}); diff --git a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-thenable.js b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-thenable.js index 1a3855254..333bbeb14 100644 --- a/test/built-ins/Promise/prototype/then/resolve-settled-rejected-thenable.js +++ b/test/built-ins/Promise/prototype/then/resolve-settled-rejected-thenable.js @@ -36,21 +36,25 @@ flags: [async] ---*/ var value = {}; -var thenable = new Promise(function(resolve) { resolve(value); }); -var p1 = new Promise(function(_, reject) { reject(); }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); +var p1 = new Promise(function(_, reject) { + reject(); +}); var p2; 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; - } + 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.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js index a956ab8a3..4a9918517 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-nonstrict.js @@ -13,25 +13,25 @@ flags: [async, noStrict] ---*/ var expectedThis = this, - obj = {}; + obj = {}; var p = Promise.resolve(obj).then(function(arg) { - if (this !== expectedThis) { - $DONE("'this' must be global object, got " + this); - return; - } + if (this !== expectedThis) { + $DONE("'this' must be global object, got " + this); + return; + } - if (arg !== obj) { - $DONE("Expected promise to be fulfilled by obj, actually " + arg); - return; - } + if (arg !== obj) { + $DONE("Expected promise to be fulfilled by obj, actually " + arg); + return; + } - if (arguments.length !== 1) { - $DONE('Expected handler function to be called with exactly 1 argument.'); - return; - } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } - $DONE(); + $DONE(); }, function() { $DONE('The promise should not be rejected.'); }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js index e431a2793..c8b9966ed 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-invoke-strict.js @@ -13,25 +13,25 @@ flags: [async, onlyStrict] ---*/ var expectedThis = undefined, - obj = {}; + obj = {}; var p = Promise.resolve(obj).then(function(arg) { - if (this !== expectedThis) { - $DONE("'this' must be undefined, got " + this); - return; - } + if (this !== expectedThis) { + $DONE("'this' must be undefined, got " + this); + return; + } - if (arg !== obj) { - $DONE("Expected promise to be fulfilled by obj, actually " + arg); - return; - } + if (arg !== obj) { + $DONE("Expected promise to be fulfilled by obj, actually " + arg); + return; + } - if (arguments.length !== 1) { - $DONE('Expected handler function to be called with exactly 1 argument.'); - return; - } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } - $DONE(); + $DONE(); }, function() { $DONE('The promise should not be rejected.'); }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next-abrupt.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next-abrupt.js index 9024a896d..992051775 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next-abrupt.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next-abrupt.js @@ -22,24 +22,24 @@ var fulfilledCallCount = 0; var rejectedCallCount = 0; promise.then(function() { - fulfilledCallCount += 1; - throw new Error(); - }, function() { - rejectedCallCount += 1; - }); + fulfilledCallCount += 1; + throw new Error(); +}, function() { + rejectedCallCount += 1; +}); promise.then(function() { - if (fulfilledCallCount !== 1) { - $DONE('Expected "onFulfilled" handler to be invoked exactly once.'); - return; - } + if (fulfilledCallCount !== 1) { + $DONE('Expected "onFulfilled" handler to be invoked exactly once.'); + return; + } - if (rejectedCallCount !== 0) { - $DONE('Expected "onRejected" handler to not be invoked.'); - return; - } + if (rejectedCallCount !== 0) { + $DONE('Expected "onRejected" handler to not be invoked.'); + return; + } - $DONE(); - }, function() { - $DONE('This promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('This promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next.js index a2f763a51..460ee909c 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-next.js @@ -21,33 +21,33 @@ var promise = new Promise(function(resolve) { var log = ''; promise.then(function() { - log += 'a'; - }, function() { - log += 'A'; - }); + log += 'a'; +}, function() { + log += 'A'; +}); promise.then(function() { - log += 'b'; - }, function() { - log += 'B'; - }); + log += 'b'; +}, function() { + log += 'B'; +}); promise.then(function() { - log += 'c'; - }, function() { - log += 'C'; - }); + log += 'c'; +}, function() { + log += 'C'; +}); promise.then(function() { - if (log !== 'abc') { - $DONE( - 'Expected each "onFulfilled" handler to be invoked exactly once in series. ' + - 'Expected: abc. Actual: ' + log - ); - return; - } + if (log !== 'abc') { + $DONE( + 'Expected each "onFulfilled" handler to be invoked exactly once in series. ' + + 'Expected: abc. Actual: ' + log + ); + return; + } - $DONE(); - }, function() { - $DONE('This promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('This promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-abrupt.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-abrupt.js index e0cb6215d..4accef172 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-abrupt.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-abrupt.js @@ -35,16 +35,16 @@ var p1 = new Promise(function(resolve) { var p2; p2 = p1.then(function() { - throw value; - }, function() {}); + throw value; +}, function() {}); p2.then(function() { - $DONE('The `onFulfilled` handler should not be invoked.'); - }, function(x) { - if (x !== value) { - $DONE('The `onRejected` handler should be invoked with the promise result.'); - return; - } + $DONE('The `onFulfilled` handler should not be invoked.'); +}, function(x) { + if (x !== value) { + $DONE('The `onRejected` handler should be invoked with the promise result.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-normal.js b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-normal.js index f75ee39ed..2241de9c7 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-normal.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-fulfilled-return-normal.js @@ -35,16 +35,16 @@ var p1 = new Promise(function(resolve) { var p2; p2 = p1.then(function() { - return value; - }, function() {}); + return value; +}, function() {}); p2.then(function(x) { - if (x !== value) { - $DONE('The `onFulfilled` handler should be invoked with the promise result.'); - return; - } + if (x !== value) { + $DONE('The `onFulfilled` handler should be invoked with the promise result.'); + return; + } - $DONE(); - }, function() { - $DONE('The `onRejected` handler should not be invoked.'); - }); + $DONE(); +}, function() { + $DONE('The `onRejected` handler should not be invoked.'); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-identity.js b/test/built-ins/Promise/prototype/then/rxn-handler-identity.js index de2005b03..24b30c088 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-identity.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-identity.js @@ -12,13 +12,13 @@ flags: [async] var obj = {}; -var p = Promise.resolve(obj).then(/*Identity, Thrower*/) - .then(function (arg) { - if (arg !== obj) { - $DONE("Expected promise to be fulfilled with obj, actually " + arg); - return; - } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); +var p = Promise.resolve(obj).then( /*Identity, Thrower*/ ) + .then(function(arg) { + if (arg !== obj) { + $DONE("Expected promise to be fulfilled with obj, actually " + arg); + return; + } + $DONE(); + }, function() { + $DONE('The promise should not be rejected.'); + }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js index f848a8a2e..e95e55d49 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-nonstrict.js @@ -13,25 +13,25 @@ flags: [async, noStrict] ---*/ var expectedThis = this, - obj = {}; + obj = {}; -var p = Promise.reject(obj).then(function () { - $DONE("Unexpected fulfillment; expected rejection."); +var p = Promise.reject(obj).then(function() { + $DONE("Unexpected fulfillment; expected rejection."); }, function(arg) { - if (this !== expectedThis) { - $DONE("'this' must be global object, got " + this); - return; - } + if (this !== expectedThis) { + $DONE("'this' must be global object, got " + this); + return; + } - if (arg !== obj) { - $DONE("Expected promise to be rejected with obj, actually " + arg); - return; - } + if (arg !== obj) { + $DONE("Expected promise to be rejected with obj, actually " + arg); + return; + } - if (arguments.length !== 1) { - $DONE('Expected handler function to be called with exactly 1 argument.'); - return; - } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } - $DONE(); + $DONE(); }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js index 19cbbc9ec..9842201f5 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-invoke-strict.js @@ -13,25 +13,25 @@ flags: [async, onlyStrict] ---*/ var expectedThis = undefined, - obj = {}; + obj = {}; -var p = Promise.reject(obj).then(function () { - $DONE("Unexpected fulfillment; expected rejection."); +var p = Promise.reject(obj).then(function() { + $DONE("Unexpected fulfillment; expected rejection."); }, function(arg) { - if (this !== expectedThis) { - $DONE("'this' must be undefined, got " + this); - return; - } + if (this !== expectedThis) { + $DONE("'this' must be undefined, got " + this); + return; + } - if (arg !== obj) { - $DONE("Expected promise to be rejected with obj, actually " + arg); - return; - } + if (arg !== obj) { + $DONE("Expected promise to be rejected with obj, actually " + arg); + return; + } - if (arguments.length !== 1) { - $DONE('Expected handler function to be called with exactly 1 argument.'); - return; - } + if (arguments.length !== 1) { + $DONE('Expected handler function to be called with exactly 1 argument.'); + return; + } - $DONE(); + $DONE(); }); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next-abrupt.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next-abrupt.js index 2363577e8..848a88538 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next-abrupt.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next-abrupt.js @@ -22,24 +22,24 @@ var fulfilledCallCount = 0; var rejectedCallCount = 0; promise.then(function() { - fulfilledCallCount += 1; - }, function() { - rejectedCallCount += 1; - throw new Error(); - }); + fulfilledCallCount += 1; +}, function() { + rejectedCallCount += 1; + throw new Error(); +}); promise.then(function() { - $DONE('This promise should not be fulfilled.'); - }, function() { - if (fulfilledCallCount !== 0) { - $DONE('Expected "onFulfilled" handler to not be invoked.'); - return; - } + $DONE('This promise should not be fulfilled.'); +}, function() { + if (fulfilledCallCount !== 0) { + $DONE('Expected "onFulfilled" handler to not be invoked.'); + return; + } - if (rejectedCallCount !== 1) { - $DONE('Expected "onRejected" handler to be invoked exactly once.'); - return; - } + if (rejectedCallCount !== 1) { + $DONE('Expected "onRejected" handler to be invoked exactly once.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next.js index 40ef4bfd6..b1497b0a0 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-next.js @@ -21,33 +21,33 @@ var promise = new Promise(function(_, reject) { var log = ''; promise.then(function() { - log += 'A'; - }, function() { - log += 'a'; - }); + log += 'A'; +}, function() { + log += 'a'; +}); promise.then(function() { - log += 'B'; - }, function() { - log += 'b'; - }); + log += 'B'; +}, function() { + log += 'b'; +}); promise.then(function() { - log += 'C'; - }, function() { - log += 'c'; - }); + log += 'C'; +}, function() { + log += 'c'; +}); promise.then(function() { - $DONE('This promise should not be fulfilled.'); - }, function() { - if (log !== 'abc') { - $DONE( - 'Expected each "onFulfilled" handler to be invoked exactly once in series. ' + - 'Expected: abc. Actual: ' + log - ); - return; - } + $DONE('This promise should not be fulfilled.'); +}, function() { + if (log !== 'abc') { + $DONE( + 'Expected each "onFulfilled" handler to be invoked exactly once in series. ' + + 'Expected: abc. Actual: ' + log + ); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-abrupt.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-abrupt.js index 3588f64dd..fe8054f9a 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-abrupt.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-abrupt.js @@ -35,16 +35,16 @@ var p1 = new Promise(function(_, reject) { var p2; p2 = p1.then(function() {}, function() { - throw value; - }); + throw value; +}); p2.then(function() { - $DONE('The `onFulfilled` handler should not be invoked.'); - }, function(x) { - if (x !== value) { - $DONE('The `onRejected` handler should be invoked with the promise result.'); - return; - } + $DONE('The `onFulfilled` handler should not be invoked.'); +}, function(x) { + if (x !== value) { + $DONE('The `onRejected` handler should be invoked with the promise result.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-normal.js b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-normal.js index 3fe4b09c6..eb70b6e6c 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-normal.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-rejected-return-normal.js @@ -35,16 +35,16 @@ var p1 = new Promise(function(_, reject) { var p2; p2 = p1.then(function() {}, function() { - return value; - }); + return value; +}); p2.then(function(x) { - if (x !== value) { - $DONE('The `onFulfilled` handler should be invoked with the promise result.'); - return; - } + if (x !== value) { + $DONE('The `onFulfilled` handler should be invoked with the promise result.'); + return; + } - $DONE(); - }, function() { - $DONE('The `onRejected` handler should not be invoked.'); - }); + $DONE(); +}, function() { + $DONE('The `onRejected` handler should not be invoked.'); +}); diff --git a/test/built-ins/Promise/prototype/then/rxn-handler-thrower.js b/test/built-ins/Promise/prototype/then/rxn-handler-thrower.js index 217e10e4d..58b185a91 100644 --- a/test/built-ins/Promise/prototype/then/rxn-handler-thrower.js +++ b/test/built-ins/Promise/prototype/then/rxn-handler-thrower.js @@ -12,13 +12,13 @@ flags: [async] var obj = {}; -var p = Promise.reject(obj).then(/*Identity, Thrower*/) - .then(function () { - $DONE("Unexpected fulfillment - promise should reject."); - }, function (arg) { - if (arg !== obj) { - $DONE("Expected reject reason to be obj, actually " + arg); - return; - } - $DONE(); - }); +var p = Promise.reject(obj).then( /*Identity, Thrower*/ ) + .then(function() { + $DONE("Unexpected fulfillment - promise should reject."); + }, function(arg) { + if (arg !== obj) { + $DONE("Expected reject reason to be obj, actually " + arg); + return; + } + $DONE(); + }); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A1.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A1.1_T1.js index b92440669..69102cfbd 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A1.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A1.1_T1.js @@ -9,5 +9,5 @@ description: Promise.race is callable ---*/ if (typeof Promise.race !== "function") { - $ERROR("Expected Promise.race to be a function, actually " + typeof Promise.race); + $ERROR("Expected Promise.race to be a function, actually " + typeof Promise.race); } diff --git a/test/built-ins/Promise/race/S25.4.4.3_A2.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A2.1_T1.js index a3b3fd963..2e14c7ead 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A2.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A2.1_T1.js @@ -11,5 +11,5 @@ description: Promise.race returns a new promise var p = Promise.race([]); if (!(p instanceof Promise)) { - $ERROR("Expected Promise.race([]) to return a promise."); + $ERROR("Expected Promise.race([]) to return a promise."); } diff --git a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T1.js index 87a7c610a..d53b5da14 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T1.js @@ -11,11 +11,10 @@ flags: [async] var nonIterable = 3; -Promise.race(nonIterable).then(function () { - $ERROR('Promise unexpectedly fulfilled: Promise.race(nonIterable) should throw TypeError'); -}, function (err) { - if (!(err instanceof TypeError)) { - $ERROR('Expected TypeError, got ' + err); - } +Promise.race(nonIterable).then(function() { + $ERROR('Promise unexpectedly fulfilled: Promise.race(nonIterable) should throw TypeError'); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR('Expected TypeError, got ' + err); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T2.js b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T2.js index cca930722..18da6d071 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T2.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T2.js @@ -9,11 +9,10 @@ description: Promise.race rejects if argument is not object or is non-iterable flags: [async] ---*/ -Promise.race(new Error("abrupt")).then(function () { - $ERROR('Promise unexpectedly resolved: Promise.race(abruptCompletion) should throw TypeError'); -}, function (err) { - if (!(err instanceof TypeError)) { - $ERROR('Expected TypeError, got ' + err); - } +Promise.race(new Error("abrupt")).then(function() { + $ERROR('Promise unexpectedly resolved: Promise.race(abruptCompletion) should throw TypeError'); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR('Expected TypeError, got ' + err); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T3.js b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T3.js index d8aa443f9..790c51a75 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A2.2_T3.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A2.2_T3.js @@ -15,16 +15,15 @@ flags: [async] var iterThrows = {}; Object.defineProperty(iterThrows, Symbol.iterator, { - get: function () { - throw new Error("abrupt completion"); - } + get: function() { + throw new Error("abrupt completion"); + } }); -Promise.race(iterThrows).then(function () { - $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw'); -}, function (err) { - if (!(err instanceof Error)) { - $ERROR('Expected Promise to be rejected with an error, got ' + err); - } +Promise.race(iterThrows).then(function() { + $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw'); +}, function(err) { + if (!(err instanceof Error)) { + $ERROR('Expected Promise to be rejected with an error, got ' + err); + } }).then($DONE, $DONE); - diff --git a/test/built-ins/Promise/race/S25.4.4.3_A3.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A3.1_T1.js index 21b3a098d..b3d90e6fc 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A3.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A3.1_T1.js @@ -11,8 +11,7 @@ author: Sam Mikes description: Promise.race throws if 'this' does not conform to Promise constructor ---*/ -function ZeroArgConstructor() { -} +function ZeroArgConstructor() {} assert.throws(TypeError, function() { Promise.race.call(ZeroArgConstructor, [3]); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A3.1_T2.js b/test/built-ins/Promise/race/S25.4.4.3_A3.1_T2.js index e16e02a03..07c20f570 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A3.1_T2.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A3.1_T2.js @@ -11,7 +11,9 @@ author: Sam Mikes description: Promise.race throws TypeError, even on empty array, when 'this' does not conform to Promise constructor ---*/ -function BadPromiseConstructor(f) { f(undefined, undefined); } +function BadPromiseConstructor(f) { + f(undefined, undefined); +} assert.throws(TypeError, function() { Promise.race.call(BadPromiseConstructor, []); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A4.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A4.1_T1.js index a325a995b..95dde51bd 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A4.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A4.1_T1.js @@ -11,17 +11,16 @@ flags: [async] var iterThrows = {}; var error = new Test262Error(); -iterThrows[Symbol.iterator] = function () { - return { - next: function () { - throw error; - } - }; +iterThrows[Symbol.iterator] = function() { + return { + next: function() { + throw error; + } + }; }; -Promise.race(iterThrows).then(function () { - $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError'); -}, function (reason) { - assert.sameValue(reason, error); -}).then($DONE,$DONE); - +Promise.race(iterThrows).then(function() { + $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError'); +}, function(reason) { + assert.sameValue(reason, error); +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A4.1_T2.js b/test/built-ins/Promise/race/S25.4.4.3_A4.1_T2.js index 00ac77d1b..cb8912b97 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A4.1_T2.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A4.1_T2.js @@ -11,26 +11,25 @@ flags: [async] var iterThrows = {}; Object.defineProperty(iterThrows, Symbol.iterator, { - get: function () { - return { - next: function () { - var v = {}; - Object.defineProperty(v, 'value', { - get: function () { - throw new Error("abrupt completion"); - } - }); - return v; - } - }; - } + get: function() { + return { + next: function() { + var v = {}; + Object.defineProperty(v, 'value', { + get: function() { + throw new Error("abrupt completion"); + } + }); + return v; + } + }; + } }); -Promise.race(iterThrows).then(function () { - $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError'); -},function (err) { - if (!(err instanceof TypeError)) { - $ERROR('Expected TypeError, got ' + err); - } -}).then($DONE,$DONE); - +Promise.race(iterThrows).then(function() { + $ERROR('Promise unexpectedly fulfilled: Promise.race(iterThrows) should throw TypeError'); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR('Expected TypeError, got ' + err); + } +}).then($DONE, $DONE); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A5.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A5.1_T1.js index e5b7526fd..2093f8bee 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A5.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A5.1_T1.js @@ -10,10 +10,10 @@ flags: [async] var p = Promise.race([]); -p.then(function () { - $ERROR("Never settles."); -}, function () { - $ERROR("Never settles."); +p.then(function() { + $ERROR("Never settles."); +}, function() { + $ERROR("Never settles."); }).then($DONE, $DONE); // use three 'then's to allow above to settle diff --git a/test/built-ins/Promise/race/S25.4.4.3_A6.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A6.1_T1.js index 90c46e37e..81d6152a4 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A6.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A6.1_T1.js @@ -15,17 +15,17 @@ var p = Promise.race([1]); sequence.push(1); -p.then(function () { - sequence.push(4); - checkSequence(sequence, "This happens second"); +p.then(function() { + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A6.2_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A6.2_T1.js index b28ccdb51..c3e0364b3 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A6.2_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A6.2_T1.js @@ -12,23 +12,23 @@ flags: [async] var sequence = []; var p1 = Promise.reject(1), - p = Promise.race([p1]); + p = Promise.race([p1]); sequence.push(1); -p.then(function () { - $ERROR("Should not fulfill."); -}, function () { - sequence.push(4); - checkSequence(sequence, "This happens second"); +p.then(function() { + $ERROR("Should not fulfill."); +}, function() { + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T1.js index 517df57b3..ada1fba26 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T1.js @@ -12,26 +12,26 @@ flags: [async] var sequence = []; var p1 = Promise.resolve(1), - p2 = Promise.resolve(2), - p = Promise.race([p1, p2]); + p2 = Promise.resolve(2), + p = Promise.race([p1, p2]); sequence.push(1); -p.then(function (arg) { - if (arg !== 1) { - $ERROR("Expected promise to be fulfilled with 1, got " + arg); - } +p.then(function(arg) { + if (arg !== 1) { + $ERROR("Expected promise to be fulfilled with 1, got " + arg); + } - sequence.push(4); - checkSequence(sequence, "This happens second"); + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T2.js b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T2.js index f0f12a4e5..2b2dbc962 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T2.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T2.js @@ -12,26 +12,26 @@ flags: [async] var sequence = []; var p1 = Promise.resolve(1), - p2 = new Promise(function () {}), - p = Promise.race([p1, p2]); + p2 = new Promise(function() {}), + p = Promise.race([p1, p2]); sequence.push(1); -p.then(function (arg) { - if (arg !== 1) { - $ERROR("Expected promise to be fulfilled with 1, got " + arg); - } +p.then(function(arg) { + if (arg !== 1) { + $ERROR("Expected promise to be fulfilled with 1, got " + arg); + } - sequence.push(4); - checkSequence(sequence, "This happens second"); + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T3.js b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T3.js index 7e0f286c8..4e03609a1 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.1_T3.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.1_T3.js @@ -11,27 +11,27 @@ flags: [async] var sequence = []; -var p1 = new Promise(function () {}), - p2 = Promise.resolve(2), - p = Promise.race([p1, p2]); +var p1 = new Promise(function() {}), + p2 = Promise.resolve(2), + p = Promise.race([p1, p2]); sequence.push(1); -p.then(function (arg) { - if (arg !== 2) { - $ERROR("Expected promise to be fulfilled with 2, got " + arg); - } +p.then(function(arg) { + if (arg !== 2) { + $ERROR("Expected promise to be fulfilled with 2, got " + arg); + } - sequence.push(4); - checkSequence(sequence, "This happens second"); + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.2_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A7.2_T1.js index 3f24b602d..2f9d3cb67 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.2_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.2_T1.js @@ -12,28 +12,28 @@ flags: [async] var sequence = []; var p1 = Promise.reject(1), - p2 = Promise.resolve(2), - p = Promise.race([p1, p2]); + p2 = Promise.resolve(2), + p = Promise.race([p1, p2]); sequence.push(1); -p.then(function () { - $ERROR("Should not be fulfilled - expected rejection."); -}, function (arg) { - if (arg !== 1) { - $ERROR("Expected rejection reason to be 1, got " + arg); - } +p.then(function() { + $ERROR("Should not be fulfilled - expected rejection."); +}, function(arg) { + if (arg !== 1) { + $ERROR("Expected rejection reason to be 1, got " + arg); + } - sequence.push(4); - checkSequence(sequence, "This happens second"); + sequence.push(4); + checkSequence(sequence, "This happens second"); }).catch($DONE); -Promise.resolve().then(function () { - sequence.push(3); - checkSequence(sequence, "This happens first"); -}).then(function () { - sequence.push(5); - checkSequence(sequence, "This happens third"); +Promise.resolve().then(function() { + sequence.push(3); + checkSequence(sequence, "This happens first"); +}).then(function() { + sequence.push(5); + checkSequence(sequence, "This happens third"); }).then($DONE, $DONE); sequence.push(2); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.3_T1.js b/test/built-ins/Promise/race/S25.4.4.3_A7.3_T1.js index 02dad7f9d..7628a4664 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.3_T1.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.3_T1.js @@ -9,14 +9,18 @@ flags: [async] ---*/ var resolveP1, rejectP2, - p1 = new Promise(function (resolve) { resolveP1 = resolve; }), - p2 = new Promise(function (resolve, reject) { rejectP2 = reject; }); + p1 = new Promise(function(resolve) { + resolveP1 = resolve; + }), + p2 = new Promise(function(resolve, reject) { + rejectP2 = reject; + }); rejectP2(new Error("Promise.race should not see this if P1 already resolved")); resolveP1(1); -Promise.race([p1, p2]).then(function (arg) { - if (arg !== 1) { - $ERROR("Expected fulfillment with 1, got " + arg); - } +Promise.race([p1, p2]).then(function(arg) { + if (arg !== 1) { + $ERROR("Expected fulfillment with 1, got " + arg); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/race/S25.4.4.3_A7.3_T2.js b/test/built-ins/Promise/race/S25.4.4.3_A7.3_T2.js index 535116ea1..91803cce5 100644 --- a/test/built-ins/Promise/race/S25.4.4.3_A7.3_T2.js +++ b/test/built-ins/Promise/race/S25.4.4.3_A7.3_T2.js @@ -9,17 +9,20 @@ flags: [async] ---*/ var resolveP1, rejectP2, - p1 = new Promise(function (resolve) { resolveP1 = resolve; }), - p2 = new Promise(function (resolve, reject) { rejectP2 = reject; }); + p1 = new Promise(function(resolve) { + resolveP1 = resolve; + }), + p2 = new Promise(function(resolve, reject) { + rejectP2 = reject; + }); -Promise.race([p1, p2]).then(function () { - $ERROR("Should not be fulfilled: expected rejection."); -}, function (arg) { - if (arg !== 2) { - $ERROR("Expected rejection reason to be 2, got " + arg); - } +Promise.race([p1, p2]).then(function() { + $ERROR("Should not be fulfilled: expected rejection."); +}, function(arg) { + if (arg !== 2) { + $ERROR("Expected rejection reason to be 2, got " + arg); + } }).then($DONE, $DONE); rejectP2(2); resolveP1(1); - diff --git a/test/built-ins/Promise/race/capability-executor-called-twice.js b/test/built-ins/Promise/race/capability-executor-called-twice.js index 7e21ce01e..652f3201c 100644 --- a/test/built-ins/Promise/race/capability-executor-called-twice.js +++ b/test/built-ins/Promise/race/capability-executor-called-twice.js @@ -27,7 +27,7 @@ Promise.race.call(function(executor) { checkPoint += "a"; executor(); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); assert.sameValue(checkPoint, "abc", "executor initially called with no arguments"); @@ -37,7 +37,7 @@ Promise.race.call(function(executor) { checkPoint += "a"; executor(undefined, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); assert.sameValue(checkPoint, "abc", "executor initially called with (undefined, undefined)"); @@ -46,9 +46,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.race.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (undefined, function)"); @@ -58,9 +58,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.race.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (function, undefined)"); @@ -72,7 +72,7 @@ assert.throws(TypeError, function() { checkPoint += "a"; executor("invalid value", 123); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, []); }, "executor initially called with (String, Number)"); diff --git a/test/built-ins/Promise/race/capability-executor-not-callable.js b/test/built-ins/Promise/race/capability-executor-not-callable.js index be31cf297..ae52d9c10 100644 --- a/test/built-ins/Promise/race/capability-executor-not-callable.js +++ b/test/built-ins/Promise/race/capability-executor-not-callable.js @@ -56,7 +56,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.race.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; }, []); }, "executor called with (undefined, function)"); @@ -66,7 +66,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.race.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; }, []); }, "executor called with (function, undefined)"); diff --git a/test/built-ins/Promise/race/invoke-resolve-error-close.js b/test/built-ins/Promise/race/invoke-resolve-error-close.js index 36651be4e..df90989cb 100644 --- a/test/built-ins/Promise/race/invoke-resolve-error-close.js +++ b/test/built-ins/Promise/race/invoke-resolve-error-close.js @@ -29,7 +29,10 @@ var returnCount = 0; iterDoneSpy[Symbol.iterator] = function() { return { next: function() { - return { value: null, done: false }; + return { + value: null, + done: false + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/race/invoke-resolve-get-error-close.js b/test/built-ins/Promise/race/invoke-resolve-get-error-close.js index d2958b5b3..cc874421c 100644 --- a/test/built-ins/Promise/race/invoke-resolve-get-error-close.js +++ b/test/built-ins/Promise/race/invoke-resolve-get-error-close.js @@ -29,7 +29,9 @@ var returnCount = 0; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false }; + return { + done: false + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/race/invoke-then-error-close.js b/test/built-ins/Promise/race/invoke-then-error-close.js index a9df84f49..07d80abab 100644 --- a/test/built-ins/Promise/race/invoke-then-error-close.js +++ b/test/built-ins/Promise/race/invoke-then-error-close.js @@ -31,7 +31,10 @@ var returnCount = 0; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false, value: promise }; + return { + done: false, + value: promise + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/race/invoke-then-get-error-close.js b/test/built-ins/Promise/race/invoke-then-get-error-close.js index 93f095ee2..9dbb52017 100644 --- a/test/built-ins/Promise/race/invoke-then-get-error-close.js +++ b/test/built-ins/Promise/race/invoke-then-get-error-close.js @@ -30,7 +30,10 @@ var returnCount = 0; iter[Symbol.iterator] = function() { return { next: function() { - return { done: false, value: promise }; + return { + done: false, + value: promise + }; }, return: function() { returnCount += 1; diff --git a/test/built-ins/Promise/race/reject-deferred.js b/test/built-ins/Promise/race/reject-deferred.js index 59f891510..c7e321a36 100644 --- a/test/built-ins/Promise/race/reject-deferred.js +++ b/test/built-ins/Promise/race/reject-deferred.js @@ -24,7 +24,9 @@ flags: [async] var thenable = { then: function(_, reject) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { reject(); }); diff --git a/test/built-ins/Promise/race/reject-ignored-deferred.js b/test/built-ins/Promise/race/reject-ignored-deferred.js index c64b70da4..43df80e3f 100644 --- a/test/built-ins/Promise/race/reject-ignored-deferred.js +++ b/test/built-ins/Promise/race/reject-ignored-deferred.js @@ -29,7 +29,9 @@ flags: [async] var fulfiller = { then: function(resolve) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { resolve(); }); @@ -37,7 +39,9 @@ var fulfiller = { }; var rejector = { then: function(_, reject) { - new Promise(function(resolve) { resolve(); }) + new Promise(function(resolve) { + resolve(); + }) .then(function() { reject(); }); diff --git a/test/built-ins/Promise/race/resolve-prms-cstm-then.js b/test/built-ins/Promise/race/resolve-prms-cstm-then.js index 238785a50..07c6317a2 100644 --- a/test/built-ins/Promise/race/resolve-prms-cstm-then.js +++ b/test/built-ins/Promise/race/resolve-prms-cstm-then.js @@ -35,7 +35,9 @@ var thenableValue = { resolve(value); } }; -var thenable = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); thenable.then = function(resolve) { resolve(thenableValue); diff --git a/test/built-ins/Promise/race/resolve-self.js b/test/built-ins/Promise/race/resolve-self.js index 6fc2a3820..565bc94e5 100644 --- a/test/built-ins/Promise/race/resolve-self.js +++ b/test/built-ins/Promise/race/resolve-self.js @@ -33,7 +33,9 @@ var thenable = { }; try { - Promise.resolve = function(v) { return v; }; + Promise.resolve = function(v) { + return v; + }; self = Promise.race([thenable]); } finally { Promise.resolve = builtinResolve; @@ -42,15 +44,15 @@ try { resolve(self); self.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(value) { - if (!value) { - $DONE('The promise should be rejected with a value.'); - return; - } - if (value.constructor !== TypeError) { - $DONE('The promise should be rejected with a TypeError instance.'); - return; - } - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}, function(value) { + if (!value) { + $DONE('The promise should be rejected with a value.'); + return; + } + if (value.constructor !== TypeError) { + $DONE('The promise should be rejected with a TypeError instance.'); + return; + } + $DONE(); +}); diff --git a/test/built-ins/Promise/race/same-reject-function.js b/test/built-ins/Promise/race/same-reject-function.js index dbcdf7c5b..b67e4ff41 100644 --- a/test/built-ins/Promise/race/same-reject-function.js +++ b/test/built-ins/Promise/race/same-reject-function.js @@ -13,14 +13,17 @@ info: | ... ---*/ -function rejectFunction() { } +function rejectFunction() {} function Constructor(executor) { executor($ERROR, rejectFunction); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; -var callCount1 = 0, callCount2 = 0; +var callCount1 = 0, + callCount2 = 0; var p1 = { then: function(onFulfilled, onRejected) { diff --git a/test/built-ins/Promise/race/same-resolve-function.js b/test/built-ins/Promise/race/same-resolve-function.js index b20ee7242..10b6bfec6 100644 --- a/test/built-ins/Promise/race/same-resolve-function.js +++ b/test/built-ins/Promise/race/same-resolve-function.js @@ -13,14 +13,17 @@ info: | ... ---*/ -function resolveFunction() { } +function resolveFunction() {} function Constructor(executor) { executor(resolveFunction, $ERROR); } -Constructor.resolve = function(v) { return v; }; +Constructor.resolve = function(v) { + return v; +}; -var callCount1 = 0, callCount2 = 0; +var callCount1 = 0, + callCount2 = 0; var p1 = { then: function(onFulfilled, onRejected) { diff --git a/test/built-ins/Promise/race/species-get-error.js b/test/built-ins/Promise/race/species-get-error.js index 26e2fd039..b32fd7ef4 100644 --- a/test/built-ins/Promise/race/species-get-error.js +++ b/test/built-ins/Promise/race/species-get-error.js @@ -14,7 +14,7 @@ features: [Symbol.species] ---*/ function C(executor) { - executor(function(){}, function(){}); + executor(function() {}, function() {}); } Object.defineProperty(C, Symbol.species, { get: function() { diff --git a/test/built-ins/Promise/reject-function-nonconstructor.js b/test/built-ins/Promise/reject-function-nonconstructor.js index 752a7c9e1..cf77ab828 100644 --- a/test/built-ins/Promise/reject-function-nonconstructor.js +++ b/test/built-ins/Promise/reject-function-nonconstructor.js @@ -17,4 +17,6 @@ new Promise(function(resolve, reject) { }); assert.sameValue(Object.prototype.hasOwnProperty.call(rejectFunction, "prototype"), false); -assert.throws(TypeError, function() { new rejectFunction(); }); +assert.throws(TypeError, function() { + new rejectFunction(); +}); diff --git a/test/built-ins/Promise/reject-ignored-via-abrupt.js b/test/built-ins/Promise/reject-ignored-via-abrupt.js index 3e0855acf..9e5a978b4 100644 --- a/test/built-ins/Promise/reject-ignored-via-abrupt.js +++ b/test/built-ins/Promise/reject-ignored-via-abrupt.js @@ -28,7 +28,7 @@ var p = new Promise(function(resolve) { }); p.then(function() { - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/reject-ignored-via-fn-deferred.js b/test/built-ins/Promise/reject-ignored-via-fn-deferred.js index 90cdaaa5c..b272e50f0 100644 --- a/test/built-ins/Promise/reject-ignored-via-fn-deferred.js +++ b/test/built-ins/Promise/reject-ignored-via-fn-deferred.js @@ -30,10 +30,10 @@ var p = new Promise(function(_resolve, _reject) { }); p.then(function() { - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); resolve(); returnValue = reject(thenable); diff --git a/test/built-ins/Promise/reject-ignored-via-fn-immed.js b/test/built-ins/Promise/reject-ignored-via-fn-immed.js index 118c0b448..d9a5018af 100644 --- a/test/built-ins/Promise/reject-ignored-via-fn-immed.js +++ b/test/built-ins/Promise/reject-ignored-via-fn-immed.js @@ -31,7 +31,7 @@ var p = new Promise(function(resolve, reject) { assert.sameValue(returnValue, undefined, '"reject" function return value'); p.then(function() { - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/reject-via-abrupt-queue.js b/test/built-ins/Promise/reject-via-abrupt-queue.js index b4a6e556a..c4194c4a8 100644 --- a/test/built-ins/Promise/reject-via-abrupt-queue.js +++ b/test/built-ins/Promise/reject-via-abrupt-queue.js @@ -42,13 +42,13 @@ var p = new Promise(function() { }); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }).then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}).then(function() { + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } + $DONE(); +}); diff --git a/test/built-ins/Promise/reject-via-abrupt.js b/test/built-ins/Promise/reject-via-abrupt.js index 71be43108..c51a6f177 100644 --- a/test/built-ins/Promise/reject-via-abrupt.js +++ b/test/built-ins/Promise/reject-via-abrupt.js @@ -25,12 +25,12 @@ var p = new Promise(function() { }); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/reject-via-fn-deferred-queue.js b/test/built-ins/Promise/reject-via-fn-deferred-queue.js index 9bd28ff33..12bdde783 100644 --- a/test/built-ins/Promise/reject-via-fn-deferred-queue.js +++ b/test/built-ins/Promise/reject-via-fn-deferred-queue.js @@ -45,17 +45,17 @@ var p = new Promise(function(_, _reject) { }); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }).then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } - - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}).then(function() { + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } + + $DONE(); +}); returnValue = reject(thenable); diff --git a/test/built-ins/Promise/reject-via-fn-deferred.js b/test/built-ins/Promise/reject-via-fn-deferred.js index 24333fb0f..1d1576a1c 100644 --- a/test/built-ins/Promise/reject-via-fn-deferred.js +++ b/test/built-ins/Promise/reject-via-fn-deferred.js @@ -25,15 +25,15 @@ var p = new Promise(function(_, _reject) { }); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } - $DONE(); - }); + $DONE(); +}); returnValue = reject(thenable); diff --git a/test/built-ins/Promise/reject-via-fn-immed-queue.js b/test/built-ins/Promise/reject-via-fn-immed-queue.js index 3c83ea5ca..e48cbe002 100644 --- a/test/built-ins/Promise/reject-via-fn-immed-queue.js +++ b/test/built-ins/Promise/reject-via-fn-immed-queue.js @@ -46,14 +46,14 @@ var p = new Promise(function(_, reject) { assert.sameValue(returnValue, undefined, '"reject" function return value'); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }).then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } - - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}).then(function() { + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } + + $DONE(); +}); diff --git a/test/built-ins/Promise/reject-via-fn-immed.js b/test/built-ins/Promise/reject-via-fn-immed.js index eec1b98df..90573149a 100644 --- a/test/built-ins/Promise/reject-via-fn-immed.js +++ b/test/built-ins/Promise/reject-via-fn-immed.js @@ -26,12 +26,12 @@ var p = new Promise(function(_, reject) { assert.sameValue(returnValue, undefined, '"reject" function return value'); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(x) { - if (x !== thenable) { - $DONE('The promise should be rejected with the resolution value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(x) { + if (x !== thenable) { + $DONE('The promise should be rejected with the resolution value.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/reject/S25.4.4.4_A1.1_T1.js b/test/built-ins/Promise/reject/S25.4.4.4_A1.1_T1.js index 95decca57..469656417 100644 --- a/test/built-ins/Promise/reject/S25.4.4.4_A1.1_T1.js +++ b/test/built-ins/Promise/reject/S25.4.4.4_A1.1_T1.js @@ -10,5 +10,5 @@ description: Promise.reject is a function ---*/ if ((typeof Promise.reject) !== "function") { - $ERROR("Expected Promise.reject to be a function"); + $ERROR("Expected Promise.reject to be a function"); } diff --git a/test/built-ins/Promise/reject/S25.4.4.4_A2.1_T1.js b/test/built-ins/Promise/reject/S25.4.4.4_A2.1_T1.js index 6bd6b5f9f..cf83e8bcf 100644 --- a/test/built-ins/Promise/reject/S25.4.4.4_A2.1_T1.js +++ b/test/built-ins/Promise/reject/S25.4.4.4_A2.1_T1.js @@ -19,13 +19,13 @@ flags: [async] var p = Promise.reject(3); if (!(p instanceof Promise)) { - $ERROR("Expected Promise.reject to return a promise."); + $ERROR("Expected Promise.reject to return a promise."); } -p.then(function () { - $ERROR("Promise should not be fulfilled."); -}, function (arg) { - if (arg !== 3) { - $ERROR("Expected promise to be rejected with supplied arg, got " + arg); - } +p.then(function() { + $ERROR("Promise should not be fulfilled."); +}, function(arg) { + if (arg !== 3) { + $ERROR("Expected promise to be rejected with supplied arg, got " + arg); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/reject/S25.4.4.4_A3.1_T1.js b/test/built-ins/Promise/reject/S25.4.4.4_A3.1_T1.js index 47fb6d93a..0f9fdc394 100644 --- a/test/built-ins/Promise/reject/S25.4.4.4_A3.1_T1.js +++ b/test/built-ins/Promise/reject/S25.4.4.4_A3.1_T1.js @@ -9,8 +9,7 @@ author: Sam Mikes description: Promise.reject throws TypeError for bad 'this' ---*/ -function ZeroArgConstructor() { -} +function ZeroArgConstructor() {} assert.throws(TypeError, function() { Promise.reject.call(ZeroArgConstructor, 4); diff --git a/test/built-ins/Promise/reject/capability-executor-called-twice.js b/test/built-ins/Promise/reject/capability-executor-called-twice.js index 0fc52baa2..f1632f40f 100644 --- a/test/built-ins/Promise/reject/capability-executor-called-twice.js +++ b/test/built-ins/Promise/reject/capability-executor-called-twice.js @@ -27,7 +27,7 @@ Promise.reject.call(function(executor) { checkPoint += "a"; executor(); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); assert.sameValue(checkPoint, "abc", "executor initially called with no arguments"); @@ -37,7 +37,7 @@ Promise.reject.call(function(executor) { checkPoint += "a"; executor(undefined, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); assert.sameValue(checkPoint, "abc", "executor initially called with (undefined, undefined)"); @@ -46,9 +46,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.reject.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (undefined, function)"); @@ -58,9 +58,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.reject.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (function, undefined)"); @@ -72,7 +72,7 @@ assert.throws(TypeError, function() { checkPoint += "a"; executor("invalid value", 123); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (String, Number)"); diff --git a/test/built-ins/Promise/reject/capability-executor-not-callable.js b/test/built-ins/Promise/reject/capability-executor-not-callable.js index 8aa286ba8..42e0978e7 100644 --- a/test/built-ins/Promise/reject/capability-executor-not-callable.js +++ b/test/built-ins/Promise/reject/capability-executor-not-callable.js @@ -56,7 +56,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.reject.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; }, {}); }, "executor called with (undefined, function)"); @@ -66,7 +66,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.reject.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; }, {}); }, "executor called with (function, undefined)"); diff --git a/test/built-ins/Promise/reject/capability-invocation.js b/test/built-ins/Promise/reject/capability-invocation.js index 3a9c6891a..9fc397676 100644 --- a/test/built-ins/Promise/reject/capability-invocation.js +++ b/test/built-ins/Promise/reject/capability-invocation.js @@ -17,7 +17,9 @@ info: | 7. ReturnIfAbrupt(promise). ---*/ -var expectedThis = (function() { return this; })(); +var expectedThis = (function() { + return this; +})(); var resolveCount = 0; var thisValue, args; var P = function(executor) { diff --git a/test/built-ins/Promise/resolve-function-nonconstructor.js b/test/built-ins/Promise/resolve-function-nonconstructor.js index 32e89382a..5603b8010 100644 --- a/test/built-ins/Promise/resolve-function-nonconstructor.js +++ b/test/built-ins/Promise/resolve-function-nonconstructor.js @@ -17,4 +17,6 @@ new Promise(function(resolve, reject) { }); assert.sameValue(Object.prototype.hasOwnProperty.call(resolveFunction, "prototype"), false); -assert.throws(TypeError, function() { new resolveFunction(); }); +assert.throws(TypeError, function() { + new resolveFunction(); +}); diff --git a/test/built-ins/Promise/resolve-ignored-via-fn-deferred.js b/test/built-ins/Promise/resolve-ignored-via-fn-deferred.js index 8bdd314e4..a78396daf 100644 --- a/test/built-ins/Promise/resolve-ignored-via-fn-deferred.js +++ b/test/built-ins/Promise/resolve-ignored-via-fn-deferred.js @@ -31,10 +31,10 @@ var p = new Promise(function(_resolve, _reject) { }); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function() { - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}, function() { + $DONE(); +}); reject(thenable); returnValue = resolve(); diff --git a/test/built-ins/Promise/resolve-ignored-via-fn-immed.js b/test/built-ins/Promise/resolve-ignored-via-fn-immed.js index 2b5cafbf8..7c5eefb26 100644 --- a/test/built-ins/Promise/resolve-ignored-via-fn-immed.js +++ b/test/built-ins/Promise/resolve-ignored-via-fn-immed.js @@ -32,7 +32,7 @@ var p = new Promise(function(resolve, reject) { assert.sameValue(returnValue, undefined, '"reject" function return value'); p.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function() { - $DONE(); - }); + $DONE('The promise should not be fulfilled.'); +}, function() { + $DONE(); +}); diff --git a/test/built-ins/Promise/resolve-non-obj-deferred.js b/test/built-ins/Promise/resolve-non-obj-deferred.js index 4cd93b663..36a380b0e 100644 --- a/test/built-ins/Promise/resolve-non-obj-deferred.js +++ b/test/built-ins/Promise/resolve-non-obj-deferred.js @@ -23,15 +23,15 @@ var promise = new Promise(function(_resolve) { }); promise.then(function(value) { - if (value !== 45) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 45) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); returnValue = resolve(45); diff --git a/test/built-ins/Promise/resolve-non-obj-immed.js b/test/built-ins/Promise/resolve-non-obj-immed.js index b9400d266..3bb74c10b 100644 --- a/test/built-ins/Promise/resolve-non-obj-immed.js +++ b/test/built-ins/Promise/resolve-non-obj-immed.js @@ -23,12 +23,12 @@ var promise = new Promise(function(resolve) { assert.sameValue(returnValue, undefined, '"resolve" return value'); promise.then(function(value) { - if (value !== 45) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 45) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve-non-thenable-deferred.js b/test/built-ins/Promise/resolve-non-thenable-deferred.js index d39c04bbe..e760edb11 100644 --- a/test/built-ins/Promise/resolve-non-thenable-deferred.js +++ b/test/built-ins/Promise/resolve-non-thenable-deferred.js @@ -22,22 +22,24 @@ flags: [async] ---*/ var returnValue = null; -var nonThenable = { then: null }; +var nonThenable = { + then: null +}; var resolve; var promise = new Promise(function(_resolve) { resolve = _resolve; }); promise.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); returnValue = resolve(nonThenable); diff --git a/test/built-ins/Promise/resolve-non-thenable-immed.js b/test/built-ins/Promise/resolve-non-thenable-immed.js index 5f7b13b67..1c2463a8b 100644 --- a/test/built-ins/Promise/resolve-non-thenable-immed.js +++ b/test/built-ins/Promise/resolve-non-thenable-immed.js @@ -22,7 +22,9 @@ flags: [async] ---*/ var returnValue = null; -var nonThenable = { then: null }; +var nonThenable = { + then: null +}; var promise = new Promise(function(resolve) { returnValue = resolve(nonThenable); }); @@ -30,12 +32,12 @@ var promise = new Promise(function(resolve) { assert.sameValue(returnValue, undefined, '"resolve" return value'); promise.then(function(value) { - if (value !== nonThenable) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== nonThenable) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve-poisoned-then-deferred.js b/test/built-ins/Promise/resolve-poisoned-then-deferred.js index ad3239355..2b2a3419b 100644 --- a/test/built-ins/Promise/resolve-poisoned-then-deferred.js +++ b/test/built-ins/Promise/resolve-poisoned-then-deferred.js @@ -30,15 +30,15 @@ var promise = new Promise(function(_resolve) { }); promise.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(val) { + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }); + $DONE(); +}); returnValue = resolve(poisonedThen); diff --git a/test/built-ins/Promise/resolve-poisoned-then-immed.js b/test/built-ins/Promise/resolve-poisoned-then-immed.js index 22658f20a..cb7d4c29c 100644 --- a/test/built-ins/Promise/resolve-poisoned-then-immed.js +++ b/test/built-ins/Promise/resolve-poisoned-then-immed.js @@ -31,12 +31,12 @@ var promise = new Promise(function(resolve) { assert.sameValue(returnValue, undefined, '"resolve" return value'); promise.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(val) { + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/resolve-prms-cstm-then-deferred.js b/test/built-ins/Promise/resolve-prms-cstm-then-deferred.js index d167f2a8e..542df5b65 100644 --- a/test/built-ins/Promise/resolve-prms-cstm-then-deferred.js +++ b/test/built-ins/Promise/resolve-prms-cstm-then-deferred.js @@ -27,7 +27,9 @@ flags: [async] var returnValue = null; var value = {}; var resolve; -var thenable = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); var promise = new Promise(function(_resolve) { resolve = _resolve; }); @@ -37,15 +39,15 @@ thenable.then = function(resolve) { }; promise.then(function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); returnValue = resolve(thenable); diff --git a/test/built-ins/Promise/resolve-prms-cstm-then-immed.js b/test/built-ins/Promise/resolve-prms-cstm-then-immed.js index bc292a8c4..3936c9700 100644 --- a/test/built-ins/Promise/resolve-prms-cstm-then-immed.js +++ b/test/built-ins/Promise/resolve-prms-cstm-then-immed.js @@ -27,7 +27,9 @@ flags: [async] var returnValue = null; var value = {}; var lateCallCount = 0; -var thenable = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); thenable.then = function(resolve) { resolve(value); @@ -44,16 +46,16 @@ thenable.then = function() { }; promise.then(function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } - - if (lateCallCount > 0) { - $DONE('The `then` method should be executed synchronously.'); - } - - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } + + if (lateCallCount > 0) { + $DONE('The `then` method should be executed synchronously.'); + } + + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve-self.js b/test/built-ins/Promise/resolve-self.js index 02a75bd27..ed519fa82 100644 --- a/test/built-ins/Promise/resolve-self.js +++ b/test/built-ins/Promise/resolve-self.js @@ -24,20 +24,20 @@ var promise = new Promise(function(_resolve) { }); promise.then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(reason) { - if (!reason) { - $DONE('The promise should be rejected with a value.'); - return; - } + $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; - } + if (reason.constructor !== TypeError) { + $DONE('The promise should be rejected with a TypeError instance.'); + return; + } - $DONE(); - }); + $DONE(); +}); returnValue = resolve(promise); diff --git a/test/built-ins/Promise/resolve-thenable-deferred.js b/test/built-ins/Promise/resolve-thenable-deferred.js index 2c0602aea..ea7ce79b0 100644 --- a/test/built-ins/Promise/resolve-thenable-deferred.js +++ b/test/built-ins/Promise/resolve-thenable-deferred.js @@ -27,21 +27,23 @@ flags: [async] var returnValue = null; var value = {}; var resolve; -var thenable = new Promise(function(resolve) { resolve(value); }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); var promise = new Promise(function(_resolve) { resolve = _resolve; }); promise.then(function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); returnValue = resolve(thenable); diff --git a/test/built-ins/Promise/resolve-thenable-immed.js b/test/built-ins/Promise/resolve-thenable-immed.js index 7d90a5e1c..4be0fc547 100644 --- a/test/built-ins/Promise/resolve-thenable-immed.js +++ b/test/built-ins/Promise/resolve-thenable-immed.js @@ -25,7 +25,9 @@ flags: [async] var returnValue = null; var value = {}; -var thenable = new Promise(function(resolve) { resolve(value); }); +var thenable = new Promise(function(resolve) { + resolve(value); +}); var promise = new Promise(function(resolve) { returnValue = resolve(thenable); }); @@ -33,12 +35,12 @@ var promise = new Promise(function(resolve) { assert.sameValue(returnValue, undefined, '"resolve" return value'); promise.then(function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A1.1_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A1.1_T1.js index 07c4e02f0..b4d5943c7 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A1.1_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A1.1_T1.js @@ -10,5 +10,5 @@ description: Promise.resolve is a function ---*/ if ((typeof Promise.resolve) !== "function") { - $ERROR("Expected Promise.resolve to be a function"); + $ERROR("Expected Promise.resolve to be a function"); } diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A2.1_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A2.1_T1.js index 15718a0a6..6b79535d6 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A2.1_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A2.1_T1.js @@ -8,8 +8,8 @@ description: Promise.resolve passes through a promise w/ same Constructor ---*/ var p1 = Promise.resolve(1), - p2 = Promise.resolve(p1); + p2 = Promise.resolve(p1); if (p1 !== p2) { - $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); + $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); } diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A2.2_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A2.2_T1.js index 2b471179f..294bf71fc 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A2.2_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A2.2_T1.js @@ -9,18 +9,20 @@ flags: [async] ---*/ var resolveP1, - p1 = new Promise(function (resolve) { resolveP1 = resolve; }), - p2 = Promise.resolve(p1), - obj = {}; + p1 = new Promise(function(resolve) { + resolveP1 = resolve; + }), + p2 = Promise.resolve(p1), + obj = {}; if (p1 !== p2) { - $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); + $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); } -p2.then(function (arg) { - if (arg !== obj) { - $ERROR("Expected promise to be resolved with obj, actually " + arg); - } +p2.then(function(arg) { + if (arg !== obj) { + $ERROR("Expected promise to be resolved with obj, actually " + arg); + } }).then($DONE, $DONE); resolveP1(obj); diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A2.3_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A2.3_T1.js index 3ea901fc8..a17137231 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A2.3_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A2.3_T1.js @@ -9,20 +9,22 @@ flags: [async] ---*/ var rejectP1, - p1 = new Promise(function (resolve, reject) { rejectP1 = reject; }), - p2 = Promise.resolve(p1), - obj = {}; + p1 = new Promise(function(resolve, reject) { + rejectP1 = reject; + }), + p2 = Promise.resolve(p1), + obj = {}; if (p1 !== p2) { - $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); + $ERROR("Expected p1 === Promise.resolve(p1) because they have same constructor"); } -p2.then(function () { - $ERROR("Expected p2 to be rejected, not fulfilled."); -}, function (arg) { - if (arg !== obj) { - $ERROR("Expected promise to be rejected with reason obj, actually " + arg); - } +p2.then(function() { + $ERROR("Expected p2 to be rejected, not fulfilled."); +}, function(arg) { + if (arg !== obj) { + $ERROR("Expected promise to be rejected with reason obj, actually " + arg); + } }).then($DONE, $DONE); rejectP1(obj); diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A3.1_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A3.1_T1.js index 1da71f6c7..568d089b4 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A3.1_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A3.1_T1.js @@ -14,22 +14,22 @@ flags: [async] var sequence = []; var thenable = { - then: function(onResolve, onReject) { - sequence.push(3); - checkSequence(sequence, "thenable.then called"); + then: function(onResolve, onReject) { + sequence.push(3); + checkSequence(sequence, "thenable.then called"); - assert.sameValue(this, thenable); + assert.sameValue(this, thenable); - onResolve('resolved'); + onResolve('resolved'); - sequence.push(4); - checkSequence(sequence, "after resolved"); + sequence.push(4); + checkSequence(sequence, "after resolved"); - throw new Error('interrupt flow'); + throw new Error('interrupt flow'); - sequence.push(4); - checkSequence(sequence, "duplicate sequence point not pushed"); - } + sequence.push(4); + checkSequence(sequence, "duplicate sequence point not pushed"); + } }; sequence.push(1); @@ -40,10 +40,10 @@ var p1 = Promise.resolve(thenable); sequence.push(2); checkSequence(sequence, "thenable.then queued but not yet called"); -p1.then(function (q) { - sequence.push(5); - checkSequence(sequence, "all done"); +p1.then(function(q) { + sequence.push(5); + checkSequence(sequence, "all done"); - assert.sameValue(q, 'resolved'); + assert.sameValue(q, 'resolved'); }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/resolve/S25.4.4.5_A4.1_T1.js b/test/built-ins/Promise/resolve/S25.4.4.5_A4.1_T1.js index 3eb8f83f9..2ae973406 100644 --- a/test/built-ins/Promise/resolve/S25.4.4.5_A4.1_T1.js +++ b/test/built-ins/Promise/resolve/S25.4.4.5_A4.1_T1.js @@ -11,14 +11,16 @@ flags: [async] ---*/ var resolveP, - p = new Promise(function (resolve) { resolveP = resolve; }); + p = new Promise(function(resolve) { + resolveP = resolve; + }); resolveP(p); -p.then(function () { - $ERROR("Should not fulfill: should reject with TypeError."); -}, function (err) { - if (!(err instanceof TypeError)) { - $ERROR("Expected TypeError, got " + err); - } +p.then(function() { + $ERROR("Should not fulfill: should reject with TypeError."); +}, function(err) { + if (!(err instanceof TypeError)) { + $ERROR("Expected TypeError, got " + err); + } }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_1.js b/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_1.js index 61f5e7eae..f67bff242 100644 --- a/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_1.js +++ b/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_1.js @@ -11,13 +11,13 @@ flags: [async] ---*/ var thenable = { - then: function(onResolve, onReject) { - return onResolve('resolved'); - } + then: function(onResolve, onReject) { + return onResolve('resolved'); + } }; var p = Promise.resolve(thenable); -p.then(function (r) { - assert.sameValue(r, 'resolved'); +p.then(function(r) { + assert.sameValue(r, 'resolved'); }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_2.js b/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_2.js index 1cb07bbe9..c243d9c3a 100644 --- a/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_2.js +++ b/test/built-ins/Promise/resolve/S25.Promise_resolve_foreign_thenable_2.js @@ -14,15 +14,15 @@ flags: [async] var sequence = []; var thenable = { - then: function(onResolve, onReject) { + then: function(onResolve, onReject) { - sequence.push(3); - checkSequence(sequence, "thenable.then called"); + sequence.push(3); + checkSequence(sequence, "thenable.then called"); - assert.sameValue(this, thenable, "thenable.then called with `thenable` as `this`"); + assert.sameValue(this, thenable, "thenable.then called with `thenable` as `this`"); - return onResolve('resolved'); - } + return onResolve('resolved'); + } }; sequence.push(1); @@ -33,9 +33,9 @@ var p = Promise.resolve(thenable); sequence.push(2); checkSequence(sequence, "thenable.then queued but not yet called"); -p.then(function (r) { - sequence.push(4); - checkSequence(sequence, "all done"); +p.then(function(r) { + sequence.push(4); + checkSequence(sequence, "all done"); - assert.sameValue(r, 'resolved'); + assert.sameValue(r, 'resolved'); }).then($DONE, $DONE); diff --git a/test/built-ins/Promise/resolve/capability-executor-called-twice.js b/test/built-ins/Promise/resolve/capability-executor-called-twice.js index 1db7b9483..37074d240 100644 --- a/test/built-ins/Promise/resolve/capability-executor-called-twice.js +++ b/test/built-ins/Promise/resolve/capability-executor-called-twice.js @@ -27,7 +27,7 @@ Promise.resolve.call(function(executor) { checkPoint += "a"; executor(); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); assert.sameValue(checkPoint, "abc", "executor initially called with no arguments"); @@ -37,7 +37,7 @@ Promise.resolve.call(function(executor) { checkPoint += "a"; executor(undefined, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); assert.sameValue(checkPoint, "abc", "executor initially called with (undefined, undefined)"); @@ -46,9 +46,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.resolve.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (undefined, function)"); @@ -58,9 +58,9 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.resolve.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (function, undefined)"); @@ -72,7 +72,7 @@ assert.throws(TypeError, function() { checkPoint += "a"; executor("invalid value", 123); checkPoint += "b"; - executor(function(){}, function(){}); + executor(function() {}, function() {}); checkPoint += "c"; }, {}); }, "executor initially called with (String, Number)"); diff --git a/test/built-ins/Promise/resolve/capability-executor-not-callable.js b/test/built-ins/Promise/resolve/capability-executor-not-callable.js index cbc6b97ae..58dfe71d6 100644 --- a/test/built-ins/Promise/resolve/capability-executor-not-callable.js +++ b/test/built-ins/Promise/resolve/capability-executor-not-callable.js @@ -56,7 +56,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.resolve.call(function(executor) { checkPoint += "a"; - executor(undefined, function(){}); + executor(undefined, function() {}); checkPoint += "b"; }, {}); }, "executor called with (undefined, function)"); @@ -66,7 +66,7 @@ var checkPoint = ""; assert.throws(TypeError, function() { Promise.resolve.call(function(executor) { checkPoint += "a"; - executor(function(){}, undefined); + executor(function() {}, undefined); checkPoint += "b"; }, {}); }, "executor called with (function, undefined)"); diff --git a/test/built-ins/Promise/resolve/context-non-object-with-promise.js b/test/built-ins/Promise/resolve/context-non-object-with-promise.js index 7e20d493b..c59cabeb2 100644 --- a/test/built-ins/Promise/resolve/context-non-object-with-promise.js +++ b/test/built-ins/Promise/resolve/context-non-object-with-promise.js @@ -14,7 +14,7 @@ info: | features: [Symbol] ---*/ -var promise = new Promise(function(){}); +var promise = new Promise(function() {}); promise.constructor = undefined; assert.throws(TypeError, function() { diff --git a/test/built-ins/Promise/resolve/resolve-from-promise-capability.js b/test/built-ins/Promise/resolve/resolve-from-promise-capability.js index 40d1e1ece..76d6483a5 100644 --- a/test/built-ins/Promise/resolve/resolve-from-promise-capability.js +++ b/test/built-ins/Promise/resolve/resolve-from-promise-capability.js @@ -16,7 +16,9 @@ info: | ... ---*/ -var expectedThisValue = (function() { return this; }()); +var expectedThisValue = (function() { + return this; +}()); var callCount = 0; var object = {}; var thisValue, args; diff --git a/test/built-ins/Promise/resolve/resolve-non-obj.js b/test/built-ins/Promise/resolve/resolve-non-obj.js index c010cbf3e..ba8adcd9a 100644 --- a/test/built-ins/Promise/resolve/resolve-non-obj.js +++ b/test/built-ins/Promise/resolve/resolve-non-obj.js @@ -17,12 +17,12 @@ flags: [async] ---*/ Promise.resolve(23).then(function(value) { - if (value !== 23) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== 23) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve/resolve-non-thenable.js b/test/built-ins/Promise/resolve/resolve-non-thenable.js index 4b764c799..032ad20f7 100644 --- a/test/built-ins/Promise/resolve/resolve-non-thenable.js +++ b/test/built-ins/Promise/resolve/resolve-non-thenable.js @@ -23,12 +23,12 @@ flags: [async] var value = {}; Promise.resolve(value).then(function(value) { - if (value !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (value !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); diff --git a/test/built-ins/Promise/resolve/resolve-poisoned-then.js b/test/built-ins/Promise/resolve/resolve-poisoned-then.js index 0da129a2d..98d7f3d99 100644 --- a/test/built-ins/Promise/resolve/resolve-poisoned-then.js +++ b/test/built-ins/Promise/resolve/resolve-poisoned-then.js @@ -26,12 +26,12 @@ var poisonedThen = Object.defineProperty({}, 'then', { }); Promise.resolve(poisonedThen).then(function() { - $DONE('The promise should not be fulfilled.'); - }, function(val) { - if (val !== value) { - $DONE('The promise should be rejected with the provided value.'); - return; - } + $DONE('The promise should not be fulfilled.'); +}, function(val) { + if (val !== value) { + $DONE('The promise should be rejected with the provided value.'); + return; + } - $DONE(); - }); + $DONE(); +}); diff --git a/test/built-ins/Promise/resolve/resolve-prms-cstm-then.js b/test/built-ins/Promise/resolve/resolve-prms-cstm-then.js index fd345394c..2b7bccc95 100644 --- a/test/built-ins/Promise/resolve/resolve-prms-cstm-then.js +++ b/test/built-ins/Promise/resolve/resolve-prms-cstm-then.js @@ -23,7 +23,9 @@ info: | var value = {}; var rejectCallCount = 0; -var thenable = new Promise(function(resolve) { resolve(); }); +var thenable = new Promise(function(resolve) { + resolve(); +}); var resolvedValue; thenable.then = function(resolve) { @@ -31,10 +33,10 @@ thenable.then = function(resolve) { }; Promise.resolve(thenable).then(function(val) { - resolvedValue = val; - }, function() { - rejectCallCount += 1; - }); + resolvedValue = val; +}, function() { + rejectCallCount += 1; +}); assert.sameValue(resolvedValue, value); assert.sameValue(rejectCallCount, 0); diff --git a/test/built-ins/Promise/resolve/resolve-thenable.js b/test/built-ins/Promise/resolve/resolve-thenable.js index 3781e7fed..2ea723f3b 100644 --- a/test/built-ins/Promise/resolve/resolve-thenable.js +++ b/test/built-ins/Promise/resolve/resolve-thenable.js @@ -30,12 +30,12 @@ var thenable = { }; Promise.resolve(thenable).then(function(val) { - if (val !== value) { - $DONE('The promise should be fulfilled with the provided value.'); - return; - } + if (val !== value) { + $DONE('The promise should be fulfilled with the provided value.'); + return; + } - $DONE(); - }, function() { - $DONE('The promise should not be rejected.'); - }); + $DONE(); +}, function() { + $DONE('The promise should not be rejected.'); +}); |