(EDIT: dear @note I am sorry for pinging you again LOL)
@noteLua: Always returns a new handle unless the passed parameter is nil, in this case
it MAY return the same handle depending on unknown conditions (consecutive calls are likely to reuse previous handle).
Jass: Returns same handle when creating multiple filters for the same function:
Filter(function foo) == Filter(function foo) ("foo" can be non-constant and constant).
For this reason, do not destroy filterfuncs created with Filter in Jass,
in the best case it does nothing but in the worst case it would affect some internals.
This behavior is similar to Condition.
Lua: It's a surprise to me that the handling of handles is so inconsistent here. Maybe it's entirely related to GC but for unknown reasons it does not return the same handle when given a global function in Lua.
Test code:
https://github.com/Luashine/wc3-test-maps/blob/3c52ea0994efa6f4f6e9c294ff616955f6a91686/Boolean-expression-API/README.md
In particular this paragraph rewritten:
(EDIT: dear
@note
I am sorry for pinging you again LOL)Lua: It's a surprise to me that the handling of handles is so inconsistent here. Maybe it's entirely related to GC but for unknown reasons it does not return the same handle when given a global function in Lua.