when.js on Mozilla Rhino example