diff --git a/src/dstr-binding/error/async-gen-func-decl-dflt.template b/src/dstr-binding/error/async-gen-func-decl-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..73788c2574d72fd1e00beefb0c31127d77e620cb --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-decl-dflt.template @@ -0,0 +1,25 @@ +// 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/async-generator/dstr-dflt- +name: async generator function declaration (default parameter) +esid: sec-asyncgenerator-definitions-instantiatefunctionobject +features: [async-iteration] +info: | + AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier + ( FormalParameters ) { AsyncGeneratorBody } + + [...] + 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody, + scope, strict). + [...] +---*/ + +async function* f(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(); +}); diff --git a/src/dstr-binding/error/async-gen-func-decl.template b/src/dstr-binding/error/async-gen-func-decl.template new file mode 100644 index 0000000000000000000000000000000000000000..50e3ca2c775f64d1da9b033cf59417c7f0077cd8 --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-decl.template @@ -0,0 +1,25 @@ +// 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/async-generator/dstr- +name: async generator function declaration +esid: sec-asyncgenerator-definitions-instantiatefunctionobject +features: [async-iteration] +info: | + AsyncGeneratorDeclaration : async [no LineTerminator here] function * BindingIdentifier + ( FormalParameters ) { AsyncGeneratorBody } + + [...] + 3. Let F be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, AsyncGeneratorBody, + scope, strict). + [...] +---*/ + +async function* f(/*{ elems }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/async-gen-func-expr-dflt.template b/src/dstr-binding/error/async-gen-func-expr-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..c7c9d3457c727727f238387d05481a2a007b2416 --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-expr-dflt.template @@ -0,0 +1,25 @@ +// 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/expressions/async-generator/dstr-dflt- +name: async generator function expression (default parameter) +esid: sec-asyncgenerator-definitions-evaluation +features: [async-iteration] +info: | + AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { + AsyncGeneratorBody } + + [...] + 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var f = async function*(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(); +}); diff --git a/src/dstr-binding/error/async-gen-func-expr.template b/src/dstr-binding/error/async-gen-func-expr.template new file mode 100644 index 0000000000000000000000000000000000000000..8da6fd8cde9562d82a195b844f8fc865078b51ff --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-expr.template @@ -0,0 +1,26 @@ +// 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/expressions/async-generator/dstr- +name: async generator function expression +esid: sec-asyncgenerator-definitions-evaluation +features: [async-iteration] +info: | + AsyncGeneratorExpression : async [no LineTerminator here] function * ( FormalParameters ) { + AsyncGeneratorBody } + + [...] + 3. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var f; +f = async function*(/*{ elems }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/async-gen-func-named-expr-dflt.template b/src/dstr-binding/error/async-gen-func-named-expr-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..8cb7da7808e6e8b0484a42d0abad15b0697d377c --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-named-expr-dflt.template @@ -0,0 +1,26 @@ +// 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/expressions/async-generator/dstr-named-dflt- +name: async generator named function expression (default parameter) +esid: sec-asyncgenerator-definitions-evaluation +features: [async-iteration] +info: | + AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier + ( FormalParameters ) { AsyncGeneratorBody } + + [...] + 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, + AsyncGeneratorBody, funcEnv, strict). + [...] +---*/ + +var f; +f = async function* g(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(); +}); diff --git a/src/dstr-binding/error/async-gen-func-named-expr.template b/src/dstr-binding/error/async-gen-func-named-expr.template new file mode 100644 index 0000000000000000000000000000000000000000..cf9176ff2466edd61e51da6f027ed35f028f3708 --- /dev/null +++ b/src/dstr-binding/error/async-gen-func-named-expr.template @@ -0,0 +1,26 @@ +// 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/expressions/async-generator/dstr-named- +name: async generator named function expression +esid: sec-asyncgenerator-definitions-evaluation +features: [async-iteration] +info: | + AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier + ( FormalParameters ) { AsyncGeneratorBody } + + [...] + 7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters, + AsyncGeneratorBody, funcEnv, strict). + [...] +---*/ + +var f; +f = async function* g(/*{ elems }*/) { + /*{ body }*/ +}; + +assert.throws(/*{ error }*/, function() { + f(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/async-gen-meth.template b/src/dstr-binding/error/async-gen-meth.template new file mode 100644 index 0000000000000000000000000000000000000000..a98c034f7ad6b29b5ec6396b4484fd12864c3da9 --- /dev/null +++ b/src/dstr-binding/error/async-gen-meth.template @@ -0,0 +1,32 @@ +// 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/expressions/object/dstr-async-gen-meth- +name: async generator method +esid: sec-asyncgenerator-definitions-propertydefinitionevaluation +features: [async-iteration] +info: | + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var obj = { + async *method(/*{ elems }*/) { + /*{ body }*/ + } +}; + +assert.throws(/*{ error }*/, function() { + obj.method(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/async-gen-method-dflt.template b/src/dstr-binding/error/async-gen-method-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..fd787e49c5af689101e43c20690992e7ddd60e07 --- /dev/null +++ b/src/dstr-binding/error/async-gen-method-dflt.template @@ -0,0 +1,32 @@ +// 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/expressions/object/dstr-async-gen-meth-dflt- +name: async generator method (default parameter) +esid: sec-asyncgenerator-definitions-propertydefinitionevaluation +features: [async-iteration] +info: | + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var obj = { + async *method(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ + } +}; + +assert.throws(/*{ error }*/, function() { + obj.method(); +}); diff --git a/src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template b/src/dstr-binding/error/cls-decl-async-gen-meth-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..4a2bcc6aa3576abab785f0f11f131a56215d0c36 --- /dev/null +++ b/src/dstr-binding/error/cls-decl-async-gen-meth-dflt.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/class/dstr-async-gen-meth-dflt- +name: class expression async generator method (default parameters) +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassDeclaration : class BindingIdentifier ClassTail + + 1. Let className be StringValue of BindingIdentifier. + 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with + argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + i. Let status be the result of performing + PropertyDefinitionEvaluation for m with arguments proto and + false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +class C { + async *method(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ + } +}; + +var method = C.prototype.method; + +assert.throws(/*{ error }*/, function() { + method(); +}); diff --git a/src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template b/src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..1794cd64e77d6bdff6e84dbe0c54d2bb78edab80 --- /dev/null +++ b/src/dstr-binding/error/cls-decl-async-gen-meth-static-dflt.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/class/dstr-async-gen-meth-static-dflt- +name: static class expression async generator method (default parameter) +esid: sec-runtime-semantics-bindingclassdeclarationevaluation +features: [async-iteration] +info: | + ClassDeclaration : class BindingIdentifier ClassTail + + 1. Let className be StringValue of BindingIdentifier. + 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with + argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + b. Else, + Let status be the result of performing PropertyDefinitionEvaluation for + m with arguments F and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +class C { + static async *method(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ + } +}; + +var method = C.method; + +assert.throws(/*{ error }*/, function() { + method(); +}); diff --git a/src/dstr-binding/error/cls-decl-async-gen-meth-static.template b/src/dstr-binding/error/cls-decl-async-gen-meth-static.template new file mode 100644 index 0000000000000000000000000000000000000000..98038e374a280eace00d182b613d87b93bb6ca21 --- /dev/null +++ b/src/dstr-binding/error/cls-decl-async-gen-meth-static.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/class/dstr-async-gen-meth-static- +name: static class expression async generator method +esid: sec-runtime-semantics-bindingclassdeclarationevaluation +features: [async-iteration] +info: | + ClassDeclaration : class BindingIdentifier ClassTail + + 1. Let className be StringValue of BindingIdentifier. + 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with + argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + b. Else, + Let status be the result of performing PropertyDefinitionEvaluation for + m with arguments F and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +class C { + static async *method(/*{ elems }*/) { + /*{ body }*/ + } +}; + +var method = C.method; + +assert.throws(/*{ error }*/, function() { + method(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/cls-decl-async-gen-meth.template b/src/dstr-binding/error/cls-decl-async-gen-meth.template new file mode 100644 index 0000000000000000000000000000000000000000..25745f17c3592de050bf9e5a1d6a3d9c1bd73678 --- /dev/null +++ b/src/dstr-binding/error/cls-decl-async-gen-meth.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/class/dstr-async-gen-meth- +name: class expression method +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassDeclaration : class BindingIdentifier ClassTail + + 1. Let className be StringValue of BindingIdentifier. + 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with + argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + i. Let status be the result of performing + PropertyDefinitionEvaluation for m with arguments proto and + false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +class C { + async *method(/*{ elems }*/) { + /*{ body }*/ + } +}; + +var method = C.prototype.method; + +assert.throws(/*{ error }*/, function() { + method(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template b/src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..05f0c41e20f248c33e81be5c6729face17e4b37b --- /dev/null +++ b/src/dstr-binding/error/cls-expr-async-gen-meth-dflt.template @@ -0,0 +1,53 @@ +// 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/expressions/class/dstr-async-gen-meth-dflt- +name: class expression async generator method (default parameter) +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassExpression : class BindingIdentifieropt ClassTail + + 1. If BindingIdentifieropt is not present, let className be undefined. + 2. Else, let className be StringValue of BindingIdentifier. + 3. Let value be the result of ClassDefinitionEvaluation of ClassTail + with argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + i. Let status be the result of performing + PropertyDefinitionEvaluation for m with arguments proto and + false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var C = class { + async *method(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ + } +}; + +var method = C.prototype.method; + +assert.throws(/*{ error }*/, function() { + method(); +}); diff --git a/src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template b/src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template new file mode 100644 index 0000000000000000000000000000000000000000..37fc8cb668f82dac29b8684b259287147415543c --- /dev/null +++ b/src/dstr-binding/error/cls-expr-async-gen-meth-static-dflt.template @@ -0,0 +1,53 @@ +// 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/expressions/class/dstr-async-gen-meth-static-dflt- +name: static class expression async generator method (default parameter) +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassExpression : class BindingIdentifieropt ClassTail + + 1. If BindingIdentifieropt is not present, let className be undefined. + 2. Else, let className be StringValue of BindingIdentifier. + 3. Let value be the result of ClassDefinitionEvaluation of ClassTail + with argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + b. Else, + Let status be the result of performing PropertyDefinitionEvaluation + for m with arguments F and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var C = class { + static async *method(/*{ elems }*/ = /*{ vals }*/) { + /*{ body }*/ + } +}; + +var method = C.method; + +assert.throws(/*{ error }*/, function() { + method(); +}); diff --git a/src/dstr-binding/error/cls-expr-async-gen-meth-static.template b/src/dstr-binding/error/cls-expr-async-gen-meth-static.template new file mode 100644 index 0000000000000000000000000000000000000000..0830cf44707e1063f5baa88dae5b7ecbe5b446d7 --- /dev/null +++ b/src/dstr-binding/error/cls-expr-async-gen-meth-static.template @@ -0,0 +1,53 @@ +// 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/expressions/class/dstr-async-gen-meth-static- +name: static class expression async generator method +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassExpression : class BindingIdentifieropt ClassTail + + 1. If BindingIdentifieropt is not present, let className be undefined. + 2. Else, let className be StringValue of BindingIdentifier. + 3. Let value be the result of ClassDefinitionEvaluation of ClassTail + with argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + b. Else, + Let status be the result of performing PropertyDefinitionEvaluation + for m with arguments F and false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var C = class { + static async *method(/*{ elems }*/) { + /*{ body }*/ + } +}; + +var method = C.method; + +assert.throws(/*{ error }*/, function() { + method(/*{ vals }*/); +}); diff --git a/src/dstr-binding/error/cls-expr-async-gen-meth.template b/src/dstr-binding/error/cls-expr-async-gen-meth.template new file mode 100644 index 0000000000000000000000000000000000000000..0e7433a4d7347d0ca6082dae49438ce561f4ecb4 --- /dev/null +++ b/src/dstr-binding/error/cls-expr-async-gen-meth.template @@ -0,0 +1,53 @@ +// 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/expressions/class/dstr-async-gen-meth- +name: class expression method +esid: sec-class-definitions-runtime-semantics-evaluation +features: [async-iteration] +info: | + ClassExpression : class BindingIdentifieropt ClassTail + + 1. If BindingIdentifieropt is not present, let className be undefined. + 2. Else, let className be StringValue of BindingIdentifier. + 3. Let value be the result of ClassDefinitionEvaluation of ClassTail + with argument className. + [...] + + 14.5.14 Runtime Semantics: ClassDefinitionEvaluation + + 21. For each ClassElement m in order from methods + a. If IsStatic of m is false, then + i. Let status be the result of performing + PropertyDefinitionEvaluation for m with arguments proto and + false. + [...] + + Runtime Semantics: PropertyDefinitionEvaluation + + AsyncGeneratorMethod : + async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) + { AsyncGeneratorBody } + + 1. Let propKey be the result of evaluating PropertyName. + 2. ReturnIfAbrupt(propKey). + 3. If the function code for this AsyncGeneratorMethod is strict mode code, let strict be true. + Otherwise let strict be false. + 4. Let scope be the running execution context's LexicalEnvironment. + 5. Let closure be ! AsyncGeneratorFunctionCreate(Method, UniqueFormalParameters, + AsyncGeneratorBody, scope, strict). + [...] +---*/ + +var C = class { + async *method(/*{ elems }*/) { + /*{ body }*/ + } +}; + +var method = C.prototype.method; + +assert.throws(/*{ error }*/, function() { + method(/*{ vals }*/); +});