Fix builds.

This commit is contained in:
Stephen Chung 2023-02-21 18:03:21 +08:00
parent a8be9c4d64
commit c58b52f2cb

View File

@ -252,7 +252,10 @@ impl AST {
#[inline(always)]
#[must_use]
pub(crate) fn statements(&self) -> &[Stmt] {
self.body.statements()
self.body
.as_deref()
.map(StmtBlock::statements)
.unwrap_or_default()
}
/// _(internals)_ Get the statements.
/// Exported under the `internals` feature only.