mirror of https://github.com/tc39/test262.git
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
This commit is contained in:
parent
c23ea89fe2
commit
13c94180c6
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -21,7 +21,7 @@ verifyProperty(C.prototype, "m", {
|
|||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
}, {restore: true});
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -21,7 +21,7 @@ verifyProperty(C, "m", {
|
|||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
}, {restore: true});
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -21,7 +21,7 @@ verifyProperty(C.prototype, "m", {
|
|||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
}, {restore: true});
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -21,7 +21,7 @@ verifyProperty(C, "m", {
|
|||
enumerable: false,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
}, {restore: true});
|
||||
|
||||
/*{ assertions }*/
|
||||
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue