Skip to content
Snippets Groups Projects
Commit a57ffd11 authored by Rick Waldron's avatar Rick Waldron
Browse files

Remove tests that allow `...{` in object destructuring. Ref gh-1050

parent a2f44c71
No related branches found
No related tags found
No related merge requests found
// Copyright (C) 2017 Caio Lima. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: >
When DestructuringAssignmentTarget is an object literal, it should be parsed
parsed as a DestructuringAssignmentPattern and evaluated as a destructuring
assignment.
template: default
esid: pending
features: [object-rest]
---*/
//- setup
var obj = {a: 3, b: 4};
//- elems
{a, b, ...{c, e}}
//- vals
{a: 1, b: 2, c: 3, d: 4, e: 5}
//- body
assert.sameValue(a, 1);
assert.sameValue(b, 2);
assert.sameValue(c, 3);
assert.sameValue(e, 5);
// Copyright (C) 2017 Caio Lima. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: >
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.
template: default
esid: pending
includes: [propertyHelper.js]
features: [object-rest]
---*/
//- elems
{a, b, ...{c, ...rest}}
//- vals
{a: 1, b: 2, c: 3, d: 4, e: 5}
//- body
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");
// Copyright (C) 2017 Caio Lima. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: >
Rest object contains just soruce object's own properties
template: default
esid: pending
includes: [propertyHelper.js]
features: [object-rest]
---*/
//- setup
var o = Object.create({ x: 1, y: 2 });
o.z = 3;
//- elems
{ x, ...{y , z} }
//- vals
o
//- body
assert.sameValue(x, 1);
assert.sameValue(y, undefined);
assert.sameValue(z, 3);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment