copy all imported enumerable methods and properties
974488
function addMixins(mixins, target, inherits, isNOTExtendingNative) {
    for (var
      source,
      init = [],
      i = 0; i < mixins.length; i++
    ) {
      source = transformMixin(mixins[i]);
      if (hOP.call(source, INIT)) {
        init.push(source[INIT]);
      }
      copyOwn(source, target, inherits, false, false, isNOTExtendingNative);
    }
    return init;
  }
1231968
public final static void copyProperties(Object from, Object to) {

        Set<Field> fromSet = getAllFiled(from.getClass());
        Set<Field> toSet = getAllFiled(to.getClass());

        Map<String, Field> toMap = new HashMap<String, Field>();
        for (Field f : toSet) {
            toMap.put(f.getName(), f);
        }

        for (Field f : fromSet) {
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            String name = f.getName();
            Field toField = toMap.get(name);
            if (toField == null) {
                continue;
            }

            toField.setAccessible(true);
            f.setAccessible(true);
            try {
                toField.set(to, f.get(from));
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }

    }
378712
function getImports(moduleTree) {
      var imports = [];

      function addImport(name) {
        if (indexOf.call(imports, name) == -1)
          imports.push(name);
      }

      // tree traversal, NB should use visitor pattern here
      function traverse(object, iterator, parent, parentProperty) {
        var key, child;
        if (iterator(object, parent, parentProperty) === false)
          return;
        for (key in object) {
          if (!object.hasOwnProperty(key))
            continue;
          if (key == 'location' || key == 'type')
            continue;
          child = object[key];
          if (typeof child == 'object' && child !== null)
            traverse(child, iterator, object, key);
        }
      }

      traverse(moduleTree, function(node) {
        // import {} from 'foo';
        // export * from 'foo';
        // export { ... } from 'foo';
        // import * as x from 'foo';
        if (node.type == 'EXPORT_DECLARATION') {
          if (node.declaration.moduleSpecifier)
            addImport(node.declaration.moduleSpecifier.token.processedValue);
        }
        else if (node.type == 'IMPORT_DECLARATION')
          addImport(node.moduleSpecifier.token.processedValue);
        else if (node.type == 'MODULE_DECLARATION')
          addImport(node.expression.token.processedValue);
      });
      return imports;
    }
674636
function mixCopy(to, from)
{
  var keys = Object.keys(from)
    , i    = keys.length
    ;

  while (i-- > 0)
  {
    to[keys[i]] = from[keys[i]];
  }

  return to;
}
1164125
function copyOwnProperties(dst, src) {
  for (var prop in src) {
    if (src.hasOwnProperty(prop)) {
      dst[prop] = src[prop];
    }
  }
}
12039
private static ImmutableList<ImportTree> getWildcardImports(List<? extends ImportTree> imports) {
    ImmutableList.Builder<ImportTree> result = ImmutableList.builder();
    for (ImportTree tree : imports) {
      // javac represents on-demand imports as a member select where the selected name is '*'.
      Tree ident = tree.getQualifiedIdentifier();
      if (!(ident instanceof MemberSelectTree)) {
        continue;
      }
      MemberSelectTree select = (MemberSelectTree) ident;
      if (select.getIdentifier().contentEquals("*")) {
        result.add(tree);
      }
    }
    return result.build();
  }
797482
function(z_real, w_copy, s_property) {

	// property is a function (ie: instance method)
	if('function' === typeof z_real[s_property]) {

		// implement same method name in virtual object
		w_copy[s_property] = function() {

			// forward to real class
			return z_real[s_property].apply(z_real, arguments);
		};
	}
	// read/write property
	else {

		// try to override object property
		try {
			Object.defineProperty(w_copy, s_property, {

				// grant user full capability to modify this property
				configurable: true,

				// give enumerability setting same value as original
				enumerable: z_real.propertyIsEnumerable(s_property),

				// fetch property from real object
				get: () => {
					return z_real[s_property];
				},

				// set property on real object
				set: (z_value) => {
					z_real[s_property] = z_value;
				},
			});
		}
		// cannot redefine property
		catch(d_redef_err) {

			// try again, this time only set the value and enumerability
			try {
				Object.defineProperty(w_copy, s_property, {

					// give enumerability setting same value as original
					enumerable: z_real.propertyIsEnumerable(s_property),

					// mask w undef
					value: undefined,
				});

				// was not exepecting this property to give us trouble
				if(!A_TROUBLE_PROPERTIES.includes(s_property)) {
					console.warn('was not expecting "'+s_property+'" to prohibit redefinition on '+arginfo(w_copy));
				}
			}
			// cannot even do that?!
			catch(d_enum_err) {

				// last try, this time only set the value
				try {
					Object.defineProperty(w_copy, s_property, {

						// mask w undef
						value: undefined,
					});

					// was not exepecting this property to give us trouble
					if(!A_TROUBLE_PROPERTIES.includes(s_property)) {
						console.warn('was not expecting "'+s_property+'" to prohibit redefinition on '+arginfo(w_copy));
					}
				}
				// fail
				catch(d_value_err) {
					throw 'cannot override property "'+s_property+'" on '+arginfo(w_copy);
				}
			}
		}
	}
}
473729
public static void copyFromTo(Object from, Object to, String fieldName) {

        if (from == null || to == null) {
            log.info("object deep copy : from or to is null ");
            return;
        }

        try {
            Method getter = getGetterMethod(from.getClass(), fieldName);

            if (getter == null) {
                //log.info("getter method not found : " + fieldName);
                return;
            }

            Method setter = getSetterMethod(to.getClass(), fieldName, getter.getReturnType());
            if (setter == null) {
                //log.info("setter method not found : " + fieldName);
                return;
            }

            setter.invoke(to, getter.invoke(from, EMPTY_CLASS));

        } catch (IllegalAccessException | InvocationTargetException e) {
            log.info("set method invoke error : " + fieldName);
        }
    }
432906
function getESModule(exports) {
  var esModule = {};
  // don't trigger getters/setters in environments that support them
  if ((typeof exports == 'object' || typeof exports == 'function') && exports !== __global) {
      if (getOwnPropertyDescriptor) {
        for (var p in exports) {
          // The default property is copied to esModule later on
          if (p === 'default')
            continue;
          defineOrCopyProperty(esModule, exports, p);
        }
      }
      else {
        extend(esModule, exports);
      }
  }
  esModule['default'] = exports;
  defineProperty(esModule, '__useDefault', {
    value: true
  });
  return esModule;
}
854260
function copyProperty(inName, inSource, inTarget) {
    var pd = getPropertyDescriptor(inSource, inName);
    Object.defineProperty(inTarget, inName, pd);
  }
761246
function (original) {
                var clone = {};
                var i, keys = Object.keys(original);

                for (i = 0; i < keys.length; i++) {
                    // copy each property into the clone
                    clone[keys[i]] = original[keys[i]];
                }

                return clone;
            }
1371229
static ImmutableSet<ExecutableElement> propertyMethodsIn(Set<ExecutableElement> abstractMethods) {
    ImmutableSet.Builder<ExecutableElement> properties = ImmutableSet.builder();
    for (ExecutableElement method : abstractMethods) {
      if (method.getParameters().isEmpty()
          && method.getReturnType().getKind() != TypeKind.VOID
          && objectMethodToOverride(method) == ObjectMethod.NONE) {
        properties.add(method);
      }
    }
    return properties.build();
  }
1069755
function() {
        var obj = arguments[0], args = Array.prototype.slice.call(arguments, 1);

        function copy(destination, source) {
            for (var property in source) {
                if (source[property] && source[property].constructor &&
                    source[property].constructor === Object) {
                    destination[property] = destination[property] || {};
                    copy(destination[property], source[property]);
                } else {
                    destination[property] = source[property];
                }
            }
            return destination;
        }

        for(var i in args) {
            copy(obj, args[i]);
        }

        return obj;
    }
265475
private void generateCopyingPart(WrappingHint.Builder builder) {
        ImmutableCollection<CopyMethod> copyMethods = ImmutableMultimap.<String, CopyMethod>builder()
                .putAll(configuration.FIELD_TYPE_TO_COPY_METHODS)
                .putAll(userDefinedCopyMethods)
                .build()
                .get(typeAssignedToField);
        
        if (copyMethods.isEmpty()) {
            throw new WrappingHintGenerationException();
        }
        
        CopyMethod firstSuitable = copyMethods.iterator().next();
        builder.setCopyMethodOwnerName(firstSuitable.owner.toString())
                .setCopyMethodName(firstSuitable.name);
        
        if (firstSuitable.isGeneric && typeSignature != null) {
            CollectionField withRemovedWildcards = CollectionField.from(typeAssignedToField, typeSignature)
                    .transformGenericTree(GenericType::withoutWildcard);
            builder.setCopyTypeParameterName(formatTypeParameter(withRemovedWildcards.asSimpleString()));
        }
    }
865008
function setEnumerable(ctx, props, state) {
    if (state === void 0) { state = false; }
    props = chek_1.split(props);
    var obj = {};
    props.forEach(function (p) {
        obj[p] = {
            writable: true,
            enumerable: false
        };
    });
    Object.defineProperties(ctx, obj);
}
246965
function mixin(source) {
  var keys = [];
  if (arguments.length > 1) {
    for (var i = 1, len = arguments.length; i < len; i++) {
      var key = arguments[i];
      if (!source.hasOwnProperty(key)) {
        throw new Error(util.format('Property not found: %s', key));
      }
      keys.push(key);
    }
  } else {
    keys = Object.keys(source);
  }
  // Copy.
  for (var i = 0, len = keys.length; i < len; i++) {
    key = keys[i];
    defineProp(this, key, descriptor(source, key));
  }
  return this;
}
815060
private TransientItemData copyPropertyData(PropertyData prop) throws RepositoryException
   {

      if (prop == null)
         return null;

      // make a copy, value may be null for deleting items
      TransientPropertyData newData =
         new TransientPropertyData(prop.getQPath(), prop.getIdentifier(), prop.getPersistedVersion(), prop.getType(),
            prop.getParentIdentifier(), prop.isMultiValued(), prop.getValues());

      return newData;
   }