diff options
author | Leo Balter <leonardo.balter@gmail.com> | 2017-06-12 19:22:53 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-12 19:22:53 -0300 |
commit | 6110675fd3f9df8016aab0c51938c0c75230118f (patch) | |
tree | 72dbb300d8cb25f13ee616b3310497b331f1498a /src | |
parent | f1c1b33b5357c59f4dfe0c8a4b72b9f0bc1b5126 (diff) | |
parent | 8f5afc29155c960cdec037a9f7ed030a1570bc05 (diff) | |
download | qtdeclarative-testsuites-6110675fd3f9df8016aab0c51938c0c75230118f.tar.gz |
Merge pull request #1045 from caiolima/obj-rest-computed-prop
Adding case to computed property
Diffstat (limited to 'src')
-rw-r--r-- | src/dstr-assignment/obj-rest-computed-property.case | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/dstr-assignment/obj-rest-computed-property.case b/src/dstr-assignment/obj-rest-computed-property.case new file mode 100644 index 000000000..75fff7e67 --- /dev/null +++ b/src/dstr-assignment/obj-rest-computed-property.case @@ -0,0 +1,38 @@ +// 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] +---*/ + +//- 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 +}); + |