fix(hooks): registered handers couldn't be concatenated in javascript version

Fixes #6531