summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Tests/builtins/Object/Object.isExtensible.js
blob: b426114f2011a066db0c0b20273133a7db491f79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
test("basic functionality", () => {
    expect(Object.isExtensible).toHaveLength(1);

    expect(Object.isExtensible()).toBeFalse();
    expect(Object.isExtensible(undefined)).toBeFalse();
    expect(Object.isExtensible(null)).toBeFalse();
    expect(Object.isExtensible(true)).toBeFalse();
    expect(Object.isExtensible(6)).toBeFalse();
    expect(Object.isExtensible("test")).toBeFalse();

    let s = Symbol();
    expect(Object.isExtensible(s)).toBeFalse();

    let o = { foo: "foo" };
    expect(Object.isExtensible(o)).toBeTrue();
    Object.preventExtensions(o);
    expect(Object.isExtensible(o)).toBeFalse();
});