promise.js
function ToInteger ( argument ) {
    var number = +argument;
    if ( number !== number ) {
      return 0;
    }
    if ( number === 0 || number === Infinity || number === -Infinity ) {
      return number;
    }
    return ( number >= 0 ? 1 : -1 ) * Math.floor(Math.abs(number));
  }
function ToInteger ( argument ) {
    var number = +argument;
    if ( number !== number ) {
      return 0;
    }
    if ( number === 0 || number === Infinity || number === -Infinity ) {
      return number;
    }
    return ( number >= 0 ? 1 : -1 ) * Math.floor(Math.abs(number));
  }
7.1.4 ToInteger