mirror of https://github.com/tc39/test262.git
Add templates for destructuring with dflt params
This commit is contained in:
parent
11d5b4f18b
commit
744cb4d2c9
|
@ -0,0 +1,48 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/arrow-function/dstr-dflt-
|
||||
name: arrow function expression (default parameter)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
ArrowFunction : ArrowParameters => ConciseBody
|
||||
|
||||
[...]
|
||||
4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, 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 f;
|
||||
f = (/*{ elems }*/ = /*{ vals }*/) => {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright (C) 2016 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-gen-meth-dflt-
|
||||
name: class expression method (default parameters)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright (C) 2016 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-gen-meth-static-dflt-
|
||||
name: static class expression generator method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (C) 2016 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-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (C) 2016 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-meth-static-dflt-
|
||||
name: static class expression method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,73 @@
|
|||
// Copyright (C) 2016 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-gen-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,73 @@
|
|||
// Copyright (C) 2016 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-gen-meth-static-dflt-
|
||||
name: static class expression generator method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (C) 2016 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-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (C) 2016 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-meth-static-dflt-
|
||||
name: static class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,48 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/function/dstr-dflt-
|
||||
name: function declaration (default parameter)
|
||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
es6id: 14.1.19
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
FunctionDeclaration :
|
||||
function BindingIdentifier ( FormalParameters ) { FunctionBody }
|
||||
|
||||
[...]
|
||||
3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
|
||||
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;
|
||||
function f(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/function/dstr-dflt-
|
||||
name: function expression (default parameter)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
FunctionExpression : function ( FormalParameters ) { FunctionBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
|
||||
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 f;
|
||||
f = function(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/generators/dstr-dflt-
|
||||
name: generator function declaration (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
es6id: 14.4.12
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
[...]
|
||||
2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||
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;
|
||||
function* f(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/dstr-dflt-
|
||||
name: generator function expression (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||
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 f;
|
||||
f = function*(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/dstr-gen-meth-dflt-
|
||||
name: generator method (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
es6id: 14.4.13
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
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 obj = {
|
||||
*method(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
obj.method().next();
|
||||
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/dstr-meth-dflt-
|
||||
name: method (default parameter)
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
es6id: 14.3.8
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
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 obj = {
|
||||
method(/*{ elems }*/ = /*{ vals }*/) {
|
||||
/*{ body }*/
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
obj.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/arrow-function/dstr-dflt-
|
||||
name: arrow function expression (default parameter)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
ArrowFunction : ArrowParameters => ConciseBody
|
||||
|
||||
[...]
|
||||
4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, 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 f = (/*{ elems }*/ = /*{ vals }*/) => {};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (C) 2016 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-gen-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
*method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
var c = new C();
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
c.method();
|
||||
});
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright (C) 2016 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-gen-meth-static-dflt-
|
||||
name: static class expression generator method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
static *method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method();
|
||||
});
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright (C) 2016 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-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
c.method();
|
||||
});
|
|
@ -0,0 +1,66 @@
|
|||
// Copyright (C) 2016 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-meth-static-dflt-
|
||||
name: static class expression method (default parameter)
|
||||
esid: sec-runtime-semantics-bindingclassdeclarationevaluation
|
||||
es6id: 14.5.15
|
||||
features: [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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
class C {
|
||||
static method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method();
|
||||
});
|
|
@ -0,0 +1,71 @@
|
|||
// Copyright (C) 2016 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-gen-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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 C = class {
|
||||
*method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
var c = new C();
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
c.method();
|
||||
});
|
|
@ -0,0 +1,70 @@
|
|||
// Copyright (C) 2016 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-gen-meth-static-dflt-
|
||||
name: static class expression generator method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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 C = class {
|
||||
static *method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method();
|
||||
});
|
|
@ -0,0 +1,69 @@
|
|||
// Copyright (C) 2016 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-meth-dflt-
|
||||
name: class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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 C = class {
|
||||
method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
var c = new C();
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
c.method();
|
||||
});
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright (C) 2016 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-meth-static-dflt-
|
||||
name: static class expression method (default parameter)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [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 C = class {
|
||||
static method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
C.method();
|
||||
});
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/function/dstr-dflt-
|
||||
name: function declaration (default parameter)
|
||||
esid: sec-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
es6id: 14.1.19
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
FunctionDeclaration :
|
||||
function BindingIdentifier ( FormalParameters ) { FunctionBody }
|
||||
|
||||
[...]
|
||||
3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody,
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
function f(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/function/dstr-dflt-
|
||||
name: function expression (default parameter)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
FunctionExpression : function ( FormalParameters ) { FunctionBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody,
|
||||
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 f = function(/*{ elems }*/ = /*{ vals }*/) {};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/statements/generators/dstr-dflt-
|
||||
name: generator function declaration (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-instantiatefunctionobject
|
||||
es6id: 14.4.12
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
GeneratorDeclaration : function * ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
[...]
|
||||
2. Let F be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
function* f(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/generators/dstr-dflt-
|
||||
name: generator function expression (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
GeneratorExpression : function * ( FormalParameters ) { GeneratorBody }
|
||||
|
||||
[...]
|
||||
3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters,
|
||||
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 f = function*(/*{ elems }*/ = /*{ vals }*/) {};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
f();
|
||||
});
|
|
@ -0,0 +1,52 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/dstr-gen-meth-dflt-
|
||||
name: generator method (default parameter)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-propertydefinitionevaluation
|
||||
es6id: 14.4.13
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
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 obj = {
|
||||
*method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
obj.method();
|
||||
});
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
path: language/expressions/object/dstr-meth-dflt-
|
||||
name: method (default parameter)
|
||||
esid: sec-runtime-semantics-definemethod
|
||||
es6id: 14.3.8
|
||||
features: [destructuring-binding, default-parameters]
|
||||
info: |
|
||||
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 obj = {
|
||||
method(/*{ elems }*/ = /*{ vals }*/) {}
|
||||
};
|
||||
|
||||
assert.throws(/*{ error }*/, function() {
|
||||
obj.method();
|
||||
});
|
Loading…
Reference in New Issue