test262/test/language/statements/class/async-meth-dflt-params-rest.js

69 lines
1.9 KiB
JavaScript
Raw Normal View History

2017-03-16 22:39:00 +01:00
// This file was procedurally generated from the following sources:
2017-04-20 18:31:29 +02:00
// - src/function-forms/dflt-params-rest.case
// - src/function-forms/syntax/cls-decl-async-meth.template
2017-03-16 22:39:00 +01:00
/*---
2017-04-20 18:31:29 +02:00
description: RestParameter does not support an initializer (class declaration async method)
2017-03-16 22:39:00 +01:00
esid: sec-class-definitions-runtime-semantics-evaluation
2017-04-20 18:31:29 +02:00
features: [default-parameters]
2017-03-16 22:39:00 +01:00
flags: [generated]
negative:
phase: parse
2017-03-16 22:39:00 +01:00
type: SyntaxError
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
2017-04-20 18:31:29 +02:00
AsyncMethod : async PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody }
2017-03-16 22:39:00 +01:00
1. Let propKey be the result of evaluating PropertyName.
2. ReturnIfAbrupt(propKey).
2017-04-20 18:31:29 +02:00
3. If the function code for this AsyncMethod is strict mode code, let strict be true. Otherwise
let strict be false.
4. Let scope be the LexicalEnvironment of the running execution context.
5. Let closure be ! AsyncFunctionCreate(Method, UniqueFormalParameters, AsyncFunctionBody,
scope, strict).
2017-03-16 22:39:00 +01:00
[...]
14.1 Function Definitions
Syntax
FunctionRestParameter[Yield] :
BindingRestElement[?Yield]
13.3.3 Destructuring Binding Patterns
Syntax
BindingRestElement[Yield] :
...BindingIdentifier[?Yield]
...BindingPattern[?Yield]
---*/
2017-04-29 22:22:24 +02:00
throw "Test262: This statement should not be evaluated.";
2017-03-16 22:39:00 +01:00
2017-04-20 18:31:29 +02:00
2017-03-16 22:39:00 +01:00
class C {
2017-04-20 18:31:29 +02:00
async method(...x = []) {
2017-03-16 22:39:00 +01:00
}
}