react 15.3.1 → 15.4.0-rc.2

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 (189) hide show
  1. package/dist/react-with-addons.js +3901 -21391
  2. package/dist/react-with-addons.min.js +3 -6
  3. package/dist/react.js +2671 -19498
  4. package/dist/react.min.js +2 -6
  5. package/lib/LinkedStateMixin.js +1 -2
  6. package/lib/PooledClass.js +3 -0
  7. package/lib/ReactAddonsDOMDependencies.js +36 -0
  8. package/lib/ReactAddonsDOMDependenciesUMDShim.js +32 -0
  9. package/lib/ReactCSSTransitionGroup.js +60 -42
  10. package/lib/ReactCSSTransitionGroupChild.js +2 -2
  11. package/lib/ReactClass.js +38 -53
  12. package/lib/ReactComponentTreeHook.js +84 -100
  13. package/lib/{DOMNamespaces.js → ReactComponentTreeHookUMDShim.js} +5 -7
  14. package/lib/ReactCurrentOwner.js +1 -1
  15. package/lib/{renderSubtreeIntoContainer.js → ReactCurrentOwnerUMDShim.js} +6 -4
  16. package/lib/ReactElement.js +6 -29
  17. package/lib/ReactElementSymbol.js +20 -0
  18. package/lib/{ReactDOMComponentFlags.js → ReactElementType.js} +4 -9
  19. package/lib/ReactElementValidator.js +1 -2
  20. package/lib/ReactPropTypeLocationNames.js +1 -0
  21. package/lib/ReactPropTypeLocations.js +2 -11
  22. package/lib/ReactPropTypes.js +5 -2
  23. package/lib/ReactPropTypesSecret.js +1 -0
  24. package/lib/ReactTransitionEvents.js +1 -1
  25. package/lib/ReactTransitionGroup.js +145 -141
  26. package/lib/ReactUMDEntry.js +11 -5
  27. package/lib/{ReactDOMFeatureFlags.js → ReactUMDShim.js} +4 -6
  28. package/lib/ReactVersion.js +1 -1
  29. package/lib/ReactWithAddons.js +15 -2
  30. package/lib/ReactWithAddonsUMDEntry.js +11 -5
  31. package/lib/canDefineProperty.js +2 -0
  32. package/lib/traverseAllChildren.js +11 -2
  33. package/lib/update.js +6 -7
  34. package/package.json +1 -1
  35. package/lib/AutoFocusUtils.js +0 -24
  36. package/lib/BeforeInputEventPlugin.js +0 -388
  37. package/lib/CSSProperty.js +0 -148
  38. package/lib/CSSPropertyOperations.js +0 -205
  39. package/lib/CallbackQueue.js +0 -106
  40. package/lib/ChangeEventPlugin.js +0 -325
  41. package/lib/DOMChildrenOperations.js +0 -194
  42. package/lib/DOMLazyTree.js +0 -118
  43. package/lib/DOMProperty.js +0 -206
  44. package/lib/DOMPropertyOperations.js +0 -221
  45. package/lib/Danger.js +0 -48
  46. package/lib/DefaultEventPluginOrder.js +0 -27
  47. package/lib/DisabledInputUtils.js +0 -50
  48. package/lib/EnterLeaveEventPlugin.js +0 -105
  49. package/lib/EventConstants.js +0 -97
  50. package/lib/EventPluginHub.js +0 -251
  51. package/lib/EventPluginRegistry.js +0 -247
  52. package/lib/EventPluginUtils.js +0 -229
  53. package/lib/EventPropagators.js +0 -137
  54. package/lib/FallbackCompositionState.js +0 -95
  55. package/lib/HTMLDOMPropertyConfig.js +0 -209
  56. package/lib/LinkedValueUtils.js +0 -136
  57. package/lib/NativeMethodsMixin.js +0 -167
  58. package/lib/ReactBrowserEventEmitter.js +0 -317
  59. package/lib/ReactChildReconciler.js +0 -154
  60. package/lib/ReactChildrenMutationWarningHook.js +0 -54
  61. package/lib/ReactComponentBrowserEnvironment.js +0 -30
  62. package/lib/ReactComponentEnvironment.js +0 -45
  63. package/lib/ReactComponentTreeTestUtils.js +0 -87
  64. package/lib/ReactCompositeComponent.js +0 -920
  65. package/lib/ReactDOM.js +0 -110
  66. package/lib/ReactDOMButton.js +0 -24
  67. package/lib/ReactDOMComponent.js +0 -1005
  68. package/lib/ReactDOMComponentTree.js +0 -188
  69. package/lib/ReactDOMContainerInfo.js +0 -33
  70. package/lib/ReactDOMEmptyComponent.js +0 -60
  71. package/lib/ReactDOMFiber.js +0 -76
  72. package/lib/ReactDOMIDOperations.js +0 -34
  73. package/lib/ReactDOMInput.js +0 -269
  74. package/lib/ReactDOMNullInputValuePropHook.js +0 -43
  75. package/lib/ReactDOMOption.js +0 -123
  76. package/lib/ReactDOMSelect.js +0 -201
  77. package/lib/ReactDOMSelection.js +0 -212
  78. package/lib/ReactDOMServer.js +0 -26
  79. package/lib/ReactDOMTextComponent.js +0 -164
  80. package/lib/ReactDOMTextarea.js +0 -155
  81. package/lib/ReactDOMTreeTraversal.js +0 -136
  82. package/lib/ReactDOMUnknownPropertyHook.js +0 -112
  83. package/lib/ReactDebugTool.js +0 -307
  84. package/lib/ReactDefaultBatchingStrategy.js +0 -68
  85. package/lib/ReactDefaultInjection.js +0 -84
  86. package/lib/ReactEmptyComponent.js +0 -30
  87. package/lib/ReactErrorUtils.js +0 -76
  88. package/lib/ReactEventEmitterMixin.js +0 -33
  89. package/lib/ReactEventListener.js +0 -157
  90. package/lib/ReactFeatureFlags.js +0 -22
  91. package/lib/ReactHostComponent.js +0 -76
  92. package/lib/ReactHostOperationHistoryHook.js +0 -37
  93. package/lib/ReactInjection.js +0 -36
  94. package/lib/ReactInputSelection.js +0 -124
  95. package/lib/ReactInstanceHandles.js +0 -302
  96. package/lib/ReactInstanceMap.js +0 -48
  97. package/lib/ReactInstrumentation.js +0 -21
  98. package/lib/ReactInvalidSetStateWarningHook.js +0 -36
  99. package/lib/ReactMarkupChecksum.js +0 -50
  100. package/lib/ReactMount.js +0 -534
  101. package/lib/ReactMultiChild.js +0 -451
  102. package/lib/ReactMultiChildUpdateTypes.js +0 -32
  103. package/lib/ReactNative.js +0 -71
  104. package/lib/ReactNativeAttributePayload.js +0 -371
  105. package/lib/ReactNativeBaseComponent.js +0 -198
  106. package/lib/ReactNativeBridgeEventPlugin.js +0 -60
  107. package/lib/ReactNativeComponentEnvironment.js +0 -31
  108. package/lib/ReactNativeComponentTree.js +0 -68
  109. package/lib/ReactNativeContainerInfo.js +0 -21
  110. package/lib/ReactNativeDOMIDOperations.js +0 -79
  111. package/lib/ReactNativeDefaultInjection.js +0 -101
  112. package/lib/ReactNativeEventEmitter.js +0 -191
  113. package/lib/ReactNativeEventPluginOrder.js +0 -16
  114. package/lib/ReactNativeGlobalResponderHandler.js +0 -25
  115. package/lib/ReactNativeMount.js +0 -193
  116. package/lib/ReactNativePropRegistry.js +0 -52
  117. package/lib/ReactNativeReconcileTransaction.js +0 -116
  118. package/lib/ReactNativeTagHandles.js +0 -56
  119. package/lib/ReactNativeTextComponent.js +0 -71
  120. package/lib/ReactNativeTreeTraversal.js +0 -127
  121. package/lib/ReactNodeTypes.js +0 -40
  122. package/lib/ReactNoop.js +0 -173
  123. package/lib/ReactOwner.js +0 -94
  124. package/lib/ReactPerf.js +0 -494
  125. package/lib/ReactReconcileTransaction.js +0 -178
  126. package/lib/ReactReconciler.js +0 -168
  127. package/lib/ReactRef.js +0 -80
  128. package/lib/ReactServerBatchingStrategy.js +0 -22
  129. package/lib/ReactServerRendering.js +0 -90
  130. package/lib/ReactServerRenderingTransaction.js +0 -90
  131. package/lib/ReactServerUpdateQueue.js +0 -141
  132. package/lib/ReactSimpleEmptyComponent.js +0 -37
  133. package/lib/ReactTestMount.js +0 -126
  134. package/lib/ReactTestReconcileTransaction.js +0 -108
  135. package/lib/ReactTestRenderer.js +0 -144
  136. package/lib/ReactTestUtils.js +0 -518
  137. package/lib/ReactUpdateQueue.js +0 -226
  138. package/lib/ReactUpdates.js +0 -251
  139. package/lib/ResponderEventPlugin.js +0 -510
  140. package/lib/ResponderSyntheticEvent.js +0 -39
  141. package/lib/ResponderTouchHistoryStore.js +0 -184
  142. package/lib/SVGDOMPropertyConfig.js +0 -302
  143. package/lib/SelectEventPlugin.js +0 -196
  144. package/lib/SimpleEventPlugin.js +0 -635
  145. package/lib/SyntheticAnimationEvent.js +0 -39
  146. package/lib/SyntheticClipboardEvent.js +0 -38
  147. package/lib/SyntheticCompositionEvent.js +0 -36
  148. package/lib/SyntheticDragEvent.js +0 -36
  149. package/lib/SyntheticEvent.js +0 -267
  150. package/lib/SyntheticFocusEvent.js +0 -36
  151. package/lib/SyntheticInputEvent.js +0 -37
  152. package/lib/SyntheticKeyboardEvent.js +0 -84
  153. package/lib/SyntheticMouseEvent.js +0 -72
  154. package/lib/SyntheticTouchEvent.js +0 -45
  155. package/lib/SyntheticTransitionEvent.js +0 -39
  156. package/lib/SyntheticUIEvent.js +0 -59
  157. package/lib/SyntheticWheelEvent.js +0 -54
  158. package/lib/TapEventPlugin.js +0 -110
  159. package/lib/TouchHistoryMath.js +0 -99
  160. package/lib/Transaction.js +0 -233
  161. package/lib/ViewportMetrics.js +0 -27
  162. package/lib/accumulate.js +0 -46
  163. package/lib/accumulateInto.js +0 -58
  164. package/lib/adler32.js +0 -44
  165. package/lib/createMicrosoftUnsafeLocalFunction.js +0 -32
  166. package/lib/createReactNativeComponentClass.js +0 -42
  167. package/lib/dangerousStyleValue.js +0 -79
  168. package/lib/escapeTextContentForBrowser.js +0 -123
  169. package/lib/findDOMNode.js +0 -60
  170. package/lib/findNodeHandle.js +0 -91
  171. package/lib/forEachAccumulated.js +0 -31
  172. package/lib/getEventCharCode.js +0 -50
  173. package/lib/getEventKey.js +0 -102
  174. package/lib/getEventModifierState.js +0 -43
  175. package/lib/getEventTarget.js +0 -35
  176. package/lib/getHostComponentFromComposite.js +0 -30
  177. package/lib/getNodeForCharacterOffset.js +0 -74
  178. package/lib/getTestDocument.js +0 -21
  179. package/lib/getTextContentAccessor.js +0 -33
  180. package/lib/getVendorPrefixedEventName.js +0 -101
  181. package/lib/instantiateReactComponent.js +0 -119
  182. package/lib/isEventSupported.js +0 -60
  183. package/lib/isTextInputElement.js +0 -51
  184. package/lib/quoteAttributeValueForBrowser.js +0 -26
  185. package/lib/reactComponentExpect.js +0 -217
  186. package/lib/setInnerHTML.js +0 -98
  187. package/lib/setTextContent.js +0 -48
  188. package/lib/shouldUpdateReactComponent.js +0 -42
  189. package/lib/validateDOMNesting.js +0 -369
