BRANCH 4.2-DEV: fix for instance functions in javascript