LibJS: Uncomment Object.{freeze,seal}() tests that now pass :^)

This commit is contained in:
Linus Groh 2021-07-11 21:58:14 +01:00
parent dfb7e716f7
commit 1856400547
Notes: sideshowbarker 2024-07-18 09:15:24 +09:00
2 changed files with 4 additions and 6 deletions

View File

@ -29,9 +29,8 @@ describe("normal behavior", () => {
test("prevents changing attributes of existing properties", () => {
const o = { foo: "bar" };
Object.freeze(o);
// FIXME: These don't change anything and should not throw!
// expect(Object.defineProperty(o, "foo", {})).toBe(o);
// expect(Object.defineProperty(o, "foo", { configurable: false })).toBe(o);
expect(Object.defineProperty(o, "foo", {})).toBe(o);
expect(Object.defineProperty(o, "foo", { configurable: false })).toBe(o);
expect(() => {
Object.defineProperty(o, "foo", { configurable: true });
}).toThrowWithMessage(TypeError, "Object's [[DefineOwnProperty]] method returned false");

View File

@ -29,9 +29,8 @@ describe("normal behavior", () => {
test("prevents changing attributes of existing properties", () => {
const o = { foo: "bar" };
Object.seal(o);
// FIXME: These don't change anything and should not throw!
// expect(Object.defineProperty(o, "foo", {})).toBe(o);
// expect(Object.defineProperty(o, "foo", { configurable: false })).toBe(o);
expect(Object.defineProperty(o, "foo", {})).toBe(o);
expect(Object.defineProperty(o, "foo", { configurable: false })).toBe(o);
expect(() => {
Object.defineProperty(o, "foo", { configurable: true });
}).toThrowWithMessage(TypeError, "Object's [[DefineOwnProperty]] method returned false");