mirror of https://github.com/tc39/test262.git
Temporal: Ensure PlainTime branding tests fail if needed.
This commit is contained in:
parent
7960d616cf
commit
2de2fe3084
|
@ -11,12 +11,12 @@ const round = Temporal.PlainTime.prototype.round;
|
|||
|
||||
assert.sameValue(typeof round, "function");
|
||||
|
||||
assert.throws(TypeError, () => round.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => round.call(null), "null");
|
||||
assert.throws(TypeError, () => round.call(true), "true");
|
||||
assert.throws(TypeError, () => round.call(""), "empty string");
|
||||
assert.throws(TypeError, () => round.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => round.call(1), "1");
|
||||
assert.throws(TypeError, () => round.call({}), "plain object");
|
||||
assert.throws(TypeError, () => round.call(Temporal.PlainTime), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => round.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype");
|
||||
assert.throws(TypeError, () => round.call(undefined, "hour"), "undefined");
|
||||
assert.throws(TypeError, () => round.call(null, "hour"), "null");
|
||||
assert.throws(TypeError, () => round.call(true, "hour"), "true");
|
||||
assert.throws(TypeError, () => round.call("", "hour"), "empty string");
|
||||
assert.throws(TypeError, () => round.call(Symbol(), "hour"), "symbol");
|
||||
assert.throws(TypeError, () => round.call(1, "hour"), "1");
|
||||
assert.throws(TypeError, () => round.call({}, "hour"), "plain object");
|
||||
assert.throws(TypeError, () => round.call(Temporal.PlainTime, "hour"), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => round.call(Temporal.PlainTime.prototype, "hour"), "Temporal.PlainTime.prototype");
|
||||
|
|
|
@ -11,12 +11,12 @@ const toZonedDateTime = Temporal.PlainTime.prototype.toZonedDateTime;
|
|||
|
||||
assert.sameValue(typeof toZonedDateTime, "function");
|
||||
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(null), "null");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(true), "true");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(""), "empty string");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(1), "1");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call({}), "plain object");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainTime), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(undefined, { plainDate: "2022-05-19", timeZone: "UTC" }), "undefined");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(null, { plainDate: "2022-05-19", timeZone: "UTC" }), "null");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(true, { plainDate: "2022-05-19", timeZone: "UTC" }), "true");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call("", { plainDate: "2022-05-19", timeZone: "UTC" }), "empty string");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Symbol(), { plainDate: "2022-05-19", timeZone: "UTC" }), "symbol");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(1, { plainDate: "2022-05-19", timeZone: "UTC" }), "1");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call({}, { plainDate: "2022-05-19", timeZone: "UTC" }), "plain object");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainTime, { plainDate: "2022-05-19", timeZone: "UTC" }), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => toZonedDateTime.call(Temporal.PlainTime.prototype, { plainDate: "2022-05-19", timeZone: "UTC" }), "Temporal.PlainTime.prototype");
|
||||
|
|
|
@ -11,12 +11,12 @@ const with_ = Temporal.PlainTime.prototype.with;
|
|||
|
||||
assert.sameValue(typeof with_, "function");
|
||||
|
||||
assert.throws(TypeError, () => with_.call(undefined), "undefined");
|
||||
assert.throws(TypeError, () => with_.call(null), "null");
|
||||
assert.throws(TypeError, () => with_.call(true), "true");
|
||||
assert.throws(TypeError, () => with_.call(""), "empty string");
|
||||
assert.throws(TypeError, () => with_.call(Symbol()), "symbol");
|
||||
assert.throws(TypeError, () => with_.call(1), "1");
|
||||
assert.throws(TypeError, () => with_.call({}), "plain object");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainTime), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype");
|
||||
assert.throws(TypeError, () => with_.call(undefined, { hour: 7 }), "undefined");
|
||||
assert.throws(TypeError, () => with_.call(null, { hour: 7 }), "null");
|
||||
assert.throws(TypeError, () => with_.call(true, { hour: 7 }), "true");
|
||||
assert.throws(TypeError, () => with_.call("", { hour: 7 }), "empty string");
|
||||
assert.throws(TypeError, () => with_.call(Symbol(), { hour: 7 }), "symbol");
|
||||
assert.throws(TypeError, () => with_.call(1, { hour: 7 }), "1");
|
||||
assert.throws(TypeError, () => with_.call({}, { hour: 7 }), "plain object");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainTime, { hour: 7 }), "Temporal.PlainTime");
|
||||
assert.throws(TypeError, () => with_.call(Temporal.PlainTime.prototype, { hour: 7 }), "Temporal.PlainTime.prototype");
|
||||
|
|
Loading…
Reference in New Issue