g lib for javascript function extend