⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 __ie5.js

📁 原名JSPackager
💻 JS
字号:
/**
 *JScript5.5 added property
 *apply method
 *call method
 *callee property
 *charCodeAt method
 *decodeURI method
 *decodeURIComponent
 *encodeURI method
 *encodeURI component
 *global property
 *hasOwnProperty method
 *ignoreCase property
 *isPrototypeOf method
 *lastMatch property
 *lastParen property
 *leftContext property
 *length property?Arguments?
 *localeCompare method
 *message property
 *multiline property
 *name property
 *pop method
 *propertyIsEnumeramble property
 *push method
 *rightContext property
 *shift method
 *splice method
 *toDateString method
 *toExponential method
 *toFixed method
 *toLocaleDateString method
 *toLocaleLowercase method
 *toLocaleTimeString method
 *toLocaleUppercase method
 *toPrecision method
 *toTimeString method
 *undefined property
 *unshift method
 *
 */
$JSI.globalContext.undefined = $JSI.globalContext.undefined;

/**
 * jscript5.5,javascript1.3
 * @param thisArg
 * @param args
 * @return function with no arguments
 */
Function.prototype.apply = function(thisArg,args) {
  var argsStr = "";
  if(args&&args.length>0){
    argsStr+="args[0]";
    for(var i=1;i<args.length;i++){
      argsStr+=",args["+i+"]";
    }
  }
  if(thisArg == null || thisArg == window){
    return eval("this("+argsStr+")");
  }
  if(!(thisArg instanceof Object)) {
    thisArg = new Object(thisArg); 
  }
  for(var prop in thisArg){
    if(thisArg[prop] == this){
      return eval("thisArg[prop]("+argsStr+")");
    }
  }
  try{
    thisArg.___$tm = this;
    return eval("thisArg.___$tm("+argsStr+")");
  }finally{
    delete thisArg.___$tm;
  }
}
/**
 * jscript5.5,javascript1.3
 * @arguments [thisArg,arg1...]
 * @return function with no arguments
 */
Function.prototype.call = function () {
  arguments.shift = Array.prototype.shift;
  return this.apply(arguments.shift(),arguments);
}
/**
 * jscript5.5 
 * JavaScript 1.2, NES 3.0
 * JavaScript 1.3: returns a Unicode value rather than an ISO-Latin-1 value.   
 * @param index
 * @return Unicode value as int
 */
String.prototype.charCodeAt = function(index){
  var c = this.charAt(index);
  c = escape(c);
  if(c.length >3){
    c = c.substr(2);
  }else{
    c = c.substr(1);
  }
  return parseInt(c,16);
}
/**
 * jscript5.5 
 * JavaScript 1.2, NES 3.0
 * JavaScript 1.3: returns a Unicode value rather than an ISO-Latin-1 value.   
 * @arguments index Unicode values as int
 */
String.fromCharCode = String.prototype.fromCharCode  = function(){
  var str = "";
  for(var i = 0;i<arguments.length;i++){
    var c = arguments[i];
    if(c<=0xF){
      str += "%0"+c.toString(16);
    }else if(c<=0xFF){
      str += "%"+c.toString(16);
    }else if(c<=0xFFF){
      str += "%u0"+c.toString(16);
    }else{
      str += "%u"+c.toString(16);
    }
  }
  return unescape(str);
}
Array.prototype.shift = function() {
  var result = this[0];
  var i = 0; 
  var nl = this.length-1;
  while(i < nl){
    this[i++] = this[i];
  }
  this.length = nl;
  return result;
}

Array.prototype.unshift = function(){
  var i = this.length-1;
  this.length += arguments.length;
  for (var j=this.length-1; i >=0; i--,j--){
    this[j] = this[i];
  }
  for(var i = 0; i < arguments.length ; i++){
    this[i] = arguments[i];
  }
  return this;
}

Array.prototype.pop = function(){
  var rtv = this[this.length-1];
  this.length -- ;
  return rtv;
}
Array.prototype.push = function(){
  var i = 0;
  while(i < arguments.length){
    this[this.length] = arguments[i++];
  }
  return this.length;
}
Array.prototype.splice = function(start,deleteCount){
  deleteCount = Math.max(deleteCount,0);
  var insert = Math.min(arguments.length - 2,0);
  var end = start+deleteCount;
  var rtv = this.slice(start,end);
  if(deleteCount>insert){
    end = start+insert;
    for (var i = start; i < this.length - 1; i++){
      this[i] = this[i+insert];
    }
    this.length += insert-deleteCount;
  }else if(deleteCount<insert){
    end = start+insert;
    var i = this.length-1;
    this.length += insert-deleteCount;
    for (var j=this.length-1; i >0; i--,j--){
      this[j] = this[i];
    }
  }
  for(var i = 0,j=start;j<end;i++,j++){
    this[j] = arguments[i]
  }
  return rtv;;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -