react 0.13.3 → 0.14.0-alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/addons.js +7 -0
  2. package/addons/CSSTransitionGroup.js +1 -0
  3. package/addons/LinkedStateMixin.js +1 -0
  4. package/addons/Perf.js +1 -0
  5. package/addons/PureRenderMixin.js +1 -0
  6. package/addons/TestUtils.js +1 -0
  7. package/addons/TransitionGroup.js +1 -0
  8. package/addons/batchedUpdates.js +1 -0
  9. package/addons/cloneWithProps.js +1 -0
  10. package/addons/createFragment.js +1 -0
  11. package/addons/renderSubtreeIntoContainer.js +1 -0
  12. package/addons/shallowCompare.js +1 -0
  13. package/addons/update.js +1 -0
  14. package/dist/JSXTransformer.js +3355 -1685
  15. package/dist/react-with-addons.js +3092 -5145
  16. package/dist/react-with-addons.min.js +6 -8
  17. package/dist/react.js +2772 -4594
  18. package/dist/react.min.js +5 -6
  19. package/lib/AutoFocusMixin.js +4 -3
  20. package/lib/BeforeInputEventPlugin.js +30 -118
  21. package/lib/CSSCore.js +12 -23
  22. package/lib/CSSProperty.js +4 -3
  23. package/lib/CSSPropertyOperations.js +14 -30
  24. package/lib/CallbackQueue.js +7 -10
  25. package/lib/ChangeEventPlugin.js +24 -88
  26. package/lib/ClientReactRootIndex.js +2 -2
  27. package/lib/DOMChildrenOperations.js +13 -33
  28. package/lib/DOMProperty.js +41 -65
  29. package/lib/DOMPropertyOperations.js +30 -51
  30. package/lib/Danger.js +19 -60
  31. package/lib/DefaultEventPluginOrder.js +2 -12
  32. package/lib/EnterLeaveEventPlugin.js +11 -33
  33. package/lib/EventConstants.js +2 -2
  34. package/lib/EventListener.js +11 -13
  35. package/lib/EventPluginHub.js +44 -47
  36. package/lib/EventPluginRegistry.js +18 -74
  37. package/lib/EventPluginUtils.js +27 -38
  38. package/lib/EventPropagators.js +23 -26
  39. package/lib/ExecutionEnvironment.js +4 -8
  40. package/lib/FallbackCompositionState.js +3 -3
  41. package/lib/HTMLDOMPropertyConfig.js +5 -17
  42. package/lib/LinkedStateMixin.js +3 -6
  43. package/lib/LinkedValueUtils.js +34 -64
  44. package/lib/LocalEventTrapMixin.js +9 -16
  45. package/lib/Object.assign.js +1 -1
  46. package/lib/PooledClass.js +8 -11
  47. package/lib/React.js +20 -38
  48. package/lib/ReactBrowserComponentMixin.js +9 -2
  49. package/lib/ReactBrowserEventEmitter.js +26 -82
  50. package/lib/ReactCSSTransitionGroup.js +13 -24
  51. package/lib/ReactCSSTransitionGroupChild.js +18 -28
  52. package/lib/ReactChildReconciler.js +11 -19
  53. package/lib/ReactChildren.js +7 -16
  54. package/lib/ReactClass.js +78 -231
  55. package/lib/ReactComponent.js +17 -51
  56. package/lib/ReactComponentBrowserEnvironment.js +4 -6
  57. package/lib/ReactComponentEnvironment.js +6 -12
  58. package/lib/ReactComponentWithPureRenderMixin.js +4 -5
  59. package/lib/ReactCompositeComponent.js +83 -318
  60. package/lib/ReactContext.js +2 -44
  61. package/lib/ReactCurrentOwner.js +1 -3
  62. package/lib/ReactDOM.js +3 -2
  63. package/lib/ReactDOMButton.js +3 -4
  64. package/lib/ReactDOMComponent.js +182 -148
  65. package/lib/ReactDOMForm.js +3 -3
  66. package/lib/ReactDOMIDOperations.js +11 -20
  67. package/lib/ReactDOMIframe.js +3 -3
  68. package/lib/ReactDOMImg.js +3 -3
  69. package/lib/ReactDOMInput.js +22 -35
  70. package/lib/ReactDOMOption.js +52 -10
  71. package/lib/ReactDOMSelect.js +50 -28
  72. package/lib/ReactDOMSelection.js +5 -20
  73. package/lib/ReactDOMTextComponent.js +17 -18
  74. package/lib/ReactDOMTextarea.js +15 -27
  75. package/lib/ReactDefaultBatchingStrategy.js +9 -13
  76. package/lib/ReactDefaultInjection.js +21 -40
  77. package/lib/ReactDefaultPerf.js +36 -69
  78. package/lib/ReactDefaultPerfAnalysis.js +8 -14
  79. package/lib/ReactElement.js +35 -72
  80. package/lib/ReactElementValidator.js +51 -110
  81. package/lib/ReactEmptyComponent.js +7 -11
  82. package/lib/ReactErrorUtils.js +2 -2
  83. package/lib/ReactEventEmitterMixin.js +3 -12
  84. package/lib/ReactEventListener.js +16 -38
  85. package/lib/ReactFragment.js +23 -54
  86. package/lib/ReactInjection.js +1 -1
  87. package/lib/ReactInputSelection.js +11 -21
  88. package/lib/ReactInstanceHandles.js +27 -57
  89. package/lib/ReactInstanceMap.js +5 -5
  90. package/lib/ReactLifeCycle.js +1 -1
  91. package/lib/ReactLink.js +2 -4
  92. package/lib/ReactMarkupChecksum.js +5 -10
  93. package/lib/ReactMount.js +136 -260
  94. package/lib/ReactMultiChild.js +19 -45
  95. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  96. package/lib/ReactNativeComponent.js +7 -11
  97. package/lib/ReactOwner.js +7 -24
  98. package/lib/ReactPerf.js +8 -12
  99. package/lib/ReactPropTransferer.js +4 -4
  100. package/lib/ReactPropTypeLocationNames.js +2 -2
  101. package/lib/ReactPropTypeLocations.js +1 -1
  102. package/lib/ReactPropTypes.js +13 -46
  103. package/lib/ReactReconcileTransaction.js +9 -34
  104. package/lib/ReactReconciler.js +9 -19
  105. package/lib/ReactRef.js +5 -8
  106. package/lib/ReactRootIndex.js +2 -2
  107. package/lib/ReactServerRendering.js +7 -15
  108. package/lib/ReactServerRenderingTransaction.js +7 -32
  109. package/lib/ReactStateSetters.js +6 -6
  110. package/lib/ReactTestUtils.js +89 -165
  111. package/lib/ReactTransitionChildMapping.js +5 -7
  112. package/lib/ReactTransitionEvents.js +5 -5
  113. package/lib/ReactTransitionGroup.js +30 -52
  114. package/lib/ReactUpdateQueue.js +27 -90
  115. package/lib/ReactUpdates.js +27 -79
  116. package/lib/ReactWithAddons.js +7 -6
  117. package/lib/SVGDOMPropertyConfig.js +39 -2
  118. package/lib/SelectEventPlugin.js +28 -29
  119. package/lib/ServerReactRootIndex.js +2 -2
  120. package/lib/SimpleEventPlugin.js +136 -128
  121. package/lib/SyntheticClipboardEvent.js +3 -7
  122. package/lib/SyntheticCompositionEvent.js +3 -9
  123. package/lib/SyntheticDragEvent.js +1 -1
  124. package/lib/SyntheticEvent.js +8 -10
  125. package/lib/SyntheticFocusEvent.js +1 -1
  126. package/lib/SyntheticInputEvent.js +3 -9
  127. package/lib/SyntheticKeyboardEvent.js +4 -4
  128. package/lib/SyntheticMouseEvent.js +8 -14
  129. package/lib/SyntheticTouchEvent.js +1 -1
  130. package/lib/SyntheticUIEvent.js +3 -3
  131. package/lib/SyntheticWheelEvent.js +11 -15
  132. package/lib/Transaction.js +12 -24
  133. package/lib/ViewportMetrics.js +2 -2
  134. package/lib/accumulateInto.js +2 -5
  135. package/lib/adler32.js +2 -2
  136. package/lib/camelize.js +4 -2
  137. package/lib/camelizeStyleName.js +2 -2
  138. package/lib/cloneWithProps.js +5 -11
  139. package/lib/containsNode.js +29 -16
  140. package/lib/createArrayFromMixed.js +17 -16
  141. package/lib/createFullPageComponent.js +4 -11
  142. package/lib/createNodesFromMarkup.js +6 -8
  143. package/lib/dangerousStyleValue.js +2 -3
  144. package/lib/emptyFunction.js +10 -4
  145. package/lib/emptyObject.js +1 -1
  146. package/lib/escapeTextContentForBrowser.js +1 -1
  147. package/lib/findDOMNode.js +5 -24
  148. package/lib/flattenChildren.js +4 -10
  149. package/lib/focusNode.js +2 -3
  150. package/lib/forEachAccumulated.js +2 -2
  151. package/lib/getActiveElement.js +4 -2
  152. package/lib/getEventCharCode.js +1 -1
  153. package/lib/getEventKey.js +1 -1
  154. package/lib/getEventModifierState.js +1 -1
  155. package/lib/getEventTarget.js +1 -1
  156. package/lib/getIteratorFn.js +2 -4
  157. package/lib/getMarkupWrap.js +5 -5
  158. package/lib/getNodeForCharacterOffset.js +1 -1
  159. package/lib/getTextContentAccessor.js +2 -4
  160. package/lib/getUnboundedScrollPosition.js +1 -1
  161. package/lib/hyphenate.js +3 -1
  162. package/lib/hyphenateStyleName.js +2 -2
  163. package/lib/instantiateReactComponent.js +14 -38
  164. package/lib/invariant.js +8 -12
  165. package/lib/isEventSupported.js +7 -10
  166. package/lib/isNode.js +4 -6
  167. package/lib/isTextInputElement.js +2 -4
  168. package/lib/isTextNode.js +3 -1
  169. package/lib/joinClasses.js +2 -2
  170. package/lib/keyMirror.js +3 -6
  171. package/lib/keyOf.js +4 -3
  172. package/lib/mapObject.js +1 -1
  173. package/lib/memoizeStringOnly.js +2 -2
  174. package/lib/onlyChild.js +2 -5
  175. package/lib/performance.js +2 -5
  176. package/lib/performanceNow.js +3 -1
  177. package/lib/quoteAttributeValueForBrowser.js +1 -1
  178. package/lib/renderSubtreeIntoContainer.js +16 -0
  179. package/lib/setInnerHTML.js +11 -8
  180. package/lib/setTextContent.js +3 -3
  181. package/lib/shallowCompare.js +24 -0
  182. package/lib/shallowEqual.js +17 -11
  183. package/lib/shouldUpdateReactComponent.js +3 -64
  184. package/lib/toArray.js +8 -19
  185. package/lib/traverseAllChildren.js +19 -82
  186. package/lib/update.js +25 -85
  187. package/lib/validateDOMNesting.js +264 -0
  188. package/lib/warning.js +17 -15
  189. package/package.json +3 -3
  190. package/lib/MobileSafariClickEventPlugin.js +0 -56
  191. package/lib/ReactPutListenerQueue.js +0 -54
  192. package/lib/cx.js +0 -52
  193. package/lib/getReactRootElementInContainer.js +0 -33
