static fromString(str, opt_radix) {
    if (str.charAt(0) == '-') {
      return Long.fromString(str.substring(1), opt_radix).negate();
    }

    // We can avoid very expensive multiply based code path for some common
    // cases.
    var numberValue = parseInt(str, opt_radix || 10);
    if (numberValue <= MAX_SAFE_INTEGER_) {
      return new Long(
          (numberValue % TWO_PWR_32_DBL_) | 0,
          (numberValue / TWO_PWR_32_DBL_) | 0);
    }

    if (str.length == 0) {
      throw new Error('number format error: empty string');
    }
    if (str.indexOf('-') >= 0) {
      throw new Error('number format error: interior "-" character: ' + str);
    }

    var radix = opt_radix || 10;
    if (radix < 2 || 36 < radix) {
      throw new Error('radix out of range: ' + radix);
    }

    // Do several (8) digits each time through the loop, so as to
    // minimize the calls to the very expensive emulated multiply.
    var radixToPower = Long.fromNumber(Math.pow(radix, 8));

    var result = Long.getZero();
    for (var i = 0; i < str.length; i += 8) {
      var size = Math.min(8, str.length - i);
      var value = parseInt(str.substring(i, i + size), radix);
      if (size < 8) {
        var power = Long.fromNumber(Math.pow(radix, size));
        result = result.multiply(power).add(Long.fromNumber(value));
      } else {
        result = result.multiply(radixToPower);
        result = result.add(Long.fromNumber(value));
      }
    }
    return result;
  }
Returns a Long representation of the given string, written using the given
radix.
@param {string} str The textual representation of the Long.
@param {number=} opt_radix The radix in which the text is written.
@return {!Long} The corresponding Long value.