Build defaultProps and propType objects by walking component prototype chain
192129
function createPropsPrototypeAndTypes(componentClass) {
  const parent = componentClass.prototype;
  if (!parent) {
    return {
      defaultProps: {}
    };
  }

  const parentClass = Object.getPrototypeOf(componentClass);
  const parentPropDefs = (parent && getPropsPrototypeAndTypes(parentClass)) || null;

  // Parse propTypes from Component.defaultProps
  const componentDefaultProps = getOwnProperty(componentClass, 'defaultProps') || {};
  const componentPropDefs = parsePropTypes(componentDefaultProps);

  // Create a merged type object
  const propTypes = Object.assign(
    {},
    parentPropDefs && parentPropDefs.propTypes,
    componentPropDefs.propTypes
  );

  // Create any necessary property descriptors and create the default prop object
  // Assign merged default props
  const defaultProps = createPropsPrototype(
    componentPropDefs.defaultProps,
    parentPropDefs && parentPropDefs.defaultProps,
    propTypes,
    componentClass
  );

  // Create a map for prop whose default value is a callback
  const deprecatedProps = Object.assign(
    {},
    parentPropDefs && parentPropDefs.deprecatedProps,
    componentPropDefs.deprecatedProps
  );

  // Store the precalculated props
  componentClass._mergedDefaultProps = defaultProps;
  componentClass._propTypes = propTypes;
  componentClass._deprecatedProps = deprecatedProps;

  return {propTypes, defaultProps, deprecatedProps};
}
410902
function build(base, config) {
  var result = resolver(base);
  Object.keys(config).forEach(function (key) {
    var value = config[key];
    if (typeof value === "string") {
      result[key] = resolver(result(value, true));
    } else if (Array.isArray(value) && value.length === 2 &&
        typeof value[0] === "string" &&  typeof value[1] === "object") {
      result[key] = build(result(value[0], true), value[1]);
    } else {
      throw new TypeError("Invalid value at: " + key);
    }
  });
  return result;
}
1249001
function getDefaultProps(Constructor, _getDefaultProps) {
      if (Constructor.getDefaultProps) {
        Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, _getDefaultProps);
      } else {
        Constructor.getDefaultProps = _getDefaultProps;
      }
    }
622762
function(newProps) {
    if ("production" !== "development") {
      var Component = ReactNativeComponent.getComponentClassForElement(
        this._currentElement
      );
      if (Component.propTypes) {
        this._checkPropTypes(
          Component.propTypes,
          newProps,
          ReactPropTypeLocations.prop
        );
      }
    }
    return newProps;
  }
606736
function(newProps) {
    if ("production" !== process.env.NODE_ENV) {
      var Component = ReactNativeComponent.getComponentClassForElement(
        this._currentElement
      );
      if (Component.propTypes) {
        this._checkPropTypes(
          Component.propTypes,
          newProps,
          ReactPropTypeLocations.prop
        );
      }
    }
    return newProps;
  }
1190655
private Builder createProtoClassBuilder() {
    componentExposedTypeBuilder.addField(
        FieldSpec
            .builder(ClassName.bestGuess("Proto"), "__proto__", Modifier.PUBLIC)
            .addAnnotation(JsProperty.class)
            .build()
    );

    return TypeSpec
        .classBuilder("Proto")
        .addSuperinterface(ParameterizedTypeName.get(JsPropertyMap.class, Object.class))
        .addModifiers(Modifier.STATIC)
        .addModifiers(Modifier.PRIVATE)
        .addAnnotation(AnnotationSpec
            .builder(JsType.class)
            .addMember("isNative", "$L", true)
            .addMember("namespace", "$T.GLOBAL", JsPackage.class)
            .addMember("name", "$S", "Object")
            .build());
  }