@@ -9,6 +9,8 @@
9
9
  * @providesModule getMarkupWrap
10
10
  */
11
11
 
12
+ 'use strict';
13
+
12
14
  var ExecutionEnvironment = require("./ExecutionEnvironment");
13
15
 
14
16
  var invariant = require("./invariant");
@@ -16,8 +18,7 @@ var invariant = require("./invariant");
16
18
  /**
17
19
  * Dummy container used to detect which wraps are necessary.
18
20
  */
19
- var dummyNode =
20
- ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
21
+ var dummyNode = ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;
21
22
 
22
23
  /**
23
24
  * Some browsers cannot use `innerHTML` to render certain elements standalone,
@@ -96,7 +97,7 @@ var markupWrap = {
96
97
  * @return {?array} Markup wrap configuration, if applicable.
97
98
  */
98
99
  function getMarkupWrap(nodeName) {
99
- ("production" !== process.env.NODE_ENV ? invariant(!!dummyNode, 'Markup wrapping node not initialized') : invariant(!!dummyNode));
100
+ 'production' !== process.env.NODE_ENV ? invariant(!!dummyNode, 'Markup wrapping node not initialized') : invariant(!!dummyNode);
100
101
  if (!markupWrap.hasOwnProperty(nodeName)) {
101
102
  nodeName = '*';
102
103
  }
@@ -111,5 +112,4 @@ function getMarkupWrap(nodeName) {
111
112
  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
112
113
  }
113
114
 
114
-
115
- module.exports = getMarkupWrap;
115
+ module.exports = getMarkupWrap;
@@ -70,4 +70,4 @@ function getNodeForCharacterOffset(root, offset) {
70
70
  }
71
71
  }
