modules/utils.js
function computeModifier(modifierString, modifiers) {
    "use strict";
    var modifier = 0,
        checkKey = function(key) {
            if (key in modifiers) return;
            throw new CasperError(format('%s is not a supported key modifier', key));
        };
    if (!modifierString) return modifier;
    var keys = modifierString.split('+');
    keys.forEach(checkKey);
    return keys.reduce(function(acc, key) {
        return acc | modifiers[key];
    }, modifier);
}
function computeModifier(modifierString, modifiers) {
    "use strict";
    var modifier = 0,
        checkKey = function(key) {
            if (key in modifiers) return;
            throw new CasperError(format('%s is not a supported key modifier', key));
        };
    if (!modifierString) return modifier;
    var keys = modifierString.split('+');
    keys.forEach(checkKey);
    return keys.reduce(function(acc, key) {
        return acc | modifiers[key];
    }, modifier);
}
function computeModifier ( modifierString , modifiers ) { "use strict" ; var modifier = 0 , checkKey = function ( key ) { if ( key in modifiers ) return ; throw new CasperError ( format ( '%s is not a supported key modifier' , key ) ) ; } ; if ( ! modifierString ) return modifier ; var keys = modifierString . split ( '+' ) ; keys . forEach ( checkKey ) ; return keys . reduce ( function ( acc , key ) { return acc | modifiers [ key ] ; } , modifier ) ; }
Computes a modifier string to its PhantomJS equivalent. A modifier string is
in the form "ctrl+alt+shift".

@param  String  modifierString  Modifier string, eg. "ctrl+alt+shift"
@param  Object  modifiers       Modifiers definitions
@return Number
Computes a modifier string to its PhantomJS equivalent . A modifier string is in the form ctrl + alt + shift .