Fixed the evaluation of JS scripts

Refs https://github.com/Behat/Mink/pull/465