72
72
 
73
- module.exports = getNodeForCharacterOffset;
73
+ module.exports = getNodeForCharacterOffset;
@@ -25,11 +25,9 @@ function getTextContentAccessor() {
25
25
  if (!contentKey && ExecutionEnvironment.canUseDOM) {
26
26
  // Prefer textContent to innerText because many browsers support both but
27
27
  // SVG <text> elements don't support innerText even when <div> does.
28
- contentKey = 'textContent' in document.documentElement ?
29
- 'textContent' :
30
- 'innerText';
28
+ contentKey = 'textContent' in document.documentElement ? 'textContent' : 'innerText';
31
29
  }
32
30
  return contentKey;
33
31
  }
34
32
 
35
- module.exports = getTextContentAccessor;
33
+ module.exports = getTextContentAccessor;
@@ -35,4 +35,4 @@ function getUnboundedScrollPosition(scrollable) {
35
35
  };
36
36
  }
37
37
 
38
- module.exports = getUnboundedScrollPosition;
38
+ module.exports = getUnboundedScrollPosition;
package/lib/hyphenate.js CHANGED
@@ -10,6 +10,8 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
+ 'use strict';
14
+
13
15
  var _uppercasePattern = /([A-Z])/g;
14
16
 
15
17
  /**
@@ -28,4 +30,4 @@ function hyphenate(string) {
28
30
  return string.replace(_uppercasePattern, '-$1').toLowerCase();
29
31
  }
30
32
 
31
- module.exports = hyphenate;
33
+ module.exports = hyphenate;
@@ -10,7 +10,7 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var hyphenate = require("./hyphenate");
16
16
 
@@ -36,4 +36,4 @@ function hyphenateStyleName(string) {
36
36
  return hyphenate(string).replace(msPattern, '-ms-');
37
37
  }
38
38
 
39
- module.exports = hyphenateStyleName;
39
+ module.exports = hyphenateStyleName;
@@ -21,14 +21,10 @@ var invariant = require("./invariant");
21
21
  var warning = require("./warning");
22
22
 
23
23
  // To avoid a cyclic dependency, we create the final class in this module
24
- var ReactCompositeComponentWrapper = function() { };
25
- assign(
26
- ReactCompositeComponentWrapper.prototype,
27
- ReactCompositeComponent.Mixin,
28
- {
29
- _instantiateReactComponent: instantiateReactComponent
30
- }
31
- );
24
+ var ReactCompositeComponentWrapper = function () {};
25
+ assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent.Mixin, {
26
+ _instantiateReactComponent: instantiateReactComponent
27
+ });
32
28
 
33
29
  /**
34
30
  * Check if the type reference is a known internal type. I.e. not a user
@@ -38,12 +34,7 @@ assign(
38
34
  * @return {boolean} Returns true if this is a valid internal type.
39
35
  */
