promise.js
function ToLength ( argument ) {
    var len = ToInteger(argument);
    return len <= 0 ? 0 : Math.min(len, Math.pow(2, 53) - 1);
  }
function ToLength ( argument ) {
    var len = ToInteger(argument);
    return len <= 0 ? 0 : Math.min(len, Math.pow(2, 53) - 1);
  }
7.1.15 ToLength