Fix #236 for JS