diff options
author | André Bargull <andre.bargull@gmail.com> | 2017-09-01 23:44:52 +0200 |
---|---|---|
committer | André Bargull <andre.bargull@gmail.com> | 2017-09-01 23:44:52 +0200 |
commit | 13c94180c643d4b2ba8ebce6ff6a90e985dd42ec (patch) | |
tree | ba369011fbcbbdc5a811bf3541f7a59e5146e9a5 /src | |
parent | c23ea89fe254a498b47fa6efdec908aa1551971d (diff) | |
download | qtdeclarative-testsuites-13c94180c643d4b2ba8ebce6ff6a90e985dd42ec.tar.gz |
Fix bugs in class-field template and case files
- Correct property access in class fields template
- Remove assertions for properties which aren't present
- Correct expected assertion value for uninitialized class field
- Correct expected property descriptor attributes
- Fix property tests in class-fields/string-literal-names.case
- Pass restore option, otherwise it's not possible to call the method later
- Fix async iteration tests to test iteration result objects
Diffstat (limited to 'src')
16 files changed, 57 insertions, 31 deletions
diff --git a/src/class-fields/computed-names.case b/src/class-fields/computed-names.case index fcfaf5321..fc99050d6 100644 --- a/src/class-fields/computed-names.case +++ b/src/class-fields/computed-names.case @@ -63,7 +63,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "not initialized"), fal assert.sameValue(Object.hasOwnProperty.call(C, "not initialized"), false); verifyProperty(c, "not initialized", { - value: "meep", + value: undefined, enumerable: true, writable: true, configurable: true diff --git a/src/class-fields/default/cls-decl-after-same-line-async-gen.template b/src/class-fields/default/cls-decl-after-same-line-async-gen.template index 49983da69..b30c14785 100644 --- a/src/class-fields/default/cls-decl-after-same-line-async-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-async-gen.template @@ -21,10 +21,11 @@ verifyProperty(C.prototype, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ c.m().next().then(function(v) { - assert.sameValue(v, 42); + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/default/cls-decl-after-same-line-async-method.template b/src/class-fields/default/cls-decl-after-same-line-async-method.template index a261640dd..b494494da 100644 --- a/src/class-fields/default/cls-decl-after-same-line-async-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-async-method.template @@ -21,7 +21,7 @@ verifyProperty(C.prototype, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template b/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template index 5d5ad3f3e..004559513 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-async-gen.template @@ -21,10 +21,11 @@ verifyProperty(C, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ C.m().next().then(function(v) { - assert.sameValue(v, 42); + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/default/cls-decl-after-same-line-static-async-method.template b/src/class-fields/default/cls-decl-after-same-line-static-async-method.template index f83605e61..9829f1f19 100644 --- a/src/class-fields/default/cls-decl-after-same-line-static-async-method.template +++ b/src/class-fields/default/cls-decl-after-same-line-static-async-method.template @@ -21,7 +21,7 @@ verifyProperty(C, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ diff --git a/src/class-fields/default/cls-decl-multiple-definitions.template b/src/class-fields/default/cls-decl-multiple-definitions.template index 4aaa9f306..5519f47e0 100644 --- a/src/class-fields/default/cls-decl-multiple-definitions.template +++ b/src/class-fields/default/cls-decl-multiple-definitions.template @@ -43,7 +43,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); verifyProperty(c, "foo", { value: "foobar", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); @@ -54,7 +54,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); verifyProperty(c, "bar", { value: "barbaz", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); diff --git a/src/class-fields/default/cls-decl-multiple-stacked-definitions.template b/src/class-fields/default/cls-decl-multiple-stacked-definitions.template index d078ed5c0..52a7fc637 100644 --- a/src/class-fields/default/cls-decl-multiple-stacked-definitions.template +++ b/src/class-fields/default/cls-decl-multiple-stacked-definitions.template @@ -15,17 +15,13 @@ class C { var c = new C(); -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - assert.sameValue(c.foo, "foobar"); assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); verifyProperty(c, "foo", { value: "foobar", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); @@ -36,7 +32,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); verifyProperty(c, "bar", { value: "barbaz", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); diff --git a/src/class-fields/default/cls-decl-new-sc-line-generator.template b/src/class-fields/default/cls-decl-new-sc-line-generator.template index c124d126e..db8a636e1 100644 --- a/src/class-fields/default/cls-decl-new-sc-line-generator.template +++ b/src/class-fields/default/cls-decl-new-sc-line-generator.template @@ -14,7 +14,7 @@ class C { var c = new C(); -assert.sameValue(c.g().next().value, 42); +assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); diff --git a/src/class-fields/default/cls-expr-after-same-line-async-gen.template b/src/class-fields/default/cls-expr-after-same-line-async-gen.template index 4d5b11967..1d9aae852 100644 --- a/src/class-fields/default/cls-expr-after-same-line-async-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-async-gen.template @@ -21,10 +21,11 @@ verifyProperty(C.prototype, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ c.m().next().then(function(v) { - assert.sameValue(v, 42); + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/default/cls-expr-after-same-line-async-method.template b/src/class-fields/default/cls-expr-after-same-line-async-method.template index 52a8356a9..18ebd86c7 100644 --- a/src/class-fields/default/cls-expr-after-same-line-async-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-async-method.template @@ -21,7 +21,7 @@ verifyProperty(C.prototype, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template b/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template index f1fdb4f45..2ce7c13c8 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-async-gen.template @@ -21,10 +21,11 @@ verifyProperty(C, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ C.m().next().then(function(v) { - assert.sameValue(v, 42); + assert.sameValue(v.value, 42); + assert.sameValue(v.done, true); }, $DONE).then($DONE, $DONE); diff --git a/src/class-fields/default/cls-expr-after-same-line-static-async-method.template b/src/class-fields/default/cls-expr-after-same-line-static-async-method.template index caa1f2f23..007288a4f 100644 --- a/src/class-fields/default/cls-expr-after-same-line-static-async-method.template +++ b/src/class-fields/default/cls-expr-after-same-line-static-async-method.template @@ -21,7 +21,7 @@ verifyProperty(C, "m", { enumerable: false, configurable: true, writable: true, -}); +}, {restore: true}); /*{ assertions }*/ diff --git a/src/class-fields/default/cls-expr-multiple-definitions.template b/src/class-fields/default/cls-expr-multiple-definitions.template index a5440f626..be05aed55 100644 --- a/src/class-fields/default/cls-expr-multiple-definitions.template +++ b/src/class-fields/default/cls-expr-multiple-definitions.template @@ -43,7 +43,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); verifyProperty(c, "foo", { value: "foobar", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); @@ -54,7 +54,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); verifyProperty(c, "bar", { value: "barbaz", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); diff --git a/src/class-fields/default/cls-expr-multiple-stacked-definitions.template b/src/class-fields/default/cls-expr-multiple-stacked-definitions.template index bd0d63c78..ee9553f6e 100644 --- a/src/class-fields/default/cls-expr-multiple-stacked-definitions.template +++ b/src/class-fields/default/cls-expr-multiple-stacked-definitions.template @@ -15,17 +15,13 @@ var C = class { var c = new C(); -assert.sameValue(c.m(), 42); -assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); -assert.sameValue(c.m, C.prototype.m); - assert.sameValue(c.foo, "foobar"); assert.sameValue(Object.hasOwnProperty.call(C, "foo"), false); assert.sameValue(Object.hasOwnProperty.call(C.prototype, "foo"), false); verifyProperty(c, "foo", { value: "foobar", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); @@ -36,7 +32,7 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "bar"), false); verifyProperty(c, "bar", { value: "barbaz", - enumerable: false, + enumerable: true, configurable: true, writable: true, }); diff --git a/src/class-fields/default/cls-expr-new-sc-line-generator.template b/src/class-fields/default/cls-expr-new-sc-line-generator.template index 5ddf98c7c..50dafb9f3 100644 --- a/src/class-fields/default/cls-expr-new-sc-line-generator.template +++ b/src/class-fields/default/cls-expr-new-sc-line-generator.template @@ -14,7 +14,7 @@ var C = class { var c = new C(); -assert.sameValue(c.g().next().value, 42); +assert.sameValue(c.m().next().value, 42); assert.sameValue(c.m, C.prototype.m); assert.sameValue(Object.hasOwnProperty.call(c, "m"), false); diff --git a/src/class-fields/string-literal-names.case b/src/class-fields/string-literal-names.case index 98e37d5d0..87260a46f 100644 --- a/src/class-fields/string-literal-names.case +++ b/src/class-fields/string-literal-names.case @@ -26,6 +26,36 @@ assert.sameValue(Object.hasOwnProperty.call(C.prototype, "a"), false); assert.sameValue(Object.hasOwnProperty.call(C, "a"), false); verifyProperty(c, "a", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "b"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "b"), false); + +verifyProperty(c, "b", { + value: undefined, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "c"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "c"), false); + +verifyProperty(c, "c", { + value: 39, + enumerable: true, + writable: true, + configurable: true +}); + +assert.sameValue(Object.hasOwnProperty.call(C.prototype, "d"), false); +assert.sameValue(Object.hasOwnProperty.call(C, "d"), false); + +verifyProperty(c, "d", { value: 42, enumerable: true, writable: true, |