diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2017-04-28 17:43:58 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2017-05-01 17:19:50 -0400 |
commit | 8f7dc1912aa1977de9924b92a282a40c52f2d6e1 (patch) | |
tree | f5312a4cbbc63100369ee38dbf8aaaec44c5d2df /src | |
parent | d5e1150325e93e76774c0f4b779ef17bebdc07d6 (diff) | |
download | qtdeclarative-testsuites-8f7dc1912aa1977de9924b92a282a40c52f2d6e1.tar.gz |
for-await-of: dstr-binding, async func & async gen templates
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-func-const.template (renamed from src/dstr-binding/default/for-await-of-const.template) | 2 | ||||
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-func-let.template (renamed from src/dstr-binding/default/for-await-of-let.template) | 3 | ||||
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-func-var.template (renamed from src/dstr-binding/default/for-await-of-var.template) | 2 | ||||
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-gen-const.template | 51 | ||||
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-gen-let.template | 52 | ||||
-rw-r--r-- | src/dstr-binding/default/for-await-of-async-gen-var.template | 49 |
6 files changed, 156 insertions, 3 deletions
diff --git a/src/dstr-binding/default/for-await-of-const.template b/src/dstr-binding/default/for-await-of-async-func-const.template index f0d90221a..36a27da78 100644 --- a/src/dstr-binding/default/for-await-of-const.template +++ b/src/dstr-binding/default/for-await-of-async-func-const.template @@ -1,7 +1,7 @@ // Copyright (C) 2017 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -path: language/statements/for-await-of/dstr-const- +path: language/statements/for-await-of/async-func-dstr-const- name: for-await-of statement esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation features: [destructuring-binding, async-iteration] diff --git a/src/dstr-binding/default/for-await-of-let.template b/src/dstr-binding/default/for-await-of-async-func-let.template index 3fe5f1600..69d3a3c5c 100644 --- a/src/dstr-binding/default/for-await-of-let.template +++ b/src/dstr-binding/default/for-await-of-async-func-let.template @@ -1,7 +1,7 @@ // Copyright (C) 2017 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -path: language/statements/for-await-of/dstr-let- +path: language/statements/for-await-of/async-func-dstr-let- name: for-await-of statement esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation features: [destructuring-binding, async-iteration] @@ -45,6 +45,7 @@ async function fn() { iterCount += 1; } } + fn() .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE) .then($DONE, $DONE); diff --git a/src/dstr-binding/default/for-await-of-var.template b/src/dstr-binding/default/for-await-of-async-func-var.template index 7c97d614c..eea5e60af 100644 --- a/src/dstr-binding/default/for-await-of-var.template +++ b/src/dstr-binding/default/for-await-of-async-func-var.template @@ -1,7 +1,7 @@ // Copyright (C) 2017 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -path: language/statements/for-await-of/dstr-var- +path: language/statements/for-await-of/async-func-dstr-var- name: for-await-of statement esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation features: [destructuring-binding, async-iteration] diff --git a/src/dstr-binding/default/for-await-of-async-gen-const.template b/src/dstr-binding/default/for-await-of-async-gen-const.template new file mode 100644 index 000000000..c3891e781 --- /dev/null +++ b/src/dstr-binding/default/for-await-of-async-gen-const.template @@ -0,0 +1,51 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/statements/for-await-of/async-gen-dstr-const- +name: for-await-of statement +esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation +features: [destructuring-binding, async-iteration] +flags: [async] +info: | + IterationStatement : + for await ( ForDeclaration of AssignmentExpression ) Statement + + [...] + 2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult, + lexicalBinding, labelSet, async). + + 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation + + [...] + 3. Let destructuring be IsDestructuring of lhs. + [...] + 5. Repeat + [...] + h. If destructuring is false, then + [...] + i. Else + i. If lhsKind is assignment, then + [...] + ii. Else if lhsKind is varBinding, then + [...] + iii. Else, + 1. Assert: lhsKind is lexicalBinding. + 2. Assert: lhs is a ForDeclaration. + 3. Let status be the result of performing BindingInitialization + for lhs passing nextValue and iterationEnv as arguments. + [...] +---*/ + +var iterCount = 0; + +async function *fn() { + for await (const /*{ elems }*/ of [/*{ vals }*/]) { + /*{ body }*/ + + iterCount += 1; + } +} + +fn().next() + .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE) + .then($DONE, $DONE); diff --git a/src/dstr-binding/default/for-await-of-async-gen-let.template b/src/dstr-binding/default/for-await-of-async-gen-let.template new file mode 100644 index 000000000..8a78365b0 --- /dev/null +++ b/src/dstr-binding/default/for-await-of-async-gen-let.template @@ -0,0 +1,52 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/statements/for-await-of/async-gen-dstr-let- +name: for-await-of statement +esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation +features: [destructuring-binding, async-iteration] +flags: [async] +info: | + IterationStatement : + for await ( ForDeclaration of AssignmentExpression ) Statement + + [...] + 2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult, + lexicalBinding, labelSet, async). + + 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation + + [...] + 3. Let destructuring be IsDestructuring of lhs. + [...] + 5. Repeat + [...] + h. If destructuring is false, then + [...] + i. Else + i. If lhsKind is assignment, then + [...] + ii. Else if lhsKind is varBinding, then + [...] + iii. Else, + 1. Assert: lhsKind is lexicalBinding. + 2. Assert: lhs is a ForDeclaration. + 3. Let status be the result of performing BindingInitialization + for lhs passing nextValue and iterationEnv as arguments. + [...] +---*/ + +var iterCount = 0; + +async function *fn() { + for await (let /*{ elems }*/ of [/*{ vals }*/]) { + /*{ body }*/ + + iterCount += 1; + } +} + +fn().next() + .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE) + .then($DONE, $DONE); + diff --git a/src/dstr-binding/default/for-await-of-async-gen-var.template b/src/dstr-binding/default/for-await-of-async-gen-var.template new file mode 100644 index 000000000..06e3d52b6 --- /dev/null +++ b/src/dstr-binding/default/for-await-of-async-gen-var.template @@ -0,0 +1,49 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/statements/for-await-of/async-gen-dstr-var- +name: for-await-of statement +esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation +features: [destructuring-binding, async-iteration] +flags: [async] +info: | + IterationStatement : + for await ( var ForBinding of AssignmentExpression ) Statement + + [...] + 2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult, + varBinding, labelSet, async). + + 13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation + + [...] + 3. Let destructuring be IsDestructuring of lhs. + [...] + 5. Repeat + [...] + h. If destructuring is false, then + [...] + i. Else + i. If lhsKind is assignment, then + [...] + ii. Else if lhsKind is varBinding, then + 1. Assert: lhs is a ForBinding. + 2. Let status be the result of performing BindingInitialization + for lhs passing nextValue and undefined as the arguments. + [...] +---*/ + +var iterCount = 0; + +async function *fn() { + for await (var /*{ elems }*/ of [/*{ vals }*/]) { + /*{ body }*/ + + iterCount += 1; + } +} + +fn().next() + .then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE) + .then($DONE, $DONE); + |