summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Bargull <andre.bargull@gmail.com>2017-09-16 17:00:55 +0200
committerAndré Bargull <andre.bargull@gmail.com>2017-09-16 17:00:55 +0200
commit58111fff7bcb385b53b0363ad0148de7944d64e7 (patch)
treecd32970602aa43f2beda2b26b23bf00f004248a5
parent86da17166310709aa0bd5d23ba2cb2cff13e87a9 (diff)
downloadqtdeclarative-testsuites-58111fff7bcb385b53b0363ad0148de7944d64e7.tar.gz
Regenerate tests
-rw-r--r--test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close-null.js20
-rw-r--r--test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close.js19
-rw-r--r--test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-err.js17
-rw-r--r--test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-null.js18
-rw-r--r--test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close.js12
-rw-r--r--test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-iter-rtrn-close-null.js19
-rw-r--r--test/language/statements/for-of/dstr-array-elem-iter-rtrn-close-null.js20
-rw-r--r--test/language/statements/for-of/dstr-array-elem-iter-rtrn-close.js19
-rw-r--r--test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-err.js17
-rw-r--r--test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-null.js18
-rw-r--r--test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close.js12
11 files changed, 146 insertions, 45 deletions
diff --git a/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close-null.js b/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close-null.js
index 012dc8992..e01b3990f 100644
--- a/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close-null.js
+++ b/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close-null.js
@@ -33,13 +33,20 @@ info: |
exception.
---*/
-var iterable = {};
+var nextCount = 0;
+var returnCount = 0;
+var unreachable = 0;
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
+ returnCount += 1;
return null;
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -48,7 +55,7 @@ function* g() {
var result;
var vals = iterable;
-result = [ {}[yield] ] = vals;
+result = [ {} = yield ] = vals;
unreachable += 1;
@@ -56,9 +63,14 @@ assert.sameValue(result, vals);
}
-iter = g();
+var iter = g();
iter.next();
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(TypeError, function() {
iter.return();
});
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 1);
+assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
diff --git a/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close.js b/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close.js
index 628357252..79f5d13ce 100644
--- a/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close.js
+++ b/test/language/expressions/assignment/dstr-array-elem-iter-rtrn-close.js
@@ -31,12 +31,16 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
var thisValue = null;
var args = null;
-var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
thisValue = this;
@@ -44,7 +48,7 @@ var iterator = {
return {};
}
};
-var iter, result;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -54,17 +58,22 @@ function* g() {
var result;
var vals = iterable;
-result = [ {}[yield] ] = vals;
+result = [ {} = yield ] = vals;
unreachable += 1;
assert.sameValue(result, vals);
}
-iter = g();
+var iter = g();
iter.next();
-result = iter.return(777);
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
+
+var result = iter.return(777);
+
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
assert.sameValue(result.value, 777);
diff --git a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-err.js b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
index af2468b11..eb1d05505 100644
--- a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
+++ b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
@@ -36,17 +36,21 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
-var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
throw new Test262Error();
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -56,7 +60,7 @@ function* g() {
var result;
var vals = iterable;
-result = [ {}[yield] , ] = vals;
+result = [ {} = yield , ] = vals;
unreachable += 1;
@@ -64,11 +68,14 @@ assert.sameValue(result, vals);
}
-iter = g();
+var iter = g();
iter.next();
+
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(Test262Error, function() {
iter.return();
});
-
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
diff --git a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-null.js b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
index f622e7d89..757f8a5aa 100644
--- a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
+++ b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
@@ -39,13 +39,19 @@ info: |
exception.
---*/
-var iterable = {};
+var nextCount = 0;
+var returnCount = 0;
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
+ returnCount += 1;
return null;
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -55,7 +61,7 @@ function* g() {
var result;
var vals = iterable;
-result = [ {}[yield] , ] = vals;
+result = [ {} = yield , ] = vals;
@@ -63,9 +69,13 @@ assert.sameValue(result, vals);
}
-iter = g();
+var iter = g();
iter.next();
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(TypeError, function() {
iter.return();
});
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 1);
diff --git a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close.js b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close.js
index 23110527e..9a6ebed9a 100644
--- a/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close.js
+++ b/test/language/expressions/assignment/dstr-array-elem-trlg-iter-list-rtrn-close.js
@@ -37,12 +37,17 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
var thisValue = null;
var args = null;
var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
thisValue = this;
@@ -61,7 +66,7 @@ function* g() {
var result;
var vals = iterable;
-result = [ {}[yield] , ] = vals;
+result = [ {} = yield , ] = vals;
unreachable += 1;
@@ -71,8 +76,13 @@ assert.sameValue(result, vals);
iter = g();
iter.next();
+
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
+
result = iter.return(888);
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
assert.sameValue(result.value, 888);
diff --git a/test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-iter-rtrn-close-null.js b/test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-iter-rtrn-close-null.js
index ddd3f1fb0..7fb85ba02 100644
--- a/test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-iter-rtrn-close-null.js
+++ b/test/language/statements/for-await-of/async-gen-decl-dstr-array-elem-iter-rtrn-close-null.js
@@ -24,12 +24,6 @@ info: |
lhs using AssignmentPattern as the goal symbol.
[...]
- AssignmentElement : DestructuringAssignmentTarget Initializer
- 1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then
- a. Let lref be the result of evaluating DestructuringAssignmentTarget.
- b. ReturnIfAbrupt(lref).
- [...]
-
ArrayAssignmentPattern : [ AssignmentElementList ]
[...]
@@ -46,8 +40,15 @@ info: |
---*/
let unreachable = 0;
+let nextCount = 0;
+let returnCount = 0;
let iterator = {
+ next() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return() {
+ returnCount += 1;
return null;
}
};
@@ -59,7 +60,7 @@ let iterable = {
let iterCount = 0;
async function * fn() {
- for await ([ {}[yield] ] of [iterable]) {
+ for await ([ {} = yield ] of [iterable]) {
unreachable += 1;
iterCount += 1;
}
@@ -68,10 +69,14 @@ async function * fn() {
let iter = fn();
iter.next().then(result => {
+ assert.sameValue(nextCount, 1);
+ assert.sameValue(returnCount, 0);
assert.sameValue(result.value, undefined);
assert.sameValue(result.done, false);
iter.return().then(() => $DONE('Promise incorrectly fulfilled.'), ({ constructor }) => {
+ assert.sameValue(nextCount, 1);
+ assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0);
assert.sameValue(constructor, TypeError);
}).then($DONE, $DONE);
diff --git a/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close-null.js b/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close-null.js
index ba4717465..972c6c2cb 100644
--- a/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close-null.js
+++ b/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close-null.js
@@ -42,13 +42,20 @@ info: |
exception.
---*/
-var iterable = {};
+var nextCount = 0;
+var returnCount = 0;
+var unreachable = 0;
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
+ returnCount += 1;
return null;
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -56,7 +63,7 @@ function* g() {
var counter = 0;
-for ([ {}[yield] ] of [iterable]) {
+for ([ {} = yield ] of [iterable]) {
unreachable += 1;
counter += 1;
}
@@ -65,9 +72,14 @@ assert.sameValue(counter, 1);
}
-iter = g();
+var iter = g();
iter.next();
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(TypeError, function() {
iter.return();
});
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 1);
+assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
diff --git a/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close.js b/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close.js
index 84175bc50..e1f43ddf8 100644
--- a/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close.js
+++ b/test/language/statements/for-of/dstr-array-elem-iter-rtrn-close.js
@@ -40,12 +40,16 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
var thisValue = null;
var args = null;
-var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
thisValue = this;
@@ -53,7 +57,7 @@ var iterator = {
return {};
}
};
-var iter, result;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -62,7 +66,7 @@ function* g() {
var counter = 0;
-for ([ {}[yield] ] of [iterable]) {
+for ([ {} = yield ] of [iterable]) {
unreachable += 1;
counter += 1;
}
@@ -70,10 +74,15 @@ for ([ {}[yield] ] of [iterable]) {
assert.sameValue(counter, 1);
}
-iter = g();
+var iter = g();
iter.next();
-result = iter.return(777);
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
+
+var result = iter.return(777);
+
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
assert.sameValue(result.value, 777);
diff --git a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-err.js b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
index c5137f4e2..30fb04f8b 100644
--- a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
+++ b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-err.js
@@ -45,17 +45,21 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
-var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
throw new Test262Error();
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -64,7 +68,7 @@ function* g() {
var counter = 0;
-for ([ {}[yield] , ] of [iterable]) {
+for ([ {} = yield , ] of [iterable]) {
unreachable += 1;
counter += 1;
}
@@ -73,11 +77,14 @@ assert.sameValue(counter, 1);
}
-iter = g();
+var iter = g();
iter.next();
+
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(Test262Error, function() {
iter.return();
});
-
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
diff --git a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-null.js b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
index 0ee69ab93..ca4219139 100644
--- a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
+++ b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close-null.js
@@ -48,13 +48,19 @@ info: |
exception.
---*/
-var iterable = {};
+var nextCount = 0;
+var returnCount = 0;
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
+ returnCount += 1;
return null;
}
};
-var iter;
+var iterable = {};
iterable[Symbol.iterator] = function() {
return iterator;
};
@@ -63,7 +69,7 @@ function* g() {
var counter = 0;
-for ([ {}[yield] , ] of [iterable]) {
+for ([ {} = yield , ] of [iterable]) {
counter += 1;
}
@@ -72,9 +78,13 @@ assert.sameValue(counter, 1);
}
-iter = g();
+var iter = g();
iter.next();
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
assert.throws(TypeError, function() {
iter.return();
});
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 1);
diff --git a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close.js b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close.js
index eb1c4c749..94ddc7db3 100644
--- a/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close.js
+++ b/test/language/statements/for-of/dstr-array-elem-trlg-iter-list-rtrn-close.js
@@ -46,12 +46,17 @@ info: |
8. If innerResult.[[type]] is throw, return Completion(innerResult).
---*/
+var nextCount = 0;
var returnCount = 0;
var unreachable = 0;
var thisValue = null;
var args = null;
var iterable = {};
var iterator = {
+ next: function() {
+ nextCount += 1;
+ return {done: false, value: undefined};
+ },
return: function() {
returnCount += 1;
thisValue = this;
@@ -69,7 +74,7 @@ function* g() {
var counter = 0;
-for ([ {}[yield] , ] of [iterable]) {
+for ([ {} = yield , ] of [iterable]) {
unreachable += 1;
counter += 1;
}
@@ -80,8 +85,13 @@ assert.sameValue(counter, 1);
iter = g();
iter.next();
+
+assert.sameValue(nextCount, 1);
+assert.sameValue(returnCount, 0);
+
result = iter.return(888);
+assert.sameValue(nextCount, 1);
assert.sameValue(returnCount, 1);
assert.sameValue(unreachable, 0, 'Unreachable statement was not executed');
assert.sameValue(result.value, 888);