MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / eval_function

Method eval_function

aiscript-vm/src/vm/mod.rs:147–163  ·  view source on GitHub ↗
(
        &mut self,
        chunk_id: ChunkId,
        params: &[serde_json::Value],
    )

Source from the content-addressed store, hash-verified

145 }
146
147 pub fn eval_function(
148 &mut self,
149 chunk_id: ChunkId,
150 params: &[serde_json::Value],
151 ) -> Result<ReturnValue, VmError> {
152 self.arena.mutate_root(|_mc, state| {
153 let ctx = state.get_context();
154 let return_value = state.eval_function_with_id(
155 chunk_id,
156 &params
157 .iter()
158 .map(|v| Value::from_serde_value(ctx, v))
159 .collect::<Vec<_>>(),
160 )?;
161 Ok(ReturnValue::from(return_value))
162 })
163 }
164
165 pub fn interpret(&mut self) -> Result<ReturnValue, VmError> {
166 loop {

Callers 3

mapFunction · 0.45
filterFunction · 0.45
pollMethod · 0.45

Calls 3

mutate_rootMethod · 0.80
get_contextMethod · 0.80
eval_function_with_idMethod · 0.80

Tested by

no test coverage detected