Check whether a variable at the given offset is a catch frame's parameter declaration within the given parent frame.
(
name: &str,
offset: u32,
parent: &crate::scope_collector::Frame,
frames: &[crate::scope_collector::Frame],
)
| 450 | /// Check whether a variable at the given offset is a catch frame's |
| 451 | /// parameter declaration within the given parent frame. |
| 452 | fn is_catch_frame_parameter( |
| 453 | name: &str, |
| 454 | offset: u32, |
| 455 | parent: &crate::scope_collector::Frame, |
| 456 | frames: &[crate::scope_collector::Frame], |
| 457 | ) -> bool { |
| 458 | frames.iter().any(|f| { |
| 459 | f.kind == FrameKind::Catch |
| 460 | && f.start > parent.start |
| 461 | && f.end < parent.end |
| 462 | && f.parameters.iter().any(|p| p.as_str() == name) |
| 463 | && offset < f.start |
| 464 | }) |
| 465 | } |
| 466 | |
| 467 | /// Check whether `offset` falls inside any nested frame (closure, |
| 468 | /// arrow function, or catch) within the given parent frame. |
no test coverage detected