Corresponding lowering creating wrappers from JS Backend was used.
Also, the lowering was changed to create local function, instead of
normal one in outer scope, as a lot of logic from local declarations
lowering should be duplicated otherwise for correct type parameters
handling.
^KT-38535