mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
|
@ -0,0 +1,63 @@
|
|||
test("length is 2", () => {
|
||||
expect(Reflect.deleteProperty).toHaveLength(2);
|
||||
});
|
||||
|
||||
describe("errors", () => {
|
||||
test("target must be an object", () => {
|
||||
[null, undefined, "foo", 123, NaN, Infinity].forEach(value => {
|
||||
expect(() => {
|
||||
Reflect.deleteProperty(value);
|
||||
}).toThrowWithMessage(TypeError, `${value} is not an object`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("normal behavior", () => {
|
||||
test("deleting non-existent property", () => {
|
||||
expect(Reflect.deleteProperty({})).toBeTrue();
|
||||
expect(Reflect.deleteProperty({}, "foo")).toBeTrue();
|
||||
});
|
||||
|
||||
test("deleting existent property", () => {
|
||||
var o = { foo: 1 };
|
||||
expect(o.foo).toBe(1);
|
||||
expect(Reflect.deleteProperty(o, "foo")).toBeTrue();
|
||||
expect(o.foo).toBeUndefined();
|
||||
expect(Reflect.deleteProperty(o, "foo")).toBeTrue();
|
||||
expect(o.foo).toBeUndefined();
|
||||
});
|
||||
|
||||
test("deleting existent, configurable, non-writable property", () => {
|
||||
var o = {};
|
||||
Object.defineProperty(o, "foo", { value: 1, configurable: true, writable: false });
|
||||
expect(Reflect.deleteProperty(o, "foo")).toBeTrue();
|
||||
expect(o.foo).toBeUndefined();
|
||||
});
|
||||
|
||||
test("deleting existent, non-configurable, writable property", () => {
|
||||
var o = {};
|
||||
Object.defineProperty(o, "foo", { value: 1, configurable: false, writable: true });
|
||||
expect(Reflect.deleteProperty(o, "foo")).toBeFalse();
|
||||
expect(o.foo).toBe(1);
|
||||
});
|
||||
|
||||
test("deleting existent, non-configurable, non-writable property", () => {
|
||||
var o = {};
|
||||
Object.defineProperty(o, "foo", { value: 1, configurable: false, writable: false });
|
||||
expect(Reflect.deleteProperty(o, "foo")).toBeFalse();
|
||||
expect(o.foo).toBe(1);
|
||||
});
|
||||
|
||||
test("deleting array index", () => {
|
||||
var a = [1, 2, 3];
|
||||
expect(a).toHaveLength(3);
|
||||
expect(a[0]).toBe(1);
|
||||
expect(a[1]).toBe(2);
|
||||
expect(a[2]).toBe(3);
|
||||
expect(Reflect.deleteProperty(a, 1)).toBeTrue();
|
||||
expect(a).toHaveLength(3);
|
||||
expect(a[0]).toBe(1);
|
||||
expect(a[1]).toBeUndefined();
|
||||
expect(a[2]).toBe(3);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue