diff --git a/crates/sim/src/script/host/registry.rs b/crates/sim/src/script/host/registry.rs index 4e883c5..72825bb 100644 --- a/crates/sim/src/script/host/registry.rs +++ b/crates/sim/src/script/host/registry.rs @@ -17,7 +17,10 @@ impl Default for NativeRegistry { } let defined = match &args[0] { Value::Undefined => false, - Value::Object(id) => world.resource::().live(id), + Value::Object(id) => { + let runtime = world.resource::(); + runtime.live(id) && !runtime.pending_deletes.contains(id) + } _ => true, }; Ok(Value::Int(i32::from(defined)))