Skip to content

Instantly share code, notes, and snippets.

@func09
Created March 5, 2009 19:15
Show Gist options
  • Save func09/74499 to your computer and use it in GitHub Desktop.
Save func09/74499 to your computer and use it in GitHub Desktop.
class com.func09.utils.ObjectUtil {
/**
* MIX-INメソッド
* @param destination
* @param source
*/
public static function extend( destination:Object, source:Object ){
for( var prop:String in source )
destination[prop] = source[prop];
return destination;
}
/*
public static function clone( source:Object ):Object{
var result:Object = new Object();
for( var prop:String in source ){
switch( typeof( source[prop] ) ){
case 'array':
var i:Number = -1;
result[prop] = [];
while( ++i < source[prop] ){
result[prop].push( source[prop][i] );
}
break;
case 'object':
result[prop] = clone( source[prop] );
break;
default:
result[prop] = source[prop];
break;
}
}
}
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment