Follow-up to fix for ticket #1166 (js fix)

(grafted from 8014848835e0c0630f3822a11da300a308b5ea5a)

--HG--
extra : source : 8014848835e0c0630f3822a11da300a308b5ea5a