From 1dd15dd2f39cb0ab7cc63035725b2de18b778812 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 22 Sep 2020 10:30:51 -0400 Subject: [PATCH] More cases --- ...-rest-non-string-computed-property-1.case} | 0 ...est-non-string-computed-property-1dot.case | 32 ++++++++++++++++++ ...st-non-string-computed-property-1dot0.case | 32 ++++++++++++++++++ ...rest-non-string-computed-property-1e0.case | 32 ++++++++++++++++++ ...-non-string-computed-property-array-1.case | 32 ++++++++++++++++++ ...on-string-computed-property-array-1e0.case | 33 +++++++++++++++++++ ...non-string-computed-property-string-1.case | 32 ++++++++++++++++++ 7 files changed, 193 insertions(+) rename src/dstr-assignment/{obj-rest-non-string-computed-property.case => obj-rest-non-string-computed-property-1.case} (100%) create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-1dot.case create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-1dot0.case create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-1e0.case create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-array-1.case create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-array-1e0.case create mode 100644 src/dstr-assignment/obj-rest-non-string-computed-property-string-1.case diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property.case b/src/dstr-assignment/obj-rest-non-string-computed-property-1.case similarity index 100% rename from src/dstr-assignment/obj-rest-non-string-computed-property.case rename to src/dstr-assignment/obj-rest-non-string-computed-property-1.case diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-1dot.case b/src/dstr-assignment/obj-rest-non-string-computed-property-1dot.case new file mode 100644 index 0000000000..6d6b068dca --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-1dot.case @@ -0,0 +1,32 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [compareArray.js,propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: [1], bar: 2 } +//- body +assert.compareArray(b, [1]); + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-1dot0.case b/src/dstr-assignment/obj-rest-non-string-computed-property-1dot0.case new file mode 100644 index 0000000000..dea8e0ffff --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-1dot0.case @@ -0,0 +1,32 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: 1.0, bar: 2 } +//- body +assert.sameValue(b, 1); + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-1e0.case b/src/dstr-assignment/obj-rest-non-string-computed-property-1e0.case new file mode 100644 index 0000000000..f1ef56cb84 --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-1e0.case @@ -0,0 +1,32 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: 1e0, bar: 2 } +//- body +assert.sameValue(b, 1); + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-array-1.case b/src/dstr-assignment/obj-rest-non-string-computed-property-array-1.case new file mode 100644 index 0000000000..6d6b068dca --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-array-1.case @@ -0,0 +1,32 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [compareArray.js,propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: [1], bar: 2 } +//- body +assert.compareArray(b, [1]); + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-array-1e0.case b/src/dstr-assignment/obj-rest-non-string-computed-property-array-1e0.case new file mode 100644 index 0000000000..82ee3d0dcc --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-array-1e0.case @@ -0,0 +1,33 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [compareArray.js,propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: [1e0], bar: 2 } +//- body +assert.compareArray(b, [1]); + + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); + diff --git a/src/dstr-assignment/obj-rest-non-string-computed-property-string-1.case b/src/dstr-assignment/obj-rest-non-string-computed-property-string-1.case new file mode 100644 index 0000000000..50df80b4da --- /dev/null +++ b/src/dstr-assignment/obj-rest-non-string-computed-property-string-1.case @@ -0,0 +1,32 @@ +// Copyright (C) 2020 HyeockJin Kim. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + Destructuring field can be a non-string computed property, i.e it + can be defined only at runtime. Rest operation needs to skip + these properties as well. +template: default +includes: [propertyHelper.js] +features: [object-rest] +---*/ + +//- setup +var a = 1.; +var b, rest; +//- elems +{[a]:b, ...rest} +//- vals +{[a]: "1", bar: 2 } +//- body +assert.sameValue(b, "1"); + +assert.sameValue(Object.getOwnPropertyDescriptor(rest, "1"), undefined); + +verifyProperty(rest, "bar", { + value: 2, + enumerable: true, + writable: true, + configurable: true +}); +