docs: static Object js_parseInt(Object[] args) {
          String s = ScriptRuntime.toString(args, 0);
          int radix = ScriptRuntime.toInt32(args, 1);
  
          int len = s.length();
          if (len == 0)
              return ScriptRuntime.NaNobj;
  
          boolean negative = false;
          int start = 0;
          char c;
          do {
              c = s.charAt(start);
              if (!ScriptRuntime.isStrWhiteSpaceChar(c))
                  break;
              start++;
          } while (start < len);
  
          if (c == '+' || (negative = (c == '-')))
              start++;
  
          final int NO_RADIX = -1;
          if (radix == 0) {
              radix = NO_RADIX;
          } else if (radix < 2 || radix > 36) {
              return ScriptRuntime.NaNobj;
          } else if (radix == 16 && len - start > 1 && s.charAt(start) == '0') {
              c = s.charAt(start+1);
              if (c == 'x' || c == 'X')
                  start += 2;
          }
  
          if (radix == NO_RADIX) {
              radix = 10;
              if (len - start > 1 && s.charAt(start) == '0') {
                  c = s.charAt(start+1);
                  if (c == 'x' || c == 'X') {
                      radix = 16;
                      start += 2;
                  } else if ('0' <= c && c <= '9') {
                      radix = 8;
                      start++;
                  }
              }
          }
  
          double d = ScriptRuntime.stringPrefixToNumber(s, start, radix);
          return ScriptRuntime.wrapNumber(negative ? -d : d);
      }