Refactor #4237: create functions done

add attr function to JSB