mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Generate tests
This commit is contained in:
parent
0200c63396
commit
0cc55bb44d
@ -0,0 +1,57 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({...x} = { get v() { count++; return 2; } }) => {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,54 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) => {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 = ({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) => {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({ x, ...{y , z} } = o) => {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({...rest} = o) => {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,62 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/arrow-function-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (arrow function expression (default parameter))
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 = ({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) => {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,57 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({...x}) => {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({ get v() { count++; return 2; } });
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,54 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({a, b, ...{c, e}}) => {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 = ({a, b, ...{c, ...rest}}) => {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({ x, ...{y , z} }) => {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(o);
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = ({...rest}) => {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(o);
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,62 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/arrow-function.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (arrow function expression)
|
||||
esid: sec-arrow-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.2.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 = ({a, b, ...rest}) => {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({x: 1, y: 2, a: 5, b: 3});
|
||||
assert.sameValue(callCount, 1, 'arrow function invoked exactly once');
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-descriptors.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Object created from rest deconstruction doesn't copy source object property descriptors. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
var obj = {};
|
||||
Object.defineProperty(obj, "a", { value: 3, configurable: false, enumerable: true });
|
||||
Object.defineProperty(obj, "b", { value: 4, writable: false, enumerable: true });
|
||||
|
||||
var result;
|
||||
var vals = obj;
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,32 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-empty-obj.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: RestBindingInitialization creates a new object even if lhs is an empty object (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
|
||||
var result;
|
||||
var vals = {};
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.notSameValue(rest, undefined);
|
||||
assert.notSameValue(rest, null);
|
||||
assert.sameValue(typeof rest, "object");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,27 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-getter-abrupt-get-error.case
|
||||
// - src/dstr-assignment/error/assignment-expr.template
|
||||
/*---
|
||||
description: Rest deconstruction doesn't happen if getter return is abrupt (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var x;
|
||||
var count = 0;
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
0, {...x} = { get v() { count++; throw new Test262Error(); } };
|
||||
});
|
||||
|
||||
assert.sameValue(count, 1);
|
||||
|
36
test/language/expressions/assignment/dstr-obj-rest-getter.js
Normal file
36
test/language/expressions/assignment/dstr-obj-rest-getter.js
Normal file
@ -0,0 +1,36 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-getter.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var x;
|
||||
var count = 0;
|
||||
|
||||
var result;
|
||||
var vals = { get v() { count++; return 2; } };
|
||||
|
||||
result = {...x} = vals;
|
||||
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,43 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj-nested-rest.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var a, b, c, rest;
|
||||
|
||||
var result;
|
||||
var vals = {a: 1, b: 2, c: 3, d: 4, e: 5};
|
||||
|
||||
result = {a, b, ...{c, ...rest}} = vals;
|
||||
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var a, b, c, d, e;
|
||||
|
||||
var result;
|
||||
var vals = {a: 1, b: 2, c: 3, d: 4, e: 5};
|
||||
|
||||
result = {a, b, ...{c, e}} = vals;
|
||||
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
assert.sameValue(d, undefined);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,25 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-not-last-element-invalid.case
|
||||
// - src/dstr-assignment/syntax/assignment-expr.template
|
||||
/*---
|
||||
description: Object rest element needs to be the last AssignmenProperty in ObjectAssignmentPattern. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest, b;
|
||||
|
||||
0, {...rest, b} = {}
|
||||
;
|
32
test/language/expressions/assignment/dstr-obj-rest-number.js
Normal file
32
test/language/expressions/assignment/dstr-obj-rest-number.js
Normal file
@ -0,0 +1,32 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-number.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: RestBindingInitialization creates a new object even if lhs is a Number (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
|
||||
var result;
|
||||
var vals = 51;
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.notSameValue(rest, undefined);
|
||||
assert.notSameValue(rest, null);
|
||||
assert(rest instanceof Object);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,35 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-obj-own-property.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var x, y, z;
|
||||
|
||||
var result;
|
||||
var vals = o;
|
||||
|
||||
result = { x, ...{y , z} } = vals;
|
||||
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,24 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-put-const.case
|
||||
// - src/dstr-assignment/error/assignment-expr.template
|
||||
/*---
|
||||
description: The object rest deconstruction assignment target should obey `const` semantics. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [const, destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
const rest = null;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
0, {...rest} = {}
|
||||
;
|
||||
});
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-skip-non-enumerable.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
var obj = {a: 3, b: 4};
|
||||
Object.defineProperty(obj, "x", { value: 4, enumerable: false });
|
||||
|
||||
var result;
|
||||
var vals = obj;
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(rest, "x"), undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,33 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-str-val.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: RestBindingInitialization creats an object with indexes as property name (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
|
||||
var result;
|
||||
var vals = "foo";
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.sameValue(rest["0"], "f");
|
||||
assert.sameValue(rest["1"], "o");
|
||||
assert.sameValue(rest["2"], "o");
|
||||
assert(rest instanceof Object);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,32 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-symbol-val.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: RestBindingInitialization creates a new object if lhs is a Symbol (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
|
||||
var result;
|
||||
var vals = Symbol("foo");
|
||||
|
||||
result = {...rest} = vals;
|
||||
|
||||
assert.notSameValue(rest, undefined);
|
||||
assert.notSameValue(rest, null);
|
||||
assert(rest instanceof Object);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,39 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-to-property-with-setter.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object property setter, its value should be binded as rest object. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var settedValue;
|
||||
var executedGetter = false;
|
||||
var src = {
|
||||
get y() { executedGetter = true; },
|
||||
set y(v) {
|
||||
settedValue = v;
|
||||
}
|
||||
}
|
||||
src.y = undefined;
|
||||
|
||||
var result;
|
||||
var vals = { x: 1, y: 2};
|
||||
|
||||
result = {...src.y} = vals;
|
||||
|
||||
assert.sameValue(settedValue.x, 1);
|
||||
assert.sameValue(settedValue.y, 2);
|
||||
assert(!executedGetter, "The property should not be accessed");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,35 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-to-property.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object property, its value should be binded as rest object. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var src = {};
|
||||
|
||||
var result;
|
||||
var vals = { x: 1, y: 2};
|
||||
|
||||
result = {...src.y} = vals;
|
||||
|
||||
assert.sameValue(src.y.x, 1);
|
||||
assert.sameValue(src.y.y, 2);
|
||||
|
||||
verifyEnumerable(src, "y");
|
||||
verifyWritable(src, "y");
|
||||
verifyConfigurable(src, "y");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,24 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-val-null.case
|
||||
// - src/dstr-assignment/error/assignment-expr.template
|
||||
/*---
|
||||
description: TypeError is thrown when rhs is null because of 7.1.13 ToObject ( argument ) used by CopyDataProperties (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
0, {...rest} = null
|
||||
;
|
||||
});
|
@ -0,0 +1,24 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-val-undefined.case
|
||||
// - src/dstr-assignment/error/assignment-expr.template
|
||||
/*---
|
||||
description: TypeError is thrown when rhs is ```undefined``` because of 7.1.13 ToObject ( argument ) used by CopyDataProperties (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest;
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
0, {...rest} = undefined
|
||||
;
|
||||
});
|
@ -0,0 +1,42 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-valid-object.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var rest, a, b;
|
||||
|
||||
|
||||
var result;
|
||||
var vals = {x: 1, y: 2, a: 5, b: 3};
|
||||
|
||||
result = {a, b, ...rest} = vals;
|
||||
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
@ -0,0 +1,82 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,89 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,82 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({ get v() { count++; return 2; } }).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,89 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method(o).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
*method({...rest}) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method(o).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({x: 1, y: 2, a: 5, b: 3}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,82 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,89 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (static class expression generator method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method().next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,82 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({ get v() { count++; return 2; } }).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,89 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,80 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method(o).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,88 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static *method({...rest}) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method(o).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,87 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-gen-meth-static.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (static class expression generator method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({x: 1, y: 2, a: 5, b: 3}).next();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,86 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,84 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({ get v() { count++; return 2; } });
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,86 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method(o);
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
method({...rest}) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method(o);
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,84 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
new C().method({x: 1, y: 2, a: 5, b: 3});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,86 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,84 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (static class expression method (default parameter))
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method();
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,79 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({ get v() { count++; return 2; } });
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,76 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,86 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,77 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method(o);
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,85 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var C = class {
|
||||
static method({...rest}) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method(o);
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,84 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/cls-expr-meth-static.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (static class expression method)
|
||||
esid: sec-class-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.5.16
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
}
|
||||
};
|
||||
|
||||
C.method({x: 1, y: 2, a: 5, b: 3});
|
||||
assert.sameValue(callCount, 1, 'method invoked exactly once');
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,65 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (function expression (default parameter))
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f();
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({ get v() { count++; return 2; } });
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,65 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(o);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function({...rest}) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(o);
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/func-expr.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (function expression)
|
||||
esid: sec-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.1.20
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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({a, b, ...rest}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({x: 1, y: 2, a: 5, b: 3});
|
||||
assert.sameValue(callCount, 1, 'function invoked exactly once');
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({...x} = { get v() { count++; return 2; } }) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({a, b, ...{c, e}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,65 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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*({a, b, ...{c, ...rest}} = {a: 1, b: 2, c: 3, d: 4, e: 5}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({ x, ...{y , z} } = o) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,64 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-skip-non-enumerable.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object doesn't contain non-enumerable properties (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = {a: 3, b: 4};
|
||||
Object.defineProperty(o, "x", { value: 4, enumerable: false });
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({...rest} = o) {
|
||||
assert.sameValue(rest.a, 3);
|
||||
assert.sameValue(rest.b, 4);
|
||||
assert.sameValue(rest.x, undefined);
|
||||
|
||||
verifyEnumerable(rest, "a");
|
||||
verifyWritable(rest, "a");
|
||||
verifyConfigurable(rest, "a");
|
||||
|
||||
verifyEnumerable(rest, "b");
|
||||
verifyWritable(rest, "b");
|
||||
verifyConfigurable(rest, "b");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,63 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-val-obj.case
|
||||
// - src/dstr-binding/default/gen-func-expr-dflt.template
|
||||
/*---
|
||||
description: Rest object contains just unextracted data (generator function expression (default parameter))
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding, default-parameters]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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*({a, b, ...rest} = {x: 1, y: 2, a: 5, b: 3}) {
|
||||
assert.sameValue(rest.x, 1);
|
||||
assert.sameValue(rest.y, 2);
|
||||
assert.sameValue(rest.a, undefined);
|
||||
assert.sameValue(rest.b, undefined);
|
||||
|
||||
verifyEnumerable(rest, "x");
|
||||
verifyWritable(rest, "x");
|
||||
verifyConfigurable(rest, "x");
|
||||
|
||||
verifyEnumerable(rest, "y");
|
||||
verifyWritable(rest, "y");
|
||||
verifyConfigurable(rest, "y");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f().next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,58 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-getter.case
|
||||
// - src/dstr-binding/default/gen-func-expr.template
|
||||
/*---
|
||||
description: Getter is called when obj is being deconstructed to a rest Object (generator function expression)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 count = 0;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({...x}) {
|
||||
assert.sameValue(x.v, 2);
|
||||
assert.sameValue(count, 1);
|
||||
|
||||
verifyEnumerable(x, "v");
|
||||
verifyWritable(x, "v");
|
||||
verifyConfigurable(x, "v");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({ get v() { count++; return 2; } }).next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,55 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding/default/gen-func-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (generator function expression)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
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 obj = {a: 3, b: 4};
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({a, b, ...{c, e}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,65 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding/default/gen-func-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (generator function expression)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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*({a, b, ...{c, ...rest}}) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f({a: 1, b: 2, c: 3, d: 4, e: 5}).next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
@ -0,0 +1,56 @@
|
||||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding/default/gen-func-expr.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (generator function expression)
|
||||
esid: sec-generator-function-definitions-runtime-semantics-evaluation
|
||||
es6id: 14.4.14
|
||||
features: [destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
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 o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var callCount = 0;
|
||||
var f;
|
||||
f = function*({ x, ...{y , z} }) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
callCount = callCount + 1;
|
||||
};
|
||||
|
||||
f(o).next();
|
||||
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|
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