afw-org / afw

Adaptive Framework
https://afw.tools
MIT License
4 stars 2 forks source link

Passing a function as a parameter from an array seems to generate an error #89

Open JeremyGrieshop opened 5 months ago

JeremyGrieshop commented 5 months ago

As discussed, I'm adding a test that fails to demonstrate the evaluation error (set to skip for now).

#!/usr/bin/env afw

function foo() {
    return "foo";
}

function bar(f) {
    return f();
}

let a = [
    foo
];

// fixme this throws 'afw_value_convert() value required > 20 evaluations'
return bar(a[0]);

See src/afw/tests/language/script/function.as