(proto, name)
| 84 | 39: [function (require, module, exports) { 'use strict'; var ReactReconciler = require('./ReactReconciler'); var flattenChildren = require('./flattenChildren'); var instantiateReactComponent = require('./instantiateReactComponent'); var shouldUpdateReactComponent = require('./shouldUpdateReactComponent'); var ReactChildReconciler = { instantiateChildren: function (nestedChildNodes, transaction, context) { var children = flattenChildren(nestedChildNodes); for (var name in children) { if (children.hasOwnProperty(name)) { var child = children[name]; var childInstance = instantiateReactComponent(child, null); children[name] = childInstance; } } return children; }, updateChildren: function (prevChildren, nextNestedChildNodes, transaction, context) { var nextChildren = flattenChildren(nextNestedChildNodes); if (!nextChildren && !prevChildren) { return null; } var name; for (name in nextChildren) { if (!nextChildren.hasOwnProperty(name)) { continue; } var prevChild = prevChildren && prevChildren[name]; var prevElement = prevChild && prevChild._currentElement; var nextElement = nextChildren[name]; if (shouldUpdateReactComponent(prevElement, nextElement)) { ReactReconciler.receiveComponent(prevChild, nextElement, transaction, context); nextChildren[name] = prevChild; } else { if (prevChild) { ReactReconciler.unmountComponent(prevChild, name); } var nextChildInstance = instantiateReactComponent(nextElement, null); nextChildren[name] = nextChildInstance; } } for (name in prevChildren) { if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) { ReactReconciler.unmountComponent(prevChildren[name]); } } return nextChildren; }, unmountChildren: function (renderedChildren) { for (var name in renderedChildren) { var renderedChild = renderedChildren[name]; ReactReconciler.unmountComponent(renderedChild); } } }; module.exports = ReactChildReconciler; }, { './ReactReconciler': 89, './flattenChildren': 126, './instantiateReactComponent': 142, './shouldUpdateReactComponent': 159 }], |
| 85 | 40: [function (require, module, exports) { 'use strict'; var PooledClass = require('./PooledClass'); var ReactFragment = require('./ReactFragment'); var traverseAllChildren = require('./traverseAllChildren'); var warning = require('./warning'); var twoArgumentPooler = PooledClass.twoArgumentPooler; var threeArgumentPooler = PooledClass.threeArgumentPooler; function ForEachBookKeeping (forEachFunction, forEachContext) { this.forEachFunction = forEachFunction; this.forEachContext = forEachContext; }PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild (traverseContext, child, name, i) { var forEachBookKeeping = traverseContext; forEachBookKeeping.forEachFunction.call(forEachBookKeeping.forEachContext, child, i); } function forEachChildren (children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); ForEachBookKeeping.release(traverseContext); } function MapBookKeeping (mapResult, mapFunction, mapContext) { this.mapResult = mapResult; this.mapFunction = mapFunction; this.mapContext = mapContext; }PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler); function mapSingleChildIntoContext (traverseContext, child, name, i) { var mapBookKeeping = traverseContext; var mapResult = mapBookKeeping.mapResult; var keyUnique = !mapResult.hasOwnProperty(name); if ('production' !== 'production') { 'production' !== 'production' ? warning(keyUnique, 'ReactChildren.map(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name) : null; } if (keyUnique) { var mappedChild = mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i); mapResult[name] = mappedChild; } } function mapChildren (children, func, context) { if (children == null) { return children; } var mapResult = {}; var traverseContext = MapBookKeeping.getPooled(mapResult, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); MapBookKeeping.release(traverseContext); return ReactFragment.create(mapResult); } function forEachSingleChildDummy (traverseContext, child, name, i) { return null; } function countChildren (children, context) { return traverseAllChildren(children, forEachSingleChildDummy, null); } var ReactChildren = { forEach: forEachChildren, map: mapChildren, count: countChildren }; module.exports = ReactChildren; }, { './PooledClass': 35, './ReactFragment': 71, './traverseAllChildren': 161, './warning': 162 }], |
| 86 | 41: [function (require, module, exports) { 'use strict'; var ReactComponent = require('./ReactComponent'); var ReactCurrentOwner = require('./ReactCurrentOwner'); var ReactElement = require('./ReactElement'); var ReactErrorUtils = require('./ReactErrorUtils'); var ReactInstanceMap = require('./ReactInstanceMap'); var ReactLifeCycle = require('./ReactLifeCycle'); var ReactPropTypeLocations = require('./ReactPropTypeLocations'); var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); var ReactUpdateQueue = require('./ReactUpdateQueue'); var assign = require('./Object.assign'); var invariant = require('./invariant'); var keyMirror = require('./keyMirror'); var keyOf = require('./keyOf'); var warning = require('./warning'); var MIXINS_KEY = keyOf({ mixins: null }); var SpecPolicy = keyMirror({ DEFINE_ONCE: null, DEFINE_MANY: null, OVERRIDE_BASE: null, DEFINE_MANY_MERGED: null }); var injectedMixins = []; var ReactClassInterface = { mixins: SpecPolicy.DEFINE_MANY, statics: SpecPolicy.DEFINE_MANY, propTypes: SpecPolicy.DEFINE_MANY, contextTypes: SpecPolicy.DEFINE_MANY, childContextTypes: SpecPolicy.DEFINE_MANY, getDefaultProps: SpecPolicy.DEFINE_MANY_MERGED, getInitialState: SpecPolicy.DEFINE_MANY_MERGED, getChildContext: SpecPolicy.DEFINE_MANY_MERGED, render: SpecPolicy.DEFINE_ONCE, componentWillMount: SpecPolicy.DEFINE_MANY, componentDidMount: SpecPolicy.DEFINE_MANY, componentWillReceiveProps: SpecPolicy.DEFINE_MANY, shouldComponentUpdate: SpecPolicy.DEFINE_ONCE, componentWillUpdate: SpecPolicy.DEFINE_MANY, componentDidUpdate: SpecPolicy.DEFINE_MANY, componentWillUnmount: SpecPolicy.DEFINE_MANY, updateComponent: SpecPolicy.OVERRIDE_BASE }; var RESERVED_SPEC_KEYS = { displayName: function (Constructor, displayName) { Constructor.displayName = displayName; }, mixins: function (Constructor, mixins) { if (mixins) { for (var i = 0; i < mixins.length; i++) { mixSpecIntoComponent(Constructor, mixins[i]); } } }, childContextTypes: function (Constructor, childContextTypes) { if ('production' !== 'production') { validateTypeDef(Constructor, childContextTypes, ReactPropTypeLocations.childContext); }Constructor.childContextTypes = assign({}, Constructor.childContextTypes, childContextTypes); }, contextTypes: function (Constructor, contextTypes) { if ('production' !== 'production') { validateTypeDef(Constructor, contextTypes, ReactPropTypeLocations.context); }Constructor.contextTypes = assign({}, Constructor.contextTypes, contextTypes); }, getDefaultProps: function (Constructor, getDefaultProps) { if (Constructor.getDefaultProps) { Constructor.getDefaultProps = createMergedResultFunction(Constructor.getDefaultProps, getDefaultProps); } else { Constructor.getDefaultProps = getDefaultProps; } }, propTypes: function (Constructor, propTypes) { if ('production' !== 'production') { validateTypeDef(Constructor, propTypes, ReactPropTypeLocations.prop); }Constructor.propTypes = assign({}, Constructor.propTypes, propTypes); }, statics: function (Constructor, statics) { mixStaticSpecIntoComponent(Constructor, statics); } }; function validateTypeDef (Constructor, typeDef, location) { for (var propName in typeDef) { if (typeDef.hasOwnProperty(propName)) { 'production' !== 'production' ? warning(typeof typeDef[propName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', Constructor.displayName || 'ReactClass', ReactPropTypeLocationNames[location], propName) : null; } } } function validateMethodOverride (proto, name) { var specPolicy = ReactClassInterface.hasOwnProperty(name) ? ReactClassInterface[name] : null; if (ReactClassMixin.hasOwnProperty(name)) { 'production' !== 'production' ? invariant(specPolicy === SpecPolicy.OVERRIDE_BASE, 'ReactClassInterface: You are attempting to override ' + '`%s` from your class specification. Ensure that your method names ' + 'do not overlap with React methods.', name) : invariant(specPolicy === SpecPolicy.OVERRIDE_BASE); } if (proto.hasOwnProperty(name)) { 'production' !== 'production' ? invariant(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED, 'ReactClassInterface: You are attempting to define ' + '`%s` on your component more than once. This conflict may be due ' + 'to a mixin.', name) : invariant(specPolicy === SpecPolicy.DEFINE_MANY || specPolicy === SpecPolicy.DEFINE_MANY_MERGED); } } function mixSpecIntoComponent (Constructor, spec) { if (!spec) { return; }'production' !== 'production' ? invariant(typeof spec !== 'function', "ReactClass: You're attempting to " + 'use a component class as a mixin. Instead, just use a regular object.') : invariant(typeof spec !== 'function'); 'production' !== 'production' ? invariant(!ReactElement.isValidElement(spec), "ReactClass: You're attempting to " + 'use a component as a mixin. Instead, just use a regular object.') : invariant(!ReactElement.isValidElement(spec)); var proto = Constructor.prototype; if (spec.hasOwnProperty(MIXINS_KEY)) { RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); } for (var name in spec) { if (!spec.hasOwnProperty(name)) { continue; } if (name === MIXINS_KEY) { continue; } var property = spec[name]; validateMethodOverride(proto, name); if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { RESERVED_SPEC_KEYS[name](Constructor, property); } else { var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); var isAlreadyDefined = proto.hasOwnProperty(name); var markedDontBind = property && property.__reactDontBind; var isFunction = typeof property === 'function'; var shouldAutoBind = isFunction && !isReactClassMethod && !isAlreadyDefined && !markedDontBind; if (shouldAutoBind) { if (!proto.__reactAutoBindMap) { proto.__reactAutoBindMap = {}; }proto.__reactAutoBindMap[name] = property; proto[name] = property; } else { if (isAlreadyDefined) { var specPolicy = ReactClassInterface[name]; 'production' !== 'production' ? invariant(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY), 'ReactClass: Unexpected spec policy %s for key %s ' + 'when mixing in component specs.', specPolicy, name) : invariant(isReactClassMethod && (specPolicy === SpecPolicy.DEFINE_MANY_MERGED || specPolicy === SpecPolicy.DEFINE_MANY)); if (specPolicy === SpecPolicy.DEFINE_MANY_MERGED) { proto[name] = createMergedResultFunction(proto[name], property); } else if (specPolicy === SpecPolicy.DEFINE_MANY) { proto[name] = createChainedFunction(proto[name], property); } } else { proto[name] = property; if ('production' !== 'production') { if (typeof property === 'function' && spec.displayName) { proto[name].displayName = spec.displayName + '_' + name; } } } } } } } function mixStaticSpecIntoComponent (Constructor, statics) { if (!statics) { return; } for (var name in statics) { var property = statics[name]; if (!statics.hasOwnProperty(name)) { continue; } var isReserved = name in RESERVED_SPEC_KEYS; 'production' !== 'production' ? invariant(!isReserved, 'ReactClass: You are attempting to define a reserved ' + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + 'as an instance property instead; it will still be accessible on the ' + 'constructor.', name) : invariant(!isReserved); var isInherited = name in Constructor; 'production' !== 'production' ? invariant(!isInherited, 'ReactClass: You are attempting to define ' + '`%s` on your component more than once. This conflict may be ' + 'due to a mixin.', name) : invariant(!isInherited); Constructor[name] = property; } } function mergeIntoWithNoDuplicateKeys (one, two) { 'production' !== 'production' ? invariant(one && two && typeof one === 'object' && typeof two === 'object', 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.') : invariant(one && two && typeof one === 'object' && typeof two === 'object'); for (var key in two) { if (two.hasOwnProperty(key)) { 'production' !== 'production' ? invariant(one[key] === undefined, 'mergeIntoWithNoDuplicateKeys(): ' + 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', key) : invariant(one[key] === undefined); one[key] = two[key]; } } return one; } function createMergedResultFunction (one, two) { return function mergedResult () { var a = one.apply(this, arguments); var b = two.apply(this, arguments); if (a == null) { return b; } else if (b == null) { return a; } var c = {}; mergeIntoWithNoDuplicateKeys(c, a); mergeIntoWithNoDuplicateKeys(c, b); return c; }; } function createChainedFunction (one, two) { return function chainedFunction () { one.apply(this, arguments); two.apply(this, arguments); }; } function bindAutoBindMethod (component, method) { var boundMethod = method.bind(component); if ('production' !== 'production') { boundMethod.__reactBoundContext = component; boundMethod.__reactBoundMethod = method; boundMethod.__reactBoundArguments = null; var componentName = component.constructor.displayName; var _bind = boundMethod.bind; boundMethod.bind = function (newThis) { for (var args = [], $__0 = 1, $__1 = arguments.length; $__0 < $__1; $__0++)args.push(arguments[$__0]); if (newThis !== component && newThis !== null) { 'production' !== 'production' ? warning(false, 'bind(): React component methods may only be bound to the ' + 'component instance. See %s', componentName) : null; } else if (!args.length) { 'production' !== 'production' ? warning(false, 'bind(): You are binding a component method to the component. ' + 'React does this for you automatically in a high-performance ' + 'way, so you can safely remove this call. See %s', componentName) : null; return boundMethod; } var reboundMethod = _bind.apply(boundMethod, arguments); reboundMethod.__reactBoundContext = component; reboundMethod.__reactBoundMethod = method; reboundMethod.__reactBoundArguments = args; return reboundMethod; }; } return boundMethod; } function bindAutoBindMethods (component) { for (var autoBindKey in component.__reactAutoBindMap) { if (component.__reactAutoBindMap.hasOwnProperty(autoBindKey)) { var method = component.__reactAutoBindMap[autoBindKey]; component[autoBindKey] = bindAutoBindMethod(component, ReactErrorUtils.guard(method, component.constructor.displayName + '.' + autoBindKey)); } } } var typeDeprecationDescriptor = { enumerable: false, get: function () { var displayName = this.displayName || this.name || 'Component'; 'production' !== 'production' ? warning(false, '%s.type is deprecated. Use %s directly to access the class.', displayName, displayName) : null; Object.defineProperty(this, 'type', { value: this }); return this; } }; var ReactClassMixin = { replaceState: function (newState, callback) { ReactUpdateQueue.enqueueReplaceState(this, newState); if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } }, isMounted: function () { if ('production' !== 'production') { var owner = ReactCurrentOwner.current; if (owner !== null) { 'production' !== 'production' ? warning(owner._warnedAboutRefsInRender, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', owner.getName() || 'A component') : null; owner._warnedAboutRefsInRender = true; } } var internalInstance = ReactInstanceMap.get(this); return internalInstance && internalInstance !== ReactLifeCycle.currentlyMountingInstance; }, setProps: function (partialProps, callback) { ReactUpdateQueue.enqueueSetProps(this, partialProps); if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } }, replaceProps: function (newProps, callback) { ReactUpdateQueue.enqueueReplaceProps(this, newProps); if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } } }; var ReactClassComponent = function () {}; assign(ReactClassComponent.prototype, ReactComponent.prototype, ReactClassMixin); var ReactClass = { createClass: function (spec) { var Constructor = function (props, context) { if ('production' !== 'production') { 'production' !== 'production' ? warning(this instanceof Constructor, 'Something is calling a React component directly. Use a factory or ' + 'JSX instead. See: https://fb.me/react-legacyfactory') : null; } if (this.__reactAutoBindMap) { bindAutoBindMethods(this); } this.props = props; this.context = context; this.state = null; var initialState = this.getInitialState ? this.getInitialState() : null; if ('production' !== 'production') { if (typeof initialState === 'undefined' && this.getInitialState._isMockFunction) { initialState = null; } }'production' !== 'production' ? invariant(typeof initialState === 'object' && !Array.isArray(initialState), '%s.getInitialState(): must return an object or null', Constructor.displayName || 'ReactCompositeComponent') : invariant(typeof initialState === 'object' && !Array.isArray(initialState)); this.state = initialState; }; Constructor.prototype = new ReactClassComponent(); Constructor.prototype.constructor = Constructor; injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); mixSpecIntoComponent(Constructor, spec); if (Constructor.getDefaultProps) { Constructor.defaultProps = Constructor.getDefaultProps(); } if ('production' !== 'production') { if (Constructor.getDefaultProps) { Constructor.getDefaultProps.isReactClassApproved = {}; } if (Constructor.prototype.getInitialState) { Constructor.prototype.getInitialState.isReactClassApproved = {}; } }'production' !== 'production' ? invariant(Constructor.prototype.render, 'createClass(...): Class specification must implement a `render` method.') : invariant(Constructor.prototype.render); if ('production' !== 'production') { 'production' !== 'production' ? warning(!Constructor.prototype.componentShouldUpdate, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', spec.displayName || 'A component') : null; } for (var methodName in ReactClassInterface) { if (!Constructor.prototype[methodName]) { Constructor.prototype[methodName] = null; } }Constructor.type = Constructor; if ('production' !== 'production') { try { Object.defineProperty(Constructor, 'type', typeDeprecationDescriptor); } catch (x) {} } return Constructor; }, injection: { injectMixin: function (mixin) { injectedMixins.push(mixin); } } }; module.exports = ReactClass; }, { './Object.assign': 34, './ReactComponent': 42, './ReactCurrentOwner': 47, './ReactElement': 65, './ReactErrorUtils': 68, './ReactInstanceMap': 75, './ReactLifeCycle': 76, './ReactPropTypeLocationNames': 84, './ReactPropTypeLocations': 85, './ReactUpdateQueue': 94, './invariant': 143, './keyMirror': 148, './keyOf': 149, './warning': 162 }], |
| 87 | 42: [function (require, module, exports) { 'use strict'; var ReactUpdateQueue = require('./ReactUpdateQueue'); var invariant = require('./invariant'); var warning = require('./warning'); function ReactComponent (props, context) { this.props = props; this.context = context; }ReactComponent.prototype.setState = function (partialState, callback) { 'production' !== 'production' ? invariant(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null, 'setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.') : invariant(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null); if ('production' !== 'production') { 'production' !== 'production' ? warning(partialState != null, 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().') : null; }ReactUpdateQueue.enqueueSetState(this, partialState); if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } }; ReactComponent.prototype.forceUpdate = function (callback) { ReactUpdateQueue.enqueueForceUpdate(this); if (callback) { ReactUpdateQueue.enqueueCallback(this, callback); } }; if ('production' !== 'production') { var deprecatedAPIs = { getDOMNode: ['getDOMNode', 'Use React.findDOMNode(component) instead.'], isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceProps: ['replaceProps', 'Instead, call React.render again at the top level.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'], setProps: ['setProps', 'Instead, call React.render again at the top level.'] }; var defineDeprecationWarning = function (methodName, info) { try { Object.defineProperty(ReactComponent.prototype, methodName, { get: function () { 'production' !== 'production' ? warning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]) : null; return undefined; } }); } catch (x) {} }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } }module.exports = ReactComponent; }, { './ReactUpdateQueue': 94, './invariant': 143, './warning': 162 }], |
| 88 | 43: [function (require, module, exports) { 'use strict'; var ReactDOMIDOperations = require('./ReactDOMIDOperations'); var ReactMount = require('./ReactMount'); var ReactComponentBrowserEnvironment = { processChildrenUpdates: ReactDOMIDOperations.dangerouslyProcessChildrenUpdates, replaceNodeWithMarkupByID: ReactDOMIDOperations.dangerouslyReplaceNodeWithMarkupByID, unmountIDFromEnvironment: function (rootNodeID) { ReactMount.purgeID(rootNodeID); } }; module.exports = ReactComponentBrowserEnvironment; }, { './ReactDOMIDOperations': 52, './ReactMount': 78 }], |
| 89 | 44: [function (require, module, exports) { 'use strict'; var invariant = require('./invariant'); var injected = false; var ReactComponentEnvironment = { unmountIDFromEnvironment: null, replaceNodeWithMarkupByID: null, processChildrenUpdates: null, injection: { injectEnvironment: function (environment) { 'production' !== 'production' ? invariant(!injected, 'ReactCompositeComponent: injectEnvironment() can only be called once.') : invariant(!injected); ReactComponentEnvironment.unmountIDFromEnvironment = environment.unmountIDFromEnvironment; ReactComponentEnvironment.replaceNodeWithMarkupByID = environment.replaceNodeWithMarkupByID; ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates; injected = true; } } }; module.exports = ReactComponentEnvironment; }, { './invariant': 143 }], |
no test coverage detected