1160538
function processProps (instance) {
  let props
  if (isLegacy && (props = instance._props)) {
    // 1.x
    return Object.keys(props).map(key => {
      const prop = props[key]
      const options = prop.options
      return {
        type: 'props',
        key: prop.path,
        value: instance[prop.path],
        meta: options ? {
          type: options.type ? getPropType(options.type) : 'any',
          required: !!options.required,
          mode: propModes[prop.mode]
        } : {}
      }
    })
  } else if ((props = instance.$options.props)) {
    // 2.0
    const propsData = []
    for (let key in props) {
      const prop = props[key]
      key = camelize(key)
      propsData.push({
        type: 'props',
        key,
        value: instance[key],
        meta: prop ? {
          type: prop.type ? getPropType(prop.type) : 'any',
          required: !!prop.required
        } : {
          type: 'invalid'
        },
        editable: SharedData.editableProps
      })
    }
    return propsData
  } else {
    return []
  }
}
478287
function defaultProps(x, m) {
  if(!isObject(x) || !isObject(m)) {
    throw new TypeError('defaultProps: Objects required for both arguments')
  }

  return object.assign(m, x)
}
24567
function addDefaultProps (props, mixinDefaultProps) {
  if (mixinDefaultProps) {
    for (let key in mixinDefaultProps) {
      if (props[key] === undefined) {
        props[key] = mixinDefaultProps[key];
      }
    } 
  }
}
1332723
function buildConfig(
  config, items, item, inheritableConfigs = {}, visitedItems = []
) {
  let { id } = item

  if (visitedItems.includes(id)) {
    throw new Error(`Item "${id}" has cyclic dependencies`)
  }

  let _extends = item.extends || DEFAULT
  let inheritedConfig = inheritableConfigs[_extends]
  visitedItems.push(id)

  if (!inheritedConfig) {
    let parent = findOneById(items, _extends)

    if (!parent) {
      throw new Error(`Item "${id}" tries to extend a non-existent item`)
    }

    parent = buildConfig(
      config, items, parent, inheritableConfigs, visitedItems
    )
    inheritedConfig = extractInheritableConfig(config, parent)
    inheritableConfigs[parent.id] = inheritedConfig
  }

  return mergeConfigs(inheritedConfig, item)
}
845305
function defineMutationMembrane(prototype) {
  try {
    var pseudoFrozenProperties = {
      props: true
    };
    for (var key in pseudoFrozenProperties) {
      defineWarningProperty(prototype, key);
    }
    useMutationMembrane = true;
  } catch (x) {
    // IE will fail on defineProperty
  }
}
1190631
function createChainableTypeChecker(validate) {
    function checkType(
        isRequired,
        props,
        propName,
        componentName,
        location,
        propFullName,
        ...rest
    ) {
        return untracked(() => {
            componentName = componentName || "<<anonymous>>"
            propFullName = propFullName || propName
            if (props[propName] == null) {
                if (isRequired) {
                    const actual = props[propName] === null ? "null" : "undefined"
                    return new Error(
                        "The " +
                            location +
                            " `" +
                            propFullName +
                            "` is marked as required " +
                            "in `" +
                            componentName +
                            "`, but its value is `" +
                            actual +
                            "`."
                    )
                }
                return null
            } else {
                return validate(props, propName, componentName, location, propFullName, ...rest)
            }
        })
    }

    const chainedCheckType = checkType.bind(null, false)
    chainedCheckType.isRequired = checkType.bind(null, true)
    return chainedCheckType
}
1293519
def process_prop(prop_type: PT, value, build_context):
    """"""
    if prop_type in (PT.Target, PT.TargetList):
        return hashify_targets(value, build_context)
    elif prop_type in (PT.File, PT.FileList):
        return hashify_files(value)
    return value
