javascript: fix elimination of conditions #1192