use crate::runner::ds::error::JErrorType;
use crate::runner::ds::value::JsValue;
use crate::runner::plugin::types::EvalContext;
pub trait PluginResolver {
fn has_binding(&self, name: &str) -> bool;
fn resolve(&self, name: &str, ctx: &mut EvalContext) -> Result<JsValue, JErrorType>;
fn call_method(
&self,
object_name: &str,
method_name: &str,
ctx: &mut EvalContext,
this: JsValue,
args: Vec<JsValue>,
) -> Option<Result<JsValue, JErrorType>>;
fn call_constructor(
&self,
_object_name: &str,
_ctx: &mut EvalContext,
_args: Vec<JsValue>,
) -> Option<Result<JsValue, JErrorType>> {
None
}
fn name(&self) -> &str;
}