summaryrefslogtreecommitdiff
path: root/test/built-ins/Promise/all
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Promise/all')
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A1.1_T1.js2
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A2.1_T1.js2
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A2.2_T1.js12
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A2.3_T1.js8
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A2.3_T2.js8
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A2.3_T3.js8
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A3.1_T1.js12
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A3.1_T2.js14
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A3.1_T3.js20
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A4.1_T1.js3
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A5.1_T1.js20
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A6.1_T1.js2
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A6.1_T2.js14
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A7.1_T1.js26
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A7.2_T1.js22
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A8.1_T1.js26
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A8.2_T1.js20
-rw-r--r--test/built-ins/Promise/all/S25.4.4.1_A8.2_T2.js20
-rw-r--r--test/built-ins/Promise/all/call-resolve-element-after-return.js4
-rw-r--r--test/built-ins/Promise/all/call-resolve-element-items.js4
-rw-r--r--test/built-ins/Promise/all/call-resolve-element.js4
-rw-r--r--test/built-ins/Promise/all/capability-executor-called-twice.js14
-rw-r--r--test/built-ins/Promise/all/capability-executor-not-callable.js4
-rw-r--r--test/built-ins/Promise/all/capability-resolve-throws-no-close.js8
-rw-r--r--test/built-ins/Promise/all/capability-resolve-throws-reject.js4
-rw-r--r--test/built-ins/Promise/all/does-not-invoke-array-setters.js4
-rw-r--r--test/built-ins/Promise/all/invoke-resolve-error-close.js5
-rw-r--r--test/built-ins/Promise/all/invoke-resolve-get-error-close.js4
-rw-r--r--test/built-ins/Promise/all/invoke-then-error-close.js5
-rw-r--r--test/built-ins/Promise/all/invoke-then-get-error-close.js5
-rw-r--r--test/built-ins/Promise/all/new-resolve-function.js9
-rw-r--r--test/built-ins/Promise/all/reject-deferred.js4
-rw-r--r--test/built-ins/Promise/all/reject-ignored-deferred.js8
-rw-r--r--test/built-ins/Promise/all/resolve-before-loop-exit-from-same.js4
-rw-r--r--test/built-ins/Promise/all/resolve-before-loop-exit.js4
-rw-r--r--test/built-ins/Promise/all/resolve-element-function-extensible.js7
-rw-r--r--test/built-ins/Promise/all/resolve-element-function-length.js7
-rw-r--r--test/built-ins/Promise/all/resolve-element-function-name.js7
-rw-r--r--test/built-ins/Promise/all/resolve-element-function-nonconstructor.js11
-rw-r--r--test/built-ins/Promise/all/resolve-element-function-prototype.js7
-rw-r--r--test/built-ins/Promise/all/resolve-from-same-thenable.js4
-rw-r--r--test/built-ins/Promise/all/resolve-poisoned-then.js16
-rw-r--r--test/built-ins/Promise/all/resolve-thenable.js16
-rw-r--r--test/built-ins/Promise/all/same-reject-function.js9
-rw-r--r--test/built-ins/Promise/all/species-get-error.js2
45 files changed, 242 insertions, 177 deletions
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() {