diff options
author | Caio Lima <ticaiolima@gmail.com> | 2017-05-20 19:43:20 -0300 |
---|---|---|
committer | Caio Lima <ticaiolima@gmail.com> | 2017-05-22 22:24:31 -0300 |
commit | 35adcb2a7dc29b58e6b46219b8e4c521645a476c (patch) | |
tree | 24f04002d9d6dbb2f30f58c9856d29934cd94610 /src | |
parent | e4b64ecc59e086922e7c13f0dd4769b070a3fa2f (diff) | |
download | qtdeclarative-testsuites-35adcb2a7dc29b58e6b46219b8e4c521645a476c.tar.gz |
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 +}); + |