assertThrows(() => ordinaryToPrimitive(obj));
});
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new ordinaryToPrimitive(""));
+ });
+
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(
assertStrictEquals(sameValue(false, new Boolean(false)), false);
});
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new sameValue(true, true));
+ });
+
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(sameValue.name, "sameValue");
);
});
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new sameValueZero(true, true));
+ });
+
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(sameValueZero.name, "sameValueZero");
},
},
);
- assertStrictEquals(toPrimitive(value, "default"), "success");
+ assertStrictEquals(toPrimitive(value), "success");
});
it("[[Call]] throws for an invalid hint", () => {
assertThrows(() => toPrimitive(true, "badhint"));
});
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new toPrimitive(true));
+ });
+
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(toPrimitive.name, "toPrimitive");
assertStrictEquals(type(class {}), "object");
});
+ it("[[Construct]] throws an error", () => {
+ assertThrows(() => new type({}));
+ });
+
describe(".name", () => {
it("[[Get]] returns the correct name", () => {
assertStrictEquals(type.name, "type");