summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Balter <leonardo.balter@gmail.com>2018-03-09 10:39:34 -0500
committerGitHub <noreply@github.com>2018-03-09 10:39:34 -0500
commit3854fc38dd51c85062f94cd3b98f5f04ca976fae (patch)
treee1d958a6392dcca1d9f21445ec3c9bdd6bde3b74
parentcc6f2e352ea34807acffef6915026a8009a43aa1 (diff)
parentdd147e505263f5a74d1650f38f3a2151d4cca520 (diff)
downloadqtdeclarative-testsuites-3854fc38dd51c85062f94cd3b98f5f04ca976fae.tar.gz
Merge pull request #1481 from bocoup/anba-fixes
TypedArray and Async Iteration bug fixes
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js1
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/return/iterator-result-unwrap-promise.js3
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-done.js18
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-value.js18
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-unwrap-promise.js16
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result.js4
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-get-throw.js11
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-throw.js9
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/result-object-error.js8
-rw-r--r--test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js8
-rw-r--r--test/built-ins/TypedArrays/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js2
-rw-r--r--test/built-ins/TypedArrays/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js2
12 files changed, 48 insertions, 52 deletions
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js b/test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js
index d3bb1be2f..f4daeb01b 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/next/return-promise.js
@@ -12,7 +12,6 @@ info: |
...
18. Return promiseCapability.[[Promise]].
-flags: [async]
features: [async-iteration]
---*/
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/return/iterator-result-unwrap-promise.js b/test/built-ins/AsyncFromSyncIteratorPrototype/return/iterator-result-unwrap-promise.js
index 08ed58ec3..311b93a8f 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/return/iterator-result-unwrap-promise.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/return/iterator-result-unwrap-promise.js
@@ -60,4 +60,5 @@ iter.next().then(function (result) {
}).then($DONE, $DONE);
}
).catch($DONE);
-}).then($DONE, $DONE);
+
+}).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-done.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-done.js
index 0bae74492..7b6816a7c 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-done.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-done.js
@@ -30,15 +30,15 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
throw() {
- return {
- get done() {
- throw thrownError;
- },
- value: 1
- }
+ return {
+ get done() {
+ throw thrownError;
+ },
+ value: 1
+ };
}
};
}
@@ -60,8 +60,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-value.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-value.js
index a04f988a2..253490582 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-value.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-poisoned-value.js
@@ -30,15 +30,15 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
throw() {
- return {
- get value() {
- throw thrownError;
- },
- done: false
- }
+ return {
+ get value() {
+ throw thrownError;
+ },
+ done: false
+ };
}
}
}
@@ -60,8 +60,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-unwrap-promise.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-unwrap-promise.js
index 521f51311..d7b04c5db 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-unwrap-promise.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result-unwrap-promise.js
@@ -33,13 +33,13 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
throw() {
- return {
- value: Promise.resolve(42),
- done: true
- };
+ return {
+ value: Promise.resolve(42),
+ done: true
+ };
}
};
}
@@ -57,9 +57,9 @@ iter.next().then(function (result) {
assert.sameValue(result.value, 42, "Result.value should be unwrapped, got: " + result.value);
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
-}).then($DONE, $DONE);
+}).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result.js
index 041ca2009..58475844f 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/iterator-result.js
@@ -50,8 +50,8 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "promise should be reject with custom error, got: " + err)
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-get-throw.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-get-throw.js
index 87609bebb..d057a0ced 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-get-throw.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-get-throw.js
@@ -24,12 +24,12 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
get throw() {
- throw thrownError;
+ throw thrownError;
}
- }
+ };
}
};
@@ -49,11 +49,10 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
}).catch($DONE);
-
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-throw.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-throw.js
index 25bfc5b28..5625eb8e9 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-throw.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/poisoned-throw.js
@@ -27,10 +27,10 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
throw() {
- throw thrownError;
+ throw thrownError;
}
};
}
@@ -52,10 +52,9 @@ iter.next().then(function(result) {
assert.sameValue(err, thrownError, "Promise should be rejected with thrown error");
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
-
}).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/result-object-error.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/result-object-error.js
index 35e9f8336..c25bd96dd 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/result-object-error.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/result-object-error.js
@@ -28,10 +28,10 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
},
throw() {
- return 1;
+ return 1;
}
};
}
@@ -54,8 +54,8 @@ iter.next().then(function(result) {
assert(typeerror, "Expect TypeError, got: " + err);
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
diff --git a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js
index 94863e2c5..6d0442628 100644
--- a/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js
+++ b/test/built-ins/AsyncFromSyncIteratorPrototype/throw/throw-undefined.js
@@ -23,7 +23,7 @@ var obj = {
[Symbol.iterator]() {
return {
next() {
- return { value: 1, done: false };
+ return { value: 1, done: false };
}
};
}
@@ -36,7 +36,6 @@ async function* asyncg() {
var iter = asyncg();
iter.next().then(function(result) {
-
iter.throw().then(
function (result) {
throw new Test262Error("Promise should be rejected, got: " + result.value);
@@ -45,11 +44,10 @@ iter.next().then(function(result) {
assert.sameValue(err, undefined, "Promise should be rejected with undefined");
iter.next().then(({ done, value }) => {
- assert.sameValue(done, true, 'the iterator is completed');
- assert.sameValue(value, undefined, 'value is undefined');
+ assert.sameValue(done, true, 'the iterator is completed');
+ assert.sameValue(value, undefined, 'value is undefined');
}).then($DONE, $DONE);
}
).catch($DONE);
}).catch($DONE);
-
diff --git a/test/built-ins/TypedArrays/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js b/test/built-ins/TypedArrays/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js
index 1c916b43c..3b59f0509 100644
--- a/test/built-ins/TypedArrays/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js
+++ b/test/built-ins/TypedArrays/ctors/buffer-arg/bufferbyteoffset-throws-from-modulo-element-size.js
@@ -29,4 +29,4 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(RangeError, function() {
new TA(buffer, 0, undefined);
});
-});
+}, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);
diff --git a/test/built-ins/TypedArrays/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js b/test/built-ins/TypedArrays/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js
index f495e6bcc..53b6a707a 100644
--- a/test/built-ins/TypedArrays/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js
+++ b/test/built-ins/TypedArrays/ctors/buffer-arg/byteoffset-throws-from-modulo-element-size.js
@@ -24,4 +24,4 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(RangeError, function() {
new TA(buffer, 7);
});
-});
+}, [ Float64Array, Float32Array, Int32Array, Int16Array, Uint32Array, Uint16Array ]);