Ticket #4589: 4589_2.patch

File 4589_2.patch, 784 bytes (added by Garry Yao, 14 years ago)
  • _source/core/tools.js

     
    6363                {
    6464                        var clone;
    6565
    66                         // Array.
    67                         if ( obj && ( obj instanceof Array ) )
    68                         {
    69                                 clone = [];
    7066
    71                                 for ( var i = 0 ; i < obj.length ; i++ )
    72                                         clone[ i ] = this.clone( obj[ i ] );
    73 
    74                                 return clone;
    75                         }
    76 
    7767                        // "Static" types.
    7868                        if ( obj === null
    7969                                || ( typeof( obj ) != 'object' )
    8070                                || ( obj instanceof String )
    8171                                || ( obj instanceof Number )
    8272                                || ( obj instanceof Boolean )
    83                                 || ( obj instanceof Date ) )
     73                                || ( obj instanceof Date )
     74                                || ( obj instanceof RegExp ) )
    8475                        {
    8576                                return obj;
    8677                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy