What happened
See below example
What you expected
It should match js behavior
Minimal reproduction
const values = new Array(4);
console.log("values.length", values.length);
console.log("values[1]", values[1]);
console.log("values[1] === undefined", values[1] === undefined);
console.log("1 in values", 1 in values);
console.log("Object.keys(values)", Object.keys(values));
const read = values[1];
console.log("read !== undefined", read !== undefined);
values[2] = undefined;
console.log("values[2]", values[2]);
console.log("values[2] === undefined", values[2] === undefined);
console.log("2 in values", 2 in values);
Command you ran:
Output:
values.length 4
values[1] 0
values[1] === undefined false
1 in values false
Object.keys(values) []
read !== undefined true
values[2] undefined
values[2] === undefined true
2 in values false
Expected:
values.length 4
values[1] undefined
values[1] === undefined true
1 in values false
Object.keys(values) []
read !== undefined false
values[2] undefined
values[2] === undefined true
2 in values true
Environment
- Perry version: -/5/408
- Host OS: ArchLinux
- Target: native
- Rust toolchain (if building from source): rustc 1.95.0 (59807616e 2026-04-14)
- Installed via: from source
Diagnostic output
Perry Doctor
Environment Checks
──────────────────
✓ perry version: 0.5.408
✓ update status: up to date
✓ clang (LLVM codegen): clang version 22.1.3
✓ system linker (cc): cc (GCC) 15.2.1 20260209
✓ runtime library: /home/codehz/Projects/perry/target/release/libperry_runtime.a
⚠ project config (perry.toml): not found - run: perry init
All critical checks passed with some warnings.
Anything else
Also found in my ecs's demo
What happened
See below example
What you expected
It should match js behavior
Minimal reproduction
Command you ran:
perry test.ts && ./testOutput:
Expected:
Environment
Diagnostic output
Anything else
Also found in my ecs's demo