Return statement in cached function does not break, causing side-effects/wrong value to be returned
Return statements in cached functions are transformed to
utils.ThreadLocalPage.get().addRequestScopedVar("cachedfun1",val);
, and the cached value is returned at the end.
This causes an issue when a return statement is followed by other (return) statements, e.g.:cached function isProxied() : Bool { if(remoteAddress().contains(",")){ log("with comma"); return true; } log("without comma"); return false; }
will always return
Submitted by Elmer van Chastelet on 9 September 2025 at 21:35false
and always logs “without comma”.
Log in to post comments