@@ -1,99 +0,0 @@
1
- /**
2
- * @providesModule TouchHistoryMath
3
- */
4
-
5
- 'use strict';
6
-
7
- var TouchHistoryMath = {
8
- /**
9
- * This code is optimized and not intended to look beautiful. This allows
10
- * computing of touch centroids that have moved after `touchesChangedAfter`
11
- * timeStamp. You can compute the current centroid involving all touches
12
- * moves after `touchesChangedAfter`, or you can compute the previous
13
- * centroid of all touches that were moved after `touchesChangedAfter`.
14
- *
15
- * @param {TouchHistoryMath} touchHistory Standard Responder touch track
16
- * data.
17
- * @param {number} touchesChangedAfter timeStamp after which moved touches
18
- * are considered "actively moving" - not just "active".
19
- * @param {boolean} isXAxis Consider `x` dimension vs. `y` dimension.
20
- * @param {boolean} ofCurrent Compute current centroid for actively moving
21
- * touches vs. previous centroid of now actively moving touches.
22
- * @return {number} value of centroid in specified dimension.
23
- */
24
- centroidDimension: function (touchHistory, touchesChangedAfter, isXAxis, ofCurrent) {
25
- var touchBank = touchHistory.touchBank;
26
- var total = 0;
27
- var count = 0;
28
-
29
- var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null;
30
-
31
- if (oneTouchData !== null) {
32
- if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
33
- total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
34
- count = 1;
35
- }
36
- } else {
37
- for (var i = 0; i < touchBank.length; i++) {
38
- var touchTrack = touchBank[i];
39
- if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) {
40
- var toAdd; // Yuck, program temporarily in invalid state.
41
- if (ofCurrent && isXAxis) {
42
- toAdd = touchTrack.currentPageX;
43
- } else if (ofCurrent && !isXAxis) {
44
- toAdd = touchTrack.currentPageY;
45
- } else if (!ofCurrent && isXAxis) {
46
- toAdd = touchTrack.previousPageX;
47
- } else {
48
- toAdd = touchTrack.previousPageY;
49
- }
50
- total += toAdd;
51
- count++;
52
- }
53
- }
54
- }
55
- return count > 0 ? total / count : TouchHistoryMath.noCentroid;
56
- },
57
-
58
- currentCentroidXOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
59
- return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis
60
- true // ofCurrent
61
- );
62
- },
63
-
64
- currentCentroidYOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
65
- return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis
66
- true // ofCurrent
67
- );
68
- },
69
-
70
- previousCentroidXOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
71
- return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, // isXAxis
72
- false // ofCurrent
73
- );
74
- },
75
-
76
- previousCentroidYOfTouchesChangedAfter: function (touchHistory, touchesChangedAfter) {
77
- return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, // isXAxis
78
- false // ofCurrent
79
- );
80
- },
81
-
82
- currentCentroidX: function (touchHistory) {
83
- return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter
84
- true, // isXAxis
85
- true // ofCurrent
86
- );
87
- },
88
-
89
- currentCentroidY: function (touchHistory) {
90
- return TouchHistoryMath.centroidDimension(touchHistory, 0, // touchesChangedAfter
91
- false, // isXAxis
92
- true // ofCurrent
93
- );
94
- },
95
-
96
- noCentroid: -1
97
- };
98
-
99
- module.exports = TouchHistoryMath;
@@ -1,233 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule Transaction
10
- */
11
-
12
- 'use strict';
13
-
14
- var _prodInvariant = require('./reactProdInvariant');
15
-
16
- var invariant = require('fbjs/lib/invariant');
17
-
18
- /**
19
- * `Transaction` creates a black box that is able to wrap any method such that
20
- * certain invariants are maintained before and after the method is invoked
21
- * (Even if an exception is thrown while invoking the wrapped method). Whoever
22
- * instantiates a transaction can provide enforcers of the invariants at
23
- * creation time. The `Transaction` class itself will supply one additional
24
- * automatic invariant for you - the invariant that any transaction instance
25
- * should not be run while it is already being run. You would typically create a
26
- * single instance of a `Transaction` for reuse multiple times, that potentially
27
- * is used to wrap several different methods. Wrappers are extremely simple -
28
- * they only require implementing two methods.
29
- *
30
- * <pre>
31
- * wrappers (injected at creation time)
32
- * + +
33
- * | |
34
- * +-----------------|--------|--------------+
35
- * | v | |
36
- * | +---------------+ | |
37
- * | +--| wrapper1 |---|----+ |
38
- * | | +---------------+ v | |
39
- * | | +-------------+ | |
40
- * | | +----| wrapper2 |--------+ |
41
- * | | | +-------------+ | | |
42
- * | | | | | |
43
- * | v v v v | wrapper
44
- * | +---+ +---+ +---------+ +---+ +---+ | invariants
45
- * perform(anyMethod) | | | | | | | | | | | | maintained
46
- * +----------------->|-|---|-|---|-->|anyMethod|---|---|-|---|-|-------->
47
- * | | | | | | | | | | | |
48
- * | | | | | | | | | | | |
49
- * | | | | | | | | | | | |
50
- * | +---+ +---+ +---------+ +---+ +---+ |
51
- * | initialize close |
52
- * +-----------------------------------------+
53
- * </pre>
54
- *
55
- * Use cases:
56
- * - Preserving the input selection ranges before/after reconciliation.
57
- * Restoring selection even in the event of an unexpected error.
58
- * - Deactivating events while rearranging the DOM, preventing blurs/focuses,
59
- * while guaranteeing that afterwards, the event system is reactivated.
60
- * - Flushing a queue of collected DOM mutations to the main UI thread after a
61
- * reconciliation takes place in a worker thread.
62
- * - Invoking any collected `componentDidUpdate` callbacks after rendering new
63
- * content.
64
- * - (Future use case): Wrapping particular flushes of the `ReactWorker` queue
65
- * to preserve the `scrollTop` (an automatic scroll aware DOM).
66
- * - (Future use case): Layout calculations before and after DOM updates.
67
- *
68
- * Transactional plugin API:
69
- * - A module that has an `initialize` method that returns any precomputation.
70
- * - and a `close` method that accepts the precomputation. `close` is invoked
71
- * when the wrapped process is completed, or has failed.
72
- *
73
- * @param {Array<TransactionalWrapper>} transactionWrapper Wrapper modules
74
- * that implement `initialize` and `close`.
75
- * @return {Transaction} Single transaction for reuse in thread.
76
- *
77
- * @class Transaction
78
- */
79
- var Mixin = {
80
- /**
81
- * Sets up this instance so that it is prepared for collecting metrics. Does
82
- * so such that this setup method may be used on an instance that is already
83
- * initialized, in a way that does not consume additional memory upon reuse.
84
- * That can be useful if you decide to make your subclass of this mixin a
85
- * "PooledClass".
86
- */
87
- reinitializeTransaction: function () {
88
- this.transactionWrappers = this.getTransactionWrappers();
89
- if (this.wrapperInitData) {
90
- this.wrapperInitData.length = 0;
91
- } else {
92
- this.wrapperInitData = [];
93
- }
94
- this._isInTransaction = false;
95
- },
96
-
97
- _isInTransaction: false,
98
-
99
- /**
100
- * @abstract
101
- * @return {Array<TransactionWrapper>} Array of transaction wrappers.
102
- */
103
- getTransactionWrappers: null,
104
-
105
- isInTransaction: function () {
106
- return !!this._isInTransaction;
107
- },
108
-
109
- /**
110
- * Executes the function within a safety window. Use this for the top level
111
- * methods that result in large amounts of computation/mutations that would
112
- * need to be safety checked. The optional arguments helps prevent the need
113
- * to bind in many cases.
114
- *
115
- * @param {function} method Member of scope to call.
116
- * @param {Object} scope Scope to invoke from.
117
- * @param {Object?=} a Argument to pass to the method.
118
- * @param {Object?=} b Argument to pass to the method.
119
- * @param {Object?=} c Argument to pass to the method.
120
- * @param {Object?=} d Argument to pass to the method.
121
- * @param {Object?=} e Argument to pass to the method.
122
- * @param {Object?=} f Argument to pass to the method.
123
- *
124
- * @return {*} Return value from `method`.
125
- */
126
- perform: function (method, scope, a, b, c, d, e, f) {
127
- !!this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.perform(...): Cannot initialize a transaction when there is already an outstanding transaction.') : _prodInvariant('27') : void 0;
128
- var errorThrown;
129
- var ret;
130
- try {
131
- this._isInTransaction = true;
132
- // Catching errors makes debugging more difficult, so we start with
133
- // errorThrown set to true before setting it to false after calling
134
- // close -- if it's still set to true in the finally block, it means
135
- // one of these calls threw.
136
- errorThrown = true;
137
- this.initializeAll(0);
138
- ret = method.call(scope, a, b, c, d, e, f);
139
- errorThrown = false;
140
- } finally {
141
- try {
142
- if (errorThrown) {
143
- // If `method` throws, prefer to show that stack trace over any thrown
144
- // by invoking `closeAll`.
145
- try {
146
- this.closeAll(0);
147
- } catch (err) {}
148
- } else {
149
- // Since `method` didn't throw, we don't want to silence the exception
150
- // here.
151
- this.closeAll(0);
152
- }
153
- } finally {
154
- this._isInTransaction = false;
155
- }
156
- }
157
- return ret;
158
- },
159
-
160
- initializeAll: function (startIndex) {
161
- var transactionWrappers = this.transactionWrappers;
162
- for (var i = startIndex; i < transactionWrappers.length; i++) {
163
- var wrapper = transactionWrappers[i];
164
- try {
165
- // Catching errors makes debugging more difficult, so we start with the
166
- // OBSERVED_ERROR state before overwriting it with the real return value
167
- // of initialize -- if it's still set to OBSERVED_ERROR in the finally
168
- // block, it means wrapper.initialize threw.
169
- this.wrapperInitData[i] = Transaction.OBSERVED_ERROR;
170
- this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null;
171
- } finally {
172
- if (this.wrapperInitData[i] === Transaction.OBSERVED_ERROR) {
173
- // The initializer for wrapper i threw an error; initialize the
174
- // remaining wrappers but silence any exceptions from them to ensure
175
- // that the first error is the one to bubble up.
176
- try {
177
- this.initializeAll(i + 1);
178
- } catch (err) {}
179
- }
180
- }
181
- }
182
- },
183
-
184
- /**
185
- * Invokes each of `this.transactionWrappers.close[i]` functions, passing into
186
- * them the respective return values of `this.transactionWrappers.init[i]`
187
- * (`close`rs that correspond to initializers that failed will not be
188
- * invoked).
189
- */
190
- closeAll: function (startIndex) {
191
- !this.isInTransaction() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Transaction.closeAll(): Cannot close transaction when none are open.') : _prodInvariant('28') : void 0;
192
- var transactionWrappers = this.transactionWrappers;
193
- for (var i = startIndex; i < transactionWrappers.length; i++) {
194
- var wrapper = transactionWrappers[i];
195
- var initData = this.wrapperInitData[i];
196
- var errorThrown;
197
- try {
198
- // Catching errors makes debugging more difficult, so we start with
199
- // errorThrown set to true before setting it to false after calling
200
- // close -- if it's still set to true in the finally block, it means
201
- // wrapper.close threw.
202
- errorThrown = true;
203
- if (initData !== Transaction.OBSERVED_ERROR && wrapper.close) {
204
- wrapper.close.call(this, initData);
205
- }
206
- errorThrown = false;
207
- } finally {
208
- if (errorThrown) {
209
- // The closer for wrapper i threw an error; close the remaining
210
- // wrappers but silence any exceptions from them to ensure that the
211
- // first error is the one to bubble up.
212
- try {
213
- this.closeAll(i + 1);
214
- } catch (e) {}
215
- }
216
- }
217
- }
218
- this.wrapperInitData.length = 0;
219
- }
220
- };
221
-
222
- var Transaction = {
223
-
224
- Mixin: Mixin,
225
-
226
- /**
227
- * Token to look for to determine if an error occurred.
228
- */
229
- OBSERVED_ERROR: {}
230
-
231
- };
232
-
233
- module.exports = Transaction;
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule ViewportMetrics
10
- */
11
-
12
- 'use strict';
13
-
14
- var ViewportMetrics = {
15
-
16
- currentScrollLeft: 0,
17
-
18
- currentScrollTop: 0,
19
-
20
- refreshScrollValues: function (scrollPosition) {
21
- ViewportMetrics.currentScrollLeft = scrollPosition.x;
22
- ViewportMetrics.currentScrollTop = scrollPosition.y;
23
- }
24
-
25
- };
26
-
27
- module.exports = ViewportMetrics;
package/lib/accumulate.js DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * Copyright 2013-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule accumulate
10
- *
11
- */
12
-
13
- 'use strict';
14
-
15
- var _prodInvariant = require('./reactProdInvariant');
16
-
17
- var invariant = require('fbjs/lib/invariant');
18
-
19
- /**
20
- * Accumulates items that must not be null or undefined.
21
- *
22
- * This is used to conserve memory by avoiding array allocations.
23
- *
24
- * @return {*|array<*>} An accumulation of items.
25
- */
26
- function accumulate(current, next) {
27
- !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulate(...): Accumulated items must be not be null or undefined.') : _prodInvariant('29') : void 0;
28
-
29
- if (current == null) {
30
- return next;
31
- }
32
-
33
- // Both are not empty. Warning: Never call x.concat(y) when you are not
34
- // certain that x is an Array (x could be a string with concat method).
35
- if (Array.isArray(current)) {
36
- return current.concat(next);
37
- }
38
-
39
- if (Array.isArray(next)) {
40
- return [current].concat(next);
41
- }
42
-
43
- return [current, next];
44
- }
45
-
46
- module.exports = accumulate;
@@ -1,58 +0,0 @@
1
- /**
2
- * Copyright 2014-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule accumulateInto
10
- *
11
- */
12
-
13
- 'use strict';
14
-
15
- var _prodInvariant = require('./reactProdInvariant');
16
-
17
- var invariant = require('fbjs/lib/invariant');
18
-
19
- /**
20
- * Accumulates items that must not be null or undefined into the first one. This
21
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
22
- * API cleanness. Since `current` can be null before being passed in and not
23
- * null after this function, make sure to assign it back to `current`:
24
- *
25
- * `a = accumulateInto(a, b);`
26
- *
27
- * This API should be sparingly used. Try `accumulate` for something cleaner.
28
- *
29
- * @return {*|array<*>} An accumulation of items.
30
- */
31
-
32
- function accumulateInto(current, next) {
33
- !(next != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : _prodInvariant('30') : void 0;
34
-
35
- if (current == null) {
36
- return next;
37
- }
38
-
39
- // Both are not empty. Warning: Never call x.concat(y) when you are not
40
- // certain that x is an Array (x could be a string with concat method).
41
- if (Array.isArray(current)) {
42
- if (Array.isArray(next)) {
43
- current.push.apply(current, next);
44
- return current;
45
- }
46
- current.push(next);
47
- return current;
48
- }
49
-
50
- if (Array.isArray(next)) {
51
- // A bit too dangerous to mutate `next`.
52
- return [current].concat(next);
53
- }
54
-
55
- return [current, next];
56
- }
57
-
58
- module.exports = accumulateInto;