40
36
  function isInternalComponentType(type) {
41
- return (
42
- typeof type === 'function' &&
43
- typeof type.prototype !== 'undefined' &&
44
- typeof type.prototype.mountComponent === 'function' &&
45
- typeof type.prototype.receiveComponent === 'function'
46
- );
37
+ return typeof type === 'function' && typeof type.prototype !== 'undefined' && typeof type.prototype.mountComponent === 'function' && typeof type.prototype.receiveComponent === 'function';
47
38
  }
48
39
 
49
40
  /**
@@ -63,17 +54,12 @@ function instantiateReactComponent(node, parentCompositeType) {
63
54
 
64
55
  if (typeof node === 'object') {
65
56
  var element = node;
66
- if ("production" !== process.env.NODE_ENV) {
67
- ("production" !== process.env.NODE_ENV ? warning(
68
- element && (typeof element.type === 'function' ||
69
- typeof element.type === 'string'),
70
- 'Only functions or strings can be mounted as React components.'
71
- ) : null);
57
+ if ('production' !== process.env.NODE_ENV) {
58
+ 'production' !== process.env.NODE_ENV ? warning(element && (typeof element.type === 'function' || typeof element.type === 'string'), 'Only functions or strings can be mounted as React components.') : null;
72
59
  }
73
60
 
74
61
  // Special case string values
75
- if (parentCompositeType === element.type &&
76
- typeof element.type === 'string') {
62
+ if (parentCompositeType === element.type && typeof element.type === 'string') {
77
63
  // Avoid recursion if the wrapper renders itself.
78
64
  instance = ReactNativeComponent.createInternalComponent(element);
79
65
  // All native components are currently wrapped in a composite so we're
@@ -89,21 +75,11 @@ function instantiateReactComponent(node, parentCompositeType) {
89
75
  } else if (typeof node === 'string' || typeof node === 'number') {
90
76
  instance = ReactNativeComponent.createInstanceForText(node);
91
77
  } else {
92
- ("production" !== process.env.NODE_ENV ? invariant(
93
- false,
94
- 'Encountered invalid React node of type %s',
95
- typeof node
96
- ) : invariant(false));
78
+ 'production' !== process.env.NODE_ENV ? invariant(false, 'Encountered invalid React node of type %s', typeof node) : invariant(false);
97
79
  }
98
80
 
99
- if ("production" !== process.env.NODE_ENV) {
100
- ("production" !== process.env.NODE_ENV ? warning(
101
- typeof instance.construct === 'function' &&
102
- typeof instance.mountComponent === 'function' &&
103
- typeof instance.receiveComponent === 'function' &&
104
- typeof instance.unmountComponent === 'function',
105
- 'Only React Components can be mounted.'
106
- ) : null);
81
+ if ('production' !== process.env.NODE_ENV) {
82
+ 'production' !== process.env.NODE_ENV ? warning(typeof instance.construct === 'function' && typeof instance.mountComponent === 'function' && typeof instance.receiveComponent === 'function' && typeof instance.unmountComponent === 'function', 'Only React Components can be mounted.') : null;
107
83
  }
108
84
 
109
85
  // Sets up the instance. This can probably just move into the constructor now.
@@ -115,14 +91,14 @@ function instantiateReactComponent(node, parentCompositeType) {
115
91
  instance._mountIndex = 0;
116
92
  instance._mountImage = null;
117
93
 
118
- if ("production" !== process.env.NODE_ENV) {
94
+ if ('production' !== process.env.NODE_ENV) {
119
95
  instance._isOwnerNecessary = false;
120
96
  instance._warnedAboutRefsInRender = false;
121
97
  }
122
98
 
123
99
  // Internal instances should fully constructed at this point, so they should
124
100
  // not get any new fields added to them at this point.
125
- if ("production" !== process.env.NODE_ENV) {
101
+ if ('production' !== process.env.NODE_ENV) {
126
102
  if (Object.preventExtensions) {
127
103
  Object.preventExtensions(instance);
128
104
  }
@@ -131,4 +107,4 @@ function instantiateReactComponent(node, parentCompositeType) {
131
107
  return instance;
132
108
  }
133
109
 
134
- module.exports = instantiateReactComponent;
110
+ module.exports = instantiateReactComponent;
package/lib/invariant.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * @providesModule invariant
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  /**
15
15
  * Use invariant() to assert state which your program assumes to be true.
@@ -22,8 +22,8 @@
22
22
  * will remain to ensure logic does not differ in production.
23
23
  */
