OSDN Git Service

Version 0.6.169, add doc comment.
[pettanr/clientJs.git] / 0.6.x / js / 02_dom / 07_XNodeList.js
index fccfdb9..be45a3b 100644 (file)
@@ -10,13 +10,11 @@ function X_NodeList( v ){
        };\r
 \r
        if( ( l = args.length ) === 1 ) return new Node( args[ 0 ] );\r
-       if( !this || this.append !== X_NodeList.prototype.append ) return new X_NodeList( args );\r
+       if( !this || this[ 'append' ] !== X_NodeList.prototype[ 'append' ] ) return new X_NodeList( args );\r
        \r
        for( i = 0; i < l; ++i ){\r
                xnode = args[ i ];\r
-               //xnode = xnode && xnode.constructor === Node ? xnode : new Node( xnode );\r
                skip  = false;\r
-               //if( xnode._xnodeType === 0 ) continue;\r
                for( j = 0; j < n; ++j ){\r
                        if( this[ j ] === xnode ){\r
                                skip = true;\r
@@ -25,18 +23,18 @@ function X_NodeList( v ){
                };\r
                if( !skip ){\r
                        this[ n ] = xnode;\r
-                       n = ++this.length;      \r
+                       n = ++this.length;\r
                };\r
        };\r
 };\r
 X_NodeList.prototype.length = 0;\r
 \r
-X_NodeList.prototype.each = function( func /* opt_args... */ ){\r
+X_NodeList.prototype[ 'each' ] = function( func /* opt_args... */ ){\r
        var l = this.length,\r
                i = 0, args;\r
 \r
        if( 1 < arguments.length ){\r
-               args = X_Object_cloneArray( arguments );\r
+               args = X_Array_copy( arguments );\r
                for( ; i < l; ++i ){\r
                        args[ 0 ] = i;\r
                        if( func.apply( this[ i ], args ) === false ) break;\r