closed #2050: fix js glue code.