Add has_context to plugin functions.

This commit is contained in:
Stephen Chung
2022-12-03 17:03:15 +08:00
parent 249180b1e0
commit 4998eb6139
9 changed files with 98 additions and 48 deletions

View File

@@ -142,7 +142,8 @@ impl CallableFunction {
pub fn has_context(&self) -> bool {
match self {
Self::Pure(.., ctx) | Self::Method(.., ctx) => *ctx,
Self::Plugin(..) | Self::Iterator(..) => false,
Self::Plugin(f) => f.has_context(),
Self::Iterator(..) => false,
#[cfg(not(feature = "no_function"))]
Self::Script(..) => false,
}