diff --git a/test/built-ins/DataView/prototype/Symbol.toStringTag.js b/test/built-ins/DataView/prototype/Symbol.toStringTag.js index eb71c49b50..0b8e5d43c8 100644 --- a/test/built-ins/DataView/prototype/Symbol.toStringTag.js +++ b/test/built-ins/DataView/prototype/Symbol.toStringTag.js @@ -14,7 +14,11 @@ includes: [propertyHelper.js] features: [Symbol.toStringTag] ---*/ -assert.sameValue(DataView.prototype[Symbol.toStringTag], 'DataView'); +assert.sameValue( + DataView.prototype[Symbol.toStringTag], + 'DataView', + 'The value of DataView.prototype[Symbol.toStringTag] is expected to be "DataView"' +); verifyNotEnumerable(DataView.prototype, Symbol.toStringTag); verifyNotWritable(DataView.prototype, Symbol.toStringTag); diff --git a/test/built-ins/Date/S15.9.2.1_A1.js b/test/built-ins/Date/S15.9.2.1_A1.js index 40ca9cbd79..f298abc2f0 100644 --- a/test/built-ins/Date/S15.9.2.1_A1.js +++ b/test/built-ins/Date/S15.9.2.1_A1.js @@ -9,73 +9,63 @@ info: | es5id: 15.9.2.1_A1 description: Checking type of returned value ---*/ +assert.sameValue(typeof Date(), "string", 'The value of `typeof Date()` is expected to be "string"'); +assert.sameValue(typeof Date(1), "string", 'The value of `typeof Date(1)` is expected to be "string"'); +assert.sameValue(typeof Date(1970, 1), "string", 'The value of `typeof Date(1970, 1)` is expected to be "string"'); -//CHECK#1 -if (typeof Date() !== "string") { - throw new Test262Error('#1: typeof Date() should be "string", actual is ' + (typeof Date())); -} +assert.sameValue( + typeof Date(1970, 1, 1), + "string", + 'The value of `typeof Date(1970, 1, 1)` is expected to be "string"' +); -//CHECK#2 -if (typeof Date(1) !== "string") { - throw new Test262Error('#2: typeof Date(1) should be "string", actual is ' + (typeof Date(1))); -} +assert.sameValue( + typeof Date(1970, 1, 1, 1), + "string", + 'The value of `typeof Date(1970, 1, 1, 1)` is expected to be "string"' +); -//CHECK#3 -if (typeof Date(1970, 1) !== "string") { - throw new Test262Error('#3: typeof Date(1970, 1) should be "string", actual is ' + (typeof Date(1970, 1))); -} +assert.sameValue( + typeof Date(1970, 1, 1, 1), + "string", + 'The value of `typeof Date(1970, 1, 1, 1)` is expected to be "string"' +); -//CHECK#4 -if (typeof Date(1970, 1, 1) !== "string") { - throw new Test262Error('#4: typeof Date(1970, 1, 1) should be "string", actual is ' + (typeof Date(1970, 1, 1))); -} +assert.sameValue( + typeof Date(1970, 1, 1, 1, 0), + "string", + 'The value of `typeof Date(1970, 1, 1, 1, 0)` is expected to be "string"' +); -//CHECK#5 -if (typeof Date(1970, 1, 1, 1) !== "string") { - throw new Test262Error('#5: typeof Date(1970, 1, 1, 1) should be "string", actual is ' + (typeof Date(1970, 1, 1, 1))); -} +assert.sameValue( + typeof Date(1970, 1, 1, 1, 0, 0), + "string", + 'The value of `typeof Date(1970, 1, 1, 1, 0, 0)` is expected to be "string"' +); -//CHECK#6 -if (typeof Date(1970, 1, 1, 1) !== "string") { - throw new Test262Error('#7: typeof Date(1970, 1, 1, 1) should be "string", actual is ' + (typeof Date(1970, 1, 1, 1))); -} +assert.sameValue( + typeof Date(1970, 1, 1, 1, 0, 0, 0), + "string", + 'The value of `typeof Date(1970, 1, 1, 1, 0, 0, 0)` is expected to be "string"' +); -//CHECK#8 -if (typeof Date(1970, 1, 1, 1, 0) !== "string") { - throw new Test262Error('#8: typeof Date(1970, 1, 1, 1, 0) should be "string", actual is ' + (typeof Date(1970, 1, 1, 1, 0))); -} +assert.sameValue( + typeof Date(Number.NaN), + "string", + 'The value of `typeof Date(Number.NaN)` is expected to be "string"' +); -//CHECK#9 -if (typeof Date(1970, 1, 1, 1, 0, 0) !== "string") { - throw new Test262Error('#9: typeof Date(1970, 1, 1, 1, 0, 0) should be "string", actual is ' + (typeof Date(1970, 1, 1, 1, 0, 0))); -} +assert.sameValue( + typeof Date(Number.POSITIVE_INFINITY), + "string", + 'The value of `typeof Date(Number.POSITIVE_INFINITY)` is expected to be "string"' +); -//CHECK#10 -if (typeof Date(1970, 1, 1, 1, 0, 0, 0) !== "string") { - throw new Test262Error('#10: typeof Date(1970, 1, 1, 1, 0, 0, 0) should be "string", actual is ' + (typeof Date(1970, 1, 1, 1, 0, 0, 0))); -} +assert.sameValue( + typeof Date(Number.NEGATIVE_INFINITY), + "string", + 'The value of `typeof Date(Number.NEGATIVE_INFINITY)` is expected to be "string"' +); -//CHECK#11 -if (typeof Date(Number.NaN) !== "string") { - throw new Test262Error('#11: typeof Date(Number.NaN) should be "string", actual is ' + (typeof Date(Number.NaN))); -} - -//CHECK#12 -if (typeof Date(Number.POSITIVE_INFINITY) !== "string") { - throw new Test262Error('#12: typeof Date(Number.POSITIVE_INFINITY) should be "string", actual is ' + (typeof Date(Number.POSITIVE_INFINITY))); -} - -//CHECK#13 -if (typeof Date(Number.NEGATIVE_INFINITY) !== "string") { - throw new Test262Error('#13: typeof Date(Number.NEGATIVE_INFINITY) should be "string", actual is ' + (typeof Date(Number.NEGATIVE_INFINITY))); -} - -//CHECK#14 -if (typeof Date(undefined) !== "string") { - throw new Test262Error('#14: typeof Date(undefined) should be "string", actual is ' + (typeof Date(undefined))); -} - -//CHECK#15 -if (typeof Date(null) !== "string") { - throw new Test262Error('#15: typeof Date(null) should be "string", actual is ' + (typeof Date(null))); -} +assert.sameValue(typeof Date(undefined), "string", 'The value of `typeof Date(undefined)` is expected to be "string"'); +assert.sameValue(typeof Date(null), "string", 'The value of `typeof Date(null)` is expected to be "string"'); diff --git a/test/built-ins/Date/S15.9.2.1_A2.js b/test/built-ins/Date/S15.9.2.1_A2.js index 3b06dfb0c9..62a7a5fd2f 100644 --- a/test/built-ins/Date/S15.9.2.1_A2.js +++ b/test/built-ins/Date/S15.9.2.1_A2.js @@ -21,72 +21,72 @@ function isEqual(d1, d2) { } } -//CHECK#1 -if (!isEqual(Date(), (new Date()).toString())) { - throw new Test262Error('#1: Date() is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(), (new Date()).toString()), + 'isEqual(Date(), (new Date()).toString()) must return true' +); -//CHECK#2 -if (!isEqual(Date(1), (new Date()).toString())) { - throw new Test262Error('#2: Date(1) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1), (new Date()).toString()), + 'isEqual(Date(1), (new Date()).toString()) must return true' +); -//CHECK#3 -if (!isEqual(Date(1970, 1), (new Date()).toString())) { - throw new Test262Error('#3: Date(1970, 1) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1), (new Date()).toString()), + 'isEqual(Date(1970, 1), (new Date()).toString()) must return true' +); -//CHECK#4 -if (!isEqual(Date(1970, 1, 1), (new Date()).toString())) { - throw new Test262Error('#4: Date(1970, 1, 1) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1), (new Date()).toString()) must return true' +); -//CHECK#5 -if (!isEqual(Date(1970, 1, 1, 1), (new Date()).toString())) { - throw new Test262Error('#5: Date(1970, 1, 1, 1) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1, 1), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1, 1), (new Date()).toString()) must return true' +); -//CHECK#6 -if (!isEqual(Date(1970, 1, 1, 1), (new Date()).toString())) { - throw new Test262Error('#7: Date(1970, 1, 1, 1) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1, 1), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1, 1), (new Date()).toString()) must return true' +); -//CHECK#8 -if (!isEqual(Date(1970, 1, 1, 1, 0), (new Date()).toString())) { - throw new Test262Error('#8: Date(1970, 1, 1, 1, 0) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1, 1, 0), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1, 1, 0), (new Date()).toString()) must return true' +); -//CHECK#9 -if (!isEqual(Date(1970, 1, 1, 1, 0, 0), (new Date()).toString())) { - throw new Test262Error('#9: Date(1970, 1, 1, 1, 0, 0) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1, 1, 0, 0), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1, 1, 0, 0), (new Date()).toString()) must return true' +); -//CHECK#10 -if (!isEqual(Date(1970, 1, 1, 1, 0, 0, 0), (new Date()).toString())) { - throw new Test262Error('#10: Date(1970, 1, 1, 1, 0, 0, 0) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(1970, 1, 1, 1, 0, 0, 0), (new Date()).toString()), + 'isEqual(Date(1970, 1, 1, 1, 0, 0, 0), (new Date()).toString()) must return true' +); -//CHECK#11 -if (!isEqual(Date(Number.NaN), (new Date()).toString())) { - throw new Test262Error('#11: Date(Number.NaN) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(Number.NaN), (new Date()).toString()), + 'isEqual(Date(Number.NaN), (new Date()).toString()) must return true' +); -//CHECK#12 -if (!isEqual(Date(Number.POSITIVE_INFINITY), (new Date()).toString())) { - throw new Test262Error('#12: Date(Number.POSITIVE_INFINITY) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(Number.POSITIVE_INFINITY), (new Date()).toString()), + 'isEqual(Date(Number.POSITIVE_INFINITY), (new Date()).toString()) must return true' +); -//CHECK#13 -if (!isEqual(Date(Number.NEGATIVE_INFINITY), (new Date()).toString())) { - throw new Test262Error('#13: Date(Number.NEGATIVE_INFINITY) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(Number.NEGATIVE_INFINITY), (new Date()).toString()), + 'isEqual(Date(Number.NEGATIVE_INFINITY), (new Date()).toString()) must return true' +); -//CHECK#14 -if (!isEqual(Date(undefined), (new Date()).toString())) { - throw new Test262Error('#14: Date(undefined) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(undefined), (new Date()).toString()), + 'isEqual(Date(undefined), (new Date()).toString()) must return true' +); -//CHECK#15 -if (!isEqual(Date(null), (new Date()).toString())) { - throw new Test262Error('#15: Date(null) is equal to (new Date()).toString()'); -} +assert( + isEqual(Date(null), (new Date()).toString()), + 'isEqual(Date(null), (new Date()).toString()) must return true' +); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T1.js b/test/built-ins/Date/S15.9.3.1_A1_T1.js index 7e3934fb4b..a3a481c34f 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T1.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T1.js @@ -9,218 +9,170 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 2 arguments, (year, month) ---*/ -if (typeof new Date(1899, 11) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 11), + "object", + 'The value of `typeof new Date(1899, 11)` is expected to be "object"' +); -if (new Date(1899, 11) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11) should not be undefined"); -} +assert.notSameValue(new Date(1899, 11), undefined, 'new Date(1899, 11) is expected to not equal ``undefined``'); var x13 = new Date(1899, 11); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12), + "object", + 'The value of `typeof new Date(1899, 12)` is expected to be "object"' +); -if (new Date(1899, 12) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12) should not be undefined"); -} +assert.notSameValue(new Date(1899, 12), undefined, 'new Date(1899, 12) is expected to not equal ``undefined``'); var x23 = new Date(1899, 12); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0), + "object", + 'The value of `typeof new Date(1900, 0)` is expected to be "object"' +); -if (new Date(1900, 0) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0) should not be undefined"); -} +assert.notSameValue(new Date(1900, 0), undefined, 'new Date(1900, 0) is expected to not equal ``undefined``'); var x33 = new Date(1900, 0); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11), + "object", + 'The value of `typeof new Date(1969, 11)` is expected to be "object"' +); -if (new Date(1969, 11) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11) should not be undefined"); -} +assert.notSameValue(new Date(1969, 11), undefined, 'new Date(1969, 11) is expected to not equal ``undefined``'); var x43 = new Date(1969, 11); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12), + "object", + 'The value of `typeof new Date(1969, 12)` is expected to be "object"' +); -if (new Date(1969, 12) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12) should not be undefined"); -} +assert.notSameValue(new Date(1969, 12), undefined, 'new Date(1969, 12) is expected to not equal ``undefined``'); var x53 = new Date(1969, 12); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0), + "object", + 'The value of `typeof new Date(1970, 0)` is expected to be "object"' +); -if (new Date(1970, 0) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0) should not be undefined"); -} +assert.notSameValue(new Date(1970, 0), undefined, 'new Date(1970, 0) is expected to not equal ``undefined``'); var x63 = new Date(1970, 0); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11), + "object", + 'The value of `typeof new Date(1999, 11)` is expected to be "object"' +); -if (new Date(1999, 11) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11) should not be undefined"); -} +assert.notSameValue(new Date(1999, 11), undefined, 'new Date(1999, 11) is expected to not equal ``undefined``'); var x73 = new Date(1999, 11); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12), + "object", + 'The value of `typeof new Date(1999, 12)` is expected to be "object"' +); -if (new Date(1999, 12) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12) should not be undefined"); -} +assert.notSameValue(new Date(1999, 12), undefined, 'new Date(1999, 12) is expected to not equal ``undefined``'); var x83 = new Date(1999, 12); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0), + "object", + 'The value of `typeof new Date(2000, 0)` is expected to be "object"' +); -if (new Date(2000, 0) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0) should not be undefined"); -} +assert.notSameValue(new Date(2000, 0), undefined, 'new Date(2000, 0) is expected to not equal ``undefined``'); var x93 = new Date(2000, 0); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11), + "object", + 'The value of `typeof new Date(2099, 11)` is expected to be "object"' +); -if (new Date(2099, 11) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11) should not be undefined"); -} +assert.notSameValue(new Date(2099, 11), undefined, 'new Date(2099, 11) is expected to not equal ``undefined``'); var x103 = new Date(2099, 11); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12), + "object", + 'The value of `typeof new Date(2099, 12)` is expected to be "object"' +); -if (new Date(2099, 12) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12) should not be undefined"); -} +assert.notSameValue(new Date(2099, 12), undefined, 'new Date(2099, 12) is expected to not equal ``undefined``'); var x113 = new Date(2099, 12); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0), + "object", + 'The value of `typeof new Date(2100, 0)` is expected to be "object"' +); -if (new Date(2100, 0) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0) should not be undefined"); -} +assert.notSameValue(new Date(2100, 0), undefined, 'new Date(2100, 0) is expected to not equal ``undefined``'); var x123 = new Date(2100, 0); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T2.js b/test/built-ins/Date/S15.9.3.1_A1_T2.js index fcc281e384..4b12e95162 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T2.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T2.js @@ -9,218 +9,170 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 3 arguments, (year, month, date) ---*/ -if (typeof new Date(1899, 11, 31) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11, 31) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 11, 31), + "object", + 'The value of `typeof new Date(1899, 11, 31)` is expected to be "object"' +); -if (new Date(1899, 11, 31) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11, 31) should not be undefined"); -} +assert.notSameValue(new Date(1899, 11, 31), undefined, 'new Date(1899, 11, 31) is expected to not equal ``undefined``'); var x13 = new Date(1899, 11, 31); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11, 31) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11, 31); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11, 31) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12, 1) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12, 1), + "object", + 'The value of `typeof new Date(1899, 12, 1)` is expected to be "object"' +); -if (new Date(1899, 12, 1) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12, 1) should not be undefined"); -} +assert.notSameValue(new Date(1899, 12, 1), undefined, 'new Date(1899, 12, 1) is expected to not equal ``undefined``'); var x23 = new Date(1899, 12, 1); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12, 1) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12, 1); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12, 1) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0, 1) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0, 1), + "object", + 'The value of `typeof new Date(1900, 0, 1)` is expected to be "object"' +); -if (new Date(1900, 0, 1) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0, 1) should not be undefined"); -} +assert.notSameValue(new Date(1900, 0, 1), undefined, 'new Date(1900, 0, 1) is expected to not equal ``undefined``'); var x33 = new Date(1900, 0, 1); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0, 1) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0, 1); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0, 1) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11, 31) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11, 31) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11, 31), + "object", + 'The value of `typeof new Date(1969, 11, 31)` is expected to be "object"' +); -if (new Date(1969, 11, 31) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11, 31) should not be undefined"); -} +assert.notSameValue(new Date(1969, 11, 31), undefined, 'new Date(1969, 11, 31) is expected to not equal ``undefined``'); var x43 = new Date(1969, 11, 31); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11, 31) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11, 31); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11, 31) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12, 1) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12, 1), + "object", + 'The value of `typeof new Date(1969, 12, 1)` is expected to be "object"' +); -if (new Date(1969, 12, 1) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12, 1) should not be undefined"); -} +assert.notSameValue(new Date(1969, 12, 1), undefined, 'new Date(1969, 12, 1) is expected to not equal ``undefined``'); var x53 = new Date(1969, 12, 1); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12, 1) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12, 1); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12, 1) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0, 1) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0, 1), + "object", + 'The value of `typeof new Date(1970, 0, 1)` is expected to be "object"' +); -if (new Date(1970, 0, 1) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0, 1) should not be undefined"); -} +assert.notSameValue(new Date(1970, 0, 1), undefined, 'new Date(1970, 0, 1) is expected to not equal ``undefined``'); var x63 = new Date(1970, 0, 1); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0, 1) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0, 1); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0, 1) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11, 31) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11, 31) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11, 31), + "object", + 'The value of `typeof new Date(1999, 11, 31)` is expected to be "object"' +); -if (new Date(1999, 11, 31) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11, 31) should not be undefined"); -} +assert.notSameValue(new Date(1999, 11, 31), undefined, 'new Date(1999, 11, 31) is expected to not equal ``undefined``'); var x73 = new Date(1999, 11, 31); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11, 31) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11, 31); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11, 31) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12, 1) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12, 1), + "object", + 'The value of `typeof new Date(1999, 12, 1)` is expected to be "object"' +); -if (new Date(1999, 12, 1) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12, 1) should not be undefined"); -} +assert.notSameValue(new Date(1999, 12, 1), undefined, 'new Date(1999, 12, 1) is expected to not equal ``undefined``'); var x83 = new Date(1999, 12, 1); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12, 1) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12, 1); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12, 1) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0, 1) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0, 1), + "object", + 'The value of `typeof new Date(2000, 0, 1)` is expected to be "object"' +); -if (new Date(2000, 0, 1) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0, 1) should not be undefined"); -} +assert.notSameValue(new Date(2000, 0, 1), undefined, 'new Date(2000, 0, 1) is expected to not equal ``undefined``'); var x93 = new Date(2000, 0, 1); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0, 1) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0, 1); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0, 1) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11, 31) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11, 31) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11, 31), + "object", + 'The value of `typeof new Date(2099, 11, 31)` is expected to be "object"' +); -if (new Date(2099, 11, 31) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11, 31) should not be undefined"); -} +assert.notSameValue(new Date(2099, 11, 31), undefined, 'new Date(2099, 11, 31) is expected to not equal ``undefined``'); var x103 = new Date(2099, 11, 31); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11, 31) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11, 31); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11, 31) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12, 1) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12, 1), + "object", + 'The value of `typeof new Date(2099, 12, 1)` is expected to be "object"' +); -if (new Date(2099, 12, 1) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12, 1) should not be undefined"); -} +assert.notSameValue(new Date(2099, 12, 1), undefined, 'new Date(2099, 12, 1) is expected to not equal ``undefined``'); var x113 = new Date(2099, 12, 1); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12, 1) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12, 1); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12, 1) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0, 1) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0, 1) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0, 1), + "object", + 'The value of `typeof new Date(2100, 0, 1)` is expected to be "object"' +); -if (new Date(2100, 0, 1) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0, 1) should not be undefined"); -} +assert.notSameValue(new Date(2100, 0, 1), undefined, 'new Date(2100, 0, 1) is expected to not equal ``undefined``'); var x123 = new Date(2100, 0, 1); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0, 1) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0, 1); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0, 1) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T3.js b/test/built-ins/Date/S15.9.3.1_A1_T3.js index ca83e1cf6c..d44417367a 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T3.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T3.js @@ -8,219 +8,202 @@ info: | esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 4 arguments, (year, month, date, hours) ---*/ +assert.sameValue( + typeof new Date(1899, 11, 31, 23), + "object", + 'The value of `typeof new Date(1899, 11, 31, 23)` is expected to be "object"' +); -if (typeof new Date(1899, 11, 31, 23) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11, 31, 23) should be 'object'"); -} - -if (new Date(1899, 11, 31, 23) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11, 31, 23) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 11, 31, 23), + undefined, + 'new Date(1899, 11, 31, 23) is expected to not equal ``undefined``' +); var x13 = new Date(1899, 11, 31, 23); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11, 31, 23) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11, 31, 23); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11, 31, 23) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12, 1, 0) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12, 1, 0), + "object", + 'The value of `typeof new Date(1899, 12, 1, 0)` is expected to be "object"' +); -if (new Date(1899, 12, 1, 0) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12, 1, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 12, 1, 0), + undefined, + 'new Date(1899, 12, 1, 0) is expected to not equal ``undefined``' +); var x23 = new Date(1899, 12, 1, 0); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12, 1, 0); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12, 1, 0) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0, 1, 0) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0, 1, 0), + "object", + 'The value of `typeof new Date(1900, 0, 1, 0)` is expected to be "object"' +); -if (new Date(1900, 0, 1, 0) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(new Date(1900, 0, 1, 0), undefined, 'new Date(1900, 0, 1, 0) is expected to not equal ``undefined``'); var x33 = new Date(1900, 0, 1, 0); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0, 1, 0); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11, 31, 23) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11, 31, 23) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11, 31, 23), + "object", + 'The value of `typeof new Date(1969, 11, 31, 23)` is expected to be "object"' +); -if (new Date(1969, 11, 31, 23) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11, 31, 23) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 11, 31, 23), + undefined, + 'new Date(1969, 11, 31, 23) is expected to not equal ``undefined``' +); var x43 = new Date(1969, 11, 31, 23); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11, 31, 23) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11, 31, 23); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11, 31, 23) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12, 1, 0) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12, 1, 0), + "object", + 'The value of `typeof new Date(1969, 12, 1, 0)` is expected to be "object"' +); -if (new Date(1969, 12, 1, 0) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12, 1, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 12, 1, 0), + undefined, + 'new Date(1969, 12, 1, 0) is expected to not equal ``undefined``' +); var x53 = new Date(1969, 12, 1, 0); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12, 1, 0); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12, 1, 0) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0, 1, 0) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0, 1, 0), + "object", + 'The value of `typeof new Date(1970, 0, 1, 0)` is expected to be "object"' +); -if (new Date(1970, 0, 1, 0) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(new Date(1970, 0, 1, 0), undefined, 'new Date(1970, 0, 1, 0) is expected to not equal ``undefined``'); var x63 = new Date(1970, 0, 1, 0); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0, 1, 0); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11, 31, 23) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11, 31, 23) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11, 31, 23), + "object", + 'The value of `typeof new Date(1999, 11, 31, 23)` is expected to be "object"' +); -if (new Date(1999, 11, 31, 23) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11, 31, 23) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 11, 31, 23), + undefined, + 'new Date(1999, 11, 31, 23) is expected to not equal ``undefined``' +); var x73 = new Date(1999, 11, 31, 23); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11, 31, 23) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11, 31, 23); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11, 31, 23) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12, 1, 0) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12, 1, 0), + "object", + 'The value of `typeof new Date(1999, 12, 1, 0)` is expected to be "object"' +); -if (new Date(1999, 12, 1, 0) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12, 1, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 12, 1, 0), + undefined, + 'new Date(1999, 12, 1, 0) is expected to not equal ``undefined``' +); var x83 = new Date(1999, 12, 1, 0); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12, 1, 0); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12, 1, 0) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0, 1, 0) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0, 1, 0), + "object", + 'The value of `typeof new Date(2000, 0, 1, 0)` is expected to be "object"' +); -if (new Date(2000, 0, 1, 0) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(new Date(2000, 0, 1, 0), undefined, 'new Date(2000, 0, 1, 0) is expected to not equal ``undefined``'); var x93 = new Date(2000, 0, 1, 0); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0, 1, 0); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11, 31, 23) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11, 31, 23) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11, 31, 23), + "object", + 'The value of `typeof new Date(2099, 11, 31, 23)` is expected to be "object"' +); -if (new Date(2099, 11, 31, 23) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11, 31, 23) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 11, 31, 23), + undefined, + 'new Date(2099, 11, 31, 23) is expected to not equal ``undefined``' +); var x103 = new Date(2099, 11, 31, 23); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11, 31, 23) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11, 31, 23); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11, 31, 23) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12, 1, 0) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12, 1, 0), + "object", + 'The value of `typeof new Date(2099, 12, 1, 0)` is expected to be "object"' +); -if (new Date(2099, 12, 1, 0) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12, 1, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 12, 1, 0), + undefined, + 'new Date(2099, 12, 1, 0) is expected to not equal ``undefined``' +); var x113 = new Date(2099, 12, 1, 0); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12, 1, 0); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12, 1, 0) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0, 1, 0) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0, 1, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0, 1, 0), + "object", + 'The value of `typeof new Date(2100, 0, 1, 0)` is expected to be "object"' +); -if (new Date(2100, 0, 1, 0) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(new Date(2100, 0, 1, 0), undefined, 'new Date(2100, 0, 1, 0) is expected to not equal ``undefined``'); var x123 = new Date(2100, 0, 1, 0); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0, 1, 0) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0, 1, 0); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0, 1, 0) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T4.js b/test/built-ins/Date/S15.9.3.1_A1_T4.js index 88d5ffb261..6a71040074 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T4.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T4.js @@ -8,219 +8,218 @@ info: | esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 5 arguments, (year, month, date, hours, minutes) ---*/ +assert.sameValue( + typeof new Date(1899, 11, 31, 23, 59), + "object", + 'The value of `typeof new Date(1899, 11, 31, 23, 59)` is expected to be "object"' +); -if (typeof new Date(1899, 11, 31, 23, 59) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11, 31, 23, 59) should be 'object'"); -} - -if (new Date(1899, 11, 31, 23, 59) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 11, 31, 23, 59), + undefined, + 'new Date(1899, 11, 31, 23, 59) is expected to not equal ``undefined``' +); var x13 = new Date(1899, 11, 31, 23, 59); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11, 31, 23, 59); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12, 1, 0, 0) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12, 1, 0, 0), + "object", + 'The value of `typeof new Date(1899, 12, 1, 0, 0)` is expected to be "object"' +); -if (new Date(1899, 12, 1, 0, 0) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 12, 1, 0, 0), + undefined, + 'new Date(1899, 12, 1, 0, 0) is expected to not equal ``undefined``' +); var x23 = new Date(1899, 12, 1, 0, 0); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12, 1, 0, 0); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0, 1, 0, 0) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0, 1, 0, 0), + "object", + 'The value of `typeof new Date(1900, 0, 1, 0, 0)` is expected to be "object"' +); -if (new Date(1900, 0, 1, 0, 0) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1900, 0, 1, 0, 0), + undefined, + 'new Date(1900, 0, 1, 0, 0) is expected to not equal ``undefined``' +); var x33 = new Date(1900, 0, 1, 0, 0); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0, 1, 0, 0); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11, 31, 23, 59) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11, 31, 23, 59), + "object", + 'The value of `typeof new Date(1969, 11, 31, 23, 59)` is expected to be "object"' +); -if (new Date(1969, 11, 31, 23, 59) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 11, 31, 23, 59), + undefined, + 'new Date(1969, 11, 31, 23, 59) is expected to not equal ``undefined``' +); var x43 = new Date(1969, 11, 31, 23, 59); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11, 31, 23, 59); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12, 1, 0, 0) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12, 1, 0, 0), + "object", + 'The value of `typeof new Date(1969, 12, 1, 0, 0)` is expected to be "object"' +); -if (new Date(1969, 12, 1, 0, 0) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 12, 1, 0, 0), + undefined, + 'new Date(1969, 12, 1, 0, 0) is expected to not equal ``undefined``' +); var x53 = new Date(1969, 12, 1, 0, 0); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12, 1, 0, 0); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0, 1, 0, 0) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0, 1, 0, 0), + "object", + 'The value of `typeof new Date(1970, 0, 1, 0, 0)` is expected to be "object"' +); -if (new Date(1970, 0, 1, 0, 0) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1970, 0, 1, 0, 0), + undefined, + 'new Date(1970, 0, 1, 0, 0) is expected to not equal ``undefined``' +); var x63 = new Date(1970, 0, 1, 0, 0); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0, 1, 0, 0); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11, 31, 23, 59) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11, 31, 23, 59), + "object", + 'The value of `typeof new Date(1999, 11, 31, 23, 59)` is expected to be "object"' +); -if (new Date(1999, 11, 31, 23, 59) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 11, 31, 23, 59), + undefined, + 'new Date(1999, 11, 31, 23, 59) is expected to not equal ``undefined``' +); var x73 = new Date(1999, 11, 31, 23, 59); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11, 31, 23, 59); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12, 1, 0, 0) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12, 1, 0, 0), + "object", + 'The value of `typeof new Date(1999, 12, 1, 0, 0)` is expected to be "object"' +); -if (new Date(1999, 12, 1, 0, 0) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 12, 1, 0, 0), + undefined, + 'new Date(1999, 12, 1, 0, 0) is expected to not equal ``undefined``' +); var x83 = new Date(1999, 12, 1, 0, 0); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12, 1, 0, 0); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0, 1, 0, 0) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0, 1, 0, 0), + "object", + 'The value of `typeof new Date(2000, 0, 1, 0, 0)` is expected to be "object"' +); -if (new Date(2000, 0, 1, 0, 0) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2000, 0, 1, 0, 0), + undefined, + 'new Date(2000, 0, 1, 0, 0) is expected to not equal ``undefined``' +); var x93 = new Date(2000, 0, 1, 0, 0); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0, 1, 0, 0); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11, 31, 23, 59) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11, 31, 23, 59), + "object", + 'The value of `typeof new Date(2099, 11, 31, 23, 59)` is expected to be "object"' +); -if (new Date(2099, 11, 31, 23, 59) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 11, 31, 23, 59), + undefined, + 'new Date(2099, 11, 31, 23, 59) is expected to not equal ``undefined``' +); var x103 = new Date(2099, 11, 31, 23, 59); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11, 31, 23, 59) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11, 31, 23, 59); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11, 31, 23, 59) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12, 1, 0, 0) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12, 1, 0, 0), + "object", + 'The value of `typeof new Date(2099, 12, 1, 0, 0)` is expected to be "object"' +); -if (new Date(2099, 12, 1, 0, 0) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 12, 1, 0, 0), + undefined, + 'new Date(2099, 12, 1, 0, 0) is expected to not equal ``undefined``' +); var x113 = new Date(2099, 12, 1, 0, 0); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12, 1, 0, 0); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0, 1, 0, 0) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0, 1, 0, 0), + "object", + 'The value of `typeof new Date(2100, 0, 1, 0, 0)` is expected to be "object"' +); -if (new Date(2100, 0, 1, 0, 0) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2100, 0, 1, 0, 0), + undefined, + 'new Date(2100, 0, 1, 0, 0) is expected to not equal ``undefined``' +); var x123 = new Date(2100, 0, 1, 0, 0); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0, 1, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0, 1, 0, 0); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0, 1, 0, 0) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T5.js b/test/built-ins/Date/S15.9.3.1_A1_T5.js index 4e2c791cf1..91b323b9dc 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T5.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T5.js @@ -8,219 +8,218 @@ info: | esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 6 arguments, (year, month, date, hours, minutes, seconds) ---*/ +assert.sameValue( + typeof new Date(1899, 11, 31, 23, 59, 59), + "object", + 'The value of `typeof new Date(1899, 11, 31, 23, 59, 59)` is expected to be "object"' +); -if (typeof new Date(1899, 11, 31, 23, 59, 59) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11, 31, 23, 59, 59) should be 'object'"); -} - -if (new Date(1899, 11, 31, 23, 59, 59) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 11, 31, 23, 59, 59), + undefined, + 'new Date(1899, 11, 31, 23, 59, 59) is expected to not equal ``undefined``' +); var x13 = new Date(1899, 11, 31, 23, 59, 59); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11, 31, 23, 59, 59); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(1899, 12, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1899, 12, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 12, 1, 0, 0, 0), + undefined, + 'new Date(1899, 12, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x23 = new Date(1899, 12, 1, 0, 0, 0); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12, 1, 0, 0, 0); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(1900, 0, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1900, 0, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1900, 0, 1, 0, 0, 0), + undefined, + 'new Date(1900, 0, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x33 = new Date(1900, 0, 1, 0, 0, 0); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0, 1, 0, 0, 0); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11, 31, 23, 59, 59) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11, 31, 23, 59, 59), + "object", + 'The value of `typeof new Date(1969, 11, 31, 23, 59, 59)` is expected to be "object"' +); -if (new Date(1969, 11, 31, 23, 59, 59) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 11, 31, 23, 59, 59), + undefined, + 'new Date(1969, 11, 31, 23, 59, 59) is expected to not equal ``undefined``' +); var x43 = new Date(1969, 11, 31, 23, 59, 59); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11, 31, 23, 59, 59); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(1969, 12, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1969, 12, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 12, 1, 0, 0, 0), + undefined, + 'new Date(1969, 12, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x53 = new Date(1969, 12, 1, 0, 0, 0); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12, 1, 0, 0, 0); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(1970, 0, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1970, 0, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1970, 0, 1, 0, 0, 0), + undefined, + 'new Date(1970, 0, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x63 = new Date(1970, 0, 1, 0, 0, 0); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0, 1, 0, 0, 0); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11, 31, 23, 59, 59) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11, 31, 23, 59, 59), + "object", + 'The value of `typeof new Date(1999, 11, 31, 23, 59, 59)` is expected to be "object"' +); -if (new Date(1999, 11, 31, 23, 59, 59) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 11, 31, 23, 59, 59), + undefined, + 'new Date(1999, 11, 31, 23, 59, 59) is expected to not equal ``undefined``' +); var x73 = new Date(1999, 11, 31, 23, 59, 59); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11, 31, 23, 59, 59); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(1999, 12, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1999, 12, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 12, 1, 0, 0, 0), + undefined, + 'new Date(1999, 12, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x83 = new Date(1999, 12, 1, 0, 0, 0); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12, 1, 0, 0, 0); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(2000, 0, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2000, 0, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2000, 0, 1, 0, 0, 0), + undefined, + 'new Date(2000, 0, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x93 = new Date(2000, 0, 1, 0, 0, 0); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0, 1, 0, 0, 0); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11, 31, 23, 59, 59) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11, 31, 23, 59, 59), + "object", + 'The value of `typeof new Date(2099, 11, 31, 23, 59, 59)` is expected to be "object"' +); -if (new Date(2099, 11, 31, 23, 59, 59) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 11, 31, 23, 59, 59), + undefined, + 'new Date(2099, 11, 31, 23, 59, 59) is expected to not equal ``undefined``' +); var x103 = new Date(2099, 11, 31, 23, 59, 59); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11, 31, 23, 59, 59) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11, 31, 23, 59, 59); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11, 31, 23, 59, 59) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(2099, 12, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2099, 12, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 12, 1, 0, 0, 0), + undefined, + 'new Date(2099, 12, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x113 = new Date(2099, 12, 1, 0, 0, 0); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12, 1, 0, 0, 0); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0, 1, 0, 0, 0) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0, 1, 0, 0, 0), + "object", + 'The value of `typeof new Date(2100, 0, 1, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2100, 0, 1, 0, 0, 0) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2100, 0, 1, 0, 0, 0), + undefined, + 'new Date(2100, 0, 1, 0, 0, 0) is expected to not equal ``undefined``' +); var x123 = new Date(2100, 0, 1, 0, 0, 0); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0, 1, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0, 1, 0, 0, 0); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0, 1, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A1_T6.js b/test/built-ins/Date/S15.9.3.1_A1_T6.js index 1fda43ba20..98508170dc 100644 --- a/test/built-ins/Date/S15.9.3.1_A1_T6.js +++ b/test/built-ins/Date/S15.9.3.1_A1_T6.js @@ -8,219 +8,218 @@ info: | esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 7 arguments, (year, month, date, hours, minutes, seconds, ms) ---*/ +assert.sameValue( + typeof new Date(1899, 11, 31, 23, 59, 59, 999), + "object", + 'The value of `typeof new Date(1899, 11, 31, 23, 59, 59, 999)` is expected to be "object"' +); -if (typeof new Date(1899, 11, 31, 23, 59, 59, 999) !== "object") { - throw new Test262Error("#1.1: typeof new Date(1899, 11, 31, 23, 59, 59, 999) should be 'object'"); -} - -if (new Date(1899, 11, 31, 23, 59, 59, 999) === undefined) { - throw new Test262Error("#1.2: new Date(1899, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 11, 31, 23, 59, 59, 999), + undefined, + 'new Date(1899, 11, 31, 23, 59, 59, 999) is expected to not equal ``undefined``' +); var x13 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(1899, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(1899, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(1899, 12, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#2.1: typeof new Date(1899, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1899, 12, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(1899, 12, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1899, 12, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#2.2: new Date(1899, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1899, 12, 1, 0, 0, 0, 0), + undefined, + 'new Date(1899, 12, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x23 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(1899, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(1899, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(1900, 0, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#3.1: typeof new Date(1900, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1900, 0, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(1900, 0, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1900, 0, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#3.2: new Date(1900, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1900, 0, 1, 0, 0, 0, 0), + undefined, + 'new Date(1900, 0, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x33 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(1900, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(1900, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 11, 31, 23, 59, 59, 999) !== "object") { - throw new Test262Error("#4.1: typeof new Date(1969, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 11, 31, 23, 59, 59, 999), + "object", + 'The value of `typeof new Date(1969, 11, 31, 23, 59, 59, 999)` is expected to be "object"' +); -if (new Date(1969, 11, 31, 23, 59, 59, 999) === undefined) { - throw new Test262Error("#4.2: new Date(1969, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 11, 31, 23, 59, 59, 999), + undefined, + 'new Date(1969, 11, 31, 23, 59, 59, 999) is expected to not equal ``undefined``' +); var x43 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(1969, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(1969, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(1969, 12, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#5.1: typeof new Date(1969, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1969, 12, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(1969, 12, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1969, 12, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#5.2: new Date(1969, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1969, 12, 1, 0, 0, 0, 0), + undefined, + 'new Date(1969, 12, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x53 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(1969, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(1969, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(1970, 0, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#6.1: typeof new Date(1970, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1970, 0, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(1970, 0, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1970, 0, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#6.2: new Date(1970, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1970, 0, 1, 0, 0, 0, 0), + undefined, + 'new Date(1970, 0, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x63 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(1970, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(1970, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 11, 31, 23, 59, 59, 999) !== "object") { - throw new Test262Error("#7.1: typeof new Date(1999, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 11, 31, 23, 59, 59, 999), + "object", + 'The value of `typeof new Date(1999, 11, 31, 23, 59, 59, 999)` is expected to be "object"' +); -if (new Date(1999, 11, 31, 23, 59, 59, 999) === undefined) { - throw new Test262Error("#7.2: new Date(1999, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 11, 31, 23, 59, 59, 999), + undefined, + 'new Date(1999, 11, 31, 23, 59, 59, 999) is expected to not equal ``undefined``' +); var x73 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(1999, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(1999, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(1999, 12, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#8.1: typeof new Date(1999, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(1999, 12, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(1999, 12, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(1999, 12, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#8.2: new Date(1999, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(1999, 12, 1, 0, 0, 0, 0), + undefined, + 'new Date(1999, 12, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x83 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(1999, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(1999, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); -if (typeof new Date(2000, 0, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#9.1: typeof new Date(2000, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2000, 0, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(2000, 0, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2000, 0, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#9.2: new Date(2000, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2000, 0, 1, 0, 0, 0, 0), + undefined, + 'new Date(2000, 0, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x93 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (typeof x93 !== "object") { - throw new Test262Error("#9.3: typeof new Date(2000, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x93, "object", 'The value of `typeof x93` is expected to be "object"'); var x94 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (x94 === undefined) { - throw new Test262Error("#9.4: new Date(2000, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x94, undefined, 'The value of x94 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 11, 31, 23, 59, 59, 999) !== "object") { - throw new Test262Error("#10.1: typeof new Date(2099, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 11, 31, 23, 59, 59, 999), + "object", + 'The value of `typeof new Date(2099, 11, 31, 23, 59, 59, 999)` is expected to be "object"' +); -if (new Date(2099, 11, 31, 23, 59, 59, 999) === undefined) { - throw new Test262Error("#10.2: new Date(2099, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 11, 31, 23, 59, 59, 999), + undefined, + 'new Date(2099, 11, 31, 23, 59, 59, 999) is expected to not equal ``undefined``' +); var x103 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (typeof x103 !== "object") { - throw new Test262Error("#10.3: typeof new Date(2099, 11, 31, 23, 59, 59, 999) should be 'object'"); -} +assert.sameValue(typeof x103, "object", 'The value of `typeof x103` is expected to be "object"'); var x104 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (x104 === undefined) { - throw new Test262Error("#10.4: new Date(2099, 11, 31, 23, 59, 59, 999) should not be undefined"); -} +assert.notSameValue(x104, undefined, 'The value of x104 is expected to not equal ``undefined``'); -if (typeof new Date(2099, 12, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#11.1: typeof new Date(2099, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2099, 12, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(2099, 12, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2099, 12, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#11.2: new Date(2099, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2099, 12, 1, 0, 0, 0, 0), + undefined, + 'new Date(2099, 12, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x113 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (typeof x113 !== "object") { - throw new Test262Error("#11.3: typeof new Date(2099, 12, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x113, "object", 'The value of `typeof x113` is expected to be "object"'); var x114 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (x114 === undefined) { - throw new Test262Error("#11.4: new Date(2099, 12, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x114, undefined, 'The value of x114 is expected to not equal ``undefined``'); -if (typeof new Date(2100, 0, 1, 0, 0, 0, 0) !== "object") { - throw new Test262Error("#12.1: typeof new Date(2100, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue( + typeof new Date(2100, 0, 1, 0, 0, 0, 0), + "object", + 'The value of `typeof new Date(2100, 0, 1, 0, 0, 0, 0)` is expected to be "object"' +); -if (new Date(2100, 0, 1, 0, 0, 0, 0) === undefined) { - throw new Test262Error("#12.2: new Date(2100, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue( + new Date(2100, 0, 1, 0, 0, 0, 0), + undefined, + 'new Date(2100, 0, 1, 0, 0, 0, 0) is expected to not equal ``undefined``' +); var x123 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (typeof x123 !== "object") { - throw new Test262Error("#12.3: typeof new Date(2100, 0, 1, 0, 0, 0, 0) should be 'object'"); -} +assert.sameValue(typeof x123, "object", 'The value of `typeof x123` is expected to be "object"'); var x124 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (x124 === undefined) { - throw new Test262Error("#12.4: new Date(2100, 0, 1, 0, 0, 0, 0) should not be undefined"); -} +assert.notSameValue(x124, undefined, 'The value of x124 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T1.js b/test/built-ins/Date/S15.9.3.1_A2_T1.js index 54a7c7313c..b76077957d 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T1.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T1.js @@ -11,181 +11,229 @@ description: 2 arguments, (year, month) ---*/ var x11 = new Date(1899, 11); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T2.js b/test/built-ins/Date/S15.9.3.1_A2_T2.js index b071b6dfa3..1efe97a480 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T2.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T2.js @@ -11,181 +11,229 @@ description: 3 arguments, (year, month, date) ---*/ var x11 = new Date(1899, 11, 31); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11, 31); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11, 31); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12, 1); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12, 1); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12, 1); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0, 1); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0, 1); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0, 1); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11, 31); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11, 31); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11, 31); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12, 1); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12, 1); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12, 1); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0, 1); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0, 1); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0, 1); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11, 31); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11, 31); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11, 31); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12, 1); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12, 1); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12, 1); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0, 1); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0, 1); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0, 1); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11, 31); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11, 31); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11, 31); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12, 1); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12, 1); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12, 1); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0, 1); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0, 1); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0, 1); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T3.js b/test/built-ins/Date/S15.9.3.1_A2_T3.js index dcd13ca834..1264caea2d 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T3.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T3.js @@ -11,181 +11,229 @@ description: 4 arguments, (year, month, date, hours) ---*/ var x11 = new Date(1899, 11, 31, 23); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11, 31, 23); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11, 31, 23); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12, 1, 0); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12, 1, 0); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12, 1, 0); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0, 1, 0); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0, 1, 0); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0, 1, 0); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11, 31, 23); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11, 31, 23); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11, 31, 23); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12, 1, 0); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12, 1, 0); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12, 1, 0); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0, 1, 0); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0, 1, 0); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0, 1, 0); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11, 31, 23); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11, 31, 23); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11, 31, 23); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12, 1, 0); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12, 1, 0); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12, 1, 0); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0, 1, 0); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0, 1, 0); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0, 1, 0); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11, 31, 23); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11, 31, 23); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11, 31, 23); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12, 1, 0); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12, 1, 0); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12, 1, 0); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0, 1, 0); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0, 1, 0); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0, 1, 0); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T4.js b/test/built-ins/Date/S15.9.3.1_A2_T4.js index 76645f67dd..d38db27e45 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T4.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T4.js @@ -11,181 +11,229 @@ description: 5 arguments, (year, month, date, hours, minutes) ---*/ var x11 = new Date(1899, 11, 31, 23, 59); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11, 31, 23, 59); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11, 31, 23, 59); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12, 1, 0, 0); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12, 1, 0, 0); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0, 1, 0, 0); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0, 1, 0, 0); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11, 31, 23, 59); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11, 31, 23, 59); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11, 31, 23, 59); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12, 1, 0, 0); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12, 1, 0, 0); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0, 1, 0, 0); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0, 1, 0, 0); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11, 31, 23, 59); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11, 31, 23, 59); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11, 31, 23, 59); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12, 1, 0, 0); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12, 1, 0, 0); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0, 1, 0, 0); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0, 1, 0, 0); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11, 31, 23, 59); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11, 31, 23, 59); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11, 31, 23, 59); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12, 1, 0, 0); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12, 1, 0, 0); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0, 1, 0, 0); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0, 1, 0, 0); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0, 1, 0, 0); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T5.js b/test/built-ins/Date/S15.9.3.1_A2_T5.js index 7aac4f7560..daf7b090f1 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T5.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T5.js @@ -11,181 +11,229 @@ description: 6 arguments, (year, month, date, hours, minutes, seconds) ---*/ var x11 = new Date(1899, 11, 31, 23, 59, 59); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11, 31, 23, 59, 59); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11, 31, 23, 59, 59); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12, 1, 0, 0, 0); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12, 1, 0, 0, 0); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0, 1, 0, 0, 0); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0, 1, 0, 0, 0); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11, 31, 23, 59, 59); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11, 31, 23, 59, 59); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11, 31, 23, 59, 59); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12, 1, 0, 0, 0); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12, 1, 0, 0, 0); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0, 1, 0, 0, 0); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0, 1, 0, 0, 0); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11, 31, 23, 59, 59); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11, 31, 23, 59, 59); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11, 31, 23, 59, 59); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12, 1, 0, 0, 0); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12, 1, 0, 0, 0); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0, 1, 0, 0, 0); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0, 1, 0, 0, 0); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11, 31, 23, 59, 59); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11, 31, 23, 59, 59); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11, 31, 23, 59, 59); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12, 1, 0, 0, 0); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12, 1, 0, 0, 0); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0, 1, 0, 0, 0); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0, 1, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0, 1, 0, 0, 0); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A2_T6.js b/test/built-ins/Date/S15.9.3.1_A2_T6.js index cc7d84e8ab..d2f4483f28 100644 --- a/test/built-ins/Date/S15.9.3.1_A2_T6.js +++ b/test/built-ins/Date/S15.9.3.1_A2_T6.js @@ -11,181 +11,229 @@ description: 7 arguments, (year, month, date, hours, minutes, seconds, ms) ---*/ var x11 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype === x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype === x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype === x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x41.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype === x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype === x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype === x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype === x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype === x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); var x91 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (typeof x91.constructor.prototype !== "object") { - throw new Test262Error("#9.1: typeof x91.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x91.constructor.prototype, + "object", + 'The value of `typeof x91.constructor.prototype` is expected to be "object"' +); var x92 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x92)) { - throw new Test262Error('#9.2: Date.prototype.isPrototypeOf(x92)'); -} +assert(Date.prototype.isPrototypeOf(x92), 'Date.prototype.isPrototypeOf(x92) must return true'); var x93 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (Date.prototype !== x93.constructor.prototype) { - throw new Test262Error("#9.3: Date.prototype === x93.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x93.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x93.constructor.prototype' +); var x101 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (typeof x101.constructor.prototype !== "object") { - throw new Test262Error("#10.1: typeof x101.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x101.constructor.prototype, + "object", + 'The value of `typeof x101.constructor.prototype` is expected to be "object"' +); var x102 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (!Date.prototype.isPrototypeOf(x102)) { - throw new Test262Error('#10.2: Date.prototype.isPrototypeOf(x102)'); -} +assert(Date.prototype.isPrototypeOf(x102), 'Date.prototype.isPrototypeOf(x102) must return true'); var x103 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (Date.prototype !== x103.constructor.prototype) { - throw new Test262Error("#10.3: Date.prototype === x103.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x103.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x103.constructor.prototype' +); var x111 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (typeof x111.constructor.prototype !== "object") { - throw new Test262Error("#11.1: typeof x111.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x111.constructor.prototype, + "object", + 'The value of `typeof x111.constructor.prototype` is expected to be "object"' +); var x112 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x112)) { - throw new Test262Error('#11.2: Date.prototype.isPrototypeOf(x112)'); -} +assert(Date.prototype.isPrototypeOf(x112), 'Date.prototype.isPrototypeOf(x112) must return true'); var x113 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (Date.prototype !== x113.constructor.prototype) { - throw new Test262Error("#11.3: Date.prototype === x113.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x113.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x113.constructor.prototype' +); var x121 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (typeof x121.constructor.prototype !== "object") { - throw new Test262Error("#12.1: typeof x121.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x121.constructor.prototype, + "object", + 'The value of `typeof x121.constructor.prototype` is expected to be "object"' +); var x122 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (!Date.prototype.isPrototypeOf(x122)) { - throw new Test262Error('#12.2: Date.prototype.isPrototypeOf(x122)'); -} +assert(Date.prototype.isPrototypeOf(x122), 'Date.prototype.isPrototypeOf(x122) must return true'); var x123 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (Date.prototype !== x123.constructor.prototype) { - throw new Test262Error("#12.3: Date.prototype === x123.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x123.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x123.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T1.1.js b/test/built-ins/Date/S15.9.3.1_A3_T1.1.js index e38d8af2fd..edb69689e8 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T1.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T1.1.js @@ -12,61 +12,97 @@ description: > ---*/ var x1 = new Date(1899, 11); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11)) must return "[object Date]"' +); var x2 = new Date(1899, 12); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12)) must return "[object Date]"' +); var x3 = new Date(1900, 0); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0)) must return "[object Date]"' +); var x4 = new Date(1969, 11); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11)) must return "[object Date]"' +); var x5 = new Date(1969, 12); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12)) must return "[object Date]"' +); var x6 = new Date(1970, 0); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0)) must return "[object Date]"' +); var x7 = new Date(1999, 11); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11)) must return "[object Date]"' +); var x8 = new Date(1999, 12); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12)) must return "[object Date]"' +); var x9 = new Date(2000, 0); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0)) must return "[object Date]"' +); var x10 = new Date(2099, 11); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11)) must return "[object Date]"' +); var x11 = new Date(2099, 12); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12)) must return "[object Date]"' +); var x12 = new Date(2100, 0); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T1.2.js b/test/built-ins/Date/S15.9.3.1_A3_T1.2.js index de0640541f..11cc695f3b 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T1.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T1.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T2.1.js b/test/built-ins/Date/S15.9.3.1_A3_T2.1.js index 61b4ff2f7f..b7e7ea12e6 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T2.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T2.1.js @@ -12,61 +12,97 @@ description: > ---*/ var x1 = new Date(1899, 11, 31); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11, 31)) must return "[object Date]"' +); var x2 = new Date(1899, 12, 1); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12, 1)) must return "[object Date]"' +); var x3 = new Date(1900, 0, 1); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0, 1)) must return "[object Date]"' +); var x4 = new Date(1969, 11, 31); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11, 31)) must return "[object Date]"' +); var x5 = new Date(1969, 12, 1); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12, 1)) must return "[object Date]"' +); var x6 = new Date(1970, 0, 1); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0, 1)) must return "[object Date]"' +); var x7 = new Date(1999, 11, 31); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11, 31)) must return "[object Date]"' +); var x8 = new Date(1999, 12, 1); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12, 1)) must return "[object Date]"' +); var x9 = new Date(2000, 0, 1); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0, 1)) must return "[object Date]"' +); var x10 = new Date(2099, 11, 31); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11, 31)) must return "[object Date]"' +); var x11 = new Date(2099, 12, 1); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12, 1)) must return "[object Date]"' +); var x12 = new Date(2100, 0, 1); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0, 1)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T2.2.js b/test/built-ins/Date/S15.9.3.1_A3_T2.2.js index 4d2fc9b70c..333e82ba33 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T2.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T2.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11, 31); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12, 1); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0, 1); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11, 31); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12, 1); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0, 1); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11, 31); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12, 1); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0, 1); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11, 31); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12, 1); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0, 1); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T3.1.js b/test/built-ins/Date/S15.9.3.1_A3_T3.1.js index fcd332eb31..00e5b841ac 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T3.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T3.1.js @@ -12,61 +12,97 @@ description: > ---*/ var x1 = new Date(1899, 11, 31, 23); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11, 31, 23)) must return "[object Date]"' +); var x2 = new Date(1899, 12, 1, 0); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12, 1, 0)) must return "[object Date]"' +); var x3 = new Date(1900, 0, 1, 0); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0, 1, 0)) must return "[object Date]"' +); var x4 = new Date(1969, 11, 31, 23); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11, 31, 23)) must return "[object Date]"' +); var x5 = new Date(1969, 12, 1, 0); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12, 1, 0)) must return "[object Date]"' +); var x6 = new Date(1970, 0, 1, 0); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0, 1, 0)) must return "[object Date]"' +); var x7 = new Date(1999, 11, 31, 23); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11, 31, 23)) must return "[object Date]"' +); var x8 = new Date(1999, 12, 1, 0); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12, 1, 0)) must return "[object Date]"' +); var x9 = new Date(2000, 0, 1, 0); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0, 1, 0)) must return "[object Date]"' +); var x10 = new Date(2099, 11, 31, 23); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11, 31, 23)) must return "[object Date]"' +); var x11 = new Date(2099, 12, 1, 0); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12, 1, 0)) must return "[object Date]"' +); var x12 = new Date(2100, 0, 1, 0); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0, 1, 0)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T3.2.js b/test/built-ins/Date/S15.9.3.1_A3_T3.2.js index c9eac35e12..eb1dcdb534 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T3.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T3.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11, 31, 23); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12, 1, 0); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0, 1, 0); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11, 31, 23); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12, 1, 0); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0, 1, 0); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11, 31, 23); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12, 1, 0); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0, 1, 0); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11, 31, 23); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12, 1, 0); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0, 1, 0); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T4.1.js b/test/built-ins/Date/S15.9.3.1_A3_T4.1.js index 44e89423f1..94f3a4d8c7 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T4.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T4.1.js @@ -12,61 +12,97 @@ description: > ---*/ var x1 = new Date(1899, 11, 31, 23, 59); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11, 31, 23, 59)) must return "[object Date]"' +); var x2 = new Date(1899, 12, 1, 0, 0); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12, 1, 0, 0)) must return "[object Date]"' +); var x3 = new Date(1900, 0, 1, 0, 0); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0, 1, 0, 0)) must return "[object Date]"' +); var x4 = new Date(1969, 11, 31, 23, 59); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11, 31, 23, 59)) must return "[object Date]"' +); var x5 = new Date(1969, 12, 1, 0, 0); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12, 1, 0, 0)) must return "[object Date]"' +); var x6 = new Date(1970, 0, 1, 0, 0); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0, 1, 0, 0)) must return "[object Date]"' +); var x7 = new Date(1999, 11, 31, 23, 59); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11, 31, 23, 59)) must return "[object Date]"' +); var x8 = new Date(1999, 12, 1, 0, 0); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12, 1, 0, 0)) must return "[object Date]"' +); var x9 = new Date(2000, 0, 1, 0, 0); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0, 1, 0, 0)) must return "[object Date]"' +); var x10 = new Date(2099, 11, 31, 23, 59); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11, 31, 23, 59)) must return "[object Date]"' +); var x11 = new Date(2099, 12, 1, 0, 0); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12, 1, 0, 0)) must return "[object Date]"' +); var x12 = new Date(2100, 0, 1, 0, 0); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0, 1, 0, 0)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T4.2.js b/test/built-ins/Date/S15.9.3.1_A3_T4.2.js index af9c12c620..052c0376d1 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T4.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T4.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11, 31, 23, 59); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12, 1, 0, 0); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0, 1, 0, 0); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11, 31, 23, 59); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12, 1, 0, 0); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0, 1, 0, 0); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11, 31, 23, 59); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12, 1, 0, 0); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0, 1, 0, 0); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11, 31, 23, 59); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12, 1, 0, 0); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0, 1, 0, 0); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T5.1.js b/test/built-ins/Date/S15.9.3.1_A3_T5.1.js index 92741dfc4f..4b556e11dc 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T5.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T5.1.js @@ -10,61 +10,97 @@ description: 6 arguments, (year, month, date, hours, minutes, seconds) ---*/ var x1 = new Date(1899, 11, 31, 23, 59, 59); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11, 31, 23, 59, 59)) must return "[object Date]"' +); var x2 = new Date(1899, 12, 1, 0, 0, 0); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12, 1, 0, 0, 0)) must return "[object Date]"' +); var x3 = new Date(1900, 0, 1, 0, 0, 0); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0, 1, 0, 0, 0)) must return "[object Date]"' +); var x4 = new Date(1969, 11, 31, 23, 59, 59); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11, 31, 23, 59, 59)) must return "[object Date]"' +); var x5 = new Date(1969, 12, 1, 0, 0, 0); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12, 1, 0, 0, 0)) must return "[object Date]"' +); var x6 = new Date(1970, 0, 1, 0, 0, 0); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0, 1, 0, 0, 0)) must return "[object Date]"' +); var x7 = new Date(1999, 11, 31, 23, 59, 59); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11, 31, 23, 59, 59)) must return "[object Date]"' +); var x8 = new Date(1999, 12, 1, 0, 0, 0); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12, 1, 0, 0, 0)) must return "[object Date]"' +); var x9 = new Date(2000, 0, 1, 0, 0, 0); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0, 1, 0, 0, 0)) must return "[object Date]"' +); var x10 = new Date(2099, 11, 31, 23, 59, 59); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11, 31, 23, 59, 59)) must return "[object Date]"' +); var x11 = new Date(2099, 12, 1, 0, 0, 0); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12, 1, 0, 0, 0)) must return "[object Date]"' +); var x12 = new Date(2100, 0, 1, 0, 0, 0); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0, 1, 0, 0, 0)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T5.2.js b/test/built-ins/Date/S15.9.3.1_A3_T5.2.js index 519bc94ba4..3269291786 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T5.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T5.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11, 31, 23, 59, 59); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12, 1, 0, 0, 0); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0, 1, 0, 0, 0); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11, 31, 23, 59, 59); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12, 1, 0, 0, 0); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0, 1, 0, 0, 0); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11, 31, 23, 59, 59); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12, 1, 0, 0, 0); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0, 1, 0, 0, 0); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11, 31, 23, 59, 59); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12, 1, 0, 0, 0); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0, 1, 0, 0, 0); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T6.1.js b/test/built-ins/Date/S15.9.3.1_A3_T6.1.js index a4fe3025b1..3fa17e2b51 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T6.1.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T6.1.js @@ -10,61 +10,97 @@ description: 7 arguments, (year, month, date, hours, minutes, seconds, ms) ---*/ var x1 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 11, 31, 23, 59, 59, 999)) must return "[object Date]"' +); var x2 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(1899, 12, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x3 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(1900, 0, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x4 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 11, 31, 23, 59, 59, 999)) must return "[object Date]"' +); var x5 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(1969, 12, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x6 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(1970, 0, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x7 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 11, 31, 23, 59, 59, 999)) must return "[object Date]"' +); var x8 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(1999, 12, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x9 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x9) !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x9), + "[object Date]", + 'Object.prototype.toString.call(new Date(2000, 0, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x10 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (Object.prototype.toString.call(x10) !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x10), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 11, 31, 23, 59, 59, 999)) must return "[object Date]"' +); var x11 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x11) !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x11), + "[object Date]", + 'Object.prototype.toString.call(new Date(2099, 12, 1, 0, 0, 0, 0)) must return "[object Date]"' +); var x12 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (Object.prototype.toString.call(x12) !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x12), + "[object Date]", + 'Object.prototype.toString.call(new Date(2100, 0, 1, 0, 0, 0, 0)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.1_A3_T6.2.js b/test/built-ins/Date/S15.9.3.1_A3_T6.2.js index 5c99bb9b94..94da312a41 100644 --- a/test/built-ins/Date/S15.9.3.1_A3_T6.2.js +++ b/test/built-ins/Date/S15.9.3.1_A3_T6.2.js @@ -14,61 +14,37 @@ description: > Date.prototype.toString = Object.prototype.toString; var x1 = new Date(1899, 11, 31, 23, 59, 59, 999); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(1899, 12, 1, 0, 0, 0, 0); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(1900, 0, 1, 0, 0, 0, 0); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(1969, 11, 31, 23, 59, 59, 999); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(1969, 12, 1, 0, 0, 0, 0); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(1970, 0, 1, 0, 0, 0, 0); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(1999, 11, 31, 23, 59, 59, 999); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(1999, 12, 1, 0, 0, 0, 0); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); var x9 = new Date(2000, 0, 1, 0, 0, 0, 0); -if (x9.toString() !== "[object Date]") { - throw new Test262Error("#9: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x9.toString(), "[object Date]", 'x9.toString() must return "[object Date]"'); var x10 = new Date(2099, 11, 31, 23, 59, 59, 999); -if (x10.toString() !== "[object Date]") { - throw new Test262Error("#10: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x10.toString(), "[object Date]", 'x10.toString() must return "[object Date]"'); var x11 = new Date(2099, 12, 1, 0, 0, 0, 0); -if (x11.toString() !== "[object Date]") { - throw new Test262Error("#11: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x11.toString(), "[object Date]", 'x11.toString() must return "[object Date]"'); var x12 = new Date(2100, 0, 1, 0, 0, 0, 0); -if (x12.toString() !== "[object Date]") { - throw new Test262Error("#12: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x12.toString(), "[object Date]", 'x12.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T0.js b/test/built-ins/Date/S15.9.3.1_A4_T0.js new file mode 100644 index 0000000000..280f83357d --- /dev/null +++ b/test/built-ins/Date/S15.9.3.1_A4_T0.js @@ -0,0 +1,29 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The [[Value]] property of the newly constructed object + is set by following steps: + 1. Call ToNumber(year) + 2. Call ToNumber(month) + 3. If date is supplied use ToNumber(date) + 4. If hours is supplied use ToNumber(hours) + 5. If minutes is supplied use ToNumber(minutes) + 6. If seconds is supplied use ToNumber(seconds) + 7. If ms is supplied use ToNumber(ms) +esid: sec-date-year-month-date-hours-minutes-seconds-ms +description: 1 argument (year) +---*/ + +function PoisonedValueOf(val) { + this.value = val; + this.valueOf = function() { + throw new Test262Error(); + }; + this.toString = function() {}; +} + +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1)); +}, '`new Date(new PoisonedValueOf(1))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T1.js b/test/built-ins/Date/S15.9.3.1_A4_T1.js index 6abfb91f33..ce875e6f85 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T1.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T1.js @@ -16,34 +16,18 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 2 arguments, (year, month) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2)); +}, '`new Date(1, new PoisonedValueOf(2))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T2.js b/test/built-ins/Date/S15.9.3.1_A4_T2.js index c9f9096930..db163ea9f7 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T2.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T2.js @@ -16,45 +16,22 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 3 arguments, (year, month, date) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2), new myObj(3)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2), new myObj(3)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3))` throws a Test262Error exception'); -//CHECK#3 -try { - var x3 = new Date(1, 2, new myObj(3)); - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); -} -catch (e) { - if (e !== "valueOf-3") { - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3)); +}, '`new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, 2, new PoisonedValueOf(3)); +}, '`new Date(1, 2, new PoisonedValueOf(3))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T3.js b/test/built-ins/Date/S15.9.3.1_A4_T3.js index bd00972209..e3cc46a09d 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T3.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T3.js @@ -16,56 +16,26 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 4 arguments, (year, month, date, hours) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2), new myObj(3), new myObj(4)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2), new myObj(3), new myObj(4)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4))` throws a Test262Error exception'); -//CHECK#3 -try { - var x3 = new Date(1, 2, new myObj(3), new myObj(4)); - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); -} -catch (e) { - if (e !== "valueOf-3") { - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4)); +}, '`new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4))` throws a Test262Error exception'); -//CHECK#4 -try { - var x4 = new Date(1, 2, 3, new myObj(4)); - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); -} -catch (e) { - if (e !== "valueOf-4") { - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4)); +}, '`new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, 2, 3, new PoisonedValueOf(4)); +}, '`new Date(1, 2, 3, new PoisonedValueOf(4))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T4.js b/test/built-ins/Date/S15.9.3.1_A4_T4.js index e001756044..15eec4a09c 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T4.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T4.js @@ -16,67 +16,30 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 5 arguments, (year, month, date, hours, minutes) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2), new myObj(3), new myObj(4), new myObj(5)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2), new myObj(3), new myObj(4), new myObj(5)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5))` throws a Test262Error exception'); -//CHECK#3 -try { - var x3 = new Date(1, 2, new myObj(3), new myObj(4), new myObj(5)); - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); -} -catch (e) { - if (e !== "valueOf-3") { - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5)); +}, '`new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5))` throws a Test262Error exception'); -//CHECK#4 -try { - var x4 = new Date(1, 2, 3, new myObj(4), new myObj(5)); - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); -} -catch (e) { - if (e !== "valueOf-4") { - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5)); +}, '`new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5))` throws a Test262Error exception'); -//CHECK#5 -try { - var x5 = new Date(1, 2, 3, 4, new myObj(5)); - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); -} -catch (e) { - if (e !== "valueOf-5") { - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5)); +}, '`new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, new PoisonedValueOf(5)); +}, '`new Date(1, 2, 3, 4, new PoisonedValueOf(5))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T5.js b/test/built-ins/Date/S15.9.3.1_A4_T5.js index e0c5d6c0b4..f787cc8f48 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T5.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T5.js @@ -16,78 +16,34 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 6 arguments, (year, month, date, hours, minutes, seconds) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2), new myObj(3), new myObj(4), new myObj(5), new myObj(6)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2), new myObj(3), new myObj(4), new myObj(5), new myObj(6)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6))` throws a Test262Error exception'); -//CHECK#3 -try { - var x3 = new Date(1, 2, new myObj(3), new myObj(4), new myObj(5), new myObj(6)); - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); -} -catch (e) { - if (e !== "valueOf-3") { - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6)); +}, '`new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6))` throws a Test262Error exception'); -//CHECK#4 -try { - var x4 = new Date(1, 2, 3, new myObj(4), new myObj(5), new myObj(6)); - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); -} -catch (e) { - if (e !== "valueOf-4") { - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6)); +}, '`new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6))` throws a Test262Error exception'); -//CHECK#5 -try { - var x5 = new Date(1, 2, 3, 4, new myObj(5), new myObj(6)); - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); -} -catch (e) { - if (e !== "valueOf-5") { - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6)); +}, '`new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6))` throws a Test262Error exception'); -//CHECK#6 -try { - var x6 = new Date(1, 2, 3, 4, 5, new myObj(6)); - throw new Test262Error("#6: The 6th step is calling ToNumber(seconds)"); -} -catch (e) { - if (e !== "valueOf-6") { - throw new Test262Error("#6: The 6th step is calling ToNumber(seconds)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, new PoisonedValueOf(5), new PoisonedValueOf(6)); +}, '`new Date(1, 2, 3, 4, new PoisonedValueOf(5), new PoisonedValueOf(6))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, 5, new PoisonedValueOf(6)); +}, '`new Date(1, 2, 3, 4, 5, new PoisonedValueOf(6))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A4_T6.js b/test/built-ins/Date/S15.9.3.1_A4_T6.js index f5ab6c1409..bc1f7db6e3 100644 --- a/test/built-ins/Date/S15.9.3.1_A4_T6.js +++ b/test/built-ins/Date/S15.9.3.1_A4_T6.js @@ -16,89 +16,38 @@ esid: sec-date-year-month-date-hours-minutes-seconds-ms description: 7 arguments, (year, month, date, hours, minutes, seconds, ms) ---*/ -var myObj = function(val) { +function PoisonedValueOf(val) { this.value = val; this.valueOf = function() { - throw "valueOf-" + this.value; + throw new Test262Error(); }; - this.toString = function() { - throw "toString-" + this.value; - }; -}; - -//CHECK#1 -try { - var x1 = new Date(new myObj(1), new myObj(2), new myObj(3), new myObj(4), new myObj(5), new myObj(6), new myObj(7)); - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); -} -catch (e) { - if (e !== "valueOf-1") { - throw new Test262Error("#1: The 1st step is calling ToNumber(year)"); - } + this.toString = function() {}; } -//CHECK#2 -try { - var x2 = new Date(1, new myObj(2), new myObj(3), new myObj(4), new myObj(5), new myObj(6), new myObj(7)); - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); -} -catch (e) { - if (e !== "valueOf-2") { - throw new Test262Error("#2: The 2nd step is calling ToNumber(month)"); - } -} +assert.throws(Test262Error, () => { + new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(new PoisonedValueOf(1), new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); -//CHECK#3 -try { - var x3 = new Date(1, 2, new myObj(3), new myObj(4), new myObj(5), new myObj(6), new myObj(7)); - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); -} -catch (e) { - if (e !== "valueOf-3") { - throw new Test262Error("#3: The 3rd step is calling ToNumber(date)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(1, new PoisonedValueOf(2), new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); -//CHECK#4 -try { - var x4 = new Date(1, 2, 3, new myObj(4), new myObj(5), new myObj(6), new myObj(7)); - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); -} -catch (e) { - if (e !== "valueOf-4") { - throw new Test262Error("#4: The 4th step is calling ToNumber(hours)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(1, 2, new PoisonedValueOf(3), new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); -//CHECK#5 -try { - var x5 = new Date(1, 2, 3, 4, new myObj(5), new myObj(6), new myObj(7)); - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); -} -catch (e) { - if (e !== "valueOf-5") { - throw new Test262Error("#5: The 5th step is calling ToNumber(minutes)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(1, 2, 3, new PoisonedValueOf(4), new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); -//CHECK#6 -try { - var x6 = new Date(1, 2, 3, 4, 5, new myObj(6), new myObj(7)); - throw new Test262Error("#6: The 6th step is calling ToNumber(seconds)"); -} -catch (e) { - if (e !== "valueOf-6") { - throw new Test262Error("#6: The 6th step is calling ToNumber(seconds)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(1, 2, 3, 4, new PoisonedValueOf(5), new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); -//CHECK#7 -try { - var x7 = new Date(1, 2, 3, 4, 5, 6, new myObj(7)); - throw new Test262Error("#7: The 7th step is calling ToNumber(ms)"); -} -catch (e) { - if (e !== "valueOf-7") { - throw new Test262Error("#7: The 7th step is calling ToNumber(ms)"); - } -} +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, 5, new PoisonedValueOf(6), new PoisonedValueOf(7)); +}, '`new Date(1, 2, 3, 4, 5, new PoisonedValueOf(6), new PoisonedValueOf(7))` throws a Test262Error exception'); + +assert.throws(Test262Error, () => { + new Date(1, 2, 3, 4, 5, 6, new PoisonedValueOf(7)); +}, '`new Date(1, 2, 3, 4, 5, 6, new PoisonedValueOf(7))` throws a Test262Error exception'); diff --git a/test/built-ins/Date/S15.9.3.1_A6_T1.js b/test/built-ins/Date/S15.9.3.1_A6_T1.js index 7fd62c3924..5a493f8bcb 100644 --- a/test/built-ins/Date/S15.9.3.1_A6_T1.js +++ b/test/built-ins/Date/S15.9.3.1_A6_T1.js @@ -15,37 +15,37 @@ function DateValue(year, month, date, hours, minutes, seconds, ms) { var x; x = DateValue(1899, 11); -assert.sameValue(x, NaN, "(1899, 11)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1899, 12); -assert.sameValue(x, NaN, "(1899, 12)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1900, 0); -assert.sameValue(x, NaN, "(1900, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 11); -assert.sameValue(x, NaN, "(1969, 11)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 12); -assert.sameValue(x, NaN, "(1969, 12)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1970, 0); -assert.sameValue(x, NaN, "(1970, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 11); -assert.sameValue(x, NaN, "(1999, 11)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 12); -assert.sameValue(x, NaN, "(1999, 12)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2000, 0); -assert.sameValue(x, NaN, "(2000, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 11); -assert.sameValue(x, NaN, "(2099, 11)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 12); -assert.sameValue(x, NaN, "(2099, 12)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2100, 0); -assert.sameValue(x, NaN, "(2100, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); diff --git a/test/built-ins/Date/S15.9.3.1_A6_T2.js b/test/built-ins/Date/S15.9.3.1_A6_T2.js index 17ae6eaca3..73d0dccdf3 100644 --- a/test/built-ins/Date/S15.9.3.1_A6_T2.js +++ b/test/built-ins/Date/S15.9.3.1_A6_T2.js @@ -15,37 +15,37 @@ function DateValue(year, month, date, hours, minutes, seconds, ms) { var x; x = DateValue(1899, 11, 31); -assert.sameValue(x, NaN, "(1899, 11, 31)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1899, 12, 1); -assert.sameValue(x, NaN, "(1899, 12, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1900, 0, 1); -assert.sameValue(x, NaN, "(1900, 0, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 11, 31); -assert.sameValue(x, NaN, "(1969, 11, 31)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 12, 1); -assert.sameValue(x, NaN, "(1969, 12, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1970, 0, 1); -assert.sameValue(x, NaN, "(1970, 0, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 11, 31); -assert.sameValue(x, NaN, "(1999, 11, 31)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 12, 1); -assert.sameValue(x, NaN, "(1999, 12, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2000, 0, 1); -assert.sameValue(x, NaN, "(2000, 0, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 11, 31); -assert.sameValue(x, NaN, "(2099, 11, 31)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 12, 1); -assert.sameValue(x, NaN, "(2099, 12, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2100, 0, 1); -assert.sameValue(x, NaN, "(2100, 0, 1)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); diff --git a/test/built-ins/Date/S15.9.3.1_A6_T3.js b/test/built-ins/Date/S15.9.3.1_A6_T3.js index c6f55a2c5f..1f6c7f7b46 100644 --- a/test/built-ins/Date/S15.9.3.1_A6_T3.js +++ b/test/built-ins/Date/S15.9.3.1_A6_T3.js @@ -15,37 +15,37 @@ function DateValue(year, month, date, hours, minutes, seconds, ms) { var x; x = DateValue(1899, 11, 31, 23); -assert.sameValue(x, NaN, "(1899, 11, 31, 23)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1899, 12, 1, 0); -assert.sameValue(x, NaN, "(1899, 12, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1900, 0, 1, 0); -assert.sameValue(x, NaN, "(1900, 0, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 11, 31, 23); -assert.sameValue(x, NaN, "(1969, 11, 31, 23)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 12, 1, 0); -assert.sameValue(x, NaN, "(1969, 12, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1970, 0, 1, 0); -assert.sameValue(x, NaN, "(1970, 0, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 11, 31, 23); -assert.sameValue(x, NaN, "(1999, 11, 31, 23)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 12, 1, 0); -assert.sameValue(x, NaN, "(1999, 12, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2000, 0, 1, 0); -assert.sameValue(x, NaN, "(2000, 0, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 11, 31, 23); -assert.sameValue(x, NaN, "(2099, 11, 31, 23)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 12, 1, 0); -assert.sameValue(x, NaN, "(2099, 12, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2100, 0, 1, 0); -assert.sameValue(x, NaN, "(2100, 0, 1, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); diff --git a/test/built-ins/Date/S15.9.3.1_A6_T4.js b/test/built-ins/Date/S15.9.3.1_A6_T4.js index a615aaf8bd..70a033a952 100644 --- a/test/built-ins/Date/S15.9.3.1_A6_T4.js +++ b/test/built-ins/Date/S15.9.3.1_A6_T4.js @@ -15,37 +15,37 @@ function DateValue(year, month, date, hours, minutes, seconds, ms) { var x; x = DateValue(1899, 11, 31, 23, 59); -assert.sameValue(x, NaN, "(1899, 11, 31, 23, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1899, 12, 1, 0, 0); -assert.sameValue(x, NaN, "(1899, 12, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1900, 0, 1, 0, 0); -assert.sameValue(x, NaN, "(1900, 0, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 11, 31, 23, 59); -assert.sameValue(x, NaN, "(1969, 11, 31, 23, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 12, 1, 0, 0); -assert.sameValue(x, NaN, "(1969, 12, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1970, 0, 1, 0, 0); -assert.sameValue(x, NaN, "(1970, 0, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 11, 31, 23, 59); -assert.sameValue(x, NaN, "(1999, 11, 31, 23, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 12, 1, 0, 0); -assert.sameValue(x, NaN, "(1999, 12, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2000, 0, 1, 0, 0); -assert.sameValue(x, NaN, "(2000, 0, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 11, 31, 23, 59); -assert.sameValue(x, NaN, "(2099, 11, 31, 23, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 12, 1, 0, 0); -assert.sameValue(x, NaN, "(2099, 12, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2100, 0, 1, 0, 0); -assert.sameValue(x, NaN, "(2100, 0, 1, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); diff --git a/test/built-ins/Date/S15.9.3.1_A6_T5.js b/test/built-ins/Date/S15.9.3.1_A6_T5.js index 9c986341e4..3afea227de 100644 --- a/test/built-ins/Date/S15.9.3.1_A6_T5.js +++ b/test/built-ins/Date/S15.9.3.1_A6_T5.js @@ -15,37 +15,37 @@ function DateValue(year, month, date, hours, minutes, seconds, ms) { var x; x = DateValue(1899, 11, 31, 23, 59, 59); -assert.sameValue(x, NaN, "(1899, 11, 31, 23, 59, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1899, 12, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(1899, 12, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1900, 0, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(1900, 0, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 11, 31, 23, 59, 59); -assert.sameValue(x, NaN, "(1969, 11, 31, 23, 59, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1969, 12, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(1969, 12, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1970, 0, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(1970, 0, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 11, 31, 23, 59, 59); -assert.sameValue(x, NaN, "(1999, 11, 31, 23, 59, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(1999, 12, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(1999, 12, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2000, 0, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(2000, 0, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 11, 31, 23, 59, 59); -assert.sameValue(x, NaN, "(2099, 11, 31, 23, 59, 59)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2099, 12, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(2099, 12, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); x = DateValue(2100, 0, 1, 0, 0, 0); -assert.sameValue(x, NaN, "(2100, 0, 1, 0, 0, 0)"); +assert.sameValue(x, NaN, 'The value of x is expected to equal NaN'); diff --git a/test/built-ins/Date/S15.9.3.2_A1_T1.js b/test/built-ins/Date/S15.9.3.2_A1_T1.js index dd886b43af..95ea703e72 100644 --- a/test/built-ins/Date/S15.9.3.2_A1_T1.js +++ b/test/built-ins/Date/S15.9.3.2_A1_T1.js @@ -9,147 +9,130 @@ esid: sec-date-value description: Checking types of newly created objects and it values includes: [dateConstants.js] ---*/ +assert.sameValue( + typeof new Date(date_1899_end), + "object", + 'The value of `typeof new Date(date_1899_end)` is expected to be "object"' +); -if (typeof new Date(date_1899_end) !== "object") { - throw new Test262Error("#1.1: typeof new Date(date_1899_end) === 'object'"); -} - -if (new Date(date_1899_end) === undefined) { - throw new Test262Error("#1.2: new Date(date_1899_end) === undefined"); -} +assert.notSameValue(new Date(date_1899_end), undefined, 'new Date(date_1899_end) is expected to not equal ``undefined``'); var x13 = new Date(date_1899_end); -if (typeof x13 !== "object") { - throw new Test262Error("#1.3: typeof new Date(date_1899_end) !== 'object'"); -} +assert.sameValue(typeof x13, "object", 'The value of `typeof x13` is expected to be "object"'); var x14 = new Date(date_1899_end); -if (x14 === undefined) { - throw new Test262Error("#1.4: new Date(date_1899_end) !== undefined"); -} +assert.notSameValue(x14, undefined, 'The value of x14 is expected to not equal ``undefined``'); -if (typeof new Date(date_1900_start) !== "object") { - throw new Test262Error("#2.1: typeof new Date(date_1900_start) === 'object'"); -} +assert.sameValue( + typeof new Date(date_1900_start), + "object", + 'The value of `typeof new Date(date_1900_start)` is expected to be "object"' +); -if (new Date(date_1900_start) === undefined) { - throw new Test262Error("#2.2: new Date(date_1900_start) === undefined"); -} +assert.notSameValue( + new Date(date_1900_start), + undefined, + 'new Date(date_1900_start) is expected to not equal ``undefined``' +); var x23 = new Date(date_1900_start); -if (typeof x23 !== "object") { - throw new Test262Error("#2.3: typeof new Date(date_1900_start) !== 'object'"); -} +assert.sameValue(typeof x23, "object", 'The value of `typeof x23` is expected to be "object"'); var x24 = new Date(date_1900_start); -if (x24 === undefined) { - throw new Test262Error("#2.4: new Date(date_1900_start) !== undefined"); -} +assert.notSameValue(x24, undefined, 'The value of x24 is expected to not equal ``undefined``'); -if (typeof new Date(date_1969_end) !== "object") { - throw new Test262Error("#3.1: typeof new Date(date_1969_end) === 'object'"); -} +assert.sameValue( + typeof new Date(date_1969_end), + "object", + 'The value of `typeof new Date(date_1969_end)` is expected to be "object"' +); -if (new Date(date_1969_end) === undefined) { - throw new Test262Error("#3.2: new Date(date_1969_end) === undefined"); -} +assert.notSameValue(new Date(date_1969_end), undefined, 'new Date(date_1969_end) is expected to not equal ``undefined``'); var x33 = new Date(date_1969_end); -if (typeof x33 !== "object") { - throw new Test262Error("#3.3: typeof new Date(date_1969_end) !== 'object'"); -} +assert.sameValue(typeof x33, "object", 'The value of `typeof x33` is expected to be "object"'); var x34 = new Date(date_1969_end); -if (x34 === undefined) { - throw new Test262Error("#3.4: new Date(date_1969_end) !== undefined"); -} +assert.notSameValue(x34, undefined, 'The value of x34 is expected to not equal ``undefined``'); -if (typeof new Date(date_1970_start) !== "object") { - throw new Test262Error("#4.1: typeof new Date(date_1970_start) === 'object'"); -} +assert.sameValue( + typeof new Date(date_1970_start), + "object", + 'The value of `typeof new Date(date_1970_start)` is expected to be "object"' +); -if (new Date(date_1970_start) === undefined) { - throw new Test262Error("#4.2: new Date(date_1970_start) === undefined"); -} +assert.notSameValue( + new Date(date_1970_start), + undefined, + 'new Date(date_1970_start) is expected to not equal ``undefined``' +); var x43 = new Date(date_1970_start); -if (typeof x43 !== "object") { - throw new Test262Error("#4.3: typeof new Date(date_1970_start) !== 'object'"); -} +assert.sameValue(typeof x43, "object", 'The value of `typeof x43` is expected to be "object"'); var x44 = new Date(date_1970_start); -if (x44 === undefined) { - throw new Test262Error("#4.4: new Date(date_1970_start) !== undefined"); -} +assert.notSameValue(x44, undefined, 'The value of x44 is expected to not equal ``undefined``'); -if (typeof new Date(date_1999_end) !== "object") { - throw new Test262Error("#5.1: typeof new Date(date_1999_end) === 'object'"); -} +assert.sameValue( + typeof new Date(date_1999_end), + "object", + 'The value of `typeof new Date(date_1999_end)` is expected to be "object"' +); -if (new Date(date_1999_end) === undefined) { - throw new Test262Error("#5.2: new Date(date_1999_end) === undefined"); -} +assert.notSameValue(new Date(date_1999_end), undefined, 'new Date(date_1999_end) is expected to not equal ``undefined``'); var x53 = new Date(date_1999_end); -if (typeof x53 !== "object") { - throw new Test262Error("#5.3: typeof new Date(date_1999_end) !== 'object'"); -} +assert.sameValue(typeof x53, "object", 'The value of `typeof x53` is expected to be "object"'); var x54 = new Date(date_1999_end); -if (x54 === undefined) { - throw new Test262Error("#5.4: new Date(date_1999_end) !== undefined"); -} +assert.notSameValue(x54, undefined, 'The value of x54 is expected to not equal ``undefined``'); -if (typeof new Date(date_2000_start) !== "object") { - throw new Test262Error("#6.1: typeof new Date(date_2000_start) === 'object'"); -} +assert.sameValue( + typeof new Date(date_2000_start), + "object", + 'The value of `typeof new Date(date_2000_start)` is expected to be "object"' +); -if (new Date(date_2000_start) === undefined) { - throw new Test262Error("#6.2: new Date(date_2000_start) === undefined"); -} +assert.notSameValue( + new Date(date_2000_start), + undefined, + 'new Date(date_2000_start) is expected to not equal ``undefined``' +); var x63 = new Date(date_2000_start); -if (typeof x63 !== "object") { - throw new Test262Error("#6.3: typeof new Date(date_2000_start) !== 'object'"); -} +assert.sameValue(typeof x63, "object", 'The value of `typeof x63` is expected to be "object"'); var x64 = new Date(date_2000_start); -if (x64 === undefined) { - throw new Test262Error("#6.4: new Date(date_2000_start) !== undefined"); -} +assert.notSameValue(x64, undefined, 'The value of x64 is expected to not equal ``undefined``'); -if (typeof new Date(date_2099_end) !== "object") { - throw new Test262Error("#7.1: typeof new Date(date_2099_end) === 'object'"); -} +assert.sameValue( + typeof new Date(date_2099_end), + "object", + 'The value of `typeof new Date(date_2099_end)` is expected to be "object"' +); -if (new Date(date_2099_end) === undefined) { - throw new Test262Error("#7.2: new Date(date_2099_end) === undefined"); -} +assert.notSameValue(new Date(date_2099_end), undefined, 'new Date(date_2099_end) is expected to not equal ``undefined``'); var x73 = new Date(date_2099_end); -if (typeof x73 !== "object") { - throw new Test262Error("#7.3: typeof new Date(date_2099_end) !== 'object'"); -} +assert.sameValue(typeof x73, "object", 'The value of `typeof x73` is expected to be "object"'); var x74 = new Date(date_2099_end); -if (x74 === undefined) { - throw new Test262Error("#7.4: new Date(date_2099_end) !== undefined"); -} +assert.notSameValue(x74, undefined, 'The value of x74 is expected to not equal ``undefined``'); -if (typeof new Date(date_2100_start) !== "object") { - throw new Test262Error("#8.1: typeof new Date(date_2100_start) === 'object'"); -} +assert.sameValue( + typeof new Date(date_2100_start), + "object", + 'The value of `typeof new Date(date_2100_start)` is expected to be "object"' +); -if (new Date(date_2100_start) === undefined) { - throw new Test262Error("#8.2: new Date(date_2100_start) === undefined"); -} +assert.notSameValue( + new Date(date_2100_start), + undefined, + 'new Date(date_2100_start) is expected to not equal ``undefined``' +); var x83 = new Date(date_2100_start); -if (typeof x83 !== "object") { - throw new Test262Error("#8.3: typeof new Date(date_2100_start) !== 'object'"); -} +assert.sameValue(typeof x83, "object", 'The value of `typeof x83` is expected to be "object"'); var x84 = new Date(date_2100_start); -if (x84 === undefined) { - throw new Test262Error("#8.4: new Date(date_2100_start) !== undefined"); -} +assert.notSameValue(x84, undefined, 'The value of x84 is expected to not equal ``undefined``'); diff --git a/test/built-ins/Date/S15.9.3.2_A2_T1.js b/test/built-ins/Date/S15.9.3.2_A2_T1.js index f97949bb4b..bc33c95342 100644 --- a/test/built-ins/Date/S15.9.3.2_A2_T1.js +++ b/test/built-ins/Date/S15.9.3.2_A2_T1.js @@ -12,121 +12,153 @@ includes: [dateConstants.js] ---*/ var x11 = new Date(date_1899_end); -if (typeof x11.constructor.prototype !== "object") { - throw new Test262Error("#1.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x11.constructor.prototype, + "object", + 'The value of `typeof x11.constructor.prototype` is expected to be "object"' +); var x12 = new Date(date_1899_end); -if (!Date.prototype.isPrototypeOf(x12)) { - throw new Test262Error('#1.2: Date.prototype.isPrototypeOf(x12)'); -} +assert(Date.prototype.isPrototypeOf(x12), 'Date.prototype.isPrototypeOf(x12) must return true'); var x13 = new Date(date_1899_end); -if (Date.prototype !== x13.constructor.prototype) { - throw new Test262Error("#1.3: Date.prototype !== x13.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x13.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x13.constructor.prototype' +); var x21 = new Date(date_1900_start); -if (typeof x21.constructor.prototype !== "object") { - throw new Test262Error("#2.1: typeof x21.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x21.constructor.prototype, + "object", + 'The value of `typeof x21.constructor.prototype` is expected to be "object"' +); var x22 = new Date(date_1900_start); -if (!Date.prototype.isPrototypeOf(x22)) { - throw new Test262Error('#2.2: Date.prototype.isPrototypeOf(x22)'); -} +assert(Date.prototype.isPrototypeOf(x22), 'Date.prototype.isPrototypeOf(x22) must return true'); var x23 = new Date(date_1900_start); -if (Date.prototype !== x23.constructor.prototype) { - throw new Test262Error("#2.3: Date.prototype !== x23.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x23.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x23.constructor.prototype' +); var x31 = new Date(date_1969_end); -if (typeof x31.constructor.prototype !== "object") { - throw new Test262Error("#3.1: typeof x31.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x31.constructor.prototype, + "object", + 'The value of `typeof x31.constructor.prototype` is expected to be "object"' +); var x32 = new Date(date_1969_end); -if (!Date.prototype.isPrototypeOf(x32)) { - throw new Test262Error('#3.2: Date.prototype.isPrototypeOf(x32)'); -} +assert(Date.prototype.isPrototypeOf(x32), 'Date.prototype.isPrototypeOf(x32) must return true'); var x33 = new Date(date_1969_end); -if (Date.prototype !== x33.constructor.prototype) { - throw new Test262Error("#3.3: Date.prototype !== x33.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x33.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x33.constructor.prototype' +); var x41 = new Date(date_1970_start); -if (typeof x41.constructor.prototype !== "object") { - throw new Test262Error("#4.1: typeof x11.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x41.constructor.prototype, + "object", + 'The value of `typeof x41.constructor.prototype` is expected to be "object"' +); var x42 = new Date(date_1970_start); -if (!Date.prototype.isPrototypeOf(x42)) { - throw new Test262Error('#4.2: Date.prototype.isPrototypeOf(x42)'); -} +assert(Date.prototype.isPrototypeOf(x42), 'Date.prototype.isPrototypeOf(x42) must return true'); var x43 = new Date(date_1970_start); -if (Date.prototype !== x43.constructor.prototype) { - throw new Test262Error("#4.3: Date.prototype !== x43.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x43.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x43.constructor.prototype' +); var x51 = new Date(date_1999_end); -if (typeof x51.constructor.prototype !== "object") { - throw new Test262Error("#5.1: typeof x51.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x51.constructor.prototype, + "object", + 'The value of `typeof x51.constructor.prototype` is expected to be "object"' +); var x52 = new Date(date_1999_end); -if (!Date.prototype.isPrototypeOf(x52)) { - throw new Test262Error('#5.2: Date.prototype.isPrototypeOf(x52)'); -} +assert(Date.prototype.isPrototypeOf(x52), 'Date.prototype.isPrototypeOf(x52) must return true'); var x53 = new Date(date_1999_end); -if (Date.prototype !== x53.constructor.prototype) { - throw new Test262Error("#5.3: Date.prototype !== x53.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x53.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x53.constructor.prototype' +); var x61 = new Date(date_2000_start); -if (typeof x61.constructor.prototype !== "object") { - throw new Test262Error("#6.1: typeof x61.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x61.constructor.prototype, + "object", + 'The value of `typeof x61.constructor.prototype` is expected to be "object"' +); var x62 = new Date(date_2000_start); -if (!Date.prototype.isPrototypeOf(x62)) { - throw new Test262Error('#6.2: Date.prototype.isPrototypeOf(x62)'); -} +assert(Date.prototype.isPrototypeOf(x62), 'Date.prototype.isPrototypeOf(x62) must return true'); var x63 = new Date(date_2000_start); -if (Date.prototype !== x63.constructor.prototype) { - throw new Test262Error("#6.3: Date.prototype !== x63.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x63.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x63.constructor.prototype' +); var x71 = new Date(date_2099_end); -if (typeof x71.constructor.prototype !== "object") { - throw new Test262Error("#7.1: typeof x71.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x71.constructor.prototype, + "object", + 'The value of `typeof x71.constructor.prototype` is expected to be "object"' +); var x72 = new Date(date_2099_end); -if (!Date.prototype.isPrototypeOf(x72)) { - throw new Test262Error('#7.2: Date.prototype.isPrototypeOf(x72)'); -} +assert(Date.prototype.isPrototypeOf(x72), 'Date.prototype.isPrototypeOf(x72) must return true'); var x73 = new Date(date_2099_end); -if (Date.prototype !== x73.constructor.prototype) { - throw new Test262Error("#7.3: Date.prototype !== x73.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x73.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x73.constructor.prototype' +); var x81 = new Date(date_2100_start); -if (typeof x81.constructor.prototype !== "object") { - throw new Test262Error("#8.1: typeof x81.constructor.prototype === 'object'"); -} + +assert.sameValue( + typeof x81.constructor.prototype, + "object", + 'The value of `typeof x81.constructor.prototype` is expected to be "object"' +); var x82 = new Date(date_2100_start); -if (!Date.prototype.isPrototypeOf(x82)) { - throw new Test262Error('#8.2: Date.prototype.isPrototypeOf(x82)'); -} +assert(Date.prototype.isPrototypeOf(x82), 'Date.prototype.isPrototypeOf(x82) must return true'); var x83 = new Date(date_2100_start); -if (Date.prototype !== x83.constructor.prototype) { - throw new Test262Error("#8.3: Date.prototype !== x83.constructor.prototype"); -} + +assert.sameValue( + Date.prototype, + x83.constructor.prototype, + 'The value of Date.prototype is expected to equal the value of x83.constructor.prototype' +); diff --git a/test/built-ins/Date/S15.9.3.2_A3_T1.1.js b/test/built-ins/Date/S15.9.3.2_A3_T1.1.js index 1a81dd1cdb..c9b2036f75 100644 --- a/test/built-ins/Date/S15.9.3.2_A3_T1.1.js +++ b/test/built-ins/Date/S15.9.3.2_A3_T1.1.js @@ -11,41 +11,65 @@ includes: [dateConstants.js] ---*/ var x1 = new Date(date_1899_end); -if (Object.prototype.toString.call(x1) !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x1), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_1899_end)) must return "[object Date]"' +); var x2 = new Date(date_1900_start); -if (Object.prototype.toString.call(x2) !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x2), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_1900_start)) must return "[object Date]"' +); var x3 = new Date(date_1969_end); -if (Object.prototype.toString.call(x3) !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x3), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_1969_end)) must return "[object Date]"' +); var x4 = new Date(date_1970_start); -if (Object.prototype.toString.call(x4) !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x4), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_1970_start)) must return "[object Date]"' +); var x5 = new Date(date_1999_end); -if (Object.prototype.toString.call(x5) !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x5), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_1999_end)) must return "[object Date]"' +); var x6 = new Date(date_2000_start); -if (Object.prototype.toString.call(x6) !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x6), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_2000_start)) must return "[object Date]"' +); var x7 = new Date(date_2099_end); -if (Object.prototype.toString.call(x7) !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x7), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_2099_end)) must return "[object Date]"' +); var x8 = new Date(date_2100_start); -if (Object.prototype.toString.call(x8) !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} + +assert.sameValue( + Object.prototype.toString.call(x8), + "[object Date]", + 'Object.prototype.toString.call(new Date(date_2100_start)) must return "[object Date]"' +); diff --git a/test/built-ins/Date/S15.9.3.2_A3_T1.2.js b/test/built-ins/Date/S15.9.3.2_A3_T1.2.js index b352b721fb..41490a5a74 100644 --- a/test/built-ins/Date/S15.9.3.2_A3_T1.2.js +++ b/test/built-ins/Date/S15.9.3.2_A3_T1.2.js @@ -13,41 +13,25 @@ includes: [dateConstants.js] Date.prototype.toString = Object.prototype.toString; var x1 = new Date(date_1899_end); -if (x1.toString() !== "[object Date]") { - throw new Test262Error("#1: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x1.toString(), "[object Date]", 'x1.toString() must return "[object Date]"'); var x2 = new Date(date_1900_start); -if (x2.toString() !== "[object Date]") { - throw new Test262Error("#2: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x2.toString(), "[object Date]", 'x2.toString() must return "[object Date]"'); var x3 = new Date(date_1969_end); -if (x3.toString() !== "[object Date]") { - throw new Test262Error("#3: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x3.toString(), "[object Date]", 'x3.toString() must return "[object Date]"'); var x4 = new Date(date_1970_start); -if (x4.toString() !== "[object Date]") { - throw new Test262Error("#4: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x4.toString(), "[object Date]", 'x4.toString() must return "[object Date]"'); var x5 = new Date(date_1999_end); -if (x5.toString() !== "[object Date]") { - throw new Test262Error("#5: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x5.toString(), "[object Date]", 'x5.toString() must return "[object Date]"'); var x6 = new Date(date_2000_start); -if (x6.toString() !== "[object Date]") { - throw new Test262Error("#6: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x6.toString(), "[object Date]", 'x6.toString() must return "[object Date]"'); var x7 = new Date(date_2099_end); -if (x7.toString() !== "[object Date]") { - throw new Test262Error("#7: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x7.toString(), "[object Date]", 'x7.toString() must return "[object Date]"'); var x8 = new Date(date_2100_start); -if (x8.toString() !== "[object Date]") { - throw new Test262Error("#8: The [[Class]] property of the newly constructed object is set to 'Date'"); -} +assert.sameValue(x8.toString(), "[object Date]", 'x8.toString() must return "[object Date]"'); diff --git a/test/built-ins/Date/S15.9.4_A1.js b/test/built-ins/Date/S15.9.4_A1.js index 3a21806953..3a0169ac8e 100644 --- a/test/built-ins/Date/S15.9.4_A1.js +++ b/test/built-ins/Date/S15.9.4_A1.js @@ -6,7 +6,4 @@ info: The Date constructor has the property "prototype" esid: sec-date-constructor description: Checking existence of the property "prototype" ---*/ - -if (!Date.hasOwnProperty("prototype")) { - throw new Test262Error('#1: The Date constructor has the property "prototype"'); -} +assert(Date.hasOwnProperty("prototype"), 'Date.hasOwnProperty("prototype") must return true'); diff --git a/test/built-ins/Date/S15.9.4_A2.js b/test/built-ins/Date/S15.9.4_A2.js index 07477dbb37..17b467efe0 100644 --- a/test/built-ins/Date/S15.9.4_A2.js +++ b/test/built-ins/Date/S15.9.4_A2.js @@ -6,7 +6,4 @@ info: The Date constructor has the property "parse" esid: sec-date-constructor description: Checking existence of the property "parse" ---*/ - -if (!Date.hasOwnProperty("parse")) { - throw new Test262Error('#1: The Date constructor has the property "parse"'); -} +assert(Date.hasOwnProperty("parse"), 'Date.hasOwnProperty("parse") must return true'); diff --git a/test/built-ins/Date/S15.9.4_A3.js b/test/built-ins/Date/S15.9.4_A3.js index ecda1b9fc2..b1eb440637 100644 --- a/test/built-ins/Date/S15.9.4_A3.js +++ b/test/built-ins/Date/S15.9.4_A3.js @@ -6,7 +6,4 @@ info: The Date constructor has the property "UTC" esid: sec-date-constructor description: Checking existence of the property "UTC" ---*/ - -if (!Date.hasOwnProperty("UTC")) { - throw new Test262Error('#1: The Date constructor has the property "UTC"'); -} +assert(Date.hasOwnProperty("UTC"), 'Date.hasOwnProperty("UTC") must return true'); diff --git a/test/built-ins/Date/S15.9.4_A4.js b/test/built-ins/Date/S15.9.4_A4.js index 07dbc584c9..a2e8fea1a2 100644 --- a/test/built-ins/Date/S15.9.4_A4.js +++ b/test/built-ins/Date/S15.9.4_A4.js @@ -8,8 +8,4 @@ info: | esid: sec-date-constructor description: Checking Function.prototype.isPrototypeOf(Date) ---*/ - -//CHECK#1 -if (!(Function.prototype.isPrototypeOf(Date))) { - throw new Test262Error('#1: the value of the internal [[Prototype]] property of the Date constructor is the Function prototype object.'); -} +assert(Function.prototype.isPrototypeOf(Date), 'Function.prototype.isPrototypeOf(Date) must return true'); diff --git a/test/built-ins/Date/S15.9.4_A5.js b/test/built-ins/Date/S15.9.4_A5.js index b9b5c7024b..ec38330bf4 100644 --- a/test/built-ins/Date/S15.9.4_A5.js +++ b/test/built-ins/Date/S15.9.4_A5.js @@ -6,13 +6,5 @@ info: Date constructor has length property whose value is 7 esid: sec-date-constructor description: Checking Date.length property ---*/ - -//CHECK#1 -if (!Date.hasOwnProperty("length")) { - throw new Test262Error('#1: Date constructor has length property'); -} - -//CHECK#2 -if (Date.length !== 7) { - throw new Test262Error('#2: Date constructor length property value should be 7'); -} +assert(Date.hasOwnProperty("length"), 'Date.hasOwnProperty("length") must return true'); +assert.sameValue(Date.length, 7, 'The value of Date.length is expected to be 7'); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A1_T1.js b/test/built-ins/Date/UTC/S15.9.4.3_A1_T1.js index 17842f2494..69ebf9aa06 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A1_T1.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A1_T1.js @@ -9,10 +9,9 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.UTC; -if (x === 1) +if (x === 1) { Date.UTC = 2; -else +} else { Date.UTC = 1; -if (Date.UTC === x) { - throw new Test262Error('#1: The Date.UTC has not the attribute ReadOnly'); } +assert.notSameValue(Date.UTC, x, 'The value of Date.UTC is expected to not equal the value of `x`'); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A1_T2.js b/test/built-ins/Date/UTC/S15.9.4.3_A1_T2.js index 6dbdc3a9ce..9e22673861 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A1_T2.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A1_T2.js @@ -7,11 +7,5 @@ info: The Date property "UTC" has { DontEnum } attributes es5id: 15.9.4.3_A1_T2 description: Checking absence of DontDelete attribute ---*/ - -if (delete Date.UTC === false) { - throw new Test262Error('#1: The Date.UTC property has not the attributes DontDelete'); -} - -if (Date.hasOwnProperty('UTC')) { - throw new Test262Error('#2: The Date.UTC property has not the attributes DontDelete'); -} +assert.notSameValue(delete Date.UTC, false, 'The value of delete Date.UTC is not false'); +assert(!Date.hasOwnProperty('UTC'), 'The value of !Date.hasOwnProperty(\'UTC\') is expected to be true'); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A1_T3.js b/test/built-ins/Date/UTC/S15.9.4.3_A1_T3.js index 5097181855..b1584d84eb 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A1_T3.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A1_T3.js @@ -7,13 +7,11 @@ info: The Date property "UTC" has { DontEnum } attributes es5id: 15.9.4.3_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.propertyIsEnumerable('UTC')) { - throw new Test262Error('#1: The Date.UTC property has the attribute DontEnum'); -} +assert( + !Date.propertyIsEnumerable('UTC'), + 'The value of !Date.propertyIsEnumerable(\'UTC\') is expected to be true' +); for (var x in Date) { - if (x === "UTC") { - throw new Test262Error('#2: The Date.UTC has the attribute DontEnum'); - } + assert.notSameValue(x, "UTC", 'The value of x is not "UTC"'); } diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A2_T1.js b/test/built-ins/Date/UTC/S15.9.4.3_A2_T1.js index eefa2e33d9..9aa5398f1c 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A2_T1.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A2_T1.js @@ -7,11 +7,5 @@ info: The "length" property of the "UTC" is 7 es5id: 15.9.4.3_A2_T1 description: The "length" property of the "UTC" is 7 ---*/ - -if (Date.UTC.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The UTC has a "length" property'); -} - -if (Date.UTC.length !== 7) { - throw new Test262Error('#2: The "length" property of the UTC is 7'); -} +assert.sameValue(Date.UTC.hasOwnProperty("length"), true, 'Date.UTC.hasOwnProperty("length") must return true'); +assert.sameValue(Date.UTC.length, 7, 'The value of Date.UTC.length is expected to be 7'); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js b/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js index 3c04ed9105..b1c576b19e 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A3_T1.js @@ -13,6 +13,4 @@ includes: [propertyHelper.js] var x = Date.UTC.length; verifyNotWritable(Date.UTC, "length", null, 1); -if (Date.UTC.length !== x) { - throw new Test262Error('#1: The Date.UTC.length has the attribute ReadOnly'); -} +assert.sameValue(Date.UTC.length, x, 'The value of Date.UTC.length is expected to equal the value of x'); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A3_T2.js b/test/built-ins/Date/UTC/S15.9.4.3_A3_T2.js index f43c19861f..3bab3bf5e9 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A3_T2.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A3_T2.js @@ -10,10 +10,9 @@ es5id: 15.9.4.3_A3_T2 description: Checking DontDelete attribute ---*/ -if (delete Date.UTC.length !== true) { - throw new Test262Error('#1: The Date.UTC.length property does not have the attributes DontDelete'); -} +assert.sameValue(delete Date.UTC.length, true, 'The value of `delete Date.UTC.length` is expected to be true'); -if (Date.UTC.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.UTC.length property does not have the attributes DontDelete'); -} +assert( + !Date.UTC.hasOwnProperty('length'), + 'The value of !Date.UTC.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/UTC/S15.9.4.3_A3_T3.js b/test/built-ins/Date/UTC/S15.9.4.3_A3_T3.js index 8f8ef9b20a..63cf7e00ce 100644 --- a/test/built-ins/Date/UTC/S15.9.4.3_A3_T3.js +++ b/test/built-ins/Date/UTC/S15.9.4.3_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.4.3_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.UTC.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.UTC.length property has the attribute DontEnum'); -} +assert( + !Date.UTC.propertyIsEnumerable('length'), + 'The value of !Date.UTC.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.UTC) { - if (x === "length") { - throw new Test262Error('#2: The Date.UTC.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/parse/S15.9.4.2_A1_T1.js b/test/built-ins/Date/parse/S15.9.4.2_A1_T1.js index 9a24cbeaab..2a1f253aaa 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A1_T1.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A1_T1.js @@ -8,10 +8,9 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.parse; -if (x === 1) +if (x === 1) { Date.parse = 2; -else +} else { Date.parse = 1; -if (Date.parse === x) { - throw new Test262Error('#1: The Date.parse has not the attribute ReadOnly'); } +assert.notSameValue(Date.parse, x, 'The value of Date.parse is expected to not equal the value of `x`'); diff --git a/test/built-ins/Date/parse/S15.9.4.2_A1_T2.js b/test/built-ins/Date/parse/S15.9.4.2_A1_T2.js index 59649bca4b..c67eb1e15e 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A1_T2.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A1_T2.js @@ -6,11 +6,5 @@ info: The Date property "parse" has { DontEnum } attributes esid: sec-date.parse description: Checking absence of DontDelete attribute ---*/ - -if (delete Date.parse === false) { - throw new Test262Error('#1: The Date.parse property has not the attributes DontDelete'); -} - -if (Date.hasOwnProperty('parse')) { - throw new Test262Error('#2: The Date.parse property has not the attributes DontDelete'); -} +assert.notSameValue(delete Date.parse, false, 'The value of delete Date.parse is not false'); +assert(!Date.hasOwnProperty('parse'), 'The value of !Date.hasOwnProperty(\'parse\') is expected to be true'); diff --git a/test/built-ins/Date/parse/S15.9.4.2_A1_T3.js b/test/built-ins/Date/parse/S15.9.4.2_A1_T3.js index a6fd7466f1..b2714f8a94 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A1_T3.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A1_T3.js @@ -6,13 +6,11 @@ info: The Date property "parse" has { DontEnum } attributes esid: sec-date.parse description: Checking DontEnum attribute ---*/ - -if (Date.propertyIsEnumerable('parse')) { - throw new Test262Error('#1: The Date.parse property has the attribute DontEnum'); -} +assert( + !Date.propertyIsEnumerable('parse'), + 'The value of !Date.propertyIsEnumerable(\'parse\') is expected to be true' +); for (var x in Date) { - if (x === "parse") { - throw new Test262Error('#2: The Date.parse has the attribute DontEnum'); - } + assert.notSameValue(x, "parse", 'The value of x is not "parse"'); } diff --git a/test/built-ins/Date/parse/S15.9.4.2_A2_T1.js b/test/built-ins/Date/parse/S15.9.4.2_A2_T1.js index 115a0674c2..a1aeaaaf61 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A2_T1.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A2_T1.js @@ -6,11 +6,5 @@ info: The "length" property of the "parse" is 1 esid: sec-date.parse description: The "length" property of the "parse" is 1 ---*/ - -if (Date.parse.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The parse has a "length" property'); -} - -if (Date.parse.length !== 1) { - throw new Test262Error('#2: The "length" property of the parse is 1'); -} +assert.sameValue(Date.parse.hasOwnProperty("length"), true, 'Date.parse.hasOwnProperty("length") must return true'); +assert.sameValue(Date.parse.length, 1, 'The value of Date.parse.length is expected to be 1'); diff --git a/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js b/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js index 0054721ca8..db6a24743a 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A3_T1.js @@ -12,6 +12,4 @@ includes: [propertyHelper.js] var x = Date.parse.length; verifyNotWritable(Date.parse, "length", null, 1); -if (Date.parse.length !== x) { - throw new Test262Error('#1: The Date.parse.length has the attribute ReadOnly'); -} +assert.sameValue(Date.parse.length, x, 'The value of Date.parse.length is expected to equal the value of x'); diff --git a/test/built-ins/Date/parse/S15.9.4.2_A3_T2.js b/test/built-ins/Date/parse/S15.9.4.2_A3_T2.js index 9776dfcdac..4cf28eb30b 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A3_T2.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A3_T2.js @@ -8,11 +8,9 @@ info: | esid: sec-date.parse description: Checking DontDelete attribute ---*/ +assert.sameValue(delete Date.parse.length, true, 'The value of `delete Date.parse.length` is expected to be true'); -if (delete Date.parse.length !== true) { - throw new Test262Error('#1: The Date.parse.length property does not have the attributes DontDelete'); -} - -if (Date.parse.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.parse.length property does not have the attributes DontDelete'); -} +assert( + !Date.parse.hasOwnProperty('length'), + 'The value of !Date.parse.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/parse/S15.9.4.2_A3_T3.js b/test/built-ins/Date/parse/S15.9.4.2_A3_T3.js index 3824a5d434..b0692e6a98 100644 --- a/test/built-ins/Date/parse/S15.9.4.2_A3_T3.js +++ b/test/built-ins/Date/parse/S15.9.4.2_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.parse description: Checking DontEnum attribute ---*/ - -if (Date.parse.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.parse.length property has the attribute DontEnum'); -} +assert( + !Date.parse.propertyIsEnumerable('length'), + 'The value of !Date.parse.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.parse) { - if (x === "length") { - throw new Test262Error('#2: The Date.parse.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js b/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js index e2b7ff4ef1..88f0636d96 100644 --- a/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js +++ b/test/built-ins/Date/prototype/S15.9.4.1_A1_T1.js @@ -12,6 +12,4 @@ includes: [propertyHelper.js] var x = Date.prototype; verifyNotWritable(Date, "prototype", null, 1); -if (Date.prototype !== x) { - throw new Test262Error('#1: The Date.prototype has the attribute ReadOnly'); -} +assert.sameValue(Date.prototype, x, 'The value of Date.prototype is expected to equal the value of x'); diff --git a/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js b/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js index d2d7ffe0b5..8c65bf1d1d 100644 --- a/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js +++ b/test/built-ins/Date/prototype/S15.9.4.1_A1_T2.js @@ -13,11 +13,11 @@ includes: [propertyHelper.js] verifyNotConfigurable(Date, "prototype"); try { - if (delete Date.prototype !== false) { - throw new Test262Error('#1: The Date.prototype property has the attributes DontDelete'); - } + assert.sameValue(delete Date.prototype, false); } catch (e) { - if (e instanceof Test262Error) throw e; + if (e instanceof Test262Error) { + throw e; + } assert(e instanceof TypeError); } diff --git a/test/built-ins/Date/prototype/S15.9.4.1_A1_T3.js b/test/built-ins/Date/prototype/S15.9.4.1_A1_T3.js index 2be2962616..19a2688ac5 100644 --- a/test/built-ins/Date/prototype/S15.9.4.1_A1_T3.js +++ b/test/built-ins/Date/prototype/S15.9.4.1_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype description: Checking DontEnum attribute ---*/ - -if (Date.propertyIsEnumerable('prototype')) { - throw new Test262Error('#1: The Date.prototype property has the attribute DontEnum'); -} +assert( + !Date.propertyIsEnumerable('prototype'), + 'The value of !Date.propertyIsEnumerable(\'prototype\') is expected to be true' +); for (var x in Date) { - if (x === "prototype") { - throw new Test262Error('#2: The Date.prototype has the attribute DontEnum'); - } + assert.notSameValue(x, "prototype", 'The value of x is not "prototype"'); } diff --git a/test/built-ins/Date/prototype/S15.9.5_A01_T1.js b/test/built-ins/Date/prototype/S15.9.5_A01_T1.js index e2155e9737..38bbc25b71 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A01_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A01_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "constructor" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "constructor" ---*/ - -if (Date.prototype.hasOwnProperty("constructor") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "constructor"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("constructor"), + true, + 'Date.prototype.hasOwnProperty("constructor") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A02_T1.js b/test/built-ins/Date/prototype/S15.9.5_A02_T1.js index 5306946136..700d24fd93 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A02_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A02_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toString" ---*/ - -if (Date.prototype.hasOwnProperty("toString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toString"), + true, + 'Date.prototype.hasOwnProperty("toString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A03_T1.js b/test/built-ins/Date/prototype/S15.9.5_A03_T1.js index 81ef02eb66..268c6209ad 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A03_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A03_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toDateString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toDateString" ---*/ - -if (Date.prototype.hasOwnProperty("toDateString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toDateString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toDateString"), + true, + 'Date.prototype.hasOwnProperty("toDateString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A04_T1.js b/test/built-ins/Date/prototype/S15.9.5_A04_T1.js index 357c38271d..f40497506e 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A04_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A04_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toTimeString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toTimeString" ---*/ - -if (Date.prototype.hasOwnProperty("toTimeString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toTimeString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toTimeString"), + true, + 'Date.prototype.hasOwnProperty("toTimeString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A05_T1.js b/test/built-ins/Date/prototype/S15.9.5_A05_T1.js index d11fa7d536..7068d3dd2c 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A05_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A05_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toLocaleString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toLocaleString" ---*/ - -if (Date.prototype.hasOwnProperty("toLocaleString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toLocaleString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toLocaleString"), + true, + 'Date.prototype.hasOwnProperty("toLocaleString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A06_T1.js b/test/built-ins/Date/prototype/S15.9.5_A06_T1.js index 87d0b1b002..97e0908904 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A06_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A06_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toLocaleDateString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toLocaleDateString" ---*/ - -if (Date.prototype.hasOwnProperty("toLocaleDateString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toLocaleDateString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toLocaleDateString"), + true, + 'Date.prototype.hasOwnProperty("toLocaleDateString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A07_T1.js b/test/built-ins/Date/prototype/S15.9.5_A07_T1.js index e804cdeb76..53b6e8715e 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A07_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A07_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toLocaleTimeString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toLocaleTimeString" ---*/ - -if (Date.prototype.hasOwnProperty("toLocaleTimeString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toLocaleTimeString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toLocaleTimeString"), + true, + 'Date.prototype.hasOwnProperty("toLocaleTimeString") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A08_T1.js b/test/built-ins/Date/prototype/S15.9.5_A08_T1.js index 16cca02471..ec5103ab93 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A08_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A08_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "valueOf" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "valueOf" ---*/ - -if (Date.prototype.hasOwnProperty("valueOf") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "valueOf"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("valueOf"), + true, + 'Date.prototype.hasOwnProperty("valueOf") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A09_T1.js b/test/built-ins/Date/prototype/S15.9.5_A09_T1.js index adf95108bb..5e7caa2479 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A09_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A09_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getTime" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getTime" ---*/ - -if (Date.prototype.hasOwnProperty("getTime") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getTime"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getTime"), + true, + 'Date.prototype.hasOwnProperty("getTime") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A10_T1.js b/test/built-ins/Date/prototype/S15.9.5_A10_T1.js index 0176bee965..91af461ae2 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A10_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A10_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getFullYear" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getFullYear" ---*/ - -if (Date.prototype.hasOwnProperty("getFullYear") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getFullYear"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getFullYear"), + true, + 'Date.prototype.hasOwnProperty("getFullYear") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A11_T1.js b/test/built-ins/Date/prototype/S15.9.5_A11_T1.js index 22ea0966aa..f9477f451e 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A11_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A11_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCFullYear" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCFullYear" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCFullYear") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCFullYear"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCFullYear"), + true, + 'Date.prototype.hasOwnProperty("getUTCFullYear") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A12_T1.js b/test/built-ins/Date/prototype/S15.9.5_A12_T1.js index bf78dfd193..0acffeb84d 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A12_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A12_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getMonth" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getMonth" ---*/ - -if (Date.prototype.hasOwnProperty("getMonth") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getMonth"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getMonth"), + true, + 'Date.prototype.hasOwnProperty("getMonth") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A13_T1.js b/test/built-ins/Date/prototype/S15.9.5_A13_T1.js index b1ea62dc5b..10ca67864f 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A13_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A13_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCMonth" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCMonth" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCMonth") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCMonth"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCMonth"), + true, + 'Date.prototype.hasOwnProperty("getUTCMonth") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A14_T1.js b/test/built-ins/Date/prototype/S15.9.5_A14_T1.js index cc0ac63067..799752ce9c 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A14_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A14_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getDate" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getDate" ---*/ - -if (Date.prototype.hasOwnProperty("getDate") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getDate"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getDate"), + true, + 'Date.prototype.hasOwnProperty("getDate") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A15_T1.js b/test/built-ins/Date/prototype/S15.9.5_A15_T1.js index 0cf0058744..4a3812dc99 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A15_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A15_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCDate" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCDate" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCDate") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCDate"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCDate"), + true, + 'Date.prototype.hasOwnProperty("getUTCDate") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A16_T1.js b/test/built-ins/Date/prototype/S15.9.5_A16_T1.js index 4063e854f6..3f1ba1b572 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A16_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A16_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getDay" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getDay" ---*/ - -if (Date.prototype.hasOwnProperty("getDay") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getDay"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getDay"), + true, + 'Date.prototype.hasOwnProperty("getDay") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A17_T1.js b/test/built-ins/Date/prototype/S15.9.5_A17_T1.js index ecd44ccbf8..35a06ac4fc 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A17_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A17_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCDay" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCDay" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCDay") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCDay"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCDay"), + true, + 'Date.prototype.hasOwnProperty("getUTCDay") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A18_T1.js b/test/built-ins/Date/prototype/S15.9.5_A18_T1.js index d66809dd5c..5ba4cb9cf2 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A18_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A18_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getHours" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getHours" ---*/ - -if (Date.prototype.hasOwnProperty("getHours") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getHours"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getHours"), + true, + 'Date.prototype.hasOwnProperty("getHours") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A19_T1.js b/test/built-ins/Date/prototype/S15.9.5_A19_T1.js index 1c524c6724..3aff479891 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A19_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A19_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCHours" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCHours" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCHours") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCHours"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCHours"), + true, + 'Date.prototype.hasOwnProperty("getUTCHours") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A20_T1.js b/test/built-ins/Date/prototype/S15.9.5_A20_T1.js index f9c52ce5e3..2f66f96a7f 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A20_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A20_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getMinutes" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getMinutes" ---*/ - -if (Date.prototype.hasOwnProperty("getMinutes") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getMinutes"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getMinutes"), + true, + 'Date.prototype.hasOwnProperty("getMinutes") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A21_T1.js b/test/built-ins/Date/prototype/S15.9.5_A21_T1.js index 87ab35c6b3..2cdc7bbd07 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A21_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A21_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCMinutes" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCMinutes" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCMinutes") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCMinutes"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCMinutes"), + true, + 'Date.prototype.hasOwnProperty("getUTCMinutes") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A22_T1.js b/test/built-ins/Date/prototype/S15.9.5_A22_T1.js index cec3c0833b..554d044d7a 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A22_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A22_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getSeconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getSeconds" ---*/ - -if (Date.prototype.hasOwnProperty("getSeconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getSeconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getSeconds"), + true, + 'Date.prototype.hasOwnProperty("getSeconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A23_T1.js b/test/built-ins/Date/prototype/S15.9.5_A23_T1.js index 1379896c4d..98a76e783c 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A23_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A23_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCSeconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCSeconds" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCSeconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCSeconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCSeconds"), + true, + 'Date.prototype.hasOwnProperty("getUTCSeconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A24_T1.js b/test/built-ins/Date/prototype/S15.9.5_A24_T1.js index a00b003ab2..e2080f67de 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A24_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A24_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getMilliseconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getMilliseconds" ---*/ - -if (Date.prototype.hasOwnProperty("getMilliseconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getMilliseconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getMilliseconds"), + true, + 'Date.prototype.hasOwnProperty("getMilliseconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A25_T1.js b/test/built-ins/Date/prototype/S15.9.5_A25_T1.js index 3cea8d821a..eb1742d06f 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A25_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A25_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getUTCMilliseconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getUTCMilliseconds" ---*/ - -if (Date.prototype.hasOwnProperty("getUTCMilliseconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getUTCMilliseconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getUTCMilliseconds"), + true, + 'Date.prototype.hasOwnProperty("getUTCMilliseconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A26_T1.js b/test/built-ins/Date/prototype/S15.9.5_A26_T1.js index 794e7a742d..7065e1fef3 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A26_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A26_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "getTimezoneOffset" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "getTimezoneOffset" ---*/ - -if (Date.prototype.hasOwnProperty("getTimezoneOffset") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "getTimezoneOffset"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("getTimezoneOffset"), + true, + 'Date.prototype.hasOwnProperty("getTimezoneOffset") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A27_T1.js b/test/built-ins/Date/prototype/S15.9.5_A27_T1.js index 0b607dc97a..0e27fae0ba 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A27_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A27_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setTime" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setTime" ---*/ - -if (Date.prototype.hasOwnProperty("setTime") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setTime"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setTime"), + true, + 'Date.prototype.hasOwnProperty("setTime") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A28_T1.js b/test/built-ins/Date/prototype/S15.9.5_A28_T1.js index b7839c8cf6..a4adfbb3be 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A28_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A28_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setMilliseconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setMilliseconds" ---*/ - -if (Date.prototype.hasOwnProperty("setMilliseconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setMilliseconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setMilliseconds"), + true, + 'Date.prototype.hasOwnProperty("setMilliseconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A29_T1.js b/test/built-ins/Date/prototype/S15.9.5_A29_T1.js index 2eed4f69fa..273bfadf32 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A29_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A29_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCMilliseconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCMilliseconds" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCMilliseconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCMilliseconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCMilliseconds"), + true, + 'Date.prototype.hasOwnProperty("setUTCMilliseconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A30_T1.js b/test/built-ins/Date/prototype/S15.9.5_A30_T1.js index 19fa3cc01c..f401b277bb 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A30_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A30_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setSeconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setSeconds" ---*/ - -if (Date.prototype.hasOwnProperty("setSeconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setSeconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setSeconds"), + true, + 'Date.prototype.hasOwnProperty("setSeconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A31_T1.js b/test/built-ins/Date/prototype/S15.9.5_A31_T1.js index 292cf7e210..81c922d350 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A31_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A31_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCSeconds" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCSeconds" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCSeconds") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCSeconds"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCSeconds"), + true, + 'Date.prototype.hasOwnProperty("setUTCSeconds") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A32_T1.js b/test/built-ins/Date/prototype/S15.9.5_A32_T1.js index fad5f62ed4..5483a90047 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A32_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A32_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setMinutes" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setMinutes" ---*/ - -if (Date.prototype.hasOwnProperty("setMinutes") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setMinutes"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setMinutes"), + true, + 'Date.prototype.hasOwnProperty("setMinutes") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A33_T1.js b/test/built-ins/Date/prototype/S15.9.5_A33_T1.js index 12e232c17b..a7123e3776 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A33_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A33_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCMinutes" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCMinutes" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCMinutes") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCMinutes"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCMinutes"), + true, + 'Date.prototype.hasOwnProperty("setUTCMinutes") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A34_T1.js b/test/built-ins/Date/prototype/S15.9.5_A34_T1.js index 369c6155a6..2d7780bd48 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A34_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A34_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setHours" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setHours" ---*/ - -if (Date.prototype.hasOwnProperty("setHours") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setHours"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setHours"), + true, + 'Date.prototype.hasOwnProperty("setHours") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A35_T1.js b/test/built-ins/Date/prototype/S15.9.5_A35_T1.js index 31a5ae75a5..a1ed9604a2 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A35_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A35_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCHours" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCHours" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCHours") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCHours"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCHours"), + true, + 'Date.prototype.hasOwnProperty("setUTCHours") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A36_T1.js b/test/built-ins/Date/prototype/S15.9.5_A36_T1.js index 5e34b0b303..ac217ea33f 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A36_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A36_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setDate" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setDate" ---*/ - -if (Date.prototype.hasOwnProperty("setDate") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setDate"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setDate"), + true, + 'Date.prototype.hasOwnProperty("setDate") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A37_T1.js b/test/built-ins/Date/prototype/S15.9.5_A37_T1.js index f2da4831c2..f913708725 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A37_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A37_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCDate" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCDate" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCDate") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCDate"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCDate"), + true, + 'Date.prototype.hasOwnProperty("setUTCDate") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A38_T1.js b/test/built-ins/Date/prototype/S15.9.5_A38_T1.js index 8c696fcf7d..befee102cb 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A38_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A38_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setMonth" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setMonth" ---*/ - -if (Date.prototype.hasOwnProperty("setMonth") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setMonth"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setMonth"), + true, + 'Date.prototype.hasOwnProperty("setMonth") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A39_T1.js b/test/built-ins/Date/prototype/S15.9.5_A39_T1.js index 745f107778..3cfaee0bef 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A39_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A39_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCMonth" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCMonth" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCMonth") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCMonth"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCMonth"), + true, + 'Date.prototype.hasOwnProperty("setUTCMonth") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A40_T1.js b/test/built-ins/Date/prototype/S15.9.5_A40_T1.js index af0d98414b..86d548d8e3 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A40_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A40_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setFullYear" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setFullYear" ---*/ - -if (Date.prototype.hasOwnProperty("setFullYear") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setFullYear"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setFullYear"), + true, + 'Date.prototype.hasOwnProperty("setFullYear") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A41_T1.js b/test/built-ins/Date/prototype/S15.9.5_A41_T1.js index 488ee62792..5efbbd6a76 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A41_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A41_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "setUTCFullYear" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "setUTCFullYear" ---*/ - -if (Date.prototype.hasOwnProperty("setUTCFullYear") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "setUTCFullYear"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("setUTCFullYear"), + true, + 'Date.prototype.hasOwnProperty("setUTCFullYear") must return true' +); diff --git a/test/built-ins/Date/prototype/S15.9.5_A42_T1.js b/test/built-ins/Date/prototype/S15.9.5_A42_T1.js index 8775bf8337..40bb7d0df1 100644 --- a/test/built-ins/Date/prototype/S15.9.5_A42_T1.js +++ b/test/built-ins/Date/prototype/S15.9.5_A42_T1.js @@ -6,7 +6,8 @@ info: The Date.prototype has the property "toUTCString" esid: sec-properties-of-the-date-prototype-object description: The Date.prototype has the property "toUTCString" ---*/ - -if (Date.prototype.hasOwnProperty("toUTCString") !== true) { - throw new Test262Error('#1: The Date.prototype has the property "toUTCString"'); -} +assert.sameValue( + Date.prototype.hasOwnProperty("toUTCString"), + true, + 'Date.prototype.hasOwnProperty("toUTCString") must return true' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js index 4ac2a607eb..d7f45dd21b 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.constructor; -if (x === 1) +if (x === 1) { Date.prototype.constructor = 2; -else +} else { Date.prototype.constructor = 1; -if (Date.prototype.constructor === x) { - throw new Test262Error('#1: The Date.prototype.constructor has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.constructor, + x, + 'The value of Date.prototype.constructor is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js index bd8433b48a..5bf15a2ce0 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "constructor" has { DontEnum } attributes esid: sec-date.prototype.constructor description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.constructor, + false, + 'The value of delete Date.prototype.constructor is not false' +); -if (delete Date.prototype.constructor === false) { - throw new Test262Error('#1: The Date.prototype.constructor property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('constructor')) { - throw new Test262Error('#2: The Date.prototype.constructor property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('constructor'), + 'The value of !Date.prototype.hasOwnProperty(\'constructor\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js index b1aeee0457..cc56ca21e5 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "constructor" has { DontEnum } attributes esid: sec-date.prototype.constructor description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('constructor')) { - throw new Test262Error('#1: The Date.prototype.constructor property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('constructor'), + 'The value of !Date.prototype.propertyIsEnumerable(\'constructor\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "constructor") { - throw new Test262Error('#2: The Date.prototype.constructor has the attribute DontEnum'); - } + assert.notSameValue(x, "constructor", 'The value of x is not "constructor"'); } diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js index 394573626c..d3df848504 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "constructor" is 7 esid: sec-date.prototype.constructor description: The "length" property of the "constructor" is 7 ---*/ +assert.sameValue( + Date.prototype.constructor.hasOwnProperty("length"), + true, + 'Date.prototype.constructor.hasOwnProperty("length") must return true' +); -if (Date.prototype.constructor.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The constructor has a "length" property'); -} - -if (Date.prototype.constructor.length !== 7) { - throw new Test262Error('#2: The "length" property of the constructor is 7'); -} +assert.sameValue( + Date.prototype.constructor.length, + 7, + 'The value of Date.prototype.constructor.length is expected to be 7' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js index ae370e614d..14cacc7cef 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.constructor.length; verifyNotWritable(Date.prototype.constructor, "length", null, 1); -if (Date.prototype.constructor.length !== x) { - throw new Test262Error('#1: The Date.prototype.constructor.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.constructor.length, + x, + 'The value of Date.prototype.constructor.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js index ffce48d488..be371e3533 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.constructor description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.constructor.length, + true, + 'The value of `delete Date.prototype.constructor.length` is expected to be true' +); -if (delete Date.prototype.constructor.length !== true) { - throw new Test262Error('#1: The Date.prototype.constructor.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.constructor.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.constructor.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.constructor.hasOwnProperty('length'), + 'The value of !Date.prototype.constructor.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js index 11b5923593..6aa8eae161 100644 --- a/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js +++ b/test/built-ins/Date/prototype/constructor/S15.9.5.1_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.constructor description: Checking DontEnum attribute ---*/ - -if (Date.prototype.constructor.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.constructor.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.constructor.propertyIsEnumerable('length'), + 'The value of !Date.prototype.constructor.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.constructor) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.constructor.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T1.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T1.js index cae70b3ce8..16dc7d1689 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T1.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getDate; -if (x === 1) +if (x === 1) { Date.prototype.getDate = 2; -else +} else { Date.prototype.getDate = 1; -if (Date.prototype.getDate === x) { - throw new Test262Error('#1: The Date.prototype.getDate has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getDate, + x, + 'The value of Date.prototype.getDate is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T2.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T2.js index 3aefd37378..2d27463b60 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T2.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "getDate" has { DontEnum } attributes esid: sec-date.prototype.getdate description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getDate, false, 'The value of delete Date.prototype.getDate is not false'); -if (delete Date.prototype.getDate === false) { - throw new Test262Error('#1: The Date.prototype.getDate property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getDate')) { - throw new Test262Error('#2: The Date.prototype.getDate property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getDate'), + 'The value of !Date.prototype.hasOwnProperty(\'getDate\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T3.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T3.js index d4b9f97ff8..e8a29d56a6 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T3.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getDate" has { DontEnum } attributes esid: sec-date.prototype.getdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getDate')) { - throw new Test262Error('#1: The Date.prototype.getDate property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getDate'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getDate\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getDate") { - throw new Test262Error('#2: The Date.prototype.getDate has the attribute DontEnum'); - } + assert.notSameValue(x, "getDate", 'The value of x is not "getDate"'); } diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A2_T1.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A2_T1.js index b60598b38c..e360624eeb 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A2_T1.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "getDate" is 0 esid: sec-date.prototype.getdate description: The "length" property of the "getDate" is 0 ---*/ +assert.sameValue( + Date.prototype.getDate.hasOwnProperty("length"), + true, + 'Date.prototype.getDate.hasOwnProperty("length") must return true' +); -if (Date.prototype.getDate.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getDate has a "length" property'); -} - -if (Date.prototype.getDate.length !== 0) { - throw new Test262Error('#2: The "length" property of the getDate is 0'); -} +assert.sameValue(Date.prototype.getDate.length, 0, 'The value of Date.prototype.getDate.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js index 94b95493f9..a85336aa7d 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getDate.length; verifyNotWritable(Date.prototype.getDate, "length", null, 1); -if (Date.prototype.getDate.length !== x) { - throw new Test262Error('#1: The Date.prototype.getDate.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getDate.length, + x, + 'The value of Date.prototype.getDate.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T2.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T2.js index 133b01fc9f..f3d8e89a9e 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T2.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getdate description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getDate.length, + true, + 'The value of `delete Date.prototype.getDate.length` is expected to be true' +); -if (delete Date.prototype.getDate.length !== true) { - throw new Test262Error('#1: The Date.prototype.getDate.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getDate.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getDate.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getDate.hasOwnProperty('length'), + 'The value of !Date.prototype.getDate.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T3.js b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T3.js index 1ad5333a4e..c12eeb44de 100644 --- a/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T3.js +++ b/test/built-ins/Date/prototype/getDate/S15.9.5.14_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getDate.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getDate.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getDate.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getDate.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getDate) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getDate.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T1.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T1.js index de68f3a8f4..b9a6d47093 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T1.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T1.js @@ -9,10 +9,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getDay; -if (x === 1) +if (x === 1) { Date.prototype.getDay = 2; -else +} else { Date.prototype.getDay = 1; -if (Date.prototype.getDay === x) { - throw new Test262Error('#1: The Date.prototype.getDay has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getDay, + x, + 'The value of Date.prototype.getDay is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T2.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T2.js index 10b4a63aba..0cd6e8faa1 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T2.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T2.js @@ -7,11 +7,9 @@ info: The Date.prototype property "getDay" has { DontEnum } attributes es5id: 15.9.5.16_A1_T2 description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getDay, false, 'The value of delete Date.prototype.getDay is not false'); -if (delete Date.prototype.getDay === false) { - throw new Test262Error('#1: The Date.prototype.getDay property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getDay')) { - throw new Test262Error('#2: The Date.prototype.getDay property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getDay'), + 'The value of !Date.prototype.hasOwnProperty(\'getDay\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T3.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T3.js index 631d48787e..66ee5dc8a1 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T3.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A1_T3.js @@ -7,13 +7,11 @@ info: The Date.prototype property "getDay" has { DontEnum } attributes es5id: 15.9.5.16_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getDay')) { - throw new Test262Error('#1: The Date.prototype.getDay property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getDay'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getDay\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getDay") { - throw new Test262Error('#2: The Date.prototype.getDay has the attribute DontEnum'); - } + assert.notSameValue(x, "getDay", 'The value of x is not "getDay"'); } diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A2_T1.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A2_T1.js index 43779b0b75..0462504f6c 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A2_T1.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A2_T1.js @@ -7,11 +7,10 @@ info: The "length" property of the "getDay" is 0 es5id: 15.9.5.16_A2_T1 description: The "length" property of the "getDay" is 0 ---*/ +assert.sameValue( + Date.prototype.getDay.hasOwnProperty("length"), + true, + 'Date.prototype.getDay.hasOwnProperty("length") must return true' +); -if (Date.prototype.getDay.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getDay has a "length" property'); -} - -if (Date.prototype.getDay.length !== 0) { - throw new Test262Error('#2: The "length" property of the getDay is 0'); -} +assert.sameValue(Date.prototype.getDay.length, 0, 'The value of Date.prototype.getDay.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js index 0e872efb21..fd85dc26d5 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T1.js @@ -13,6 +13,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getDay.length; verifyNotWritable(Date.prototype.getDay, "length", null, 1); -if (Date.prototype.getDay.length !== x) { - throw new Test262Error('#1: The Date.prototype.getDay.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getDay.length, + x, + 'The value of Date.prototype.getDay.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T2.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T2.js index 0da574c842..cf161dfe6a 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T2.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T2.js @@ -9,11 +9,13 @@ info: | es5id: 15.9.5.16_A3_T2 description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getDay.length, + true, + 'The value of `delete Date.prototype.getDay.length` is expected to be true' +); -if (delete Date.prototype.getDay.length !== true) { - throw new Test262Error('#1: The Date.prototype.getDay.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getDay.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getDay.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getDay.hasOwnProperty('length'), + 'The value of !Date.prototype.getDay.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T3.js b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T3.js index 86651c3a03..7ab9934692 100644 --- a/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T3.js +++ b/test/built-ins/Date/prototype/getDay/S15.9.5.16_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.5.16_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getDay.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getDay.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getDay.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getDay.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getDay) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getDay.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T1.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T1.js index 71291e9226..30a40d4d99 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T1.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T1.js @@ -9,10 +9,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getFullYear; -if (x === 1) +if (x === 1) { Date.prototype.getFullYear = 2; -else +} else { Date.prototype.getFullYear = 1; -if (Date.prototype.getFullYear === x) { - throw new Test262Error('#1: The Date.prototype.getFullYear has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getFullYear, + x, + 'The value of Date.prototype.getFullYear is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T2.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T2.js index 07fe467d32..d5e53c1623 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T2.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T2.js @@ -7,11 +7,13 @@ info: The Date.prototype property "getFullYear" has { DontEnum } attributes es5id: 15.9.5.10_A1_T2 description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getFullYear, + false, + 'The value of delete Date.prototype.getFullYear is not false' +); -if (delete Date.prototype.getFullYear === false) { - throw new Test262Error('#1: The Date.prototype.getFullYear property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getFullYear')) { - throw new Test262Error('#2: The Date.prototype.getFullYear property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getFullYear'), + 'The value of !Date.prototype.hasOwnProperty(\'getFullYear\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T3.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T3.js index 4882ee2d3e..2c529b72ce 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T3.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A1_T3.js @@ -7,13 +7,11 @@ info: The Date.prototype property "getFullYear" has { DontEnum } attributes es5id: 15.9.5.10_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getFullYear')) { - throw new Test262Error('#1: The Date.prototype.getFullYear property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getFullYear'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getFullYear\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getFullYear") { - throw new Test262Error('#2: The Date.prototype.getFullYear has the attribute DontEnum'); - } + assert.notSameValue(x, "getFullYear", 'The value of x is not "getFullYear"'); } diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A2_T1.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A2_T1.js index 48bcdb8043..a5df5edacb 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A2_T1.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A2_T1.js @@ -7,11 +7,14 @@ info: The "length" property of the "getFullYear" is 0 es5id: 15.9.5.10_A2_T1 description: The "length" property of the "getFullYear" is 0 ---*/ +assert.sameValue( + Date.prototype.getFullYear.hasOwnProperty("length"), + true, + 'Date.prototype.getFullYear.hasOwnProperty("length") must return true' +); -if (Date.prototype.getFullYear.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getFullYear has a "length" property'); -} - -if (Date.prototype.getFullYear.length !== 0) { - throw new Test262Error('#2: The "length" property of the getFullYear is 0'); -} +assert.sameValue( + Date.prototype.getFullYear.length, + 0, + 'The value of Date.prototype.getFullYear.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js index 1875cb083d..45260cf0ba 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T1.js @@ -13,6 +13,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getFullYear.length; verifyNotWritable(Date.prototype.getFullYear, "length", null, 1); -if (Date.prototype.getFullYear.length !== x) { - throw new Test262Error('#1: The Date.prototype.getFullYear.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getFullYear.length, + x, + 'The value of Date.prototype.getFullYear.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T2.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T2.js index 02d4fd5935..172a6a751f 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T2.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T2.js @@ -9,11 +9,13 @@ info: | es5id: 15.9.5.10_A3_T2 description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getFullYear.length, + true, + 'The value of `delete Date.prototype.getFullYear.length` is expected to be true' +); -if (delete Date.prototype.getFullYear.length !== true) { - throw new Test262Error('#1: The Date.prototype.getFullYear.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getFullYear.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getFullYear.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getFullYear.hasOwnProperty('length'), + 'The value of !Date.prototype.getFullYear.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T3.js b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T3.js index 7607da295a..7452ffd783 100644 --- a/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T3.js +++ b/test/built-ins/Date/prototype/getFullYear/S15.9.5.10_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.5.10_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getFullYear.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getFullYear.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getFullYear.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getFullYear.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getFullYear) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getFullYear.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T1.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T1.js index 3aff5183c0..2975c1788a 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T1.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T1.js @@ -9,10 +9,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getHours; -if (x === 1) +if (x === 1) { Date.prototype.getHours = 2; -else +} else { Date.prototype.getHours = 1; -if (Date.prototype.getHours === x) { - throw new Test262Error('#1: The Date.prototype.getHours has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getHours, + x, + 'The value of Date.prototype.getHours is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T2.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T2.js index 954800e92b..c66798a108 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T2.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T2.js @@ -7,11 +7,9 @@ info: The Date.prototype property "getHours" has { DontEnum } attributes es5id: 15.9.5.18_A1_T2 description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getHours, false, 'The value of delete Date.prototype.getHours is not false'); -if (delete Date.prototype.getHours === false) { - throw new Test262Error('#1: The Date.prototype.getHours property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getHours')) { - throw new Test262Error('#2: The Date.prototype.getHours property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getHours'), + 'The value of !Date.prototype.hasOwnProperty(\'getHours\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T3.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T3.js index 54a9568ce5..842e4ac672 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T3.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A1_T3.js @@ -7,13 +7,11 @@ info: The Date.prototype property "getHours" has { DontEnum } attributes es5id: 15.9.5.18_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getHours')) { - throw new Test262Error('#1: The Date.prototype.getHours property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getHours'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getHours\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getHours") { - throw new Test262Error('#2: The Date.prototype.getHours has the attribute DontEnum'); - } + assert.notSameValue(x, "getHours", 'The value of x is not "getHours"'); } diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A2_T1.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A2_T1.js index e210da7e03..73835a34f7 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A2_T1.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A2_T1.js @@ -7,11 +7,10 @@ info: The "length" property of the "getHours" is 0 es5id: 15.9.5.18_A2_T1 description: The "length" property of the "getHours" is 0 ---*/ +assert.sameValue( + Date.prototype.getHours.hasOwnProperty("length"), + true, + 'Date.prototype.getHours.hasOwnProperty("length") must return true' +); -if (Date.prototype.getHours.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getHours has a "length" property'); -} - -if (Date.prototype.getHours.length !== 0) { - throw new Test262Error('#2: The "length" property of the getHours is 0'); -} +assert.sameValue(Date.prototype.getHours.length, 0, 'The value of Date.prototype.getHours.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js index 799712b687..3377bee05c 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T1.js @@ -13,6 +13,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getHours.length; verifyNotWritable(Date.prototype.getHours, "length", null, 1); -if (Date.prototype.getHours.length !== x) { - throw new Test262Error('#1: The Date.prototype.getHours.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getHours.length, + x, + 'The value of Date.prototype.getHours.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T2.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T2.js index a84f20c0af..dec93ef9a1 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T2.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T2.js @@ -9,11 +9,13 @@ info: | es5id: 15.9.5.18_A3_T2 description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getHours.length, + true, + 'The value of `delete Date.prototype.getHours.length` is expected to be true' +); -if (delete Date.prototype.getHours.length !== true) { - throw new Test262Error('#1: The Date.prototype.getHours.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getHours.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getHours.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getHours.hasOwnProperty('length'), + 'The value of !Date.prototype.getHours.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T3.js b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T3.js index 114da52382..24d320bf6d 100644 --- a/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T3.js +++ b/test/built-ins/Date/prototype/getHours/S15.9.5.18_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.5.18_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getHours.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getHours.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getHours.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getHours.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getHours) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getHours.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T1.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T1.js index 5d99f983ba..7af74ae930 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T1.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T1.js @@ -9,10 +9,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getMilliseconds; -if (x === 1) +if (x === 1) { Date.prototype.getMilliseconds = 2; -else +} else { Date.prototype.getMilliseconds = 1; -if (Date.prototype.getMilliseconds === x) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getMilliseconds, + x, + 'The value of Date.prototype.getMilliseconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T2.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T2.js index 1cf4ec89ac..2aa05a195f 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T2.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T2.js @@ -7,11 +7,13 @@ info: The Date.prototype property "getMilliseconds" has { DontEnum } attributes es5id: 15.9.5.24_A1_T2 description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getMilliseconds, + false, + 'The value of delete Date.prototype.getMilliseconds is not false' +); -if (delete Date.prototype.getMilliseconds === false) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getMilliseconds')) { - throw new Test262Error('#2: The Date.prototype.getMilliseconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getMilliseconds'), + 'The value of !Date.prototype.hasOwnProperty(\'getMilliseconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T3.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T3.js index e02b018187..08eedf8b05 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T3.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A1_T3.js @@ -7,13 +7,11 @@ info: The Date.prototype property "getMilliseconds" has { DontEnum } attributes es5id: 15.9.5.24_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getMilliseconds')) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getMilliseconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getMilliseconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getMilliseconds") { - throw new Test262Error('#2: The Date.prototype.getMilliseconds has the attribute DontEnum'); - } + assert.notSameValue(x, "getMilliseconds", 'The value of x is not "getMilliseconds"'); } diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A2_T1.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A2_T1.js index 99afc55463..e2f88f15f4 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A2_T1.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A2_T1.js @@ -7,11 +7,14 @@ info: The "length" property of the "getMilliseconds" is 0 es5id: 15.9.5.24_A2_T1 description: The "length" property of the "getMilliseconds" is 0 ---*/ +assert.sameValue( + Date.prototype.getMilliseconds.hasOwnProperty("length"), + true, + 'Date.prototype.getMilliseconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.getMilliseconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getMilliseconds has a "length" property'); -} - -if (Date.prototype.getMilliseconds.length !== 0) { - throw new Test262Error('#2: The "length" property of the getMilliseconds is 0'); -} +assert.sameValue( + Date.prototype.getMilliseconds.length, + 0, + 'The value of Date.prototype.getMilliseconds.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js index 5cd71263a7..7316beff72 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T1.js @@ -13,6 +13,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getMilliseconds.length; verifyNotWritable(Date.prototype.getMilliseconds, "length", null, 1); -if (Date.prototype.getMilliseconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getMilliseconds.length, + x, + 'The value of Date.prototype.getMilliseconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T2.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T2.js index b6e11b2360..36753521c7 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T2.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T2.js @@ -9,11 +9,13 @@ info: | es5id: 15.9.5.24_A3_T2 description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getMilliseconds.length, + true, + 'The value of `delete Date.prototype.getMilliseconds.length` is expected to be true' +); -if (delete Date.prototype.getMilliseconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getMilliseconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getMilliseconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getMilliseconds.hasOwnProperty('length'), + 'The value of !Date.prototype.getMilliseconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T3.js b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T3.js index 823a731765..ed9b5ab4fe 100644 --- a/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T3.js +++ b/test/built-ins/Date/prototype/getMilliseconds/S15.9.5.24_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.5.24_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getMilliseconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getMilliseconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getMilliseconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getMilliseconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getMilliseconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getMilliseconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T1.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T1.js index d78b5bd7f6..01f2ba27a4 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T1.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T1.js @@ -9,10 +9,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getMinutes; -if (x === 1) +if (x === 1) { Date.prototype.getMinutes = 2; -else +} else { Date.prototype.getMinutes = 1; -if (Date.prototype.getMinutes === x) { - throw new Test262Error('#1: The Date.prototype.getMinutes has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getMinutes, + x, + 'The value of Date.prototype.getMinutes is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T2.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T2.js index adae9a2049..8b52ffaaa1 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T2.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T2.js @@ -7,11 +7,13 @@ info: The Date.prototype property "getMinutes" has { DontEnum } attributes es5id: 15.9.5.20_A1_T2 description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getMinutes, + false, + 'The value of delete Date.prototype.getMinutes is not false' +); -if (delete Date.prototype.getMinutes === false) { - throw new Test262Error('#1: The Date.prototype.getMinutes property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getMinutes')) { - throw new Test262Error('#2: The Date.prototype.getMinutes property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getMinutes'), + 'The value of !Date.prototype.hasOwnProperty(\'getMinutes\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T3.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T3.js index a9ec66c11f..75e478849a 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T3.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A1_T3.js @@ -7,13 +7,11 @@ info: The Date.prototype property "getMinutes" has { DontEnum } attributes es5id: 15.9.5.20_A1_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getMinutes')) { - throw new Test262Error('#1: The Date.prototype.getMinutes property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getMinutes'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getMinutes\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getMinutes") { - throw new Test262Error('#2: The Date.prototype.getMinutes has the attribute DontEnum'); - } + assert.notSameValue(x, "getMinutes", 'The value of x is not "getMinutes"'); } diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A2_T1.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A2_T1.js index 5279c2e67e..ee589b4727 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A2_T1.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A2_T1.js @@ -7,11 +7,14 @@ info: The "length" property of the "getMinutes" is 0 es5id: 15.9.5.20_A2_T1 description: The "length" property of the "getMinutes" is 0 ---*/ +assert.sameValue( + Date.prototype.getMinutes.hasOwnProperty("length"), + true, + 'Date.prototype.getMinutes.hasOwnProperty("length") must return true' +); -if (Date.prototype.getMinutes.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getMinutes has a "length" property'); -} - -if (Date.prototype.getMinutes.length !== 0) { - throw new Test262Error('#2: The "length" property of the getMinutes is 0'); -} +assert.sameValue( + Date.prototype.getMinutes.length, + 0, + 'The value of Date.prototype.getMinutes.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js index 11b6960870..ac09dc8bd9 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T1.js @@ -13,6 +13,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getMinutes.length; verifyNotWritable(Date.prototype.getMinutes, "length", null, 1); -if (Date.prototype.getMinutes.length !== x) { - throw new Test262Error('#1: The Date.prototype.getMinutes.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getMinutes.length, + x, + 'The value of Date.prototype.getMinutes.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T2.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T2.js index fd84b84305..aeddceb5e7 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T2.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T2.js @@ -9,11 +9,13 @@ info: | es5id: 15.9.5.20_A3_T2 description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getMinutes.length, + true, + 'The value of `delete Date.prototype.getMinutes.length` is expected to be true' +); -if (delete Date.prototype.getMinutes.length !== true) { - throw new Test262Error('#1: The Date.prototype.getMinutes.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getMinutes.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getMinutes.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getMinutes.hasOwnProperty('length'), + 'The value of !Date.prototype.getMinutes.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T3.js b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T3.js index 640c104b90..323874d7e2 100644 --- a/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T3.js +++ b/test/built-ins/Date/prototype/getMinutes/S15.9.5.20_A3_T3.js @@ -9,13 +9,11 @@ info: | es5id: 15.9.5.20_A3_T3 description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getMinutes.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getMinutes.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getMinutes.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getMinutes.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getMinutes) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getMinutes.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T1.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T1.js index 2f18458e9a..ddce06e8a9 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T1.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getMonth; -if (x === 1) +if (x === 1) { Date.prototype.getMonth = 2; -else +} else { Date.prototype.getMonth = 1; -if (Date.prototype.getMonth === x) { - throw new Test262Error('#1: The Date.prototype.getMonth has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getMonth, + x, + 'The value of Date.prototype.getMonth is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T2.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T2.js index 6c224510a7..2d806842e4 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T2.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "getMonth" has { DontEnum } attributes esid: sec-date.prototype.getmonth description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getMonth, false, 'The value of delete Date.prototype.getMonth is not false'); -if (delete Date.prototype.getMonth === false) { - throw new Test262Error('#1: The Date.prototype.getMonth property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getMonth')) { - throw new Test262Error('#2: The Date.prototype.getMonth property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getMonth'), + 'The value of !Date.prototype.hasOwnProperty(\'getMonth\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T3.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T3.js index 44bb484e43..12028732e4 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T3.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getMonth" has { DontEnum } attributes esid: sec-date.prototype.getmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getMonth')) { - throw new Test262Error('#1: The Date.prototype.getMonth property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getMonth'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getMonth\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getMonth") { - throw new Test262Error('#2: The Date.prototype.getMonth has the attribute DontEnum'); - } + assert.notSameValue(x, "getMonth", 'The value of x is not "getMonth"'); } diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A2_T1.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A2_T1.js index 635f258a4b..2a5ace4825 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A2_T1.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "getMonth" is 0 esid: sec-date.prototype.getmonth description: The "length" property of the "getMonth" is 0 ---*/ +assert.sameValue( + Date.prototype.getMonth.hasOwnProperty("length"), + true, + 'Date.prototype.getMonth.hasOwnProperty("length") must return true' +); -if (Date.prototype.getMonth.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getMonth has a "length" property'); -} - -if (Date.prototype.getMonth.length !== 0) { - throw new Test262Error('#2: The "length" property of the getMonth is 0'); -} +assert.sameValue(Date.prototype.getMonth.length, 0, 'The value of Date.prototype.getMonth.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js index 723ce4c495..27f966398e 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getMonth.length; verifyNotWritable(Date.prototype.getMonth, "length", null, 1); -if (Date.prototype.getMonth.length !== x) { - throw new Test262Error('#1: The Date.prototype.getMonth.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getMonth.length, + x, + 'The value of Date.prototype.getMonth.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T2.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T2.js index a055dee818..23137919b7 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T2.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getmonth description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getMonth.length, + true, + 'The value of `delete Date.prototype.getMonth.length` is expected to be true' +); -if (delete Date.prototype.getMonth.length !== true) { - throw new Test262Error('#1: The Date.prototype.getMonth.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getMonth.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getMonth.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getMonth.hasOwnProperty('length'), + 'The value of !Date.prototype.getMonth.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T3.js b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T3.js index 8eadd1bbba..a48e906bc7 100644 --- a/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T3.js +++ b/test/built-ins/Date/prototype/getMonth/S15.9.5.12_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getMonth.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getMonth.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getMonth.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getMonth.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getMonth) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getMonth.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T1.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T1.js index e70780c43c..6fa74174e5 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T1.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getSeconds; -if (x === 1) +if (x === 1) { Date.prototype.getSeconds = 2; -else +} else { Date.prototype.getSeconds = 1; -if (Date.prototype.getSeconds === x) { - throw new Test262Error('#1: The Date.prototype.getSeconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getSeconds, + x, + 'The value of Date.prototype.getSeconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T2.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T2.js index 823eefd2f2..9fce295ab8 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T2.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getSeconds" has { DontEnum } attributes esid: sec-date.prototype.getseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getSeconds, + false, + 'The value of delete Date.prototype.getSeconds is not false' +); -if (delete Date.prototype.getSeconds === false) { - throw new Test262Error('#1: The Date.prototype.getSeconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getSeconds')) { - throw new Test262Error('#2: The Date.prototype.getSeconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getSeconds'), + 'The value of !Date.prototype.hasOwnProperty(\'getSeconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T3.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T3.js index fcaef851fb..68337d855f 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T3.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getSeconds" has { DontEnum } attributes esid: sec-date.prototype.getseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getSeconds')) { - throw new Test262Error('#1: The Date.prototype.getSeconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getSeconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getSeconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getSeconds") { - throw new Test262Error('#2: The Date.prototype.getSeconds has the attribute DontEnum'); - } + assert.notSameValue(x, "getSeconds", 'The value of x is not "getSeconds"'); } diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A2_T1.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A2_T1.js index 76fa2ddf8c..13cd65aa6d 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A2_T1.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getSeconds" is 0 esid: sec-date.prototype.getseconds description: The "length" property of the "getSeconds" is 0 ---*/ +assert.sameValue( + Date.prototype.getSeconds.hasOwnProperty("length"), + true, + 'Date.prototype.getSeconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.getSeconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getSeconds has a "length" property'); -} - -if (Date.prototype.getSeconds.length !== 0) { - throw new Test262Error('#2: The "length" property of the getSeconds is 0'); -} +assert.sameValue( + Date.prototype.getSeconds.length, + 0, + 'The value of Date.prototype.getSeconds.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js index ef5d04a412..7f254990d1 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getSeconds.length; verifyNotWritable(Date.prototype.getSeconds, "length", null, 1); -if (Date.prototype.getSeconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.getSeconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getSeconds.length, + x, + 'The value of Date.prototype.getSeconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T2.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T2.js index 2ce51ada52..f8b95c60ed 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T2.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getSeconds.length, + true, + 'The value of `delete Date.prototype.getSeconds.length` is expected to be true' +); -if (delete Date.prototype.getSeconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.getSeconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getSeconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getSeconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getSeconds.hasOwnProperty('length'), + 'The value of !Date.prototype.getSeconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T3.js b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T3.js index e2ea2bde26..5e9761102e 100644 --- a/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T3.js +++ b/test/built-ins/Date/prototype/getSeconds/S15.9.5.22_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getSeconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getSeconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getSeconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getSeconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getSeconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getSeconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T1.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T1.js index b1fea00f42..0c01fdfdfd 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T1.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getTime; -if (x === 1) +if (x === 1) { Date.prototype.getTime = 2; -else +} else { Date.prototype.getTime = 1; -if (Date.prototype.getTime === x) { - throw new Test262Error('#1: The Date.prototype.getTime has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getTime, + x, + 'The value of Date.prototype.getTime is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T2.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T2.js index 78d3754547..dc0de8f1f7 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T2.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "getTime" has { DontEnum } attributes esid: sec-date.prototype.getseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getTime, false, 'The value of delete Date.prototype.getTime is not false'); -if (delete Date.prototype.getTime === false) { - throw new Test262Error('#1: The Date.prototype.getTime property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getTime')) { - throw new Test262Error('#2: The Date.prototype.getTime property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getTime'), + 'The value of !Date.prototype.hasOwnProperty(\'getTime\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T3.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T3.js index 451bdc9d32..ec32711f04 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T3.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getTime" has { DontEnum } attributes esid: sec-date.prototype.getseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getTime')) { - throw new Test262Error('#1: The Date.prototype.getTime property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getTime'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getTime\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getTime") { - throw new Test262Error('#2: The Date.prototype.getTime has the attribute DontEnum'); - } + assert.notSameValue(x, "getTime", 'The value of x is not "getTime"'); } diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A2_T1.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A2_T1.js index 265b8556e5..529cd23a69 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A2_T1.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "getTime" is 0 esid: sec-date.prototype.getseconds description: The "length" property of the "getTime" is 0 ---*/ +assert.sameValue( + Date.prototype.getTime.hasOwnProperty("length"), + true, + 'Date.prototype.getTime.hasOwnProperty("length") must return true' +); -if (Date.prototype.getTime.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getTime has a "length" property'); -} - -if (Date.prototype.getTime.length !== 0) { - throw new Test262Error('#2: The "length" property of the getTime is 0'); -} +assert.sameValue(Date.prototype.getTime.length, 0, 'The value of Date.prototype.getTime.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js index fedd5fdbf5..7a9eb55872 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getTime.length; verifyNotWritable(Date.prototype.getTime, "length", null, 1); -if (Date.prototype.getTime.length !== x) { - throw new Test262Error('#1: The Date.prototype.getTime.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getTime.length, + x, + 'The value of Date.prototype.getTime.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T2.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T2.js index e7d16a3c98..9fd73ca13b 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T2.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getTime.length, + true, + 'The value of `delete Date.prototype.getTime.length` is expected to be true' +); -if (delete Date.prototype.getTime.length !== true) { - throw new Test262Error('#1: The Date.prototype.getTime.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getTime.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getTime.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getTime.hasOwnProperty('length'), + 'The value of !Date.prototype.getTime.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T3.js b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T3.js index 4662c578cd..0043c700e2 100644 --- a/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T3.js +++ b/test/built-ins/Date/prototype/getTime/S15.9.5.9_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getTime.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getTime.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getTime.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getTime.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getTime) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getTime.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T1.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T1.js index 4aadf8458e..ba48003235 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T1.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T1.js @@ -10,10 +10,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getTimezoneOffset; -if (x === 1) +if (x === 1) { Date.prototype.getTimezoneOffset = 2; -else +} else { Date.prototype.getTimezoneOffset = 1; -if (Date.prototype.getTimezoneOffset === x) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getTimezoneOffset, + x, + 'The value of Date.prototype.getTimezoneOffset is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T2.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T2.js index 7286689308..8275434684 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T2.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.gettimezoneoffset description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getTimezoneOffset, + false, + 'The value of delete Date.prototype.getTimezoneOffset is not false' +); -if (delete Date.prototype.getTimezoneOffset === false) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getTimezoneOffset')) { - throw new Test262Error('#2: The Date.prototype.getTimezoneOffset property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getTimezoneOffset'), + 'The value of !Date.prototype.hasOwnProperty(\'getTimezoneOffset\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T3.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T3.js index c9ed01368c..12fa0483d6 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T3.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.gettimezoneoffset description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getTimezoneOffset')) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getTimezoneOffset'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getTimezoneOffset\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getTimezoneOffset") { - throw new Test262Error('#2: The Date.prototype.getTimezoneOffset has the attribute DontEnum'); - } + assert.notSameValue(x, "getTimezoneOffset", 'The value of x is not "getTimezoneOffset"'); } diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A2_T1.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A2_T1.js index 8203a64e20..4dded2364f 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A2_T1.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getTimezoneOffset" is 0 esid: sec-date.prototype.gettimezoneoffset description: The "length" property of the "getTimezoneOffset" is 0 ---*/ +assert.sameValue( + Date.prototype.getTimezoneOffset.hasOwnProperty("length"), + true, + 'Date.prototype.getTimezoneOffset.hasOwnProperty("length") must return true' +); -if (Date.prototype.getTimezoneOffset.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getTimezoneOffset has a "length" property'); -} - -if (Date.prototype.getTimezoneOffset.length !== 0) { - throw new Test262Error('#2: The "length" property of the getTimezoneOffset is 0'); -} +assert.sameValue( + Date.prototype.getTimezoneOffset.length, + 0, + 'The value of Date.prototype.getTimezoneOffset.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js index 5a48cf1724..c1613c5c69 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getTimezoneOffset.length; verifyNotWritable(Date.prototype.getTimezoneOffset, "length", null, 1); -if (Date.prototype.getTimezoneOffset.length !== x) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getTimezoneOffset.length, + x, + 'The value of Date.prototype.getTimezoneOffset.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T2.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T2.js index 3971044010..8d84ef3c57 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T2.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.gettimezoneoffset description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getTimezoneOffset.length, + true, + 'The value of `delete Date.prototype.getTimezoneOffset.length` is expected to be true' +); -if (delete Date.prototype.getTimezoneOffset.length !== true) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getTimezoneOffset.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getTimezoneOffset.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getTimezoneOffset.hasOwnProperty('length'), + 'The value of !Date.prototype.getTimezoneOffset.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T3.js b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T3.js index 39378802a2..a8dacfce2c 100644 --- a/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T3.js +++ b/test/built-ins/Date/prototype/getTimezoneOffset/S15.9.5.26_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.gettimezoneoffset description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getTimezoneOffset.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getTimezoneOffset.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getTimezoneOffset.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getTimezoneOffset.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getTimezoneOffset) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getTimezoneOffset.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T1.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T1.js index 2a00a9e757..38fb5d2d94 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCDate; -if (x === 1) +if (x === 1) { Date.prototype.getUTCDate = 2; -else +} else { Date.prototype.getUTCDate = 1; -if (Date.prototype.getUTCDate === x) { - throw new Test262Error('#1: The Date.prototype.getUTCDate has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCDate, + x, + 'The value of Date.prototype.getUTCDate is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T2.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T2.js index 4c1bbd8470..e2fcf7e764 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCDate" has { DontEnum } attributes esid: sec-date.prototype.getutcdate description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCDate, + false, + 'The value of delete Date.prototype.getUTCDate is not false' +); -if (delete Date.prototype.getUTCDate === false) { - throw new Test262Error('#1: The Date.prototype.getUTCDate property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCDate')) { - throw new Test262Error('#2: The Date.prototype.getUTCDate property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCDate'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCDate\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T3.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T3.js index 82586ec674..cc5bb87268 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCDate" has { DontEnum } attributes esid: sec-date.prototype.getutcdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCDate')) { - throw new Test262Error('#1: The Date.prototype.getUTCDate property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCDate'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCDate\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCDate") { - throw new Test262Error('#2: The Date.prototype.getUTCDate has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCDate", 'The value of x is not "getUTCDate"'); } diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A2_T1.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A2_T1.js index a8ca3b9495..1519b439fa 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCDate" is 0 esid: sec-date.prototype.getutcdate description: The "length" property of the "getUTCDate" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCDate.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCDate.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCDate.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCDate has a "length" property'); -} - -if (Date.prototype.getUTCDate.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCDate is 0'); -} +assert.sameValue( + Date.prototype.getUTCDate.length, + 0, + 'The value of Date.prototype.getUTCDate.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js index 08fcb32ee5..c38845a0b1 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCDate.length; verifyNotWritable(Date.prototype.getUTCDate, "length", null, 1); -if (Date.prototype.getUTCDate.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCDate.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCDate.length, + x, + 'The value of Date.prototype.getUTCDate.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T2.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T2.js index 15de469a63..ffdc0a3b9e 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcdate description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCDate.length, + true, + 'The value of `delete Date.prototype.getUTCDate.length` is expected to be true' +); -if (delete Date.prototype.getUTCDate.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCDate.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCDate.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCDate.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCDate.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCDate.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T3.js b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T3.js index 2bec0cd71e..f36e90b04b 100644 --- a/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCDate/S15.9.5.15_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCDate.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCDate.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCDate.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCDate.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCDate) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCDate.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T1.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T1.js index 0e28a28f52..2d0c9f5acf 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCDay; -if (x === 1) +if (x === 1) { Date.prototype.getUTCDay = 2; -else +} else { Date.prototype.getUTCDay = 1; -if (Date.prototype.getUTCDay === x) { - throw new Test262Error('#1: The Date.prototype.getUTCDay has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCDay, + x, + 'The value of Date.prototype.getUTCDay is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T2.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T2.js index 57c31a792f..1e75dd140e 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "getUTCDay" has { DontEnum } attributes esid: sec-date.prototype.getutcdaty description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.getUTCDay, false, 'The value of delete Date.prototype.getUTCDay is not false'); -if (delete Date.prototype.getUTCDay === false) { - throw new Test262Error('#1: The Date.prototype.getUTCDay property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCDay')) { - throw new Test262Error('#2: The Date.prototype.getUTCDay property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCDay'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCDay\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T3.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T3.js index 58a1a7ce0f..3774b6ad67 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCDay" has { DontEnum } attributes esid: sec-date.prototype.getutcdaty description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCDay')) { - throw new Test262Error('#1: The Date.prototype.getUTCDay property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCDay'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCDay\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCDay") { - throw new Test262Error('#2: The Date.prototype.getUTCDay has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCDay", 'The value of x is not "getUTCDay"'); } diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A2_T1.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A2_T1.js index df43352437..b25b4f34a1 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCDay" is 0 esid: sec-date.prototype.getutcdaty description: The "length" property of the "getUTCDay" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCDay.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCDay.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCDay.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCDay has a "length" property'); -} - -if (Date.prototype.getUTCDay.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCDay is 0'); -} +assert.sameValue( + Date.prototype.getUTCDay.length, + 0, + 'The value of Date.prototype.getUTCDay.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js index a590a97113..794e38e407 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCDay.length; verifyNotWritable(Date.prototype.getUTCDay, "length", null, 1); -if (Date.prototype.getUTCDay.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCDay.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCDay.length, + x, + 'The value of Date.prototype.getUTCDay.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T2.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T2.js index e3f9a858b0..3ce3b9927b 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcdaty description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCDay.length, + true, + 'The value of `delete Date.prototype.getUTCDay.length` is expected to be true' +); -if (delete Date.prototype.getUTCDay.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCDay.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCDay.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCDay.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCDay.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCDay.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T3.js b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T3.js index a5c5f5ada7..b8a189cd7e 100644 --- a/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCDay/S15.9.5.17_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcdaty description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCDay.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCDay.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCDay.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCDay.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCDay) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCDay.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T1.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T1.js index a6a40e6696..073d4794d6 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCFullYear; -if (x === 1) +if (x === 1) { Date.prototype.getUTCFullYear = 2; -else +} else { Date.prototype.getUTCFullYear = 1; -if (Date.prototype.getUTCFullYear === x) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCFullYear, + x, + 'The value of Date.prototype.getUTCFullYear is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T2.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T2.js index 088c070851..a01dcef4a0 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCFullYear" has { DontEnum } attributes esid: sec-date.prototype.getutcfullyear description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCFullYear, + false, + 'The value of delete Date.prototype.getUTCFullYear is not false' +); -if (delete Date.prototype.getUTCFullYear === false) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCFullYear')) { - throw new Test262Error('#2: The Date.prototype.getUTCFullYear property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCFullYear'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCFullYear\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T3.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T3.js index 520b318372..b3ed102880 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCFullYear" has { DontEnum } attributes esid: sec-date.prototype.getutcfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCFullYear')) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCFullYear'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCFullYear\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCFullYear") { - throw new Test262Error('#2: The Date.prototype.getUTCFullYear has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCFullYear", 'The value of x is not "getUTCFullYear"'); } diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A2_T1.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A2_T1.js index 7e1835fa4e..f5ef0e7057 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCFullYear" is 0 esid: sec-date.prototype.getutcfullyear description: The "length" property of the "getUTCFullYear" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCFullYear.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCFullYear.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCFullYear.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCFullYear has a "length" property'); -} - -if (Date.prototype.getUTCFullYear.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCFullYear is 0'); -} +assert.sameValue( + Date.prototype.getUTCFullYear.length, + 0, + 'The value of Date.prototype.getUTCFullYear.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js index e575954e79..98332520e2 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCFullYear.length; verifyNotWritable(Date.prototype.getUTCFullYear, "length", null, 1); -if (Date.prototype.getUTCFullYear.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCFullYear.length, + x, + 'The value of Date.prototype.getUTCFullYear.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T2.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T2.js index 186d4270b5..ce5003aaa5 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcfullyear description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCFullYear.length, + true, + 'The value of `delete Date.prototype.getUTCFullYear.length` is expected to be true' +); -if (delete Date.prototype.getUTCFullYear.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCFullYear.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCFullYear.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCFullYear.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCFullYear.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T3.js b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T3.js index 47f19f00b3..2400562fda 100644 --- a/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCFullYear/S15.9.5.11_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCFullYear.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCFullYear.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCFullYear.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCFullYear.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCFullYear) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCFullYear.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T1.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T1.js index 61c6183555..35e9cfacd5 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCHours; -if (x === 1) +if (x === 1) { Date.prototype.getUTCHours = 2; -else +} else { Date.prototype.getUTCHours = 1; -if (Date.prototype.getUTCHours === x) { - throw new Test262Error('#1: The Date.prototype.getUTCHours has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCHours, + x, + 'The value of Date.prototype.getUTCHours is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T2.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T2.js index 43a4b7b1d7..728b3f7101 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCHours" has { DontEnum } attributes esid: sec-date.prototype.getutchours description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCHours, + false, + 'The value of delete Date.prototype.getUTCHours is not false' +); -if (delete Date.prototype.getUTCHours === false) { - throw new Test262Error('#1: The Date.prototype.getUTCHours property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCHours')) { - throw new Test262Error('#2: The Date.prototype.getUTCHours property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCHours'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCHours\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T3.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T3.js index 2bf3d22bb7..09fecf7308 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCHours" has { DontEnum } attributes esid: sec-date.prototype.getutchours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCHours')) { - throw new Test262Error('#1: The Date.prototype.getUTCHours property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCHours'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCHours\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCHours") { - throw new Test262Error('#2: The Date.prototype.getUTCHours has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCHours", 'The value of x is not "getUTCHours"'); } diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A2_T1.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A2_T1.js index cf89a7186f..1a35157cf1 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCHours" is 0 esid: sec-date.prototype.getutchours description: The "length" property of the "getUTCHours" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCHours.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCHours.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCHours.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCHours has a "length" property'); -} - -if (Date.prototype.getUTCHours.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCHours is 0'); -} +assert.sameValue( + Date.prototype.getUTCHours.length, + 0, + 'The value of Date.prototype.getUTCHours.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js index 0ddb92cf02..5d75c61a65 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCHours.length; verifyNotWritable(Date.prototype.getUTCHours, "length", null, 1); -if (Date.prototype.getUTCHours.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCHours.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCHours.length, + x, + 'The value of Date.prototype.getUTCHours.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T2.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T2.js index 5664cc575c..3184bd9673 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutchours description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCHours.length, + true, + 'The value of `delete Date.prototype.getUTCHours.length` is expected to be true' +); -if (delete Date.prototype.getUTCHours.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCHours.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCHours.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCHours.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCHours.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCHours.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T3.js b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T3.js index 29d909c318..4c780f4805 100644 --- a/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCHours/S15.9.5.19_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutchours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCHours.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCHours.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCHours.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCHours.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCHours) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCHours.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T1.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T1.js index c2f1058dc4..4ab0f7472a 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T1.js @@ -10,10 +10,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCMilliseconds; -if (x === 1) +if (x === 1) { Date.prototype.getUTCMilliseconds = 2; -else +} else { Date.prototype.getUTCMilliseconds = 1; -if (Date.prototype.getUTCMilliseconds === x) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCMilliseconds, + x, + 'The value of Date.prototype.getUTCMilliseconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T2.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T2.js index 10c42237ce..fdb33f6411 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcmilliseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCMilliseconds, + false, + 'The value of delete Date.prototype.getUTCMilliseconds is not false' +); -if (delete Date.prototype.getUTCMilliseconds === false) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCMilliseconds')) { - throw new Test262Error('#2: The Date.prototype.getUTCMilliseconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCMilliseconds'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCMilliseconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T3.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T3.js index eb089c86a6..f7e2011433 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCMilliseconds')) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCMilliseconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCMilliseconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCMilliseconds") { - throw new Test262Error('#2: The Date.prototype.getUTCMilliseconds has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCMilliseconds", 'The value of x is not "getUTCMilliseconds"'); } diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A2_T1.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A2_T1.js index 6dbcf0ce90..d0ff6287e2 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCMilliseconds" is 0 esid: sec-date.prototype.getutcmilliseconds description: The "length" property of the "getUTCMilliseconds" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCMilliseconds.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCMilliseconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCMilliseconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCMilliseconds has a "length" property'); -} - -if (Date.prototype.getUTCMilliseconds.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCMilliseconds is 0'); -} +assert.sameValue( + Date.prototype.getUTCMilliseconds.length, + 0, + 'The value of Date.prototype.getUTCMilliseconds.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js index 70403bfd0b..aef247717d 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCMilliseconds.length; verifyNotWritable(Date.prototype.getUTCMilliseconds, "length", null, 1); -if (Date.prototype.getUTCMilliseconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCMilliseconds.length, + x, + 'The value of Date.prototype.getUTCMilliseconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T2.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T2.js index f02792096d..5ea144624a 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcmilliseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCMilliseconds.length, + true, + 'The value of `delete Date.prototype.getUTCMilliseconds.length` is expected to be true' +); -if (delete Date.prototype.getUTCMilliseconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCMilliseconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCMilliseconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCMilliseconds.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCMilliseconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T3.js b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T3.js index 172e2643a4..fbd61941be 100644 --- a/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCMilliseconds/S15.9.5.25_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCMilliseconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCMilliseconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCMilliseconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCMilliseconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCMilliseconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCMilliseconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js index 5f693bdd1b..81f56e536c 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCMinutes; -if (x === 1) +if (x === 1) { Date.prototype.getUTCMinutes = 2; -else +} else { Date.prototype.getUTCMinutes = 1; -if (Date.prototype.getUTCMinutes === x) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCMinutes, + x, + 'The value of Date.prototype.getUTCMinutes is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js index 4c3a4a27c4..04e6f269e1 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCMinutes" has { DontEnum } attributes esid: sec-date.prototype.getutcminutes description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCMinutes, + false, + 'The value of delete Date.prototype.getUTCMinutes is not false' +); -if (delete Date.prototype.getUTCMinutes === false) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCMinutes')) { - throw new Test262Error('#2: The Date.prototype.getUTCMinutes property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCMinutes'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCMinutes\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js index 99dca5b884..b161255e12 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCMinutes" has { DontEnum } attributes esid: sec-date.prototype.getutcminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCMinutes')) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCMinutes'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCMinutes\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCMinutes") { - throw new Test262Error('#2: The Date.prototype.getUTCMinutes has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCMinutes", 'The value of x is not "getUTCMinutes"'); } diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js index 303f62486f..3b0514a721 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCMinutes" is 0 esid: sec-date.prototype.getutcminutes description: The "length" property of the "getUTCMinutes" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCMinutes.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCMinutes.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCMinutes.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCMinutes has a "length" property'); -} - -if (Date.prototype.getUTCMinutes.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCMinutes is 0'); -} +assert.sameValue( + Date.prototype.getUTCMinutes.length, + 0, + 'The value of Date.prototype.getUTCMinutes.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js index d2aafd30c2..7ff2231209 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCMinutes.length; verifyNotWritable(Date.prototype.getUTCMinutes, "length", null, 1); -if (Date.prototype.getUTCMinutes.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCMinutes.length, + x, + 'The value of Date.prototype.getUTCMinutes.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js index 1de3ea9565..b7ab827734 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcminutes description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCMinutes.length, + true, + 'The value of `delete Date.prototype.getUTCMinutes.length` is expected to be true' +); -if (delete Date.prototype.getUTCMinutes.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCMinutes.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCMinutes.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCMinutes.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCMinutes.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js index 64af83b7b2..51a57e6beb 100644 --- a/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCMinutes/S15.9.5.21_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCMinutes.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCMinutes.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCMinutes.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCMinutes.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCMinutes) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCMinutes.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T1.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T1.js index 48196edd21..b0b525f083 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCMonth; -if (x === 1) +if (x === 1) { Date.prototype.getUTCMonth = 2; -else +} else { Date.prototype.getUTCMonth = 1; -if (Date.prototype.getUTCMonth === x) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCMonth, + x, + 'The value of Date.prototype.getUTCMonth is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T2.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T2.js index 5d6e6ae7a1..445c533f84 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCMonth" has { DontEnum } attributes esid: sec-date.prototype.getutcmonth description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCMonth, + false, + 'The value of delete Date.prototype.getUTCMonth is not false' +); -if (delete Date.prototype.getUTCMonth === false) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCMonth')) { - throw new Test262Error('#2: The Date.prototype.getUTCMonth property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCMonth'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCMonth\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T3.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T3.js index 5ca9f16a5e..4b100aa86b 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCMonth" has { DontEnum } attributes esid: sec-date.prototype.getutcmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCMonth')) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCMonth'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCMonth\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCMonth") { - throw new Test262Error('#2: The Date.prototype.getUTCMonth has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCMonth", 'The value of x is not "getUTCMonth"'); } diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A2_T1.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A2_T1.js index 8f9121d921..1ec288a3cb 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCMonth" is 0 esid: sec-date.prototype.getutcmonth description: The "length" property of the "getUTCMonth" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCMonth.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCMonth.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCMonth.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCMonth has a "length" property'); -} - -if (Date.prototype.getUTCMonth.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCMonth is 0'); -} +assert.sameValue( + Date.prototype.getUTCMonth.length, + 0, + 'The value of Date.prototype.getUTCMonth.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js index 89eda92a05..ef8ad5f17b 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCMonth.length; verifyNotWritable(Date.prototype.getUTCMonth, "length", null, 1); -if (Date.prototype.getUTCMonth.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCMonth.length, + x, + 'The value of Date.prototype.getUTCMonth.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T2.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T2.js index 46dba24905..cde08bb0b4 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcmonth description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCMonth.length, + true, + 'The value of `delete Date.prototype.getUTCMonth.length` is expected to be true' +); -if (delete Date.prototype.getUTCMonth.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCMonth.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCMonth.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCMonth.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCMonth.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T3.js b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T3.js index da76a2f5a1..a1b88c2db0 100644 --- a/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCMonth/S15.9.5.13_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCMonth.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCMonth.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCMonth.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCMonth.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCMonth) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCMonth.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T1.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T1.js index 06ecdaa5a3..50d027c71e 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T1.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.getUTCSeconds; -if (x === 1) +if (x === 1) { Date.prototype.getUTCSeconds = 2; -else +} else { Date.prototype.getUTCSeconds = 1; -if (Date.prototype.getUTCSeconds === x) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.getUTCSeconds, + x, + 'The value of Date.prototype.getUTCSeconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T2.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T2.js index c9ae764149..46657e398a 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T2.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "getUTCSeconds" has { DontEnum } attributes esid: sec-date.prototype.getutcseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.getUTCSeconds, + false, + 'The value of delete Date.prototype.getUTCSeconds is not false' +); -if (delete Date.prototype.getUTCSeconds === false) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('getUTCSeconds')) { - throw new Test262Error('#2: The Date.prototype.getUTCSeconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('getUTCSeconds'), + 'The value of !Date.prototype.hasOwnProperty(\'getUTCSeconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T3.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T3.js index 2f20461b01..fb47cd89b4 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T3.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "getUTCSeconds" has { DontEnum } attributes esid: sec-date.prototype.getutcseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('getUTCSeconds')) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('getUTCSeconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'getUTCSeconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "getUTCSeconds") { - throw new Test262Error('#2: The Date.prototype.getUTCSeconds has the attribute DontEnum'); - } + assert.notSameValue(x, "getUTCSeconds", 'The value of x is not "getUTCSeconds"'); } diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A2_T1.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A2_T1.js index 6621971a4f..34008d4344 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A2_T1.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "getUTCSeconds" is 0 esid: sec-date.prototype.getutcseconds description: The "length" property of the "getUTCSeconds" is 0 ---*/ +assert.sameValue( + Date.prototype.getUTCSeconds.hasOwnProperty("length"), + true, + 'Date.prototype.getUTCSeconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.getUTCSeconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The getUTCSeconds has a "length" property'); -} - -if (Date.prototype.getUTCSeconds.length !== 0) { - throw new Test262Error('#2: The "length" property of the getUTCSeconds is 0'); -} +assert.sameValue( + Date.prototype.getUTCSeconds.length, + 0, + 'The value of Date.prototype.getUTCSeconds.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js index 70678cc1ae..edf925635f 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.getUTCSeconds.length; verifyNotWritable(Date.prototype.getUTCSeconds, "length", null, 1); -if (Date.prototype.getUTCSeconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.getUTCSeconds.length, + x, + 'The value of Date.prototype.getUTCSeconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T2.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T2.js index ceba933d8a..0a22d1f434 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T2.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.getutcseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.getUTCSeconds.length, + true, + 'The value of `delete Date.prototype.getUTCSeconds.length` is expected to be true' +); -if (delete Date.prototype.getUTCSeconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.getUTCSeconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.getUTCSeconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.getUTCSeconds.hasOwnProperty('length'), + 'The value of !Date.prototype.getUTCSeconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T3.js b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T3.js index 309f2a0d75..b1261b6ebc 100644 --- a/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T3.js +++ b/test/built-ins/Date/prototype/getUTCSeconds/S15.9.5.23_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.getutcseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.getUTCSeconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.getUTCSeconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.getUTCSeconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.getUTCSeconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.getUTCSeconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.getUTCSeconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T1.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T1.js index f4f689ecef..10e84e0d69 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T1.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setDate; -if (x === 1) +if (x === 1) { Date.prototype.setDate = 2; -else +} else { Date.prototype.setDate = 1; -if (Date.prototype.setDate === x) { - throw new Test262Error('#1: The Date.prototype.setDate has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setDate, + x, + 'The value of Date.prototype.setDate is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T2.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T2.js index c1f15646c0..193929b97a 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T2.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "setDate" has { DontEnum } attributes esid: sec-date.prototype.setdate description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.setDate, false, 'The value of delete Date.prototype.setDate is not false'); -if (delete Date.prototype.setDate === false) { - throw new Test262Error('#1: The Date.prototype.setDate property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setDate')) { - throw new Test262Error('#2: The Date.prototype.setDate property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setDate'), + 'The value of !Date.prototype.hasOwnProperty(\'setDate\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T3.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T3.js index 801f4fad49..8f082a567a 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T3.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setDate" has { DontEnum } attributes esid: sec-date.prototype.setdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setDate')) { - throw new Test262Error('#1: The Date.prototype.setDate property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setDate'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setDate\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setDate") { - throw new Test262Error('#2: The Date.prototype.setDate has the attribute DontEnum'); - } + assert.notSameValue(x, "setDate", 'The value of x is not "setDate"'); } diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A2_T1.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A2_T1.js index 4317b8435c..c56c0a7803 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A2_T1.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "setDate" is 1 esid: sec-date.prototype.setdate description: The "length" property of the "setDate" is 1 ---*/ +assert.sameValue( + Date.prototype.setDate.hasOwnProperty("length"), + true, + 'Date.prototype.setDate.hasOwnProperty("length") must return true' +); -if (Date.prototype.setDate.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setDate has a "length" property'); -} - -if (Date.prototype.setDate.length !== 1) { - throw new Test262Error('#2: The "length" property of the setDate is 1'); -} +assert.sameValue(Date.prototype.setDate.length, 1, 'The value of Date.prototype.setDate.length is expected to be 1'); diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js index 5584aca6c1..95b8fe9d8e 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setDate.length; verifyNotWritable(Date.prototype.setDate, "length", null, 1); -if (Date.prototype.setDate.length !== x) { - throw new Test262Error('#1: The Date.prototype.setDate.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setDate.length, + x, + 'The value of Date.prototype.setDate.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T2.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T2.js index 45a0a53a53..9d9bc74389 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T2.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setdate description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setDate.length, + true, + 'The value of `delete Date.prototype.setDate.length` is expected to be true' +); -if (delete Date.prototype.setDate.length !== true) { - throw new Test262Error('#1: The Date.prototype.setDate.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setDate.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setDate.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setDate.hasOwnProperty('length'), + 'The value of !Date.prototype.setDate.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T3.js b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T3.js index 95f88a86ef..e43e7113e0 100644 --- a/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T3.js +++ b/test/built-ins/Date/prototype/setDate/S15.9.5.36_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setDate.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setDate.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setDate.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setDate.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setDate) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setDate.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T1.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T1.js index 4c62a0604a..fe63c6d3be 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T1.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setFullYear; -if (x === 1) +if (x === 1) { Date.prototype.setFullYear = 2; -else +} else { Date.prototype.setFullYear = 1; -if (Date.prototype.setFullYear === x) { - throw new Test262Error('#1: The Date.prototype.setFullYear has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setFullYear, + x, + 'The value of Date.prototype.setFullYear is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T2.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T2.js index 31d9bd4d37..609a237363 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T2.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setFullYear" has { DontEnum } attributes esid: sec-date.prototype.setfullyear description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setFullYear, + false, + 'The value of delete Date.prototype.setFullYear is not false' +); -if (delete Date.prototype.setFullYear === false) { - throw new Test262Error('#1: The Date.prototype.setFullYear property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setFullYear')) { - throw new Test262Error('#2: The Date.prototype.setFullYear property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setFullYear'), + 'The value of !Date.prototype.hasOwnProperty(\'setFullYear\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T3.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T3.js index 6af69b5f60..d97a7a1d76 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T3.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setFullYear" has { DontEnum } attributes esid: sec-date.prototype.setfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setFullYear')) { - throw new Test262Error('#1: The Date.prototype.setFullYear property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setFullYear'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setFullYear\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setFullYear") { - throw new Test262Error('#2: The Date.prototype.setFullYear has the attribute DontEnum'); - } + assert.notSameValue(x, "setFullYear", 'The value of x is not "setFullYear"'); } diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A2_T1.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A2_T1.js index 9d33920680..a65679a20e 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A2_T1.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setFullYear" is 3 esid: sec-date.prototype.setfullyear description: The "length" property of the "setFullYear" is 3 ---*/ +assert.sameValue( + Date.prototype.setFullYear.hasOwnProperty("length"), + true, + 'Date.prototype.setFullYear.hasOwnProperty("length") must return true' +); -if (Date.prototype.setFullYear.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setFullYear has a "length" property'); -} - -if (Date.prototype.setFullYear.length !== 3) { - throw new Test262Error('#2: The "length" property of the setFullYear is 3'); -} +assert.sameValue( + Date.prototype.setFullYear.length, + 3, + 'The value of Date.prototype.setFullYear.length is expected to be 3' +); diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js index 9f908b9932..9220f1c015 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setFullYear.length; verifyNotWritable(Date.prototype.setFullYear, "length", null, 1); -if (Date.prototype.setFullYear.length !== x) { - throw new Test262Error('#1: The Date.prototype.setFullYear.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setFullYear.length, + x, + 'The value of Date.prototype.setFullYear.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T2.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T2.js index 7495e2e613..09294a76c0 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T2.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setfullyear description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setFullYear.length, + true, + 'The value of `delete Date.prototype.setFullYear.length` is expected to be true' +); -if (delete Date.prototype.setFullYear.length !== true) { - throw new Test262Error('#1: The Date.prototype.setFullYear.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setFullYear.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setFullYear.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setFullYear.hasOwnProperty('length'), + 'The value of !Date.prototype.setFullYear.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T3.js b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T3.js index 1cb256f48c..f899d99735 100644 --- a/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T3.js +++ b/test/built-ins/Date/prototype/setFullYear/S15.9.5.40_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setFullYear.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setFullYear.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setFullYear.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setFullYear.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setFullYear) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setFullYear.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T1.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T1.js index f61d497afa..386a9d6e58 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T1.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setHours; -if (x === 1) +if (x === 1) { Date.prototype.setHours = 2; -else +} else { Date.prototype.setHours = 1; -if (Date.prototype.setHours === x) { - throw new Test262Error('#1: The Date.prototype.setHours has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setHours, + x, + 'The value of Date.prototype.setHours is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T2.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T2.js index a047afcce3..7d61e53de1 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T2.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "setHours" has { DontEnum } attributes esid: sec-date.prototype.sethours description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.setHours, false, 'The value of delete Date.prototype.setHours is not false'); -if (delete Date.prototype.setHours === false) { - throw new Test262Error('#1: The Date.prototype.setHours property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setHours')) { - throw new Test262Error('#2: The Date.prototype.setHours property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setHours'), + 'The value of !Date.prototype.hasOwnProperty(\'setHours\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T3.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T3.js index 9257300d3d..fa9a8d09d8 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T3.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setHours" has { DontEnum } attributes esid: sec-date.prototype.sethours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setHours')) { - throw new Test262Error('#1: The Date.prototype.setHours property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setHours'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setHours\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setHours") { - throw new Test262Error('#2: The Date.prototype.setHours has the attribute DontEnum'); - } + assert.notSameValue(x, "setHours", 'The value of x is not "setHours"'); } diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A2_T1.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A2_T1.js index f614d321b7..5452e487f0 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A2_T1.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "setHours" is 4 esid: sec-date.prototype.sethours description: The "length" property of the "setHours" is 4 ---*/ +assert.sameValue( + Date.prototype.setHours.hasOwnProperty("length"), + true, + 'Date.prototype.setHours.hasOwnProperty("length") must return true' +); -if (Date.prototype.setHours.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setHours has a "length" property'); -} - -if (Date.prototype.setHours.length !== 4) { - throw new Test262Error('#2: The "length" property of the setHours is 4'); -} +assert.sameValue(Date.prototype.setHours.length, 4, 'The value of Date.prototype.setHours.length is expected to be 4'); diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js index a497613925..b9b6028b2f 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setHours.length; verifyNotWritable(Date.prototype.setHours, "length", null, 1); -if (Date.prototype.setHours.length !== x) { - throw new Test262Error('#1: The Date.prototype.setHours.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setHours.length, + x, + 'The value of Date.prototype.setHours.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T2.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T2.js index ca3aaff1d6..ed32092c30 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T2.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.sethours description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setHours.length, + true, + 'The value of `delete Date.prototype.setHours.length` is expected to be true' +); -if (delete Date.prototype.setHours.length !== true) { - throw new Test262Error('#1: The Date.prototype.setHours.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setHours.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setHours.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setHours.hasOwnProperty('length'), + 'The value of !Date.prototype.setHours.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T3.js b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T3.js index 842e6c5463..ec3addf904 100644 --- a/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T3.js +++ b/test/built-ins/Date/prototype/setHours/S15.9.5.34_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.sethours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setHours.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setHours.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setHours.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setHours.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setHours) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setHours.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T1.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T1.js index 4c96a98b2c..b024cd215e 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T1.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setMilliseconds; -if (x === 1) +if (x === 1) { Date.prototype.setMilliseconds = 2; -else +} else { Date.prototype.setMilliseconds = 1; -if (Date.prototype.setMilliseconds === x) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setMilliseconds, + x, + 'The value of Date.prototype.setMilliseconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T2.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T2.js index 4eadf0a229..a235a6af37 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T2.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setMilliseconds" has { DontEnum } attributes esid: sec-date.prototype.setmilliseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setMilliseconds, + false, + 'The value of delete Date.prototype.setMilliseconds is not false' +); -if (delete Date.prototype.setMilliseconds === false) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setMilliseconds')) { - throw new Test262Error('#2: The Date.prototype.setMilliseconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setMilliseconds'), + 'The value of !Date.prototype.hasOwnProperty(\'setMilliseconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T3.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T3.js index 8498df0401..5e5d843237 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T3.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setMilliseconds" has { DontEnum } attributes esid: sec-date.prototype.setmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setMilliseconds')) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setMilliseconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setMilliseconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setMilliseconds") { - throw new Test262Error('#2: The Date.prototype.setMilliseconds has the attribute DontEnum'); - } + assert.notSameValue(x, "setMilliseconds", 'The value of x is not "setMilliseconds"'); } diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A2_T1.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A2_T1.js index df2078994b..bb06bc3991 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A2_T1.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setMilliseconds" is 1 esid: sec-date.prototype.setmilliseconds description: The "length" property of the "setMilliseconds" is 1 ---*/ +assert.sameValue( + Date.prototype.setMilliseconds.hasOwnProperty("length"), + true, + 'Date.prototype.setMilliseconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.setMilliseconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setMilliseconds has a "length" property'); -} - -if (Date.prototype.setMilliseconds.length !== 1) { - throw new Test262Error('#2: The "length" property of the setMilliseconds is 1'); -} +assert.sameValue( + Date.prototype.setMilliseconds.length, + 1, + 'The value of Date.prototype.setMilliseconds.length is expected to be 1' +); diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js index f63cf2b0ab..3d1a9adf61 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setMilliseconds.length; verifyNotWritable(Date.prototype.setMilliseconds, "length", null, 1); -if (Date.prototype.setMilliseconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setMilliseconds.length, + x, + 'The value of Date.prototype.setMilliseconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T2.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T2.js index 492432ca4e..7be527d8ac 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T2.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setmilliseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setMilliseconds.length, + true, + 'The value of `delete Date.prototype.setMilliseconds.length` is expected to be true' +); -if (delete Date.prototype.setMilliseconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setMilliseconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setMilliseconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setMilliseconds.hasOwnProperty('length'), + 'The value of !Date.prototype.setMilliseconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T3.js b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T3.js index 86f682478a..221d1dd592 100644 --- a/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T3.js +++ b/test/built-ins/Date/prototype/setMilliseconds/S15.9.5.28_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setMilliseconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setMilliseconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setMilliseconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setMilliseconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setMilliseconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setMilliseconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T1.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T1.js index d109b97b9a..e434211573 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T1.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setMinutes; -if (x === 1) +if (x === 1) { Date.prototype.setMinutes = 2; -else +} else { Date.prototype.setMinutes = 1; -if (Date.prototype.setMinutes === x) { - throw new Test262Error('#1: The Date.prototype.setMinutes has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setMinutes, + x, + 'The value of Date.prototype.setMinutes is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T2.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T2.js index 73d40b1d10..8ac5c704ec 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T2.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setMinutes" has { DontEnum } attributes esid: sec-date.prototype.setminutes description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setMinutes, + false, + 'The value of delete Date.prototype.setMinutes is not false' +); -if (delete Date.prototype.setMinutes === false) { - throw new Test262Error('#1: The Date.prototype.setMinutes property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setMinutes')) { - throw new Test262Error('#2: The Date.prototype.setMinutes property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setMinutes'), + 'The value of !Date.prototype.hasOwnProperty(\'setMinutes\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T3.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T3.js index 6f2f1e6794..b7cbe9c3b9 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T3.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setMinutes" has { DontEnum } attributes esid: sec-date.prototype.setminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setMinutes')) { - throw new Test262Error('#1: The Date.prototype.setMinutes property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setMinutes'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setMinutes\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setMinutes") { - throw new Test262Error('#2: The Date.prototype.setMinutes has the attribute DontEnum'); - } + assert.notSameValue(x, "setMinutes", 'The value of x is not "setMinutes"'); } diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A2_T1.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A2_T1.js index 16a9565c17..5f9749a111 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A2_T1.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setMinutes" is 3 esid: sec-date.prototype.setminutes description: The "length" property of the "setMinutes" is 3 ---*/ +assert.sameValue( + Date.prototype.setMinutes.hasOwnProperty("length"), + true, + 'Date.prototype.setMinutes.hasOwnProperty("length") must return true' +); -if (Date.prototype.setMinutes.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setMinutes has a "length" property'); -} - -if (Date.prototype.setMinutes.length !== 3) { - throw new Test262Error('#2: The "length" property of the setMinutes is 3'); -} +assert.sameValue( + Date.prototype.setMinutes.length, + 3, + 'The value of Date.prototype.setMinutes.length is expected to be 3' +); diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js index e0a9de92d6..add08522c7 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setMinutes.length; verifyNotWritable(Date.prototype.setMinutes, "length", null, 1); -if (Date.prototype.setMinutes.length !== x) { - throw new Test262Error('#1: The Date.prototype.setMinutes.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setMinutes.length, + x, + 'The value of Date.prototype.setMinutes.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T2.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T2.js index 6d08cdf16b..30d4b4de0a 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T2.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setminutes description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setMinutes.length, + true, + 'The value of `delete Date.prototype.setMinutes.length` is expected to be true' +); -if (delete Date.prototype.setMinutes.length !== true) { - throw new Test262Error('#1: The Date.prototype.setMinutes.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setMinutes.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setMinutes.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setMinutes.hasOwnProperty('length'), + 'The value of !Date.prototype.setMinutes.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T3.js b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T3.js index cb8cfda760..7d4a120048 100644 --- a/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T3.js +++ b/test/built-ins/Date/prototype/setMinutes/S15.9.5.32_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setMinutes.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setMinutes.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setMinutes.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setMinutes.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setMinutes) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setMinutes.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T1.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T1.js index 9b86fcd31a..53aa46ee64 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T1.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setMonth; -if (x === 1) +if (x === 1) { Date.prototype.setMonth = 2; -else +} else { Date.prototype.setMonth = 1; -if (Date.prototype.setMonth === x) { - throw new Test262Error('#1: The Date.prototype.setMonth has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setMonth, + x, + 'The value of Date.prototype.setMonth is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T2.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T2.js index 8e0b9ce5c6..0309270226 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T2.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "setMonth" has { DontEnum } attributes esid: sec-date.prototype.setmonth description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.setMonth, false, 'The value of delete Date.prototype.setMonth is not false'); -if (delete Date.prototype.setMonth === false) { - throw new Test262Error('#1: The Date.prototype.setMonth property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setMonth')) { - throw new Test262Error('#2: The Date.prototype.setMonth property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setMonth'), + 'The value of !Date.prototype.hasOwnProperty(\'setMonth\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T3.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T3.js index b7f3e6a561..39194f913b 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T3.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setMonth" has { DontEnum } attributes esid: sec-date.prototype.setmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setMonth')) { - throw new Test262Error('#1: The Date.prototype.setMonth property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setMonth'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setMonth\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setMonth") { - throw new Test262Error('#2: The Date.prototype.setMonth has the attribute DontEnum'); - } + assert.notSameValue(x, "setMonth", 'The value of x is not "setMonth"'); } diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A2_T1.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A2_T1.js index 85ba9342e4..ff19d8a321 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A2_T1.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "setMonth" is 2 esid: sec-date.prototype.setmonth description: The "length" property of the "setMonth" is 2 ---*/ +assert.sameValue( + Date.prototype.setMonth.hasOwnProperty("length"), + true, + 'Date.prototype.setMonth.hasOwnProperty("length") must return true' +); -if (Date.prototype.setMonth.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setMonth has a "length" property'); -} - -if (Date.prototype.setMonth.length !== 2) { - throw new Test262Error('#2: The "length" property of the setMonth is 2'); -} +assert.sameValue(Date.prototype.setMonth.length, 2, 'The value of Date.prototype.setMonth.length is expected to be 2'); diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js index 6d3531ecaf..4c65439ce3 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setMonth.length; verifyNotWritable(Date.prototype.setMonth, "length", null, 1); -if (Date.prototype.setMonth.length !== x) { - throw new Test262Error('#1: The Date.prototype.setMonth.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setMonth.length, + x, + 'The value of Date.prototype.setMonth.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T2.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T2.js index 2d7491c7cb..baa0a9ead9 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T2.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setmonth description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setMonth.length, + true, + 'The value of `delete Date.prototype.setMonth.length` is expected to be true' +); -if (delete Date.prototype.setMonth.length !== true) { - throw new Test262Error('#1: The Date.prototype.setMonth.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setMonth.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setMonth.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setMonth.hasOwnProperty('length'), + 'The value of !Date.prototype.setMonth.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T3.js b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T3.js index df6bfb21a1..80bd128d97 100644 --- a/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T3.js +++ b/test/built-ins/Date/prototype/setMonth/S15.9.5.38_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setMonth.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setMonth.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setMonth.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setMonth.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setMonth) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setMonth.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T1.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T1.js index c997b41864..d9b2269770 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T1.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setSeconds; -if (x === 1) +if (x === 1) { Date.prototype.setSeconds = 2; -else +} else { Date.prototype.setSeconds = 1; -if (Date.prototype.setSeconds === x) { - throw new Test262Error('#1: The Date.prototype.setSeconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setSeconds, + x, + 'The value of Date.prototype.setSeconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T2.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T2.js index d09f335fd9..68ef631aa1 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T2.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setSeconds" has { DontEnum } attributes esid: sec-date.prototype.setseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setSeconds, + false, + 'The value of delete Date.prototype.setSeconds is not false' +); -if (delete Date.prototype.setSeconds === false) { - throw new Test262Error('#1: The Date.prototype.setSeconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setSeconds')) { - throw new Test262Error('#2: The Date.prototype.setSeconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setSeconds'), + 'The value of !Date.prototype.hasOwnProperty(\'setSeconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T3.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T3.js index 7a6a890997..d083171660 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T3.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setSeconds" has { DontEnum } attributes esid: sec-date.prototype.setseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setSeconds')) { - throw new Test262Error('#1: The Date.prototype.setSeconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setSeconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setSeconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setSeconds") { - throw new Test262Error('#2: The Date.prototype.setSeconds has the attribute DontEnum'); - } + assert.notSameValue(x, "setSeconds", 'The value of x is not "setSeconds"'); } diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A2_T1.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A2_T1.js index 61d0ad6ced..a217da2360 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A2_T1.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setSeconds" is 2 esid: sec-date.prototype.setseconds description: The "length" property of the "setSeconds" is 2 ---*/ +assert.sameValue( + Date.prototype.setSeconds.hasOwnProperty("length"), + true, + 'Date.prototype.setSeconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.setSeconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setSeconds has a "length" property'); -} - -if (Date.prototype.setSeconds.length !== 2) { - throw new Test262Error('#2: The "length" property of the setSeconds is 2'); -} +assert.sameValue( + Date.prototype.setSeconds.length, + 2, + 'The value of Date.prototype.setSeconds.length is expected to be 2' +); diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js index 8d5612e9e8..27487f2767 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setSeconds.length; verifyNotWritable(Date.prototype.setSeconds, "length", null, 1); -if (Date.prototype.setSeconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.setSeconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setSeconds.length, + x, + 'The value of Date.prototype.setSeconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T2.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T2.js index 4814876289..71ff97cfd1 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T2.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setSeconds.length, + true, + 'The value of `delete Date.prototype.setSeconds.length` is expected to be true' +); -if (delete Date.prototype.setSeconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.setSeconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setSeconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setSeconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setSeconds.hasOwnProperty('length'), + 'The value of !Date.prototype.setSeconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T3.js b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T3.js index bfa1d7d759..34e39402c8 100644 --- a/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T3.js +++ b/test/built-ins/Date/prototype/setSeconds/S15.9.5.30_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setSeconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setSeconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setSeconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setSeconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setSeconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setSeconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T1.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T1.js index caecd702dd..c962c2be45 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T1.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setTime; -if (x === 1) +if (x === 1) { Date.prototype.setTime = 2; -else +} else { Date.prototype.setTime = 1; -if (Date.prototype.setTime === x) { - throw new Test262Error('#1: The Date.prototype.setTime has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setTime, + x, + 'The value of Date.prototype.setTime is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T2.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T2.js index 43e8990e7c..ef62d4e34a 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T2.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T2.js @@ -6,11 +6,9 @@ info: The Date.prototype property "setTime" has { DontEnum } attributes esid: sec-date.prototype.settime description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue(delete Date.prototype.setTime, false, 'The value of delete Date.prototype.setTime is not false'); -if (delete Date.prototype.setTime === false) { - throw new Test262Error('#1: The Date.prototype.setTime property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setTime')) { - throw new Test262Error('#2: The Date.prototype.setTime property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setTime'), + 'The value of !Date.prototype.hasOwnProperty(\'setTime\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T3.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T3.js index 7096379434..3be189c685 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T3.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setTime" has { DontEnum } attributes esid: sec-date.prototype.settime description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setTime')) { - throw new Test262Error('#1: The Date.prototype.setTime property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setTime'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setTime\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setTime") { - throw new Test262Error('#2: The Date.prototype.setTime has the attribute DontEnum'); - } + assert.notSameValue(x, "setTime", 'The value of x is not "setTime"'); } diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A2_T1.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A2_T1.js index 2cedb5df09..b85feb89a4 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A2_T1.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A2_T1.js @@ -6,11 +6,10 @@ info: The "length" property of the "setTime" is 1 esid: sec-date.prototype.settime description: The "length" property of the "setTime" is 1 ---*/ +assert.sameValue( + Date.prototype.setTime.hasOwnProperty("length"), + true, + 'Date.prototype.setTime.hasOwnProperty("length") must return true' +); -if (Date.prototype.setTime.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setTime has a "length" property'); -} - -if (Date.prototype.setTime.length !== 1) { - throw new Test262Error('#2: The "length" property of the setTime is 1'); -} +assert.sameValue(Date.prototype.setTime.length, 1, 'The value of Date.prototype.setTime.length is expected to be 1'); diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js index e7fe6c56c1..d379d4c5aa 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setTime.length; verifyNotWritable(Date.prototype.setTime, "length", null, 1); -if (Date.prototype.setTime.length !== x) { - throw new Test262Error('#1: The Date.prototype.setTime.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setTime.length, + x, + 'The value of Date.prototype.setTime.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T2.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T2.js index 229431c527..7ffb469b0a 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T2.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.settime description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setTime.length, + true, + 'The value of `delete Date.prototype.setTime.length` is expected to be true' +); -if (delete Date.prototype.setTime.length !== true) { - throw new Test262Error('#1: The Date.prototype.setTime.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setTime.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setTime.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setTime.hasOwnProperty('length'), + 'The value of !Date.prototype.setTime.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T3.js b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T3.js index b1cb8bd292..fed45f8168 100644 --- a/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T3.js +++ b/test/built-ins/Date/prototype/setTime/S15.9.5.27_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.settime description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setTime.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setTime.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setTime.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setTime.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setTime) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setTime.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T1.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T1.js index 8569df821c..14c11e2cac 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCDate; -if (x === 1) +if (x === 1) { Date.prototype.setUTCDate = 2; -else +} else { Date.prototype.setUTCDate = 1; -if (Date.prototype.setUTCDate === x) { - throw new Test262Error('#1: The Date.prototype.setUTCDate has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCDate, + x, + 'The value of Date.prototype.setUTCDate is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T2.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T2.js index a60eb1a69f..6722445234 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCDate" has { DontEnum } attributes esid: sec-date.prototype.setutcdate description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCDate, + false, + 'The value of delete Date.prototype.setUTCDate is not false' +); -if (delete Date.prototype.setUTCDate === false) { - throw new Test262Error('#1: The Date.prototype.setUTCDate property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCDate')) { - throw new Test262Error('#2: The Date.prototype.setUTCDate property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCDate'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCDate\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T3.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T3.js index 66417aa2a8..420ef5e6d1 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCDate" has { DontEnum } attributes esid: sec-date.prototype.setutcdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCDate')) { - throw new Test262Error('#1: The Date.prototype.setUTCDate property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCDate'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCDate\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCDate") { - throw new Test262Error('#2: The Date.prototype.setUTCDate has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCDate", 'The value of x is not "setUTCDate"'); } diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A2_T1.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A2_T1.js index 438e79f8c2..84c31dd7f9 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCDate" is 1 esid: sec-date.prototype.setutcdate description: The "length" property of the "setUTCDate" is 1 ---*/ +assert.sameValue( + Date.prototype.setUTCDate.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCDate.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCDate.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCDate has a "length" property'); -} - -if (Date.prototype.setUTCDate.length !== 1) { - throw new Test262Error('#2: The "length" property of the setUTCDate is 1'); -} +assert.sameValue( + Date.prototype.setUTCDate.length, + 1, + 'The value of Date.prototype.setUTCDate.length is expected to be 1' +); diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js index 4840d549c4..2938e2af82 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCDate.length; verifyNotWritable(Date.prototype.setUTCDate, "length", null, 1); -if (Date.prototype.setUTCDate.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCDate.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCDate.length, + x, + 'The value of Date.prototype.setUTCDate.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T2.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T2.js index 8a4ce2c5f9..25f9d1d4fa 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcdate description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCDate.length, + true, + 'The value of `delete Date.prototype.setUTCDate.length` is expected to be true' +); -if (delete Date.prototype.setUTCDate.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCDate.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCDate.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCDate.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCDate.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCDate.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T3.js b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T3.js index 5612e9b05d..6895403667 100644 --- a/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCDate/S15.9.5.37_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcdate description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCDate.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCDate.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCDate.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCDate.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCDate) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCDate.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T1.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T1.js index 90d37b7928..0e0575a316 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCFullYear; -if (x === 1) +if (x === 1) { Date.prototype.setUTCFullYear = 2; -else +} else { Date.prototype.setUTCFullYear = 1; -if (Date.prototype.setUTCFullYear === x) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCFullYear, + x, + 'The value of Date.prototype.setUTCFullYear is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T2.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T2.js index 8e67d0644d..57fbd4c32a 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCFullYear" has { DontEnum } attributes esid: sec-date.prototype.setutcfullyear description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCFullYear, + false, + 'The value of delete Date.prototype.setUTCFullYear is not false' +); -if (delete Date.prototype.setUTCFullYear === false) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCFullYear')) { - throw new Test262Error('#2: The Date.prototype.setUTCFullYear property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCFullYear'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCFullYear\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T3.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T3.js index a18583be07..87c26250a4 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCFullYear" has { DontEnum } attributes esid: sec-date.prototype.setutcfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCFullYear')) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCFullYear'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCFullYear\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCFullYear") { - throw new Test262Error('#2: The Date.prototype.setUTCFullYear has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCFullYear", 'The value of x is not "setUTCFullYear"'); } diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A2_T1.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A2_T1.js index 4a7fa5995b..c54d8cd288 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCFullYear" is 3 esid: sec-date.prototype.setutcfullyear description: The "length" property of the "setUTCFullYear" is 3 ---*/ +assert.sameValue( + Date.prototype.setUTCFullYear.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCFullYear.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCFullYear.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCFullYear has a "length" property'); -} - -if (Date.prototype.setUTCFullYear.length !== 3) { - throw new Test262Error('#2: The "length" property of the setUTCFullYear is 3'); -} +assert.sameValue( + Date.prototype.setUTCFullYear.length, + 3, + 'The value of Date.prototype.setUTCFullYear.length is expected to be 3' +); diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js index a972caba74..045a41b325 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCFullYear.length; verifyNotWritable(Date.prototype.setUTCFullYear, "length", null, 1); -if (Date.prototype.setUTCFullYear.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCFullYear.length, + x, + 'The value of Date.prototype.setUTCFullYear.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T2.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T2.js index d56b1b74e0..37ad888caf 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcfullyear description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCFullYear.length, + true, + 'The value of `delete Date.prototype.setUTCFullYear.length` is expected to be true' +); -if (delete Date.prototype.setUTCFullYear.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCFullYear.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCFullYear.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCFullYear.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCFullYear.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T3.js b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T3.js index ee06949e9f..c2d92a32d5 100644 --- a/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCFullYear/S15.9.5.41_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcfullyear description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCFullYear.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCFullYear.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCFullYear.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCFullYear.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCFullYear) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCFullYear.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T1.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T1.js index 23c2a4d78a..8da1662cbd 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCHours; -if (x === 1) +if (x === 1) { Date.prototype.setUTCHours = 2; -else +} else { Date.prototype.setUTCHours = 1; -if (Date.prototype.setUTCHours === x) { - throw new Test262Error('#1: The Date.prototype.setUTCHours has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCHours, + x, + 'The value of Date.prototype.setUTCHours is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T2.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T2.js index 7883defe39..844b9d8ee5 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCHours" has { DontEnum } attributes esid: sec-date.prototype.setutchours description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCHours, + false, + 'The value of delete Date.prototype.setUTCHours is not false' +); -if (delete Date.prototype.setUTCHours === false) { - throw new Test262Error('#1: The Date.prototype.setUTCHours property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCHours')) { - throw new Test262Error('#2: The Date.prototype.setUTCHours property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCHours'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCHours\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T3.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T3.js index d90f1af182..585e11411b 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCHours" has { DontEnum } attributes esid: sec-date.prototype.setutchours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCHours')) { - throw new Test262Error('#1: The Date.prototype.setUTCHours property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCHours'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCHours\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCHours") { - throw new Test262Error('#2: The Date.prototype.setUTCHours has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCHours", 'The value of x is not "setUTCHours"'); } diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A2_T1.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A2_T1.js index e5c70aa247..c8868f1d29 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCHours" is 4 esid: sec-date.prototype.setutchours description: The "length" property of the "setUTCHours" is 4 ---*/ +assert.sameValue( + Date.prototype.setUTCHours.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCHours.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCHours.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCHours has a "length" property'); -} - -if (Date.prototype.setUTCHours.length !== 4) { - throw new Test262Error('#2: The "length" property of the setUTCHours is 4'); -} +assert.sameValue( + Date.prototype.setUTCHours.length, + 4, + 'The value of Date.prototype.setUTCHours.length is expected to be 4' +); diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js index 4680c7946d..e5fde5d348 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCHours.length; verifyNotWritable(Date.prototype.setUTCHours, "length", null, 1); -if (Date.prototype.setUTCHours.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCHours.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCHours.length, + x, + 'The value of Date.prototype.setUTCHours.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T2.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T2.js index 949229d015..512603b285 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutchours description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCHours.length, + true, + 'The value of `delete Date.prototype.setUTCHours.length` is expected to be true' +); -if (delete Date.prototype.setUTCHours.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCHours.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCHours.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCHours.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCHours.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCHours.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T3.js b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T3.js index df22eef9cb..5ff1d79236 100644 --- a/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCHours/S15.9.5.35_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutchours description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCHours.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCHours.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCHours.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCHours.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCHours) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCHours.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js index ff508d3d0e..5d38232ca4 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T1.js @@ -10,10 +10,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCMilliseconds; -if (x === 1) +if (x === 1) { Date.prototype.setUTCMilliseconds = 2; -else +} else { Date.prototype.setUTCMilliseconds = 1; -if (Date.prototype.setUTCMilliseconds === x) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCMilliseconds, + x, + 'The value of Date.prototype.setUTCMilliseconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js index 57c203f0c0..079623b859 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcmilliseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCMilliseconds, + false, + 'The value of delete Date.prototype.setUTCMilliseconds is not false' +); -if (delete Date.prototype.setUTCMilliseconds === false) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCMilliseconds')) { - throw new Test262Error('#2: The Date.prototype.setUTCMilliseconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCMilliseconds'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCMilliseconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js index 6aa1acff58..2cc9838d27 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCMilliseconds')) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCMilliseconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMilliseconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCMilliseconds") { - throw new Test262Error('#2: The Date.prototype.setUTCMilliseconds has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCMilliseconds", 'The value of x is not "setUTCMilliseconds"'); } diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js index df1d17e4be..87bb57047f 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCMilliseconds" is 1 esid: sec-date.prototype.setutcmilliseconds description: The "length" property of the "setUTCMilliseconds" is 1 ---*/ +assert.sameValue( + Date.prototype.setUTCMilliseconds.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCMilliseconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCMilliseconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCMilliseconds has a "length" property'); -} - -if (Date.prototype.setUTCMilliseconds.length !== 1) { - throw new Test262Error('#2: The "length" property of the setUTCMilliseconds is 1'); -} +assert.sameValue( + Date.prototype.setUTCMilliseconds.length, + 1, + 'The value of Date.prototype.setUTCMilliseconds.length is expected to be 1' +); diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js index 3b1a74b201..96c6598058 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCMilliseconds.length; verifyNotWritable(Date.prototype.setUTCMilliseconds, "length", null, 1); -if (Date.prototype.setUTCMilliseconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCMilliseconds.length, + x, + 'The value of Date.prototype.setUTCMilliseconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js index 4572fa195e..58cd33e1b9 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcmilliseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCMilliseconds.length, + true, + 'The value of `delete Date.prototype.setUTCMilliseconds.length` is expected to be true' +); -if (delete Date.prototype.setUTCMilliseconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCMilliseconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCMilliseconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCMilliseconds.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCMilliseconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js index 68f9561589..c57b48db46 100644 --- a/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCMilliseconds/S15.9.5.29_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcmilliseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCMilliseconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCMilliseconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCMilliseconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCMilliseconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCMilliseconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCMilliseconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js index 08e1238bb9..74826f9514 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCMinutes; -if (x === 1) +if (x === 1) { Date.prototype.setUTCMinutes = 2; -else +} else { Date.prototype.setUTCMinutes = 1; -if (Date.prototype.setUTCMinutes === x) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCMinutes, + x, + 'The value of Date.prototype.setUTCMinutes is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js index d61754c607..1bcf126d55 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCMinutes" has { DontEnum } attributes esid: sec-date.prototype.setutcminutes description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCMinutes, + false, + 'The value of delete Date.prototype.setUTCMinutes is not false' +); -if (delete Date.prototype.setUTCMinutes === false) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCMinutes')) { - throw new Test262Error('#2: The Date.prototype.setUTCMinutes property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCMinutes'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCMinutes\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js index 73dcfb0bad..afe3b5b137 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCMinutes" has { DontEnum } attributes esid: sec-date.prototype.setutcminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCMinutes')) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCMinutes'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMinutes\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCMinutes") { - throw new Test262Error('#2: The Date.prototype.setUTCMinutes has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCMinutes", 'The value of x is not "setUTCMinutes"'); } diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js index 754218ae53..3ca5a125df 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCMinutes" is 3 esid: sec-date.prototype.setutcminutes description: The "length" property of the "setUTCMinutes" is 3 ---*/ +assert.sameValue( + Date.prototype.setUTCMinutes.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCMinutes.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCMinutes.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCMinutes has a "length" property'); -} - -if (Date.prototype.setUTCMinutes.length !== 3) { - throw new Test262Error('#2: The "length" property of the setUTCMinutes is 3'); -} +assert.sameValue( + Date.prototype.setUTCMinutes.length, + 3, + 'The value of Date.prototype.setUTCMinutes.length is expected to be 3' +); diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js index c205aaa32d..2ce03e444c 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCMinutes.length; verifyNotWritable(Date.prototype.setUTCMinutes, "length", null, 1); -if (Date.prototype.setUTCMinutes.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCMinutes.length, + x, + 'The value of Date.prototype.setUTCMinutes.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js index 77c7571e54..dad2e4d4b6 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcminutes description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCMinutes.length, + true, + 'The value of `delete Date.prototype.setUTCMinutes.length` is expected to be true' +); -if (delete Date.prototype.setUTCMinutes.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCMinutes.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCMinutes.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCMinutes.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCMinutes.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js index c3c501fa7d..4a0e4446bc 100644 --- a/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCMinutes/S15.9.5.33_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcminutes description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCMinutes.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCMinutes.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCMinutes.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCMinutes.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCMinutes) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCMinutes.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js index cab40a54b1..2fcdf765c3 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCMonth; -if (x === 1) +if (x === 1) { Date.prototype.setUTCMonth = 2; -else +} else { Date.prototype.setUTCMonth = 1; -if (Date.prototype.setUTCMonth === x) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCMonth, + x, + 'The value of Date.prototype.setUTCMonth is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js index 2aa28e00e8..2e48fb628a 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCMonth" has { DontEnum } attributes esid: sec-date.prototype.setutcmonth description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCMonth, + false, + 'The value of delete Date.prototype.setUTCMonth is not false' +); -if (delete Date.prototype.setUTCMonth === false) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCMonth')) { - throw new Test262Error('#2: The Date.prototype.setUTCMonth property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCMonth'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCMonth\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js index 8c89603938..f1d0534b3f 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCMonth" has { DontEnum } attributes esid: sec-date.prototype.setutcmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCMonth')) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCMonth'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCMonth\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCMonth") { - throw new Test262Error('#2: The Date.prototype.setUTCMonth has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCMonth", 'The value of x is not "setUTCMonth"'); } diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js index 0b52441a9e..fc1d5afb2e 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCMonth" is 2 esid: sec-date.prototype.setutcmonth description: The "length" property of the "setUTCMonth" is 2 ---*/ +assert.sameValue( + Date.prototype.setUTCMonth.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCMonth.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCMonth.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCMonth has a "length" property'); -} - -if (Date.prototype.setUTCMonth.length !== 2) { - throw new Test262Error('#2: The "length" property of the setUTCMonth is 2'); -} +assert.sameValue( + Date.prototype.setUTCMonth.length, + 2, + 'The value of Date.prototype.setUTCMonth.length is expected to be 2' +); diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js index fb523b42ea..09a3b51204 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCMonth.length; verifyNotWritable(Date.prototype.setUTCMonth, "length", null, 1); -if (Date.prototype.setUTCMonth.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCMonth.length, + x, + 'The value of Date.prototype.setUTCMonth.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js index 7cacfb103b..3042e14357 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcmonth description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCMonth.length, + true, + 'The value of `delete Date.prototype.setUTCMonth.length` is expected to be true' +); -if (delete Date.prototype.setUTCMonth.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCMonth.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCMonth.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCMonth.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCMonth.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js index d70057fe77..b596899167 100644 --- a/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCMonth/S15.9.5.39_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcmonth description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCMonth.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCMonth.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCMonth.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCMonth.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCMonth) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCMonth.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T1.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T1.js index 8d042faa5a..ce4434da09 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T1.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.setUTCSeconds; -if (x === 1) +if (x === 1) { Date.prototype.setUTCSeconds = 2; -else +} else { Date.prototype.setUTCSeconds = 1; -if (Date.prototype.setUTCSeconds === x) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.setUTCSeconds, + x, + 'The value of Date.prototype.setUTCSeconds is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T2.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T2.js index d0d3c746cc..7289bd37a6 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T2.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "setUTCSeconds" has { DontEnum } attributes esid: sec-date.prototype.setutcseconds description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.setUTCSeconds, + false, + 'The value of delete Date.prototype.setUTCSeconds is not false' +); -if (delete Date.prototype.setUTCSeconds === false) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('setUTCSeconds')) { - throw new Test262Error('#2: The Date.prototype.setUTCSeconds property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('setUTCSeconds'), + 'The value of !Date.prototype.hasOwnProperty(\'setUTCSeconds\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T3.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T3.js index c987c7806d..4801145dbc 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T3.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "setUTCSeconds" has { DontEnum } attributes esid: sec-date.prototype.setutcseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('setUTCSeconds')) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('setUTCSeconds'), + 'The value of !Date.prototype.propertyIsEnumerable(\'setUTCSeconds\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "setUTCSeconds") { - throw new Test262Error('#2: The Date.prototype.setUTCSeconds has the attribute DontEnum'); - } + assert.notSameValue(x, "setUTCSeconds", 'The value of x is not "setUTCSeconds"'); } diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A2_T1.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A2_T1.js index b9ae026560..df857c0c39 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A2_T1.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "setUTCSeconds" is 2 esid: sec-date.prototype.setutcseconds description: The "length" property of the "setUTCSeconds" is 2 ---*/ +assert.sameValue( + Date.prototype.setUTCSeconds.hasOwnProperty("length"), + true, + 'Date.prototype.setUTCSeconds.hasOwnProperty("length") must return true' +); -if (Date.prototype.setUTCSeconds.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The setUTCSeconds has a "length" property'); -} - -if (Date.prototype.setUTCSeconds.length !== 2) { - throw new Test262Error('#2: The "length" property of the setUTCSeconds is 2'); -} +assert.sameValue( + Date.prototype.setUTCSeconds.length, + 2, + 'The value of Date.prototype.setUTCSeconds.length is expected to be 2' +); diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js index a77ad4060b..9a2824afec 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.setUTCSeconds.length; verifyNotWritable(Date.prototype.setUTCSeconds, "length", null, 1); -if (Date.prototype.setUTCSeconds.length !== x) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.setUTCSeconds.length, + x, + 'The value of Date.prototype.setUTCSeconds.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T2.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T2.js index 809d730bf3..ee2ccb9429 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T2.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.setutcseconds description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.setUTCSeconds.length, + true, + 'The value of `delete Date.prototype.setUTCSeconds.length` is expected to be true' +); -if (delete Date.prototype.setUTCSeconds.length !== true) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.setUTCSeconds.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.setUTCSeconds.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.setUTCSeconds.hasOwnProperty('length'), + 'The value of !Date.prototype.setUTCSeconds.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T3.js b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T3.js index e0ae3592eb..317769901a 100644 --- a/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T3.js +++ b/test/built-ins/Date/prototype/setUTCSeconds/S15.9.5.31_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.setutcseconds description: Checking DontEnum attribute ---*/ - -if (Date.prototype.setUTCSeconds.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.setUTCSeconds.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.setUTCSeconds.propertyIsEnumerable('length'), + 'The value of !Date.prototype.setUTCSeconds.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.setUTCSeconds) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.setUTCSeconds.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T1.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T1.js index a1843e949d..36fdbc94ec 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T1.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toDateString; -if (x === 1) +if (x === 1) { Date.prototype.toDateString = 2; -else +} else { Date.prototype.toDateString = 1; -if (Date.prototype.toDateString === x) { - throw new Test262Error('#1: The Date.prototype.toDateString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toDateString, + x, + 'The value of Date.prototype.toDateString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T2.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T2.js index 36741aa5f8..d7126bfea8 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T2.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T2.js @@ -6,11 +6,13 @@ info: The Date.prototype property "toDateString" has { DontEnum } attributes esid: sec-date.prototype.todatestring description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.toDateString, + false, + 'The value of delete Date.prototype.toDateString is not false' +); -if (delete Date.prototype.toDateString === false) { - throw new Test262Error('#1: The Date.prototype.toDateString property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('toDateString')) { - throw new Test262Error('#2: The Date.prototype.toDateString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toDateString'), + 'The value of !Date.prototype.hasOwnProperty(\'toDateString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T3.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T3.js index dd2edcffb7..c01979c2f6 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T3.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "toDateString" has { DontEnum } attributes esid: sec-date.prototype.todatestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toDateString')) { - throw new Test262Error('#1: The Date.prototype.toDateString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toDateString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toDateString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toDateString") { - throw new Test262Error('#2: The Date.prototype.toDateString has the attribute DontEnum'); - } + assert.notSameValue(x, "toDateString", 'The value of x is not "toDateString"'); } diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A2_T1.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A2_T1.js index 0aeae31ab0..8b0c715bd9 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A2_T1.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "toDateString" is 0 esid: sec-date.prototype.todatestring description: The "length" property of the "toDateString" is 0 ---*/ +assert.sameValue( + Date.prototype.toDateString.hasOwnProperty("length"), + true, + 'Date.prototype.toDateString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toDateString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toDateString has a "length" property'); -} - -if (Date.prototype.toDateString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toDateString is 0'); -} +assert.sameValue( + Date.prototype.toDateString.length, + 0, + 'The value of Date.prototype.toDateString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js index c4734330d5..e3f090c547 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toDateString.length; verifyNotWritable(Date.prototype.toDateString, "length", null, 1); -if (Date.prototype.toDateString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toDateString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toDateString.length, + x, + 'The value of Date.prototype.toDateString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T2.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T2.js index bf4db7b60f..4fe4ff668f 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T2.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.todatestring description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.toDateString.length, + true, + 'The value of `delete Date.prototype.toDateString.length` is expected to be true' +); -if (delete Date.prototype.toDateString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toDateString.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.toDateString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toDateString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toDateString.hasOwnProperty('length'), + 'The value of !Date.prototype.toDateString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T3.js b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T3.js index acc9b2600e..b188624d17 100644 --- a/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T3.js +++ b/test/built-ins/Date/prototype/toDateString/S15.9.5.3_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.todatestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toDateString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toDateString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toDateString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toDateString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toDateString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toDateString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js index 3b24f4b75b..1829011379 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T1.js @@ -10,10 +10,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toLocaleDateString; -if (x === 1) +if (x === 1) { Date.prototype.toLocaleDateString = 2; -else +} else { Date.prototype.toLocaleDateString = 1; -if (Date.prototype.toLocaleDateString === x) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toLocaleDateString, + x, + 'The value of Date.prototype.toLocaleDateString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js index e9f2705a84..e5a4a6af90 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.tolocaledatestring description: Checking absence of DontDelete attribute ---*/ +assert.notSameValue( + delete Date.prototype.toLocaleDateString, + false, + 'The value of delete Date.prototype.toLocaleDateString is not false' +); -if (delete Date.prototype.toLocaleDateString === false) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('toLocaleDateString')) { - throw new Test262Error('#2: The Date.prototype.toLocaleDateString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toLocaleDateString'), + 'The value of !Date.prototype.hasOwnProperty(\'toLocaleDateString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js index 8324138505..d8006b6843 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tolocaledatestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toLocaleDateString')) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toLocaleDateString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toLocaleDateString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toLocaleDateString") { - throw new Test262Error('#2: The Date.prototype.toLocaleDateString has the attribute DontEnum'); - } + assert.notSameValue(x, "toLocaleDateString", 'The value of x is not "toLocaleDateString"'); } diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js index b16d9886ed..6d77b5f7d2 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A2_T1.js @@ -6,11 +6,14 @@ info: The "length" property of the "toLocaleDateString" is 0 esid: sec-date.prototype.tolocaledatestring description: The "length" property of the "toLocaleDateString" is 0 ---*/ +assert.sameValue( + Date.prototype.toLocaleDateString.hasOwnProperty("length"), + true, + 'Date.prototype.toLocaleDateString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toLocaleDateString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toLocaleDateString has a "length" property'); -} - -if (Date.prototype.toLocaleDateString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toLocaleDateString is 0'); -} +assert.sameValue( + Date.prototype.toLocaleDateString.length, + 0, + 'The value of Date.prototype.toLocaleDateString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js index 784cddacee..885961d198 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toLocaleDateString.length; verifyNotWritable(Date.prototype.toLocaleDateString, "length", null, 1); -if (Date.prototype.toLocaleDateString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toLocaleDateString.length, + x, + 'The value of Date.prototype.toLocaleDateString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js index 7a8e232a42..6e63df3468 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.tolocaledatestring description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.toLocaleDateString.length, + true, + 'The value of `delete Date.prototype.toLocaleDateString.length` is expected to be true' +); -if (delete Date.prototype.toLocaleDateString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.toLocaleDateString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toLocaleDateString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toLocaleDateString.hasOwnProperty('length'), + 'The value of !Date.prototype.toLocaleDateString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js index bbbe61ec7a..9371a6ad5f 100644 --- a/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js +++ b/test/built-ins/Date/prototype/toLocaleDateString/S15.9.5.6_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tolocaledatestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toLocaleDateString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toLocaleDateString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toLocaleDateString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toLocaleDateString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toLocaleDateString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toLocaleDateString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js index 308edb12a4..759380205f 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toLocaleString; -if (x === 1) +if (x === 1) { Date.prototype.toLocaleString = 2; -else +} else { Date.prototype.toLocaleString = 1; -if (Date.prototype.toLocaleString === x) { - throw new Test262Error('#1: The Date.prototype.toLocaleString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toLocaleString, + x, + 'The value of Date.prototype.toLocaleString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js index fbd2db8eb9..8019171e0f 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T2.js @@ -7,10 +7,13 @@ esid: sec-date.prototype.tolocalestring description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.toLocaleString === false) { - throw new Test262Error('#1: The Date.prototype.toLocaleString property has not the attributes DontDelete'); -} +assert.notSameValue( + delete Date.prototype.toLocaleString, + false, + 'The value of delete Date.prototype.toLocaleString is not false' +); -if (Date.prototype.hasOwnProperty('toLocaleString')) { - throw new Test262Error('#2: The Date.prototype.toLocaleString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toLocaleString'), + 'The value of !Date.prototype.hasOwnProperty(\'toLocaleString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js index 327fc2cfdd..c2693e9b8a 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "toLocaleString" has { DontEnum } attributes esid: sec-date.prototype.tolocalestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toLocaleString')) { - throw new Test262Error('#1: The Date.prototype.toLocaleString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toLocaleString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toLocaleString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toLocaleString") { - throw new Test262Error('#2: The Date.prototype.toLocaleString has the attribute DontEnum'); - } + assert.notSameValue(x, "toLocaleString", 'The value of x is not "toLocaleString"'); } diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js index ea3c4a4616..e6a4864d31 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A2_T1.js @@ -7,10 +7,14 @@ esid: sec-date.prototype.tolocalestring description: The "length" property of the "toLocaleString" is 0 ---*/ -if (Date.prototype.toLocaleString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toLocaleString has a "length" property'); -} +assert.sameValue( + Date.prototype.toLocaleString.hasOwnProperty("length"), + true, + 'Date.prototype.toLocaleString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toLocaleString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toLocaleString is 0'); -} +assert.sameValue( + Date.prototype.toLocaleString.length, + 0, + 'The value of Date.prototype.toLocaleString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js index 3a53c1ba44..9603a625f4 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toLocaleString.length; verifyNotWritable(Date.prototype.toLocaleString, "length", null, 1); -if (Date.prototype.toLocaleString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toLocaleString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toLocaleString.length, + x, + 'The value of Date.prototype.toLocaleString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js index a3419fb77f..19de48553d 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.tolocalestring description: Checking DontDelete attribute ---*/ -if (delete Date.prototype.toLocaleString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toLocaleString.length property does not have the attributes DontDelete'); -} +assert.sameValue( + delete Date.prototype.toLocaleString.length, + true, + 'The value of `delete Date.prototype.toLocaleString.length` is expected to be true' +); -if (Date.prototype.toLocaleString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toLocaleString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toLocaleString.hasOwnProperty('length'), + 'The value of !Date.prototype.toLocaleString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js index fb39f2ded1..2cf88d3668 100644 --- a/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js +++ b/test/built-ins/Date/prototype/toLocaleString/S15.9.5.5_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tolocalestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toLocaleString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toLocaleString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toLocaleString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toLocaleString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toLocaleString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toLocaleString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T1.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T1.js index 93e2062761..900b96b6bb 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T1.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T1.js @@ -10,10 +10,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toLocaleTimeString; -if (x === 1) +if (x === 1) { Date.prototype.toLocaleTimeString = 2; -else +} else { Date.prototype.toLocaleTimeString = 1; -if (Date.prototype.toLocaleTimeString === x) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toLocaleTimeString, + x, + 'The value of Date.prototype.toLocaleTimeString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T2.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T2.js index a6a8330659..4405bcacdb 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T2.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.tolocaletimestring description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.toLocaleTimeString === false) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString property has not the attributes DontDelete'); -} +assert.notSameValue( + delete Date.prototype.toLocaleTimeString, + false, + 'The value of delete Date.prototype.toLocaleTimeString is not false' +); -if (Date.prototype.hasOwnProperty('toLocaleTimeString')) { - throw new Test262Error('#2: The Date.prototype.toLocaleTimeString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toLocaleTimeString'), + 'The value of !Date.prototype.hasOwnProperty(\'toLocaleTimeString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T3.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T3.js index d23ae080e9..b345e28809 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T3.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A1_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tolocaletimestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toLocaleTimeString')) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toLocaleTimeString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toLocaleTimeString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toLocaleTimeString") { - throw new Test262Error('#2: The Date.prototype.toLocaleTimeString has the attribute DontEnum'); - } + assert.notSameValue(x, "toLocaleTimeString", 'The value of x is not "toLocaleTimeString"'); } diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A2_T1.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A2_T1.js index 4de2453e37..ee7b4840e2 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A2_T1.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A2_T1.js @@ -7,10 +7,14 @@ esid: sec-date.prototype.tolocaletimestring description: The "length" property of the "toLocaleTimeString" is 0 ---*/ -if (Date.prototype.toLocaleTimeString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toLocaleTimeString has a "length" property'); -} +assert.sameValue( + Date.prototype.toLocaleTimeString.hasOwnProperty("length"), + true, + 'Date.prototype.toLocaleTimeString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toLocaleTimeString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toLocaleTimeString is 0'); -} +assert.sameValue( + Date.prototype.toLocaleTimeString.length, + 0, + 'The value of Date.prototype.toLocaleTimeString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js index 20a10d0c62..9e5174bc27 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toLocaleTimeString.length; verifyNotWritable(Date.prototype.toLocaleTimeString, "length", null, 1); -if (Date.prototype.toLocaleTimeString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toLocaleTimeString.length, + x, + 'The value of Date.prototype.toLocaleTimeString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T2.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T2.js index 87ce081b5e..109761fb0d 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T2.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.tolocaletimestring description: Checking DontDelete attribute ---*/ -if (delete Date.prototype.toLocaleTimeString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString.length property does not have the attributes DontDelete'); -} +assert.sameValue( + delete Date.prototype.toLocaleTimeString.length, + true, + 'The value of `delete Date.prototype.toLocaleTimeString.length` is expected to be true' +); -if (Date.prototype.toLocaleTimeString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toLocaleTimeString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toLocaleTimeString.hasOwnProperty('length'), + 'The value of !Date.prototype.toLocaleTimeString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T3.js b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T3.js index baffc8285f..492383af94 100644 --- a/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T3.js +++ b/test/built-ins/Date/prototype/toLocaleTimeString/S15.9.5.7_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tolocaletimestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toLocaleTimeString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toLocaleTimeString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toLocaleTimeString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toLocaleTimeString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toLocaleTimeString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toLocaleTimeString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T1.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T1.js index b71921e13a..2c37304342 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T1.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toString; -if (x === 1) +if (x === 1) { Date.prototype.toString = 2; -else +} else { Date.prototype.toString = 1; -if (Date.prototype.toString === x) { - throw new Test262Error('#1: The Date.prototype.toString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toString, + x, + 'The value of Date.prototype.toString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T2.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T2.js index 98f175d63a..8b5013f65f 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T2.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T2.js @@ -7,10 +7,8 @@ esid: sec-date.prototype.tostring description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.toString === false) { - throw new Test262Error('#1: The Date.prototype.toString property has not the attributes DontDelete'); -} - -if (Date.prototype.hasOwnProperty('toString')) { - throw new Test262Error('#2: The Date.prototype.toString property has not the attributes DontDelete'); -} +assert.notSameValue(delete Date.prototype.toString, false, 'The value of delete Date.prototype.toString is not false'); +assert( + !Date.prototype.hasOwnProperty('toString'), + 'The value of !Date.prototype.hasOwnProperty(\'toString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T3.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T3.js index d5e15c30ff..4625fe23a8 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T3.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "toString" has { DontEnum } attributes esid: sec-date.prototype.tostring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toString')) { - throw new Test262Error('#1: The Date.prototype.toString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toString") { - throw new Test262Error('#2: The Date.prototype.toString has the attribute DontEnum'); - } + assert.notSameValue(x, "toString", 'The value of x is not "toString"'); } diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A2_T1.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A2_T1.js index 0273806681..53d6f0c4d0 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A2_T1.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A2_T1.js @@ -7,10 +7,10 @@ esid: sec-date.prototype.tostring description: The "length" property of the "toString" is 0 ---*/ -if (Date.prototype.toString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toString has a "length" property'); -} +assert.sameValue( + Date.prototype.toString.hasOwnProperty("length"), + true, + 'Date.prototype.toString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toString is 0'); -} +assert.sameValue(Date.prototype.toString.length, 0, 'The value of Date.prototype.toString.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js index 4297788db8..847112a7e3 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toString.length; verifyNotWritable(Date.prototype.toString, "length", null, 1); -if (Date.prototype.toString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toString.length, + x, + 'The value of Date.prototype.toString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T2.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T2.js index dd602cd447..d68561c8b1 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T2.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.tostring description: Checking DontDelete attribute ---*/ -if (delete Date.prototype.toString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toString.length property does not have the attributes DontDelete'); -} +assert.sameValue( + delete Date.prototype.toString.length, + true, + 'The value of `delete Date.prototype.toString.length` is expected to be true' +); -if (Date.prototype.toString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toString.hasOwnProperty('length'), + 'The value of !Date.prototype.toString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T3.js b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T3.js index 1d38aea0bb..6004b48caa 100644 --- a/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T3.js +++ b/test/built-ins/Date/prototype/toString/S15.9.5.2_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.tostring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T1.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T1.js index ded1a412ae..a71e3bc810 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T1.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toTimeString; -if (x === 1) +if (x === 1) { Date.prototype.toTimeString = 2; -else +} else { Date.prototype.toTimeString = 1; -if (Date.prototype.toTimeString === x) { - throw new Test262Error('#1: The Date.prototype.toTimeString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toTimeString, + x, + 'The value of Date.prototype.toTimeString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T2.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T2.js index 62a032af32..330fd077a4 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T2.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T2.js @@ -7,10 +7,13 @@ esid: sec-date.prototype.totimestring description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.toTimeString === false) { - throw new Test262Error('#1: The Date.prototype.toTimeString property has not the attributes DontDelete'); -} +assert.notSameValue( + delete Date.prototype.toTimeString, + false, + 'The value of delete Date.prototype.toTimeString is not false' +); -if (Date.prototype.hasOwnProperty('toTimeString')) { - throw new Test262Error('#2: The Date.prototype.toTimeString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toTimeString'), + 'The value of !Date.prototype.hasOwnProperty(\'toTimeString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T3.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T3.js index 17d5cd9018..baaf524a92 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T3.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "toTimeString" has { DontEnum } attributes esid: sec-date.prototype.totimestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toTimeString')) { - throw new Test262Error('#1: The Date.prototype.toTimeString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toTimeString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toTimeString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toTimeString") { - throw new Test262Error('#2: The Date.prototype.toTimeString has the attribute DontEnum'); - } + assert.notSameValue(x, "toTimeString", 'The value of x is not "toTimeString"'); } diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A2_T1.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A2_T1.js index cb0beb19b1..a690818fa8 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A2_T1.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A2_T1.js @@ -1,16 +1,20 @@ // Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. - /*--- info: The "length" property of the "toTimeString" is 0 esid: sec-date.prototype.totimestring description: The "length" property of the "toTimeString" is 0 ---*/ -if (Date.prototype.toTimeString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toTimeString has a "length" property'); -} +assert.sameValue( + Date.prototype.toTimeString.hasOwnProperty("length"), + true, + 'Date.prototype.toTimeString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toTimeString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toTimeString is 0'); -} + +assert.sameValue( + Date.prototype.toTimeString.length, + 0, + 'The value of Date.prototype.toTimeString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js index 8a8728ac98..53fc3e14b2 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toTimeString.length; verifyNotWritable(Date.prototype.toTimeString, "length", null, 1); -if (Date.prototype.toTimeString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toTimeString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toTimeString.length, + x, + 'The value of Date.prototype.toTimeString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T2.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T2.js index 780c8952b1..62bf6c847d 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T2.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T2.js @@ -8,11 +8,13 @@ info: | esid: sec-date.prototype.totimestring description: Checking DontDelete attribute ---*/ +assert.sameValue( + delete Date.prototype.toTimeString.length, + true, + 'The value of `delete Date.prototype.toTimeString.length` is expected to be true' +); -if (delete Date.prototype.toTimeString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toTimeString.length property does not have the attributes DontDelete'); -} - -if (Date.prototype.toTimeString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toTimeString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toTimeString.hasOwnProperty('length'), + 'The value of !Date.prototype.toTimeString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T3.js b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T3.js index a6343cee29..9b08e73c7c 100644 --- a/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T3.js +++ b/test/built-ins/Date/prototype/toTimeString/S15.9.5.4_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.totimestring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toTimeString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toTimeString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toTimeString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toTimeString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toTimeString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toTimeString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T1.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T1.js index 1591aada8d..f363ebb3ba 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T1.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.toUTCString; -if (x === 1) +if (x === 1) { Date.prototype.toUTCString = 2; -else +} else { Date.prototype.toUTCString = 1; -if (Date.prototype.toUTCString === x) { - throw new Test262Error('#1: The Date.prototype.toUTCString has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.toUTCString, + x, + 'The value of Date.prototype.toUTCString is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T2.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T2.js index 6b1bdf2018..ac577f56dd 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T2.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T2.js @@ -7,10 +7,13 @@ esid: sec-date.prototype.toutcstring description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.toUTCString === false) { - throw new Test262Error('#1: The Date.prototype.toUTCString property has not the attributes DontDelete'); -} +assert.notSameValue( + delete Date.prototype.toUTCString, + false, + 'The value of delete Date.prototype.toUTCString is not false' +); -if (Date.prototype.hasOwnProperty('toUTCString')) { - throw new Test262Error('#2: The Date.prototype.toUTCString property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('toUTCString'), + 'The value of !Date.prototype.hasOwnProperty(\'toUTCString\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T3.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T3.js index b2fb058536..ac4b4ff86c 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T3.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "toUTCString" has { DontEnum } attributes esid: sec-date.prototype.toutcstring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('toUTCString')) { - throw new Test262Error('#1: The Date.prototype.toUTCString property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('toUTCString'), + 'The value of !Date.prototype.propertyIsEnumerable(\'toUTCString\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "toUTCString") { - throw new Test262Error('#2: The Date.prototype.toUTCString has the attribute DontEnum'); - } + assert.notSameValue(x, "toUTCString", 'The value of x is not "toUTCString"'); } diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A2_T1.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A2_T1.js index dabdc6f764..847ec8b722 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A2_T1.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A2_T1.js @@ -7,10 +7,14 @@ esid: sec-date.prototype.toutcstring description: The "length" property of the "toUTCString" is 0 ---*/ -if (Date.prototype.toUTCString.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The toUTCString has a "length" property'); -} +assert.sameValue( + Date.prototype.toUTCString.hasOwnProperty("length"), + true, + 'Date.prototype.toUTCString.hasOwnProperty("length") must return true' +); -if (Date.prototype.toUTCString.length !== 0) { - throw new Test262Error('#2: The "length" property of the toUTCString is 0'); -} +assert.sameValue( + Date.prototype.toUTCString.length, + 0, + 'The value of Date.prototype.toUTCString.length is expected to be 0' +); diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js index 43b6da56e5..8474041573 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.toUTCString.length; verifyNotWritable(Date.prototype.toUTCString, "length", null, 1); -if (Date.prototype.toUTCString.length !== x) { - throw new Test262Error('#1: The Date.prototype.toUTCString.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.toUTCString.length, + x, + 'The value of Date.prototype.toUTCString.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T2.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T2.js index 001b8f3884..1594e37161 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T2.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.toutcstring description: Checking DontDelete attribute ---*/ -if (delete Date.prototype.toUTCString.length !== true) { - throw new Test262Error('#1: The Date.prototype.toUTCString.length property does not have the attributes DontDelete'); -} +assert.sameValue( + delete Date.prototype.toUTCString.length, + true, + 'The value of `delete Date.prototype.toUTCString.length` is expected to be true' +); -if (Date.prototype.toUTCString.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.toUTCString.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.toUTCString.hasOwnProperty('length'), + 'The value of !Date.prototype.toUTCString.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T3.js b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T3.js index c615e3a405..2a78ec0409 100644 --- a/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T3.js +++ b/test/built-ins/Date/prototype/toUTCString/S15.9.5.42_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.toutcstring description: Checking DontEnum attribute ---*/ - -if (Date.prototype.toUTCString.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.toUTCString.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.toUTCString.propertyIsEnumerable('length'), + 'The value of !Date.prototype.toUTCString.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.toUTCString) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.toUTCString.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T1.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T1.js index 1aeed82b60..910768d0a4 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T1.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T1.js @@ -8,10 +8,14 @@ description: Checking absence of ReadOnly attribute ---*/ var x = Date.prototype.valueOf; -if (x === 1) +if (x === 1) { Date.prototype.valueOf = 2; -else +} else { Date.prototype.valueOf = 1; -if (Date.prototype.valueOf === x) { - throw new Test262Error('#1: The Date.prototype.valueOf has not the attribute ReadOnly'); } + +assert.notSameValue( + Date.prototype.valueOf, + x, + 'The value of Date.prototype.valueOf is expected to not equal the value of `x`' +); diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T2.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T2.js index 6b8eb45234..9ec1c45609 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T2.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T2.js @@ -7,10 +7,9 @@ esid: sec-date.prototype.valueof description: Checking absence of DontDelete attribute ---*/ -if (delete Date.prototype.valueOf === false) { - throw new Test262Error('#1: The Date.prototype.valueOf property has not the attributes DontDelete'); -} +assert.notSameValue(delete Date.prototype.valueOf, false, 'The value of delete Date.prototype.valueOf is not false'); -if (Date.prototype.hasOwnProperty('valueOf')) { - throw new Test262Error('#2: The Date.prototype.valueOf property has not the attributes DontDelete'); -} +assert( + !Date.prototype.hasOwnProperty('valueOf'), + 'The value of !Date.prototype.hasOwnProperty(\'valueOf\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T3.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T3.js index 93aedbf03f..ad2245be03 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T3.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A1_T3.js @@ -6,13 +6,11 @@ info: The Date.prototype property "valueOf" has { DontEnum } attributes esid: sec-date.prototype.valueof description: Checking DontEnum attribute ---*/ - -if (Date.prototype.propertyIsEnumerable('valueOf')) { - throw new Test262Error('#1: The Date.prototype.valueOf property has the attribute DontEnum'); -} +assert( + !Date.prototype.propertyIsEnumerable('valueOf'), + 'The value of !Date.prototype.propertyIsEnumerable(\'valueOf\') is expected to be true' +); for (var x in Date.prototype) { - if (x === "valueOf") { - throw new Test262Error('#2: The Date.prototype.valueOf has the attribute DontEnum'); - } + assert.notSameValue(x, "valueOf", 'The value of x is not "valueOf"'); } diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A2_T1.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A2_T1.js index 06fbe3fd3a..8d339e67d9 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A2_T1.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A2_T1.js @@ -7,10 +7,10 @@ esid: sec-date.prototype.valueof description: The "length" property of the "valueOf" is 0 ---*/ -if (Date.prototype.valueOf.hasOwnProperty("length") !== true) { - throw new Test262Error('#1: The valueOf has a "length" property'); -} +assert.sameValue( + Date.prototype.valueOf.hasOwnProperty("length"), + true, + 'Date.prototype.valueOf.hasOwnProperty("length") must return true' +); -if (Date.prototype.valueOf.length !== 0) { - throw new Test262Error('#2: The "length" property of the valueOf is 0'); -} +assert.sameValue(Date.prototype.valueOf.length, 0, 'The value of Date.prototype.valueOf.length is expected to be 0'); diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js index 6d757ca58b..2d2d2514b1 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T1.js @@ -12,6 +12,9 @@ includes: [propertyHelper.js] var x = Date.prototype.valueOf.length; verifyNotWritable(Date.prototype.valueOf, "length", null, 1); -if (Date.prototype.valueOf.length !== x) { - throw new Test262Error('#1: The Date.prototype.valueOf.length has the attribute ReadOnly'); -} + +assert.sameValue( + Date.prototype.valueOf.length, + x, + 'The value of Date.prototype.valueOf.length is expected to equal the value of x' +); diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T2.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T2.js index fa38e1e978..5ffa1b82d7 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T2.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T2.js @@ -9,10 +9,13 @@ esid: sec-date.prototype.valueof description: Checking DontDelete attribute ---*/ -if (delete Date.prototype.valueOf.length !== true) { - throw new Test262Error('#1: The Date.prototype.valueOf.length property does not have the attributes DontDelete'); -} +assert.sameValue( + delete Date.prototype.valueOf.length, + true, + 'The value of `delete Date.prototype.valueOf.length` is expected to be true' +); -if (Date.prototype.valueOf.hasOwnProperty('length')) { - throw new Test262Error('#2: The Date.prototype.valueOf.length property does not have the attributes DontDelete'); -} +assert( + !Date.prototype.valueOf.hasOwnProperty('length'), + 'The value of !Date.prototype.valueOf.hasOwnProperty(\'length\') is expected to be true' +); diff --git a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T3.js b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T3.js index 936b895171..d641d8d430 100644 --- a/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T3.js +++ b/test/built-ins/Date/prototype/valueOf/S15.9.5.8_A3_T3.js @@ -8,13 +8,11 @@ info: | esid: sec-date.prototype.valueof description: Checking DontEnum attribute ---*/ - -if (Date.prototype.valueOf.propertyIsEnumerable('length')) { - throw new Test262Error('#1: The Date.prototype.valueOf.length property has the attribute DontEnum'); -} +assert( + !Date.prototype.valueOf.propertyIsEnumerable('length'), + 'The value of !Date.prototype.valueOf.propertyIsEnumerable(\'length\') is expected to be true' +); for (var x in Date.prototype.valueOf) { - if (x === "length") { - throw new Test262Error('#2: The Date.prototype.valueOf.length has the attribute DontEnum'); - } + assert.notSameValue(x, "length", 'The value of x is not "length"'); } diff --git a/test/built-ins/Date/prototype/valueOf/S9.4_A3_T1.js b/test/built-ins/Date/prototype/valueOf/S9.4_A3_T1.js index c4d97fb6b1..5dccae285a 100644 --- a/test/built-ins/Date/prototype/valueOf/S9.4_A3_T1.js +++ b/test/built-ins/Date/prototype/valueOf/S9.4_A3_T1.js @@ -12,72 +12,48 @@ description: For testing constructor Date(Number) is used // CHECK#1 var d1 = new Date(6.54321); -if (d1.valueOf() !== 6) { - throw new Test262Error('#1: var d1 = new Date(6.54321); d1.valueOf() === 6;'); -} +assert.sameValue(d1.valueOf(), 6, 'd1.valueOf() must return 6'); // CHECK#2 var d2 = new Date(-6.54321); -if (d2.valueOf() !== -6) { - throw new Test262Error('#2: var d2 = new Date(-6.54321); d2.valueOf() === -6;'); -} +assert.sameValue(d2.valueOf(), -6, 'd2.valueOf() must return -6'); // CHECK#3 var d3 = new Date(6.54321e2); -if (d3.valueOf() !== 654) { - throw new Test262Error('#3: var d3 = new Date(6.54321e2); d3.valueOf() === 654;'); -} +assert.sameValue(d3.valueOf(), 654, 'd3.valueOf() must return 654'); // CHECK#4 var d4 = new Date(-6.54321e2); -if (d4.valueOf() !== -654) { - throw new Test262Error('#4: var d4 = new Date(-6.54321e2); d4.valueOf() === -654;'); -} +assert.sameValue(d4.valueOf(), -654, 'd4.valueOf() must return -654'); // CHECK#5 var d5 = new Date(0.654321e1); -if (d5.valueOf() !== 6) { - throw new Test262Error('#5: var d5 = new Date(0.654321e1); d5.valueOf() === 6;'); -} +assert.sameValue(d5.valueOf(), 6, 'd5.valueOf() must return 6'); // CHECK#6 var d6 = new Date(-0.654321e1); -if (d6.valueOf() !== -6) { - throw new Test262Error('#6: var d6 = new Date(-0.654321e1); d6.valueOf() === -6;'); -} +assert.sameValue(d6.valueOf(), -6, 'd6.valueOf() must return -6'); // CHECK#7 var d7 = new Date(true); -if (d7.valueOf() !== 1) { - throw new Test262Error('#7: var d7 = new Date(true); d7.valueOf() === 1;'); -} +assert.sameValue(d7.valueOf(), 1, 'd7.valueOf() must return 1'); // CHECK#8 var d8 = new Date(false); -if (d8.valueOf() !== 0) { - throw new Test262Error('#8: var d8 = new Date(false); d8.valueOf() === 0;'); -} +assert.sameValue(d8.valueOf(), 0, 'd8.valueOf() must return 0'); // CHECK#9 var d9 = new Date(1.23e15); -if (d9.valueOf() !== 1.23e15) { - throw new Test262Error('#9: var d9 = new Date(1.23e15); d9.valueOf() === 1.23e15;'); -} +assert.sameValue(d9.valueOf(), 1.23e15, 'd9.valueOf() must return 1.23e15'); // CHECK#10 var d10 = new Date(-1.23e15); -if (d10.valueOf() !== -1.23e15) { - throw new Test262Error('#10: var d10 = new Date(-1.23e15); d10.valueOf() === -1.23e15;'); -} +assert.sameValue(d10.valueOf(), -1.23e15, 'd10.valueOf() must return -1.23e15'); // CHECK#11 var d11 = new Date(1.23e-15); -if (d11.valueOf() !== 0) { - throw new Test262Error('#11: var d11 = new Date(1.23e-15); d11.valueOf() === 0;'); -} +assert.sameValue(d11.valueOf(), 0, 'd11.valueOf() must return 0'); // CHECK#12 var d12 = new Date(-1.23e-15); -if (d12.valueOf() !== -0) { - throw new Test262Error('#12: var d12 = new Date(-1.23e-15); d12.valueOf() === -0;'); -} +assert.sameValue(d12.valueOf(), -0, 'd12.valueOf() must return -0'); diff --git a/test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js b/test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js index d5e6c40099..8a5ee0c4af 100644 --- a/test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js +++ b/test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js @@ -14,24 +14,20 @@ description: > // CHECK#1 var d1 = new Date(Number.NaN); -assert.sameValue(d1.valueOf(), NaN, "NaN"); +assert.sameValue(d1.valueOf(), NaN, 'd1.valueOf() returns NaN'); // CHECK#2 var d2 = new Date(Infinity); -assert.sameValue(d2.valueOf(), NaN, "Infinity"); +assert.sameValue(d2.valueOf(), NaN, 'd2.valueOf() returns NaN'); // CHECK#3 var d3 = new Date(-Infinity); -assert.sameValue(d3.valueOf(), NaN, "-Infinity"); +assert.sameValue(d3.valueOf(), NaN, 'd3.valueOf() returns NaN'); // CHECK#4 var d4 = new Date(0); -if (d4.valueOf() !== 0) { - throw new Test262Error('#4: var d4 = new Date(0); d4.valueOf() === 0;'); -} +assert.sameValue(d4.valueOf(), 0, 'd4.valueOf() must return 0'); // CHECK#5 var d5 = new Date(-0); -if (d5.valueOf() !== -0) { - throw new Test262Error('#5: var d5 = new Date(-0); d5.valueOf() === -0;'); -} +assert.sameValue(d5.valueOf(), -0, 'd5.valueOf() must return -0');