mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 23:53:20 +00:00
19 lines
438 B
JavaScript
19 lines
438 B
JavaScript
![]() |
test("Inline cache invalidated by deleting property from unique shape", () => {
|
||
|
// Create an object with an unique shape by adding a huge amount of properties.
|
||
|
let o = {};
|
||
|
for (let x = 0; x < 1000; ++x) {
|
||
|
o["prop" + x] = x;
|
||
|
}
|
||
|
|
||
|
function ic(o) {
|
||
|
return o.prop2;
|
||
|
}
|
||
|
|
||
|
let first = ic(o);
|
||
|
delete o.prop2;
|
||
|
let second = ic(o);
|
||
|
|
||
|
expect(first).toBe(2);
|
||
|
expect(second).toBeUndefined();
|
||
|
});
|