mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 07:25:15 +02:00
Duplicate src/dstr-assignment/obj-rest-computed-property.case into regular and sloppy versions. Fixes gh-1082
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
5359b1e2fd
commit
d05b7dfa35
@ -0,0 +1,39 @@
|
|||||||
|
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: >
|
||||||
|
Destructuring field can be a computed property, i.e it can be defined
|
||||||
|
only at runtime. Rest operantion needs to skip these properties as well.
|
||||||
|
template: default
|
||||||
|
esid: pending
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [object-rest]
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- setup
|
||||||
|
var a = "foo";
|
||||||
|
//- elems
|
||||||
|
{[a]:b, ...rest}
|
||||||
|
//- vals
|
||||||
|
{ foo: 1, bar: 2, baz: 3 }
|
||||||
|
//- body
|
||||||
|
assert.sameValue(b, 1);
|
||||||
|
assert.sameValue(rest.bar, 2);
|
||||||
|
assert.sameValue(rest.baz, 3);
|
||||||
|
|
||||||
|
assert.sameValue(Object.getOwnPropertyDescriptor(rest, "foo"), undefined);
|
||||||
|
|
||||||
|
verifyProperty(rest, "bar", {
|
||||||
|
enumerable: true,
|
||||||
|
writable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
verifyProperty(rest, "baz", {
|
||||||
|
enumerable: true,
|
||||||
|
writable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
desc: >
|
desc: >
|
||||||
Destructuring field can be a computed property, i.e it can be defined
|
Destructuring field can be a computed property, i.e it can be defined
|
||||||
only at runtime. Rest operantion needs to skip these properties as well.
|
only at runtime. Rest operantion needs to skip these properties as well.
|
||||||
template: default
|
template: default
|
||||||
esid: pending
|
esid: pending
|
||||||
@ -13,6 +13,7 @@ features: [object-rest]
|
|||||||
|
|
||||||
//- setup
|
//- setup
|
||||||
var a = "foo";
|
var a = "foo";
|
||||||
|
var b, rest;
|
||||||
//- elems
|
//- elems
|
||||||
{[a]:b, ...rest}
|
{[a]:b, ...rest}
|
||||||
//- vals
|
//- vals
|
||||||
|
Loading…
x
Reference in New Issue
Block a user