OSDN Git Service

Version 0.6.41, fix for Opera8 & NN7.2+.
[pettanr/clientJs.git] / 0.6.x / js / core / 00_builtin.js
index f2a5207..6d4b1a1 100644 (file)
@@ -12,7 +12,10 @@ Function.prototype.apply || (Function.prototype.apply = function (x, y) {
        if( x === window ){\r
                x.__apply = void 0;\r
        } else {\r
-               delete x.__apply ? x.__apply : x.constructor.prototype.__apply ;\r
+               if( x.constructor && x.constructor.prototype.__apply ){\r
+                       delete x.constructor.prototype.__apply;\r
+               } else\r
+               if( x.__apply ) delete x.__apply;\r
        };\r
        \r
        x.__apply = this;\r
@@ -33,15 +36,19 @@ Function.prototype.apply || (Function.prototype.apply = function (x, y) {
                        a = [];\r
                        for (i = 0; i < j; ++i)\r
                                a[i] = 'y[' + i + ']';\r
-                       r = eval('x.__apply(' + a.join(',') + ')');\r
+                       //r = eval('x.__apply(' + a.join(',') + ')');\r
+                       // closuer compiler 対策\r
+                       r = (new Function( 'x,y', 'return x.__apply(' + a.join(',') + ')' ))( x, y );\r
                        break;\r
        };\r
-       // delete x.__apply ? x.__apply : x.constructor.prototype.__apply ;\r
        // ie5\r
        if( x === window ){\r
                x.__apply = void 0;\r
        } else {\r
-               delete x.__apply ? x.__apply : x.constructor.prototype.__apply ;\r
+               if( x.constructor && x.constructor.prototype.__apply ){\r
+                       delete x.constructor.prototype.__apply;\r
+               } else\r
+               if( x.__apply ) delete x.__apply;\r
        };\r
        return r;\r
 });\r
@@ -148,6 +155,7 @@ window.encodeURIComponent || (window.encodeURIComponent = function (x) {
        });\r
 });\r
 \r
+// 手抜き\r
 window.decodeURI || (window.decodeURI = function (x) {\r
        return ("" + x).replace(/%(E(0%[AB]|[1-CEF]%[89AB]|D%[89])[0-9A-F]|C[2-9A-F]|D[0-9A-F])%[89AB][0-9A-F]|%[0-7][0-9A-F]/ig, function (s) {\r
                var c = parseInt(s.substring(1), 16);\r
@@ -160,8 +168,8 @@ window.decodeURI || (window.decodeURI = function (x) {
 });\r
 */\r
 \r
-// 手抜き\r
-window.decodeURIComponent || (window.decodeURIComponent = window.decodeURI);\r
+\r
+//window.decodeURIComponent || (window.decodeURIComponent = window.decodeURI);\r
 \r
 \r
 /*\r
@@ -169,6 +177,7 @@ window.decodeURIComponent || (window.decodeURIComponent = window.decodeURI);
  */\r
 \r
 // replace(RegExp, Function)対応\r
+/*\r
 if (window.ActiveXObject ? !Number.prototype.toFixed : (!navigator.taintEnabled && !document.createElement("input").setSelectionRange))\r
        (function () {\r
                var g = String.prototype.replace;\r
@@ -204,4 +213,6 @@ if (window.ActiveXObject ? !Number.prototype.toFixed : (!navigator.taintEnabled
                        }\r
                        return g.call(s, x, z);\r
                };\r
-       })();
\ No newline at end of file
+       })(); */\r
+       \r
+\r