afw-org / afw

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

A return inside a switch doesn't return from a function block #50

Open JeremyGrieshop opened 1 year ago

JeremyGrieshop commented 1 year ago

The return true; here should return true from the function, f:

#!/usr/bin/env afw

function f(x) {

    switch (x) {
        case 1:
            return true;
    }

    return false;
}

assert(f(1) === true);
mike000000000 commented 1 year ago

Remove skip in /workspaces/afw/src/afw/tests/language/script/switch.as test: switch-return-fn when fixed.