diff --git a/packages/entity/src/behavior-components/expression/invocation.jsx b/packages/entity/src/behavior-components/expression/invocation.jsx index 330a9a2..b1e1a26 100644 --- a/packages/entity/src/behavior-components/expression/invocation.jsx +++ b/packages/entity/src/behavior-components/expression/invocation.jsx @@ -60,9 +60,16 @@ const Invocation = ({ /> ); } - const j = description.vararg ? Math.min(description?.args?.length - 1, i) : i; - const options = description?.args?.[j].options; - const type = description?.args?.[j].type || 'undefined'; + let darg; + if ('function' === typeof description?.args) { + darg = description?.args(i); + } + else { + const j = description.vararg ? i % description?.args?.length : i; + darg = description?.args?.[j]; + } + const {options} = darg; + const type = darg.type || 'undefined'; return ( );