24
24
 
25
- var invariant = function(condition, format, a, b, c, d, e, f) {
26
- if ("production" !== process.env.NODE_ENV) {
25
+ var invariant = function (condition, format, a, b, c, d, e, f) {
26
+ if ('production' !== process.env.NODE_ENV) {
27
27
  if (format === undefined) {
28
28
  throw new Error('invariant requires an error message argument');
29
29
  }
@@ -32,17 +32,13 @@ var invariant = function(condition, format, a, b, c, d, e, f) {
32
32
  if (!condition) {
33
33
  var error;
34
34
  if (format === undefined) {
35
- error = new Error(
36
- 'Minified exception occurred; use the non-minified dev environment ' +
37
- 'for the full error message and additional helpful warnings.'
38
- );
35
+ error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
39
36
  } else {
40
37
  var args = [a, b, c, d, e, f];
41
38
  var argIndex = 0;
42
- error = new Error(
43
- 'Invariant Violation: ' +
44
- format.replace(/%s/g, function() { return args[argIndex++]; })
45
- );
39
+ error = new Error('Invariant Violation: ' + format.replace(/%s/g, function () {
40
+ return args[argIndex++];
41
+ }));
46
42
  }
47
43
 
48
44
  error.framesToPop = 1; // we don't care about invariant's own frame
@@ -50,4 +46,4 @@ var invariant = function(condition, format, a, b, c, d, e, f) {
50
46
  }
51
47
  };
52
48
 
53
- module.exports = invariant;
49
+ module.exports = invariant;
@@ -15,12 +15,10 @@ var ExecutionEnvironment = require("./ExecutionEnvironment");
15
15
 
16
16
  var useHasFeature;
17
17
  if (ExecutionEnvironment.canUseDOM) {
18
- useHasFeature =
19
- document.implementation &&
20
- document.implementation.hasFeature &&
21
- // always returns true in newer browsers as per the standard.
22
- // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
23
- document.implementation.hasFeature('', '') !== true;
18
+ useHasFeature = document.implementation && document.implementation.hasFeature &&
19
+ // always returns true in newer browsers as per the standard.
20
+ // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
21
+ document.implementation.hasFeature('', '') !== true;
24
22
  }
25
23
 
26
24
  /**
@@ -38,13 +36,12 @@ if (ExecutionEnvironment.canUseDOM) {
38
36
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
39
37
  */
40
38
  function isEventSupported(eventNameSuffix, capture) {
41
- if (!ExecutionEnvironment.canUseDOM ||
42
- capture && !('addEventListener' in document)) {
39
+ if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) {
43
40
  return false;
44
41
  }
45
42
 
46
43
  var eventName = 'on' + eventNameSuffix;
47
- var isSupported = eventName in document;
44
+ var isSupported = (eventName in document);
48
45
 
49
46
  if (!isSupported) {
50
47
  var element = document.createElement('div');
@@ -60,4 +57,4 @@ function isEventSupported(eventNameSuffix, capture) {
60
57
  return isSupported;
61
58
  }
62
59
 
63
- module.exports = isEventSupported;
60
+ module.exports = isEventSupported;
package/lib/isNode.js CHANGED
@@ -14,12 +14,10 @@
14
14
  * @param {*} object The object to check.
15
15
  * @return {boolean} Whether or not the object is a DOM node.
16
16
  */
17
+ 'use strict';
18
+
17
19
  function isNode(object) {
18
- return !!(object && (
19
- ((typeof Node === 'function' ? object instanceof Node : typeof object === 'object' &&
20
- typeof object.nodeType === 'number' &&
21
- typeof object.nodeName === 'string'))
22
- ));
20
+ return !!(object && (typeof Node === 'function' ? object instanceof Node : typeof object === 'object' && typeof object.nodeType === 'number' && typeof object.nodeName === 'string'));
23
21
  }
24
22
 
25
- module.exports = isNode;
23
+ module.exports = isNode;
@@ -33,9 +33,7 @@ var supportedInputTypes = {
33
33
  };
34
34
 
35
35
  function isTextInputElement(elem) {
36
- return elem && (
37
- (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA')
38
- );
36
+ return elem && (elem.nodeName === 'INPUT' && supportedInputTypes[elem.type] || elem.nodeName === 'TEXTAREA');
39
37
  }
40
38
 
41
- module.exports = isTextInputElement;
39
+ module.exports = isTextInputElement;
package/lib/isTextNode.js CHANGED
@@ -10,6 +10,8 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
+ 'use strict';
14
+
13
15
  var isNode = require("./isNode");
14
16
 
15
17
  /**
@@ -20,4 +22,4 @@ function isTextNode(object) {
20
22
  return isNode(object) && object.nodeType == 3;
21
23
  }
22
24
 
23
- module.exports = isTextNode;
25
+ module.exports = isTextNode;
@@ -19,7 +19,7 @@
19
19
  * @param {...?string} classes
20
20
  * @return {string}
21
21
  */
22
- function joinClasses(className/*, ... */) {
22
+ function joinClasses(className /*, ... */) {
23
23
  if (!className) {
24
24
  className = '';
25
25
  }
@@ -36,4 +36,4 @@ function joinClasses(className/*, ... */) {
36
36
  return className;
37
37
  }
38
38
 
39
- module.exports = joinClasses;
39
+ module.exports = joinClasses;
package/lib/keyMirror.js CHANGED
@@ -32,13 +32,10 @@ var invariant = require("./invariant");
32
32
  * @param {object} obj
33
33
  * @return {object}
34
34
  */
35
- var keyMirror = function(obj) {
35
+ var keyMirror = function (obj) {
36
36
  var ret = {};
37
37
  var key;
38
- ("production" !== process.env.NODE_ENV ? invariant(
39
- obj instanceof Object && !Array.isArray(obj),
40
- 'keyMirror(...): Argument must be an object.'
41
- ) : invariant(obj instanceof Object && !Array.isArray(obj)));
38
+ 'production' !== process.env.NODE_ENV ? invariant(obj instanceof Object && !Array.isArray(obj), 'keyMirror(...): Argument must be an object.') : invariant(obj instanceof Object && !Array.isArray(obj));
42
39
  for (key in obj) {
43
40
  if (!obj.hasOwnProperty(key)) {
44
41
  continue;
@@ -48,4 +45,4 @@ var keyMirror = function(obj) {
48
45
  return ret;
49
46
  };
50
47
 
51
- module.exports = keyMirror;
48
+ module.exports = keyMirror;
package/lib/keyOf.js CHANGED
@@ -19,7 +19,9 @@
19
19
  * 'xa12' in that case. Resolve keys you want to use once at startup time, then
20
20
  * reuse those resolutions.
21
21
  */
22
- var keyOf = function(oneKeyObj) {
22
+ "use strict";
23
+
24
+ var keyOf = function (oneKeyObj) {
23
25
  var key;
24
26
  for (key in oneKeyObj) {
25
27
  if (!oneKeyObj.hasOwnProperty(key)) {
@@ -30,5 +32,4 @@ var keyOf = function(oneKeyObj) {
30
32
  return null;
31
33
  };
32
34
 
33
-
34
- module.exports = keyOf;
35
+ module.exports = keyOf;
package/lib/mapObject.js CHANGED
@@ -48,4 +48,4 @@ function mapObject(object, callback, context) {
48
48
  return result;
49
49
  }
50
50
 
51
- module.exports = mapObject;
51
+ module.exports = mapObject;
@@ -20,7 +20,7 @@
20
20
  */
21
21
  function memoizeStringOnly(callback) {
22
22
  var cache = {};
23
- return function(string) {
23
+ return function (string) {
24
24
  if (!cache.hasOwnProperty(string)) {
25
25
  cache[string] = callback.call(this, string);
26
26
  }
@@ -28,4 +28,4 @@ function memoizeStringOnly(callback) {
28
28
  };
29
29
  }
30
30
 
31
- module.exports = memoizeStringOnly;
31
+ module.exports = memoizeStringOnly;
package/lib/onlyChild.js CHANGED
@@ -26,11 +26,8 @@ var invariant = require("./invariant");
26
26
  * structure.
27
27
  */
28
28
  function onlyChild(children) {
29
- ("production" !== process.env.NODE_ENV ? invariant(
30
- ReactElement.isValidElement(children),
31
- 'onlyChild must be passed a children with exactly one child.'
32
- ) : invariant(ReactElement.isValidElement(children)));
29
+ 'production' !== process.env.NODE_ENV ? invariant(ReactElement.isValidElement(children), 'onlyChild must be passed a children with exactly one child.') : invariant(ReactElement.isValidElement(children));
33
30
  return children;
34
31
  }
35
32
 
36
- module.exports = onlyChild;
33
+ module.exports = onlyChild;
@@ -17,10 +17,7 @@ var ExecutionEnvironment = require("./ExecutionEnvironment");
17
17
  var performance;
18
18
 
19
19
  if (ExecutionEnvironment.canUseDOM) {
20
- performance =
21
- window.performance ||
22
- window.msPerformance ||
23
- window.webkitPerformance;
20
+ performance = window.performance || window.msPerformance || window.webkitPerformance;
24
21
  }
25
22
 
26
- module.exports = performance || {};
23
+ module.exports = performance || {};
@@ -10,6 +10,8 @@
10
10
  * @typechecks
11
11
  */
12
12
 
13
+ 'use strict';
14
+
13
15
  var performance = require("./performance");
14
16
 
15
17
  /**
@@ -23,4 +25,4 @@ if (!performance || !performance.now) {
23
25
 
24
26
  var performanceNow = performance.now.bind(performance);
25
27
 
26
- module.exports = performanceNow;
28
+ module.exports = performanceNow;