143743
function satisfactoryTypes(
    env,            // :: Array Type
    typeInfo,       // :: TypeInfo
    typeVarMap,     // :: TypeVarMap
    expType,        // :: Type
    index,          // :: Integer
    propPath,       // :: PropPath
    values          // :: Array Any
  ) {
    var recur = satisfactoryTypes;

    for (var idx = 0; idx < values.length; idx += 1) {
      var result = expType.validate (env) (values[idx]);
      if (result.isLeft) {
        return Left (function() {
          return invalidValue (env,
                               typeInfo,
                               index,
                               Z.concat (propPath, result.value.propPath),
                               result.value.value);
        });
      }
    }

    switch (expType.type) {

      case VARIABLE:
        var typeVarName = expType.name;
        var constraints = typeInfo.constraints;
        if (hasOwnProperty.call (constraints, typeVarName)) {
          var typeClasses = constraints[typeVarName];
          for (idx = 0; idx < values.length; idx += 1) {
            for (var idx2 = 0; idx2 < typeClasses.length; idx2 += 1) {
              if (!(typeClasses[idx2].test (values[idx]))) {
                return Left (function() {
                  return typeClassConstraintViolation (
                    env,
                    typeInfo,
                    typeClasses[idx2],
                    index,
                    propPath,
                    values[idx],
                    typeVarMap
                  );
                });
              }
            }
          }
        }

        var typeVarMap$ = updateTypeVarMap (env,
                                            typeVarMap,
                                            expType,
                                            index,
                                            propPath,
                                            values);

        var okTypes = typeVarMap$[typeVarName].types;
        return isEmpty (okTypes) ?
          Left (function() {
            return typeVarConstraintViolation (
              env,
              typeInfo,
              index,
              propPath,
              typeVarMap$[typeVarName].valuesByPath
            );
          }) :
          Z.reduce (function(e, t) {
            return Z.chain (function(r) {
              //  The `a` in `Functor f => f a` corresponds to the `a`
              //  in `Maybe a` but to the `b` in `Either a b`. A type
              //  variable's $1 will correspond to either $1 or $2 of
              //  the actual type depending on the actual type's arity.
              var offset = t.arity - expType.arity;
              return expType.keys.reduce (function(e, k, idx) {
                var extractor = t.extractors[t.keys[offset + idx]];
                return Z.reduce (function(e, x) {
                  return Z.chain (function(r) {
                    return recur (env,
                                  typeInfo,
                                  r.typeVarMap,
                                  expType.types[k],
                                  index,
                                  Z.concat (propPath, [k]),
                                  [x]);
                  }, e);
                }, e, Z.chain (extractor, values));
              }, Right (r));
            }, e);
          }, Right ({typeVarMap: typeVarMap$, types: okTypes}), okTypes);

      case UNARY:
        return Z.map (
          function(result) {
            return {
              typeVarMap: result.typeVarMap,
              types: Z.map (fromUnaryType (expType),
                            or (result.types, [expType.types.$1]))
            };
          },
          recur (env,
                 typeInfo,
                 typeVarMap,
                 expType.types.$1,
                 index,
                 Z.concat (propPath, ['$1']),
                 Z.chain (expType.extractors.$1, values))
        );

      case BINARY:
        return Z.chain (
          function(result) {
            var $1s = result.types;
            return Z.map (
              function(result) {
                var $2s = result.types;
                return {
                  typeVarMap: result.typeVarMap,
                  types: Z.lift2 (fromBinaryType (expType),
                                  or ($1s, [expType.types.$1]),
                                  or ($2s, [expType.types.$2]))
                };
              },
              recur (env,
                     typeInfo,
                     result.typeVarMap,
                     expType.types.$2,
                     index,
                     Z.concat (propPath, ['$2']),
                     Z.chain (expType.extractors.$2, values))
            );
          },
          recur (env,
                 typeInfo,
                 typeVarMap,
                 expType.types.$1,
                 index,
                 Z.concat (propPath, ['$1']),
                 Z.chain (expType.extractors.$1, values))
        );

      case RECORD:
        return Z.reduce (function(e, k) {
          return Z.chain (function(r) {
            return recur (env,
                          typeInfo,
                          r.typeVarMap,
                          expType.types[k],
                          index,
                          Z.concat (propPath, [k]),
                          Z.chain (expType.extractors[k], values));
          }, e);
        }, Right ({typeVarMap: typeVarMap, types: [expType]}), expType.keys);

      default:
        return Right ({typeVarMap: typeVarMap, types: [expType]});
    }
  }
637714
function(proto, recurring, statics) {
		Array.forEach(arguments, function(mixins, i) {
			if (mixins) {
				gui.Object.each(mixins, function(name, value) {
					if (i === 0) {
						// TODO: something more elaborate (like defineProperty)
						this.prototype[name] = value;
					} else { // TODO: only at index 1 right?
						gui.Class.descendantsAndSelf(this, function(C) {
							C.$recurring[name] = value;
							C[name] = value;
						});
					}
				}, this);
			}
		}, this);
		return this;
	}
159271
function (child, parent, _protoFn) {
            var i;
            parent = _isa(parent) ? parent : [ parent ];

            for (i = 0; i < parent.length; i++) {
                for (var j in parent[i].prototype) {
                    if (parent[i].prototype.hasOwnProperty(j)) {
                        child.prototype[j] = parent[i].prototype[j];
                    }
                }
            }

            var _makeFn = function (name, protoFn) {
                return function () {
                    for (i = 0; i < parent.length; i++) {
                        if (parent[i].prototype[name])
                            parent[i].prototype[name].apply(this, arguments);
                    }
                    return protoFn.apply(this, arguments);
                };
            };

            var _oneSet = function (fns) {
                for (var k in fns) {
                    child.prototype[k] = _makeFn(k, fns[k]);
                }
            };

            if (arguments.length > 2) {
                for (i = 2; i < arguments.length; i++)
                    _oneSet(arguments[i]);
            }

            return child;
        }
1323952
function defineOnPrototype(ctor, methods) {
  var proto = ctor.prototype;
  forEachProperty(methods, function(val, key) {
    proto[key] = val;
  });
}