src/driver/utils.js
function exposeThenNative(Browser, command) {
    var exposed = ['then', ucfirst(command)].join('');

    Browser.prototype[exposed] = function () {
        var args = arguments;
        ensureDriverCommand.call(this, command, 'exposeThenNative');

        this.then(function (next) {
            args = wrapArguments.call(this, args, chainAndErrorCallback, next);
            this._driver[command].apply(this._driver, args);
        });

        return this;
    };
}
function exposeThenNative(Browser, command) {
    var exposed = ['then', ucfirst(command)].join('');

    Browser.prototype[exposed] = function () {
        var args = arguments;
        ensureDriverCommand.call(this, command, 'exposeThenNative');

        this.then(function (next) {
            args = wrapArguments.call(this, args, chainAndErrorCallback, next);
            this._driver[command].apply(this._driver, args);
        });

        return this;
    };
}
function exposeThenNative ( Browser , command ) { var exposed = [ 'then' , ucfirst ( command ) ] . join ( '' ) ; Browser . prototype [ exposed ] = function ( ) { var args = arguments ; ensureDriverCommand . call ( this , command , 'exposeThenNative' ) ; this . then ( function ( next ) { args = wrapArguments . call ( this , args , chainAndErrorCallback , next ) ; this . _driver [ command ] . apply ( this . _driver , args ) ; } ) ; return this ; } ; }
expose a native command to promise api. if a callback is given, next is not called automaticly.
expose a native command to promise api . if a callback is given next is not called automaticly .