We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f992be8 commit 216d583Copy full SHA for 216d583
core/engine/src/builtins/array/mod.rs
@@ -1294,7 +1294,11 @@ impl Array {
1294
1295
// Small optimization for arrays using dense properties.
1296
// Mirrors the fast-path in `shift`.
1297
- if o.is_array() {
+ // Guard: only take the fast path when len > 0, because for empty
1298
+ // arrays (len == 0) there are no own indexed properties and `Set`
1299
+ // must traverse the prototype chain (which may have setters that
1300
+ // freeze the array or make `length` non-writable mid-operation).
1301
+ if o.is_array() && len > 0 {
1302
let mut o_borrow = o.borrow_mut();
1303
let props = &mut o_borrow.properties_mut().indexed_properties;
1304
0 commit comments