The effect of assignments in a simple command was clarified in POSIX.1-2016. The behavior of yash 2.43 meets the new requirements, but they allow different behaviors.
In yash 2.43, variables assigned in a simple command that calls a function remain after the function returns. This behavior is inconsistent with variables assigned in a simple command that executes an external command, which are only effective during the command. To make functions behave more like external commands, variables should not remain after functions return.
The effect of assignments in a simple command was clarified in POSIX.1-2016. The behavior of yash 2.43 meets the new requirements, but they allow different behaviors.
In yash 2.43, variables assigned in a simple command that calls a function remain after the function returns. This behavior is inconsistent with variables assigned in a simple command that executes an external command, which are only effective during the command. To make functions behave more like external commands, variables should not remain after functions return.
Comparison of shell behaviors: