mirror of
https://github.com/tc39/test262.git
synced 2025-07-18 03:24:39 +02:00
Merge pull request #1708 from leobalter/private-methods-dstr-binding
Add private methods templates for dstr-binding
This commit is contained in:
commit
eda30f8984
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-dflt-
|
||||||
|
name: private class expression async generator method (default parameters)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
async * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-dflt-
|
||||||
|
name: private static class expression async generator method (default parameter)
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static async * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-
|
||||||
|
name: private static class expression async generator method
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static async * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,57 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
async * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-dflt-
|
||||||
|
name: private class expression method (default parameters)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
* #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-dflt-
|
||||||
|
name: private static class expression generator method (default parameter)
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method().next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-
|
||||||
|
name: private static class expression generator method
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, generators, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/).next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
74
src/dstr-binding/default/cls-decl-private-gen-meth.template
Normal file
74
src/dstr-binding/default/cls-decl-private-gen-meth.template
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, generators, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod : * PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
* #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/).next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
72
src/dstr-binding/default/cls-decl-private-meth-dflt.template
Normal file
72
src/dstr-binding/default/cls-decl-private-meth-dflt.template
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-dflt-
|
||||||
|
name: private class expression method (default parameter)
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-methods-private, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
#method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-static-dflt-
|
||||||
|
name: private static class expression method (default parameter)
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-static-
|
||||||
|
name: private static class expression method
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-static-methods-private, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
static #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/);
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
72
src/dstr-binding/default/cls-decl-private-meth.template
Normal file
72
src/dstr-binding/default/cls-decl-private-meth.template
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||||
|
features: [class, class-methods-private, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
class C {
|
||||||
|
#method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/);
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-dflt-
|
||||||
|
name: private class expression async generator method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-dflt-
|
||||||
|
name: private static class expression async generator method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static async * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-
|
||||||
|
name: private static class expression async generator method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static async * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,58 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, 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).
|
||||||
|
[...]
|
||||||
|
flags: [async]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-dflt-
|
||||||
|
name: private class expression method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, generators, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod :
|
||||||
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
* #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-dflt-
|
||||||
|
name: private static class expression generator method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, generators, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod :
|
||||||
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static * #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method().next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-static-
|
||||||
|
name: private static class expression generator method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, generators, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod :
|
||||||
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static * #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/).next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
76
src/dstr-binding/default/cls-expr-private-gen-meth.template
Normal file
76
src/dstr-binding/default/cls-expr-private-gen-meth.template
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
// Copyright (C) 2018 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-private-gen-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, generators, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
|
||||||
|
|
||||||
|
GeneratorMethod :
|
||||||
|
* PropertyName ( StrictFormalParameters ) { GeneratorBody }
|
||||||
|
|
||||||
|
1. Let propKey be the result of evaluating PropertyName.
|
||||||
|
2. ReturnIfAbrupt(propKey).
|
||||||
|
3. If the function code for this GeneratorMethod 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 GeneratorFunctionCreate(Method,
|
||||||
|
StrictFormalParameters, GeneratorBody, scope, strict).
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
* #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/).next();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
73
src/dstr-binding/default/cls-expr-private-meth-dflt.template
Normal file
73
src/dstr-binding/default/cls-expr-private-meth-dflt.template
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-dflt-
|
||||||
|
name: private class expression method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
#method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-static-dflt-
|
||||||
|
name: private static class expression method (default parameter)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, destructuring-binding, default-parameters]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static #method(/*{ elems }*/ = /*{ vals }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method();
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-static-
|
||||||
|
name: private static class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-static-methods-private, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
static #method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
C.method(/*{ vals }*/);
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
73
src/dstr-binding/default/cls-expr-private-meth.template
Normal file
73
src/dstr-binding/default/cls-expr-private-meth.template
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
// Copyright (C) 2018 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-private-meth-
|
||||||
|
name: private class expression method
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, destructuring-binding]
|
||||||
|
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.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
14.3.8 Runtime Semantics: DefineMethod
|
||||||
|
|
||||||
|
MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody,
|
||||||
|
scope, strict). If functionPrototype was passed as a parameter then pass its
|
||||||
|
value as the functionPrototype optional argument of FunctionCreate.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1 [[Call]] ( thisArgument, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.1.3 OrdinaryCallEvaluateBody ( F, argumentsList )
|
||||||
|
|
||||||
|
1. Let status be FunctionDeclarationInstantiation(F, argumentsList).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
|
||||||
|
|
||||||
|
[...]
|
||||||
|
23. Let iteratorRecord be Record {[[iterator]]:
|
||||||
|
CreateListIterator(argumentsList), [[done]]: false}.
|
||||||
|
24. If hasDuplicates is true, then
|
||||||
|
[...]
|
||||||
|
25. Else,
|
||||||
|
b. Let formalStatus be IteratorBindingInitialization for formals with
|
||||||
|
iteratorRecord and env as arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
#method(/*{ elems }*/) {
|
||||||
|
/*{ body }*/
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(/*{ vals }*/);
|
||||||
|
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,82 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-init-iter-close.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Iterator is closed when not exhausted by pattern evaluation (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [Symbol.iterator, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||||
|
|
||||||
|
BindingPattern : ArrayBindingPattern
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||||
|
result).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var doneCallCount = 0;
|
||||||
|
var iter = {};
|
||||||
|
iter[Symbol.iterator] = function() {
|
||||||
|
return {
|
||||||
|
next: function() {
|
||||||
|
return { value: null, done: false };
|
||||||
|
},
|
||||||
|
return: function() {
|
||||||
|
doneCallCount += 1;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x]) {
|
||||||
|
assert.sameValue(doneCallCount, 1);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(iter).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,82 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-init-iter-no-close.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Iterator is not closed when exhausted by pattern evaluation (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [Symbol.iterator, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||||
|
|
||||||
|
BindingPattern : ArrayBindingPattern
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||||
|
result).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var doneCallCount = 0;
|
||||||
|
var iter = {};
|
||||||
|
iter[Symbol.iterator] = function() {
|
||||||
|
return {
|
||||||
|
next: function() {
|
||||||
|
return { value: null, done: true };
|
||||||
|
},
|
||||||
|
return: function() {
|
||||||
|
doneCallCount += 1;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x]) {
|
||||||
|
assert.sameValue(doneCallCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(iter).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,81 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-name-iter-val.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding with normal value iteration (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x, y, z]) {
|
||||||
|
assert.sameValue(x, 1);
|
||||||
|
assert.sameValue(y, 2);
|
||||||
|
assert.sameValue(z, 3);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[x, y, z] = [4, 5, 6]]) {
|
||||||
|
assert.sameValue(x, 4);
|
||||||
|
assert.sameValue(y, 5);
|
||||||
|
assert.sameValue(z, 6);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[x, y, z] = [4, 5, 6]]) {
|
||||||
|
assert.sameValue(x, 7);
|
||||||
|
assert.sameValue(y, 8);
|
||||||
|
assert.sameValue(z, 9);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([[7, 8, 9]]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,80 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var first = 0;
|
||||||
|
var second = 0;
|
||||||
|
function* g() {
|
||||||
|
first += 1;
|
||||||
|
yield;
|
||||||
|
second += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[,] = g()]) {
|
||||||
|
assert.sameValue(first, 1);
|
||||||
|
assert.sameValue(second, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var callCount = 0;
|
||||||
|
function* g() {
|
||||||
|
callCount += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[,] = g()]) {
|
||||||
|
assert.sameValue(callCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([[]]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,76 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
var iterCount = 0;
|
||||||
|
var iter = function*() { iterCount += 1; }();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[] = function() { initCount += 1; return iter; }()]) {
|
||||||
|
assert.sameValue(initCount, 1);
|
||||||
|
assert.sameValue(iterCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[] = function() { initCount += 1; }()]) {
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([[23]]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var values = [2, 1, 3];
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[...x] = values]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x[0], 2);
|
||||||
|
assert.sameValue(x[1], 1);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,80 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var values = [2, 1, 3];
|
||||||
|
var initCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[...x] = function() { initCount += 1; }()]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x[0], 2);
|
||||||
|
assert.sameValue(x[1], 1);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([values]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,72 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with an exhausted iterator (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23]) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding does assign name to arrow functions (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([arrow = () => {}]) {
|
||||||
|
assert.sameValue(arrow.name, 'arrow');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }]) {
|
||||||
|
assert.sameValue(cls.name, 'cls');
|
||||||
|
assert.notSameValue(xCls.name, 'xCls');
|
||||||
|
assert.notSameValue(xCls2.name, 'xCls2');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([cover = (function () {}), xCover = (0, function() {})]) {
|
||||||
|
assert.sameValue(cover.name, 'cover');
|
||||||
|
assert.notSameValue(xCover.name, 'xCover');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns name to "anonymous" functions (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([fn = function () {}, xFn = function x() {}]) {
|
||||||
|
assert.sameValue(fn.name, 'fn');
|
||||||
|
assert.notSameValue(xFn.name, 'xFn');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([gen = function* () {}, xGen = function* x() {}]) {
|
||||||
|
assert.sameValue(gen.name, 'gen');
|
||||||
|
assert.notSameValue(xGen.name, 'xGen');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,68 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with a "hole" (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
[...] 6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23]) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
// another statement
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([,]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
function counter() {
|
||||||
|
initCount += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([w = counter(), x = counter(), y = counter(), z = counter()]) {
|
||||||
|
assert.sameValue(w, null);
|
||||||
|
assert.sameValue(x, 0);
|
||||||
|
assert.sameValue(y, false);
|
||||||
|
assert.sameValue(z, '');
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([null, 0, false, '']).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,71 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with an undefined value (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23]) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([undefined]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration completes (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x]) {
|
||||||
|
assert.sameValue(x, undefined);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,70 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration was completed previously (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([_, x]) {
|
||||||
|
assert.sameValue(x, undefined);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,81 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration was completed previously (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x, y, z]) {
|
||||||
|
assert.sameValue(x, 1);
|
||||||
|
assert.sameValue(y, 2);
|
||||||
|
assert.sameValue(z, 3);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
|
||||||
|
assert.sameValue(x, 44);
|
||||||
|
assert.sameValue(y, 55);
|
||||||
|
assert.sameValue(z, 66);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }]) {
|
||||||
|
assert.sameValue(x, 11);
|
||||||
|
assert.sameValue(y, 22);
|
||||||
|
assert.sameValue(z, 33);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([{ x: 11, y: 22, z: 33 }]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,83 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
|
||||||
|
assert.sameValue(v, 444);
|
||||||
|
assert.sameValue(x, 555);
|
||||||
|
assert.sameValue(z, 666);
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
u;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
w;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
y;
|
||||||
|
});
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,83 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is not used (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }]) {
|
||||||
|
assert.sameValue(v, 777);
|
||||||
|
assert.sameValue(x, 888);
|
||||||
|
assert.sameValue(z, 999);
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
u;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
w;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
y;
|
||||||
|
});
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([{ u: 777, w: 888, y: 999 }]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,78 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elision-exhausted.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Elision accepts exhausted iterator (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ Elision ]
|
||||||
|
|
||||||
|
1. Return the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||||
|
as the argument.
|
||||||
|
|
||||||
|
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||||
|
|
||||||
|
Elision : ,
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
[...]
|
||||||
|
2. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var iter = function*() {}();
|
||||||
|
iter.next();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([,]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(iter).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,87 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elision.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Elision advances iterator (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ Elision ]
|
||||||
|
|
||||||
|
1. Return the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||||
|
as the argument.
|
||||||
|
|
||||||
|
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||||
|
|
||||||
|
Elision : ,
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
2. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var first = 0;
|
||||||
|
var second = 0;
|
||||||
|
function* g() {
|
||||||
|
first += 1;
|
||||||
|
yield;
|
||||||
|
second += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([,]) {
|
||||||
|
assert.sameValue(first, 1);
|
||||||
|
assert.sameValue(second, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(g()).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,70 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-empty.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: No iteration occurs for an "empty" array binding pattern (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ ]
|
||||||
|
|
||||||
|
1. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var iterations = 0;
|
||||||
|
var iter = function*() {
|
||||||
|
iterations += 1;
|
||||||
|
}();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([]) {
|
||||||
|
assert.sameValue(iterations, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(iter).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,94 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an array BindingElementList pattern (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[x, y, z]]) {
|
||||||
|
assert.sameValue(x, 3);
|
||||||
|
assert.sameValue(y, 4);
|
||||||
|
assert.sameValue(z, 5);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([3, 4, 5]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,100 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-ary-elision.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an elision (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ Elision ]
|
||||||
|
|
||||||
|
1. Return the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||||
|
as the argument.
|
||||||
|
|
||||||
|
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||||
|
|
||||||
|
Elision : ,
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
2. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var first = 0;
|
||||||
|
var second = 0;
|
||||||
|
function* g() {
|
||||||
|
first += 1;
|
||||||
|
yield;
|
||||||
|
second += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[,]]) {
|
||||||
|
assert.sameValue(first, 1);
|
||||||
|
assert.sameValue(second, 1);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(g()).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,83 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-ary-empty.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an "empty" array pattern (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ ]
|
||||||
|
|
||||||
|
1. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var iterations = 0;
|
||||||
|
var iter = function*() {
|
||||||
|
iterations += 1;
|
||||||
|
}();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[]]) {
|
||||||
|
assert.sameValue(iterations, 1);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(iter).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,79 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-ary-rest.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing a rest element (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
var values = [1, 2, 3];
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[...x]]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.sameValue(x[0], 1);
|
||||||
|
assert.sameValue(x[1], 2);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(values).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-id-elision.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element following elision elements (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
ArrayBindingPattern : [ Elisionopt BindingRestElement ]
|
||||||
|
1. If Elision is present, then
|
||||||
|
a. Let status be the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with
|
||||||
|
iteratorRecord as the argument.
|
||||||
|
b. ReturnIfAbrupt(status).
|
||||||
|
2. Return the result of performing IteratorBindingInitialization for
|
||||||
|
BindingRestElement with iteratorRecord and environment as arguments.
|
||||||
|
---*/
|
||||||
|
var values = [1, 2, 3, 4, 5];
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([ , , ...x]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.sameValue(x[0], 3);
|
||||||
|
assert.sameValue(x[1], 4);
|
||||||
|
assert.sameValue(x[2], 5);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(values).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,71 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-id-exhausted.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: RestElement applied to an exhausted iterator (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [Symbol.iterator, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
BindingRestElement : ... BindingIdentifier
|
||||||
|
1. Let lhs be ResolveBinding(StringValue of BindingIdentifier,
|
||||||
|
environment).
|
||||||
|
2. ReturnIfAbrupt(lhs). 3. Let A be ArrayCreate(0). 4. Let n=0. 5. Repeat,
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. If environment is undefined, return PutValue(lhs, A).
|
||||||
|
ii. Return InitializeReferencedBinding(lhs, A).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([, , ...x]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x.length, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,72 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Lone rest element (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
BindingRestElement : ... BindingIdentifier
|
||||||
|
[...] 3. Let A be ArrayCreate(0). [...] 5. Repeat
|
||||||
|
[...]
|
||||||
|
f. Let status be CreateDataProperty(A, ToString (n), nextValue).
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
var values = [1, 2, 3];
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...x]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.sameValue(x[0], 1);
|
||||||
|
assert.sameValue(x[1], 2);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method(values).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-init-ary.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Reset element (nested array pattern) does not support initializer (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[ x ] = []]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-init-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Reset element (identifier) does not support initializer (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...x = []]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-init-obj.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Reset element (nested object pattern) does not support initializer (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...{ x } = []]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-not-final-ary.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element (array binding pattern) may not be followed by any element (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[x], y]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-not-final-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element (identifier) may not be followed by any element (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...x, y]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,69 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-not-final-obj.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element (object binding pattern) may not be followed by any element (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3 Destructuring Binding Patterns
|
||||||
|
ArrayBindingPattern[Yield] :
|
||||||
|
[ Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
[ BindingElementList[?Yield] ]
|
||||||
|
[ BindingElementList[?Yield] , Elisionopt BindingRestElement[?Yield]opt ]
|
||||||
|
---*/
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...{ x }, y]) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,72 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-obj-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an object binding pattern (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...{ length }]) {
|
||||||
|
assert.sameValue(length, 3);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([1, 2, 3]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,79 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-obj-prop-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an object binding pattern (private class expression method)
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
let length = "outer";
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...{ 0: v, 1: w, 2: x, 3: y, length: z }]) {
|
||||||
|
assert.sameValue(v, 7);
|
||||||
|
assert.sameValue(w, 8);
|
||||||
|
assert.sameValue(x, 9);
|
||||||
|
assert.sameValue(y, undefined);
|
||||||
|
assert.sameValue(z, 3);
|
||||||
|
|
||||||
|
assert.sameValue(length, "outer", "the length prop is not set as a binding name");
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method([7, 8, 9]).next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,82 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-init-iter-close.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Iterator is closed when not exhausted by pattern evaluation (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [Symbol.iterator, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||||
|
|
||||||
|
BindingPattern : ArrayBindingPattern
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||||
|
result).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var doneCallCount = 0;
|
||||||
|
var iter = {};
|
||||||
|
iter[Symbol.iterator] = function() {
|
||||||
|
return {
|
||||||
|
next: function() {
|
||||||
|
return { value: null, done: false };
|
||||||
|
},
|
||||||
|
return: function() {
|
||||||
|
doneCallCount += 1;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x] = iter) {
|
||||||
|
assert.sameValue(doneCallCount, 1);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,82 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-init-iter-no-close.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Iterator is not closed when exhausted by pattern evaluation (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [Symbol.iterator, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.5 Runtime Semantics: BindingInitialization
|
||||||
|
|
||||||
|
BindingPattern : ArrayBindingPattern
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, return ? IteratorClose(iterator,
|
||||||
|
result).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var doneCallCount = 0;
|
||||||
|
var iter = {};
|
||||||
|
iter[Symbol.iterator] = function() {
|
||||||
|
return {
|
||||||
|
next: function() {
|
||||||
|
return { value: null, done: true };
|
||||||
|
},
|
||||||
|
return: function() {
|
||||||
|
doneCallCount += 1;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x] = iter) {
|
||||||
|
assert.sameValue(doneCallCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,81 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-name-iter-val.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding with normal value iteration (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x, y, z] = [1, 2, 3]) {
|
||||||
|
assert.sameValue(x, 1);
|
||||||
|
assert.sameValue(y, 2);
|
||||||
|
assert.sameValue(z, 3);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elem-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[x, y, z] = [4, 5, 6]] = []) {
|
||||||
|
assert.sameValue(x, 4);
|
||||||
|
assert.sameValue(y, 5);
|
||||||
|
assert.sameValue(z, 6);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elem-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[x, y, z] = [4, 5, 6]] = [[7, 8, 9]]) {
|
||||||
|
assert.sameValue(x, 7);
|
||||||
|
assert.sameValue(y, 8);
|
||||||
|
assert.sameValue(z, 9);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,80 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elision-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var first = 0;
|
||||||
|
var second = 0;
|
||||||
|
function* g() {
|
||||||
|
first += 1;
|
||||||
|
yield;
|
||||||
|
second += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[,] = g()] = []) {
|
||||||
|
assert.sameValue(first, 1);
|
||||||
|
assert.sameValue(second, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-elision-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var callCount = 0;
|
||||||
|
function* g() {
|
||||||
|
callCount += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[,] = g()] = [[]]) {
|
||||||
|
assert.sameValue(callCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,76 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-empty-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
var iterCount = 0;
|
||||||
|
var iter = function*() { iterCount += 1; }();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[] = function() { initCount += 1; return iter; }()] = []) {
|
||||||
|
assert.sameValue(initCount, 1);
|
||||||
|
assert.sameValue(iterCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-empty-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[] = function() { initCount += 1; }()] = [[23]]) {
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-rest-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var values = [2, 1, 3];
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[...x] = values] = []) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x[0], 2);
|
||||||
|
assert.sameValue(x[1], 1);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,80 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-ary-rest-iter.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with array binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
[...]
|
||||||
|
e. Else,
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
[...]
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
var values = [2, 1, 3];
|
||||||
|
var initCount = 0;
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([[...x] = function() { initCount += 1; }()] = [values]) {
|
||||||
|
assert(Array.isArray(x));
|
||||||
|
assert.sameValue(x[0], 2);
|
||||||
|
assert.sameValue(x[1], 1);
|
||||||
|
assert.sameValue(x[2], 3);
|
||||||
|
assert.sameValue(x.length, 3);
|
||||||
|
assert.notSameValue(x, values);
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,72 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-exhausted.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with an exhausted iterator (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23] = []) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-arrow.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding does assign name to arrow functions (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([arrow = () => {}] = []) {
|
||||||
|
assert.sameValue(arrow.name, 'arrow');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-class.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns `name` to "anonymous" classes (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([cls = class {}, xCls = class X {}, xCls2 = class { static name() {} }] = []) {
|
||||||
|
assert.sameValue(cls.name, 'cls');
|
||||||
|
assert.notSameValue(xCls.name, 'xCls');
|
||||||
|
assert.notSameValue(xCls2.name, 'xCls2');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-cover.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding does assign name to "anonymous" functions "through" cover grammar (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([cover = (function () {}), xCover = (0, function() {})] = []) {
|
||||||
|
assert.sameValue(cover.name, 'cover');
|
||||||
|
assert.notSameValue(xCover.name, 'xCover');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,74 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-fn.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns name to "anonymous" functions (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([fn = function () {}, xFn = function x() {}] = []) {
|
||||||
|
assert.sameValue(fn.name, 'fn');
|
||||||
|
assert.notSameValue(xFn.name, 'xFn');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-fn-name-gen.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding assigns name to "anonymous" generator functions (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
c. ReturnIfAbrupt(v).
|
||||||
|
d. If IsAnonymousFunctionDefinition(Initializer) is true, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([gen = function* () {}, xGen = function* x() {}] = []) {
|
||||||
|
assert.sameValue(gen.name, 'gen');
|
||||||
|
assert.notSameValue(xGen.name, 'xGen');
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,68 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-hole.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with a "hole" (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
[...] 6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v). 8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23] = [,]) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
// another statement
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,77 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-skipped.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer is not evaluated when value is not `undefined` (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
var initCount = 0;
|
||||||
|
function counter() {
|
||||||
|
initCount += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([w = counter(), x = counter(), y = counter(), z = counter()] = [null, 0, false, '']) {
|
||||||
|
assert.sameValue(w, null);
|
||||||
|
assert.sameValue(x, 0);
|
||||||
|
assert.sameValue(y, false);
|
||||||
|
assert.sameValue(z, '');
|
||||||
|
assert.sameValue(initCount, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,71 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-init-undef.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Destructuring initializer with an undefined value (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be GetValue(defaultValue).
|
||||||
|
[...]
|
||||||
|
7. If environment is undefined, return PutValue(lhs, v).
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x = 23] = [undefined]) {
|
||||||
|
assert.sameValue(x, 23);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,75 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-complete.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration completes (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x] = []) {
|
||||||
|
assert.sameValue(x, undefined);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,70 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-done.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
[...]
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([_, x] = []) {
|
||||||
|
assert.sameValue(x, undefined);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,81 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-id-iter-val.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: SingleNameBinding when value iteration was completed previously (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([x, y, z] = [1, 2, 3]) {
|
||||||
|
assert.sameValue(x, 1);
|
||||||
|
assert.sameValue(y, 2);
|
||||||
|
assert.sameValue(z, 3);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-id-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = []) {
|
||||||
|
assert.sameValue(x, 44);
|
||||||
|
assert.sameValue(y, 55);
|
||||||
|
assert.sameValue(z, 66);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,73 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ x, y, z } = { x: 44, y: 55, z: 66 }] = [{ x: 11, y: 22, z: 33 }]) {
|
||||||
|
assert.sameValue(x, 11);
|
||||||
|
assert.sameValue(y, 22);
|
||||||
|
assert.sameValue(z, 33);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,83 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id-init.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = []) {
|
||||||
|
assert.sameValue(v, 444);
|
||||||
|
assert.sameValue(x, 555);
|
||||||
|
assert.sameValue(z, 666);
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
u;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
w;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
y;
|
||||||
|
});
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,83 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elem-obj-prop-id.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: BindingElement with object binding pattern and initializer is not used (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingElement : BindingPatternInitializer opt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
3. If Initializer is present and v is undefined, then
|
||||||
|
a. Let defaultValue be the result of evaluating Initializer.
|
||||||
|
b. Let v be ? GetValue(defaultValue).
|
||||||
|
4. Return the result of performing BindingInitialization of BindingPattern
|
||||||
|
with v and environment as the arguments.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([{ u: v, w: x, y: z } = { u: 444, w: 555, y: 666 }] = [{ u: 777, w: 888, y: 999 }]) {
|
||||||
|
assert.sameValue(v, 777);
|
||||||
|
assert.sameValue(x, 888);
|
||||||
|
assert.sameValue(z, 999);
|
||||||
|
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
u;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
w;
|
||||||
|
});
|
||||||
|
assert.throws(ReferenceError, function() {
|
||||||
|
y;
|
||||||
|
});
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,78 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elision-exhausted.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Elision accepts exhausted iterator (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ Elision ]
|
||||||
|
|
||||||
|
1. Return the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||||
|
as the argument.
|
||||||
|
|
||||||
|
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||||
|
|
||||||
|
Elision : ,
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
[...]
|
||||||
|
2. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var iter = function*() {}();
|
||||||
|
iter.next();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([,] = iter) {
|
||||||
|
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,87 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-elision.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Elision advances iterator (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ Elision ]
|
||||||
|
|
||||||
|
1. Return the result of performing
|
||||||
|
IteratorDestructuringAssignmentEvaluation of Elision with iteratorRecord
|
||||||
|
as the argument.
|
||||||
|
|
||||||
|
12.14.5.3 Runtime Semantics: IteratorDestructuringAssignmentEvaluation
|
||||||
|
|
||||||
|
Elision : ,
|
||||||
|
|
||||||
|
1. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
2. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var first = 0;
|
||||||
|
var second = 0;
|
||||||
|
function* g() {
|
||||||
|
first += 1;
|
||||||
|
yield;
|
||||||
|
second += 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([,] = g()) {
|
||||||
|
assert.sameValue(first, 1);
|
||||||
|
assert.sameValue(second, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,70 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-empty.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: No iteration occurs for an "empty" array binding pattern (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [generators, class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
ArrayBindingPattern : [ ]
|
||||||
|
|
||||||
|
1. Return NormalCompletion(empty).
|
||||||
|
|
||||||
|
---*/
|
||||||
|
var iterations = 0;
|
||||||
|
var iter = function*() {
|
||||||
|
iterations += 1;
|
||||||
|
}();
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([] = iter) {
|
||||||
|
assert.sameValue(iterations, 0);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,94 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dstr-binding/ary-ptrn-rest-ary-elem.case
|
||||||
|
// - src/dstr-binding/default/cls-expr-async-private-gen-meth-dflt.template
|
||||||
|
/*---
|
||||||
|
description: Rest element containing an array BindingElementList pattern (private class expression async generator method (default parameter))
|
||||||
|
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||||
|
features: [class, class-methods-private, async-iteration]
|
||||||
|
flags: [generated, async]
|
||||||
|
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).
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
BindingRestElement : ... BindingPattern
|
||||||
|
|
||||||
|
1. Let A be ArrayCreate(0).
|
||||||
|
[...]
|
||||||
|
3. Repeat
|
||||||
|
[...]
|
||||||
|
b. If iteratorRecord.[[done]] is true, then
|
||||||
|
i. Return the result of performing BindingInitialization of
|
||||||
|
BindingPattern with A and environment as the arguments.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
13.3.3.6 Runtime Semantics: IteratorBindingInitialization
|
||||||
|
|
||||||
|
SingleNameBinding : BindingIdentifier Initializeropt
|
||||||
|
|
||||||
|
[...]
|
||||||
|
4. If iteratorRecord.[[done]] is false, then
|
||||||
|
a. Let next be IteratorStep(iteratorRecord.[[iterator]]).
|
||||||
|
b. If next is an abrupt completion, set iteratorRecord.[[done]] to true.
|
||||||
|
c. ReturnIfAbrupt(next).
|
||||||
|
d. If next is false, set iteratorRecord.[[done]] to true.
|
||||||
|
e. Else,
|
||||||
|
[...]
|
||||||
|
i. Let v be IteratorValue(next).
|
||||||
|
ii. If v is an abrupt completion, set
|
||||||
|
iteratorRecord.[[done]] to true.
|
||||||
|
iii. ReturnIfAbrupt(v).
|
||||||
|
5. If iteratorRecord.[[done]] is true, let v be undefined.
|
||||||
|
[...]
|
||||||
|
8. Return InitializeReferencedBinding(lhs, v).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
var C = class {
|
||||||
|
async * #method([...[x, y, z]] = [3, 4, 5]) {
|
||||||
|
assert.sameValue(x, 3);
|
||||||
|
assert.sameValue(y, 4);
|
||||||
|
assert.sameValue(z, 5);
|
||||||
|
callCount = callCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
get method() {
|
||||||
|
return this.#method;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
new C().method().next().then(() => {
|
||||||
|
assert.sameValue(callCount, 1, 'invoked exactly once');
|
||||||
|
}).then($DONE, $DONE);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user