mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
LibJS: Fix Object::delete_property() with numeric string property
- We have to check if the property name is a string before calling as_string() on it - We can't as_number() the same property name but have to use the parsed index number Fixes #3950.
This commit is contained in:
committed by
Andreas Kling
parent
8d96f428ef
commit
0bb66890c8
@@ -46,6 +46,9 @@ test("deleting array indices", () => {
|
||||
expect(a.hasOwnProperty(1)).toBeFalse();
|
||||
expect(a.hasOwnProperty(2)).toBeFalse();
|
||||
expect(Object.getOwnPropertyNames(a)).toHaveLength(1);
|
||||
|
||||
expect(delete a["42"]).toBeTrue();
|
||||
expect(Object.getOwnPropertyNames(a)).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("deleting non-configurable property", () => {
|
||||
|
||||
Reference in New Issue
Block a user