Fix bug with plugin method call detection.

This commit is contained in:
Stephen Chung 2020-08-19 12:50:23 +08:00
parent d024f912e0
commit c55b0d7883

View File

@ -261,7 +261,9 @@ impl CallableFunction {
pub fn is_pure(&self) -> bool {
match self {
Self::Pure(_) => true,
Self::Method(_) | Self::Iterator(_) | Self::Plugin(_) => false,
Self::Method(_) | Self::Iterator(_) => false,
Self::Plugin(p) => !p.is_method_call(),
#[cfg(not(feature = "no_function"))]
Self::Script(_) => false,
@ -271,7 +273,9 @@ impl CallableFunction {
pub fn is_method(&self) -> bool {
match self {
Self::Method(_) => true,
Self::Pure(_) | Self::Iterator(_) | Self::Plugin(_) => false,
Self::Pure(_) | Self::Iterator(_) => false,
Self::Plugin(p) => p.is_method_call(),
#[cfg(not(feature = "no_function"))]
Self::Script(_) => false,