OSDN Git Service

Version 0.6.68, fix X.Type.isArray().
authoritozyun <itozyun@user.sourceforge.jp>
Wed, 27 Aug 2014 14:00:17 +0000 (23:00 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Wed, 27 Aug 2014 14:00:17 +0000 (23:00 +0900)
0.6.x/js/00_core/00_X.js
0.6.x/js/00_core/00_builtin.js
0.6.x/js/00_core/02_XType.js
0.6.x/js/00_core/03_XCallback.js
0.6.x/js/00_core/06_XEventDispatcher.js
0.6.x/js/01_dom/12_XDomEvent.js

index 3be38c6..a382553 100644 (file)
@@ -1,6 +1,6 @@
 if( !window['console'] || ( window.parent && window.parent.log ) ) console = { log : function(a){\r
        var win, elm;\r
-       //alert(a)\r
+       //alert(a);\r
        if( window.parent ){\r
                elm = parent.document.all ? parent.document.all.log : parent.log || parent.document.getElementById( 'log' );\r
                elm && ( elm.innerHTML = a + '<br>' + elm.innerHTML );\r
index 2dcc943..d6c3d32 100644 (file)
@@ -45,6 +45,7 @@ Function.prototype.apply || (Function.prototype.apply = function (x, y) {
        if( x === window ){\r
                x.__apply = void 0;\r
        } else {\r
+               //alert( typeof x );\r
                if( x.constructor && x.constructor.prototype.__apply ){\r
                        delete x.constructor.prototype.__apply;\r
                } else\r
index ea135ce..43316dd 100644 (file)
@@ -13,9 +13,11 @@ X.Type = {
                return typeof v === 'function';\r
        },\r
        isArray :\r
-               ( X.UA.IE4 || X.UA.MacIE ) ? (function(v){ return v && typeof v.length === 'number';}) : // v && v.push === Array.prototype.push\r
-               X.UA.IE ? (function(v){ return Object.prototype.toString.call(v) === '[object Array]';}) :\r
-               (new Function('v', 'return v instanceof Array;')),\r
+               new Function( 'v',\r
+                       X.UA.IE < 5.5 ? 'return v && v.push === Array.prototype.push;' : // win ie5-, MacIE5.2\r
+                       X.UA.IE ? 'return v && Object.prototype.toString.call(v) === "[object Array]"' :\r
+                               'return v instanceof Array;'\r
+               ),\r
                \r
        isBoolean : function(v) {\r
                return typeof v === 'boolean'; // v === true || v === false;\r
index b40d878..b9cc825 100644 (file)
@@ -79,7 +79,7 @@ X.Callback = {
                        };\r
                } else\r
                if( X.Type.isFunction( arg2 ) ){\r
-                       console.log( 'X.Callback._classifyCallbackArgs : arg1 が ' + arg1 + 'です' );\r
+                       //console.log( 'X.Callback._classifyCallbackArgs : arg1 が ' + arg1 + 'です' ); ie4 で error\r
                        if( alt_context ){\r
                                obj  = { x : alt_context, f : arg2, k : X.Callback._THIS_FUNC };\r
                        } else {\r
index 8e66c07..7128f9b 100644 (file)
@@ -36,7 +36,7 @@ X.EventDispatcher =
                        \r
                        listen : function( type, arg1, arg2, arg3 ){\r
                                var list = this._listeners,\r
-                                       i, l, r, f;\r
+                                       i, r, f;\r
                                if( this._dispatching ){\r
                                        if( !this._reserves ) this._reserves = [];\r
                                        this._reserves[ this._reserves.length ] = [ type, arg1, arg2, arg3, X.EventDispatcher._once ];\r
@@ -44,8 +44,8 @@ X.EventDispatcher =
                                };\r
                                \r
                                if( X.Type.isArray( type ) ){\r
-                                       for( i = 0, l = type.length; i < l; ++i ){\r
-                                               this.listen( type[ i ], arg1, arg2, arg3 );\r
+                                       for( i = type.length; i; ){\r
+                                               this.listen( type[ --i ], arg1, arg2, arg3 );\r
                                        };\r
                                        return this;\r
                                };\r
index 3ded30f..35a2f70 100644 (file)
@@ -484,7 +484,7 @@ if( 6 <= X.UA.IE && X.inHead ){
 };\r
 // Re: onLoad doesn't work with Safari?\r
 // http://lists.apple.com/archives/web-dev/2003/Oct/msg00036.html\r
-if( X.UA.WebKit || ( X.UA.Safari && X.UA.Safari < 3 ) ){ // sniff\r
+if( X.UA.WebKit || X.UA.Safari < 3 ){ // sniff\r
        X.Timer.add( 10, function(){\r
                if( !X.Dom._init ) return X.Callback.UN_LISTEN;\r
                if( 'loaded|complete'.indexOf( document.readyState ) !== -1 ) return X.Dom._init();\r