summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2017-06-28 15:48:54 -0400
committerRick Waldron <waldron.rick@gmail.com>2017-06-28 15:48:54 -0400
commitd05b7dfa35785945440bab1babb5567ca8432e07 (patch)
tree498552600388b1f0e59806f66dadbc342273c0d8 /src
parent5359b1e2fd2a1da807b90eb8077e4f2763feca60 (diff)
downloadqtdeclarative-testsuites-d05b7dfa35785945440bab1babb5567ca8432e07.tar.gz
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>
Diffstat (limited to 'src')
-rw-r--r--src/dstr-assignment/obj-rest-computed-property-no-strict.case39
-rw-r--r--src/dstr-assignment/obj-rest-computed-property.case3
2 files changed, 41 insertions, 1 deletions
diff --git a/src/dstr-assignment/obj-rest-computed-property-no-strict.case b/src/dstr-assignment/obj-rest-computed-property-no-strict.case
new file mode 100644
index 000000000..79df04536
--- /dev/null
+++ b/src/dstr-assignment/obj-rest-computed-property-no-strict.case
@@ -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
+});
+
diff --git a/src/dstr-assignment/obj-rest-computed-property.case b/src/dstr-assignment/obj-rest-computed-property.case
index 75fff7e67..e9f102cff 100644
--- a/src/dstr-assignment/obj-rest-computed-property.case
+++ b/src/dstr-assignment/obj-rest-computed-property.case
@@ -3,7 +3,7 @@
/*---
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.
template: default
esid: pending
@@ -13,6 +13,7 @@ features: [object-rest]
//- setup
var a = "foo";
+var b, rest;
//- elems
{[a]:b, ...rest}
//- vals