mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
React sync for revisions 1c2876d...7a3416f
Reviewed By: bvaughn Differential Revision: D7526137 fbshipit-source-id: 9f9db8a6b56cb4ae581a7b8d28079ec38de2180f
This commit is contained in:
parent
9b9b6c845e
commit
445b0c7080
@ -1 +1 @@
|
|||||||
1c2876d5b558b8591feb335d8d7204bc46f7da8a
|
7a3416f27532ac25849dfbc505300d469b43bbcc
|
@ -4765,6 +4765,14 @@ var ReactStrictModeWarnings = {
|
|||||||
var didWarnAboutDeprecatedLifecycles = new Set();
|
var didWarnAboutDeprecatedLifecycles = new Set();
|
||||||
var didWarnAboutUnsafeLifecycles = new Set();
|
var didWarnAboutUnsafeLifecycles = new Set();
|
||||||
|
|
||||||
|
var setToSortedString = function(set) {
|
||||||
|
var array = [];
|
||||||
|
set.forEach(function(value) {
|
||||||
|
array.push(value);
|
||||||
|
});
|
||||||
|
return array.sort().join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
||||||
pendingComponentWillMountWarnings = [];
|
pendingComponentWillMountWarnings = [];
|
||||||
pendingComponentWillReceivePropsWarnings = [];
|
pendingComponentWillReceivePropsWarnings = [];
|
||||||
@ -4790,9 +4798,7 @@ var ReactStrictModeWarnings = {
|
|||||||
|
|
||||||
var formatted = lifecycle.replace("UNSAFE_", "");
|
var formatted = lifecycle.replace("UNSAFE_", "");
|
||||||
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
||||||
var sortedComponentNames = Array.from(componentNames)
|
var sortedComponentNames = setToSortedString(componentNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lifecyclesWarningMesages.push(
|
lifecyclesWarningMesages.push(
|
||||||
formatted +
|
formatted +
|
||||||
@ -4844,9 +4850,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var sortedNames = Array.from(uniqueNames)
|
var sortedNames = setToSortedString(uniqueNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -4869,9 +4873,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var _sortedNames = Array.from(_uniqueNames)
|
var _sortedNames = setToSortedString(_uniqueNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -4893,9 +4895,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var _sortedNames2 = Array.from(_uniqueNames2)
|
var _sortedNames2 = setToSortedString(_uniqueNames2);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -6217,7 +6217,6 @@ var ReactFiberClassComponent = function(
|
|||||||
if (
|
if (
|
||||||
typeof instance.getSnapshotBeforeUpdate === "function" &&
|
typeof instance.getSnapshotBeforeUpdate === "function" &&
|
||||||
typeof instance.componentDidUpdate !== "function" &&
|
typeof instance.componentDidUpdate !== "function" &&
|
||||||
typeof instance.componentDidUpdate !== "function" &&
|
|
||||||
!didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)
|
!didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)
|
||||||
) {
|
) {
|
||||||
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
|
||||||
@ -9199,6 +9198,10 @@ var ReactFiberBeginWork = function(
|
|||||||
changedBits,
|
changedBits,
|
||||||
renderExpirationTime
|
renderExpirationTime
|
||||||
);
|
);
|
||||||
|
} else if (oldProps === newProps) {
|
||||||
|
// Skip over a memoized parent with a bitmask bailout even
|
||||||
|
// if we began working on it because of a deeper matching child.
|
||||||
|
return bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
}
|
}
|
||||||
// There is no bailout on `children` equality because we expect people
|
// There is no bailout on `children` equality because we expect people
|
||||||
// to often pass a bound method as a child, but it may reference
|
// to often pass a bound method as a child, but it may reference
|
||||||
|
@ -3656,33 +3656,40 @@ function ReactFiberBeginWork(
|
|||||||
renderExpirationTime
|
renderExpirationTime
|
||||||
);
|
);
|
||||||
case 12:
|
case 12:
|
||||||
fn = workInProgress.type;
|
a: {
|
||||||
unmaskedContext = workInProgress.pendingProps;
|
fn = workInProgress.type;
|
||||||
var oldProps = workInProgress.memoizedProps;
|
unmaskedContext = workInProgress.pendingProps;
|
||||||
props = fn._currentValue;
|
updateQueue = workInProgress.memoizedProps;
|
||||||
updateQueue = fn._changedBits;
|
props = fn._currentValue;
|
||||||
if (
|
var changedBits = fn._changedBits;
|
||||||
hasLegacyContextChanged() ||
|
if (
|
||||||
0 !== updateQueue ||
|
hasLegacyContextChanged() ||
|
||||||
oldProps !== unmaskedContext
|
0 !== changedBits ||
|
||||||
) {
|
updateQueue !== unmaskedContext
|
||||||
workInProgress.memoizedProps = unmaskedContext;
|
) {
|
||||||
oldProps = unmaskedContext.unstable_observedBits;
|
workInProgress.memoizedProps = unmaskedContext;
|
||||||
if (void 0 === oldProps || null === oldProps) oldProps = 1073741823;
|
var observedBits = unmaskedContext.unstable_observedBits;
|
||||||
workInProgress.stateNode = oldProps;
|
if (void 0 === observedBits || null === observedBits)
|
||||||
0 !== (updateQueue & oldProps) &&
|
observedBits = 1073741823;
|
||||||
propagateContextChange(
|
workInProgress.stateNode = observedBits;
|
||||||
workInProgress,
|
if (0 !== (changedBits & observedBits))
|
||||||
fn,
|
propagateContextChange(
|
||||||
updateQueue,
|
workInProgress,
|
||||||
renderExpirationTime
|
fn,
|
||||||
);
|
changedBits,
|
||||||
renderExpirationTime = unmaskedContext.children;
|
renderExpirationTime
|
||||||
renderExpirationTime = renderExpirationTime(props);
|
);
|
||||||
reconcileChildren(current, workInProgress, renderExpirationTime);
|
else if (updateQueue === unmaskedContext) {
|
||||||
current = workInProgress.child;
|
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
} else
|
break a;
|
||||||
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
}
|
||||||
|
renderExpirationTime = unmaskedContext.children;
|
||||||
|
renderExpirationTime = renderExpirationTime(props);
|
||||||
|
reconcileChildren(current, workInProgress, renderExpirationTime);
|
||||||
|
current = workInProgress.child;
|
||||||
|
} else
|
||||||
|
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
|
}
|
||||||
return current;
|
return current;
|
||||||
default:
|
default:
|
||||||
invariant(
|
invariant(
|
||||||
|
@ -2995,6 +2995,75 @@ var TouchHistoryMath = {
|
|||||||
|
|
||||||
var ReactVersion = "16.3.1";
|
var ReactVersion = "16.3.1";
|
||||||
|
|
||||||
|
var describeComponentFrame = function(name, source, ownerName) {
|
||||||
|
return (
|
||||||
|
"\n in " +
|
||||||
|
(name || "Unknown") +
|
||||||
|
(source
|
||||||
|
? " (at " +
|
||||||
|
source.fileName.replace(/^.*[\\\/]/, "") +
|
||||||
|
":" +
|
||||||
|
source.lineNumber +
|
||||||
|
")"
|
||||||
|
: ownerName ? " (created by " + ownerName + ")" : "")
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
function getComponentName(fiber) {
|
||||||
|
var type = fiber.type;
|
||||||
|
|
||||||
|
if (typeof type === "function") {
|
||||||
|
return type.displayName || type.name;
|
||||||
|
}
|
||||||
|
if (typeof type === "string") {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "ReactFragment";
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "ReactPortal";
|
||||||
|
case REACT_CALL_TYPE:
|
||||||
|
return "ReactCall";
|
||||||
|
case REACT_RETURN_TYPE:
|
||||||
|
return "ReactReturn";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function describeFiber(fiber) {
|
||||||
|
switch (fiber.tag) {
|
||||||
|
case IndeterminateComponent:
|
||||||
|
case FunctionalComponent:
|
||||||
|
case ClassComponent:
|
||||||
|
case HostComponent:
|
||||||
|
var owner = fiber._debugOwner;
|
||||||
|
var source = fiber._debugSource;
|
||||||
|
var name = getComponentName(fiber);
|
||||||
|
var ownerName = null;
|
||||||
|
if (owner) {
|
||||||
|
ownerName = getComponentName(owner);
|
||||||
|
}
|
||||||
|
return describeComponentFrame(name, source, ownerName);
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function can only be called with a work-in-progress fiber and
|
||||||
|
// only during begin or complete phase. Do not call it under any other
|
||||||
|
// circumstances.
|
||||||
|
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
||||||
|
var info = "";
|
||||||
|
var node = workInProgress;
|
||||||
|
do {
|
||||||
|
info += describeFiber(node);
|
||||||
|
// Otherwise this return pointer might point to the wrong tree:
|
||||||
|
node = node["return"];
|
||||||
|
} while (node);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
function _classCallCheck(instance, Constructor) {
|
function _classCallCheck(instance, Constructor) {
|
||||||
if (!(instance instanceof Constructor)) {
|
if (!(instance instanceof Constructor)) {
|
||||||
throw new TypeError("Cannot call a class as a function");
|
throw new TypeError("Cannot call a class as a function");
|
||||||
@ -3589,28 +3658,6 @@ var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|||||||
var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
|
var ReactCurrentOwner = ReactInternals.ReactCurrentOwner;
|
||||||
var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
var ReactDebugCurrentFrame = ReactInternals.ReactDebugCurrentFrame;
|
||||||
|
|
||||||
function getComponentName(fiber) {
|
|
||||||
var type = fiber.type;
|
|
||||||
|
|
||||||
if (typeof type === "function") {
|
|
||||||
return type.displayName || type.name;
|
|
||||||
}
|
|
||||||
if (typeof type === "string") {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
switch (type) {
|
|
||||||
case REACT_FRAGMENT_TYPE:
|
|
||||||
return "ReactFragment";
|
|
||||||
case REACT_PORTAL_TYPE:
|
|
||||||
return "ReactPortal";
|
|
||||||
case REACT_CALL_TYPE:
|
|
||||||
return "ReactCall";
|
|
||||||
case REACT_RETURN_TYPE:
|
|
||||||
return "ReactReturn";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Share this module between Fabric and React Native renderers
|
// TODO: Share this module between Fabric and React Native renderers
|
||||||
// so that both can be used in the same tree.
|
// so that both can be used in the same tree.
|
||||||
|
|
||||||
@ -4878,53 +4925,6 @@ function onCommitUnmount(fiber) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var describeComponentFrame = function(name, source, ownerName) {
|
|
||||||
return (
|
|
||||||
"\n in " +
|
|
||||||
(name || "Unknown") +
|
|
||||||
(source
|
|
||||||
? " (at " +
|
|
||||||
source.fileName.replace(/^.*[\\\/]/, "") +
|
|
||||||
":" +
|
|
||||||
source.lineNumber +
|
|
||||||
")"
|
|
||||||
: ownerName ? " (created by " + ownerName + ")" : "")
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
function describeFiber(fiber) {
|
|
||||||
switch (fiber.tag) {
|
|
||||||
case IndeterminateComponent:
|
|
||||||
case FunctionalComponent:
|
|
||||||
case ClassComponent:
|
|
||||||
case HostComponent:
|
|
||||||
var owner = fiber._debugOwner;
|
|
||||||
var source = fiber._debugSource;
|
|
||||||
var name = getComponentName(fiber);
|
|
||||||
var ownerName = null;
|
|
||||||
if (owner) {
|
|
||||||
ownerName = getComponentName(owner);
|
|
||||||
}
|
|
||||||
return describeComponentFrame(name, source, ownerName);
|
|
||||||
default:
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This function can only be called with a work-in-progress fiber and
|
|
||||||
// only during begin or complete phase. Do not call it under any other
|
|
||||||
// circumstances.
|
|
||||||
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
|
||||||
var info = "";
|
|
||||||
var node = workInProgress;
|
|
||||||
do {
|
|
||||||
info += describeFiber(node);
|
|
||||||
// Otherwise this return pointer might point to the wrong tree:
|
|
||||||
node = node["return"];
|
|
||||||
} while (node);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forked from fbjs/warning:
|
* Forked from fbjs/warning:
|
||||||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
||||||
@ -5019,6 +5019,14 @@ var ReactStrictModeWarnings = {
|
|||||||
var didWarnAboutDeprecatedLifecycles = new Set();
|
var didWarnAboutDeprecatedLifecycles = new Set();
|
||||||
var didWarnAboutUnsafeLifecycles = new Set();
|
var didWarnAboutUnsafeLifecycles = new Set();
|
||||||
|
|
||||||
|
var setToSortedString = function(set) {
|
||||||
|
var array = [];
|
||||||
|
set.forEach(function(value) {
|
||||||
|
array.push(value);
|
||||||
|
});
|
||||||
|
return array.sort().join(", ");
|
||||||
|
};
|
||||||
|
|
||||||
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
ReactStrictModeWarnings.discardPendingWarnings = function() {
|
||||||
pendingComponentWillMountWarnings = [];
|
pendingComponentWillMountWarnings = [];
|
||||||
pendingComponentWillReceivePropsWarnings = [];
|
pendingComponentWillReceivePropsWarnings = [];
|
||||||
@ -5044,9 +5052,7 @@ var ReactStrictModeWarnings = {
|
|||||||
|
|
||||||
var formatted = lifecycle.replace("UNSAFE_", "");
|
var formatted = lifecycle.replace("UNSAFE_", "");
|
||||||
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
|
||||||
var sortedComponentNames = Array.from(componentNames)
|
var sortedComponentNames = setToSortedString(componentNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lifecyclesWarningMesages.push(
|
lifecyclesWarningMesages.push(
|
||||||
formatted +
|
formatted +
|
||||||
@ -5098,9 +5104,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var sortedNames = Array.from(uniqueNames)
|
var sortedNames = setToSortedString(uniqueNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -5123,9 +5127,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var _sortedNames = Array.from(_uniqueNames)
|
var _sortedNames = setToSortedString(_uniqueNames);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -5147,9 +5149,7 @@ var ReactStrictModeWarnings = {
|
|||||||
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
didWarnAboutDeprecatedLifecycles.add(fiber.type);
|
||||||
});
|
});
|
||||||
|
|
||||||
var _sortedNames2 = Array.from(_uniqueNames2)
|
var _sortedNames2 = setToSortedString(_uniqueNames2);
|
||||||
.sort()
|
|
||||||
.join(", ");
|
|
||||||
|
|
||||||
lowPriorityWarning$1(
|
lowPriorityWarning$1(
|
||||||
false,
|
false,
|
||||||
@ -6475,7 +6475,6 @@ var ReactFiberClassComponent = function(
|
|||||||
if (
|
if (
|
||||||
typeof instance.getSnapshotBeforeUpdate === "function" &&
|
typeof instance.getSnapshotBeforeUpdate === "function" &&
|
||||||
typeof instance.componentDidUpdate !== "function" &&
|
typeof instance.componentDidUpdate !== "function" &&
|
||||||
typeof instance.componentDidUpdate !== "function" &&
|
|
||||||
!didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)
|
!didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(type)
|
||||||
) {
|
) {
|
||||||
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
|
didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(type);
|
||||||
@ -9457,6 +9456,10 @@ var ReactFiberBeginWork = function(
|
|||||||
changedBits,
|
changedBits,
|
||||||
renderExpirationTime
|
renderExpirationTime
|
||||||
);
|
);
|
||||||
|
} else if (oldProps === newProps) {
|
||||||
|
// Skip over a memoized parent with a bitmask bailout even
|
||||||
|
// if we began working on it because of a deeper matching child.
|
||||||
|
return bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
}
|
}
|
||||||
// There is no bailout on `children` equality because we expect people
|
// There is no bailout on `children` equality because we expect people
|
||||||
// to often pass a bound method as a child, but it may reference
|
// to often pass a bound method as a child, but it may reference
|
||||||
@ -14707,6 +14710,14 @@ injectFindHostInstance(NativeRenderer.findHostInstance);
|
|||||||
|
|
||||||
injection$2.injectRenderer(NativeRenderer);
|
injection$2.injectRenderer(NativeRenderer);
|
||||||
|
|
||||||
|
function computeComponentStackForErrorReporting(reactTag) {
|
||||||
|
var fiber = getInstanceFromTag(reactTag);
|
||||||
|
if (!fiber) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return getStackAddendumByWorkInProgressFiber(fiber);
|
||||||
|
}
|
||||||
|
|
||||||
var roots = new Map();
|
var roots = new Map();
|
||||||
|
|
||||||
var ReactNativeRenderer = {
|
var ReactNativeRenderer = {
|
||||||
@ -14762,7 +14773,8 @@ var ReactNativeRenderer = {
|
|||||||
ReactNativePropRegistry: ReactNativePropRegistry, // flattenStyle, Stylesheet
|
ReactNativePropRegistry: ReactNativePropRegistry, // flattenStyle, Stylesheet
|
||||||
TouchHistoryMath: TouchHistoryMath, // PanResponder
|
TouchHistoryMath: TouchHistoryMath, // PanResponder
|
||||||
createReactNativeComponentClass: createReactNativeComponentClass, // RCTText, RCTView, ReactNativeART
|
createReactNativeComponentClass: createReactNativeComponentClass, // RCTText, RCTView, ReactNativeART
|
||||||
takeSnapshot: takeSnapshot
|
takeSnapshot: takeSnapshot, // react-native-implementation
|
||||||
|
computeComponentStackForErrorReporting: computeComponentStackForErrorReporting
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1198,107 +1198,152 @@ function createPortal(children, containerInfo, implementation) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
var TouchHistoryMath = {
|
var TouchHistoryMath = {
|
||||||
centroidDimension: function(
|
centroidDimension: function(
|
||||||
touchHistory,
|
touchHistory,
|
||||||
touchesChangedAfter,
|
touchesChangedAfter,
|
||||||
isXAxis,
|
isXAxis,
|
||||||
ofCurrent
|
ofCurrent
|
||||||
) {
|
) {
|
||||||
var touchBank = touchHistory.touchBank,
|
var touchBank = touchHistory.touchBank,
|
||||||
total = 0,
|
total = 0,
|
||||||
count = 0;
|
count = 0;
|
||||||
touchHistory =
|
touchHistory =
|
||||||
1 === touchHistory.numberActiveTouches
|
1 === touchHistory.numberActiveTouches
|
||||||
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
|
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
|
||||||
: null;
|
: null;
|
||||||
if (null !== touchHistory)
|
if (null !== touchHistory)
|
||||||
touchHistory.touchActive &&
|
touchHistory.touchActive &&
|
||||||
touchHistory.currentTimeStamp > touchesChangedAfter &&
|
touchHistory.currentTimeStamp > touchesChangedAfter &&
|
||||||
|
((total +=
|
||||||
|
ofCurrent && isXAxis
|
||||||
|
? touchHistory.currentPageX
|
||||||
|
: ofCurrent && !isXAxis
|
||||||
|
? touchHistory.currentPageY
|
||||||
|
: !ofCurrent && isXAxis
|
||||||
|
? touchHistory.previousPageX
|
||||||
|
: touchHistory.previousPageY),
|
||||||
|
(count = 1));
|
||||||
|
else
|
||||||
|
for (touchHistory = 0; touchHistory < touchBank.length; touchHistory++) {
|
||||||
|
var touchTrack = touchBank[touchHistory];
|
||||||
|
null !== touchTrack &&
|
||||||
|
void 0 !== touchTrack &&
|
||||||
|
touchTrack.touchActive &&
|
||||||
|
touchTrack.currentTimeStamp >= touchesChangedAfter &&
|
||||||
((total +=
|
((total +=
|
||||||
ofCurrent && isXAxis
|
ofCurrent && isXAxis
|
||||||
? touchHistory.currentPageX
|
? touchTrack.currentPageX
|
||||||
: ofCurrent && !isXAxis
|
: ofCurrent && !isXAxis
|
||||||
? touchHistory.currentPageY
|
? touchTrack.currentPageY
|
||||||
: !ofCurrent && isXAxis
|
: !ofCurrent && isXAxis
|
||||||
? touchHistory.previousPageX
|
? touchTrack.previousPageX
|
||||||
: touchHistory.previousPageY),
|
: touchTrack.previousPageY),
|
||||||
(count = 1));
|
count++);
|
||||||
else
|
}
|
||||||
for (
|
return 0 < count ? total / count : TouchHistoryMath.noCentroid;
|
||||||
touchHistory = 0;
|
|
||||||
touchHistory < touchBank.length;
|
|
||||||
touchHistory++
|
|
||||||
) {
|
|
||||||
var touchTrack = touchBank[touchHistory];
|
|
||||||
null !== touchTrack &&
|
|
||||||
void 0 !== touchTrack &&
|
|
||||||
touchTrack.touchActive &&
|
|
||||||
touchTrack.currentTimeStamp >= touchesChangedAfter &&
|
|
||||||
((total +=
|
|
||||||
ofCurrent && isXAxis
|
|
||||||
? touchTrack.currentPageX
|
|
||||||
: ofCurrent && !isXAxis
|
|
||||||
? touchTrack.currentPageY
|
|
||||||
: !ofCurrent && isXAxis
|
|
||||||
? touchTrack.previousPageX
|
|
||||||
: touchTrack.previousPageY),
|
|
||||||
count++);
|
|
||||||
}
|
|
||||||
return 0 < count ? total / count : TouchHistoryMath.noCentroid;
|
|
||||||
},
|
|
||||||
currentCentroidXOfTouchesChangedAfter: function(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter
|
|
||||||
) {
|
|
||||||
return TouchHistoryMath.centroidDimension(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter,
|
|
||||||
!0,
|
|
||||||
!0
|
|
||||||
);
|
|
||||||
},
|
|
||||||
currentCentroidYOfTouchesChangedAfter: function(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter
|
|
||||||
) {
|
|
||||||
return TouchHistoryMath.centroidDimension(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter,
|
|
||||||
!1,
|
|
||||||
!0
|
|
||||||
);
|
|
||||||
},
|
|
||||||
previousCentroidXOfTouchesChangedAfter: function(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter
|
|
||||||
) {
|
|
||||||
return TouchHistoryMath.centroidDimension(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter,
|
|
||||||
!0,
|
|
||||||
!1
|
|
||||||
);
|
|
||||||
},
|
|
||||||
previousCentroidYOfTouchesChangedAfter: function(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter
|
|
||||||
) {
|
|
||||||
return TouchHistoryMath.centroidDimension(
|
|
||||||
touchHistory,
|
|
||||||
touchesChangedAfter,
|
|
||||||
!1,
|
|
||||||
!1
|
|
||||||
);
|
|
||||||
},
|
|
||||||
currentCentroidX: function(touchHistory) {
|
|
||||||
return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0);
|
|
||||||
},
|
|
||||||
currentCentroidY: function(touchHistory) {
|
|
||||||
return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0);
|
|
||||||
},
|
|
||||||
noCentroid: -1
|
|
||||||
},
|
},
|
||||||
objects = {},
|
currentCentroidXOfTouchesChangedAfter: function(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter
|
||||||
|
) {
|
||||||
|
return TouchHistoryMath.centroidDimension(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter,
|
||||||
|
!0,
|
||||||
|
!0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
currentCentroidYOfTouchesChangedAfter: function(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter
|
||||||
|
) {
|
||||||
|
return TouchHistoryMath.centroidDimension(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter,
|
||||||
|
!1,
|
||||||
|
!0
|
||||||
|
);
|
||||||
|
},
|
||||||
|
previousCentroidXOfTouchesChangedAfter: function(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter
|
||||||
|
) {
|
||||||
|
return TouchHistoryMath.centroidDimension(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter,
|
||||||
|
!0,
|
||||||
|
!1
|
||||||
|
);
|
||||||
|
},
|
||||||
|
previousCentroidYOfTouchesChangedAfter: function(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter
|
||||||
|
) {
|
||||||
|
return TouchHistoryMath.centroidDimension(
|
||||||
|
touchHistory,
|
||||||
|
touchesChangedAfter,
|
||||||
|
!1,
|
||||||
|
!1
|
||||||
|
);
|
||||||
|
},
|
||||||
|
currentCentroidX: function(touchHistory) {
|
||||||
|
return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0);
|
||||||
|
},
|
||||||
|
currentCentroidY: function(touchHistory) {
|
||||||
|
return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0);
|
||||||
|
},
|
||||||
|
noCentroid: -1
|
||||||
|
};
|
||||||
|
function getComponentName(fiber) {
|
||||||
|
fiber = fiber.type;
|
||||||
|
if ("function" === typeof fiber) return fiber.displayName || fiber.name;
|
||||||
|
if ("string" === typeof fiber) return fiber;
|
||||||
|
switch (fiber) {
|
||||||
|
case REACT_FRAGMENT_TYPE:
|
||||||
|
return "ReactFragment";
|
||||||
|
case REACT_PORTAL_TYPE:
|
||||||
|
return "ReactPortal";
|
||||||
|
case REACT_CALL_TYPE:
|
||||||
|
return "ReactCall";
|
||||||
|
case REACT_RETURN_TYPE:
|
||||||
|
return "ReactReturn";
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
||||||
|
var info = "";
|
||||||
|
do {
|
||||||
|
a: switch (workInProgress.tag) {
|
||||||
|
case 0:
|
||||||
|
case 1:
|
||||||
|
case 2:
|
||||||
|
case 5:
|
||||||
|
var owner = workInProgress._debugOwner,
|
||||||
|
source = workInProgress._debugSource;
|
||||||
|
var JSCompiler_inline_result = getComponentName(workInProgress);
|
||||||
|
var ownerName = null;
|
||||||
|
owner && (ownerName = getComponentName(owner));
|
||||||
|
owner = source;
|
||||||
|
JSCompiler_inline_result =
|
||||||
|
"\n in " +
|
||||||
|
(JSCompiler_inline_result || "Unknown") +
|
||||||
|
(owner
|
||||||
|
? " (at " +
|
||||||
|
owner.fileName.replace(/^.*[\\\/]/, "") +
|
||||||
|
":" +
|
||||||
|
owner.lineNumber +
|
||||||
|
")"
|
||||||
|
: ownerName ? " (created by " + ownerName + ")" : "");
|
||||||
|
break a;
|
||||||
|
default:
|
||||||
|
JSCompiler_inline_result = "";
|
||||||
|
}
|
||||||
|
info += JSCompiler_inline_result;
|
||||||
|
workInProgress = workInProgress["return"];
|
||||||
|
} while (workInProgress);
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
var objects = {},
|
||||||
uniqueID = 1,
|
uniqueID = 1,
|
||||||
emptyObject$2 = {},
|
emptyObject$2 = {},
|
||||||
ReactNativePropRegistry = (function() {
|
ReactNativePropRegistry = (function() {
|
||||||
@ -1561,22 +1606,6 @@ function mountSafeCallback(context, callback) {
|
|||||||
}
|
}
|
||||||
var ReactCurrentOwner =
|
var ReactCurrentOwner =
|
||||||
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
|
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
|
||||||
function getComponentName(fiber) {
|
|
||||||
fiber = fiber.type;
|
|
||||||
if ("function" === typeof fiber) return fiber.displayName || fiber.name;
|
|
||||||
if ("string" === typeof fiber) return fiber;
|
|
||||||
switch (fiber) {
|
|
||||||
case REACT_FRAGMENT_TYPE:
|
|
||||||
return "ReactFragment";
|
|
||||||
case REACT_PORTAL_TYPE:
|
|
||||||
return "ReactPortal";
|
|
||||||
case REACT_CALL_TYPE:
|
|
||||||
return "ReactCall";
|
|
||||||
case REACT_RETURN_TYPE:
|
|
||||||
return "ReactReturn";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
function findHostInstance() {
|
function findHostInstance() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1988,39 +2017,6 @@ function onCommitRoot(root) {
|
|||||||
function onCommitUnmount(fiber) {
|
function onCommitUnmount(fiber) {
|
||||||
"function" === typeof onCommitFiberUnmount && onCommitFiberUnmount(fiber);
|
"function" === typeof onCommitFiberUnmount && onCommitFiberUnmount(fiber);
|
||||||
}
|
}
|
||||||
function getStackAddendumByWorkInProgressFiber(workInProgress) {
|
|
||||||
var info = "";
|
|
||||||
do {
|
|
||||||
a: switch (workInProgress.tag) {
|
|
||||||
case 0:
|
|
||||||
case 1:
|
|
||||||
case 2:
|
|
||||||
case 5:
|
|
||||||
var owner = workInProgress._debugOwner,
|
|
||||||
source = workInProgress._debugSource;
|
|
||||||
var JSCompiler_inline_result = getComponentName(workInProgress);
|
|
||||||
var ownerName = null;
|
|
||||||
owner && (ownerName = getComponentName(owner));
|
|
||||||
owner = source;
|
|
||||||
JSCompiler_inline_result =
|
|
||||||
"\n in " +
|
|
||||||
(JSCompiler_inline_result || "Unknown") +
|
|
||||||
(owner
|
|
||||||
? " (at " +
|
|
||||||
owner.fileName.replace(/^.*[\\\/]/, "") +
|
|
||||||
":" +
|
|
||||||
owner.lineNumber +
|
|
||||||
")"
|
|
||||||
: ownerName ? " (created by " + ownerName + ")" : "");
|
|
||||||
break a;
|
|
||||||
default:
|
|
||||||
JSCompiler_inline_result = "";
|
|
||||||
}
|
|
||||||
info += JSCompiler_inline_result;
|
|
||||||
workInProgress = workInProgress["return"];
|
|
||||||
} while (workInProgress);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
var _require = require("ReactFeatureFlags"),
|
var _require = require("ReactFeatureFlags"),
|
||||||
enableGetDerivedStateFromCatch = _require.enableGetDerivedStateFromCatch,
|
enableGetDerivedStateFromCatch = _require.enableGetDerivedStateFromCatch,
|
||||||
debugRenderPhaseSideEffects = _require.debugRenderPhaseSideEffects,
|
debugRenderPhaseSideEffects = _require.debugRenderPhaseSideEffects,
|
||||||
@ -3926,33 +3922,40 @@ function ReactFiberBeginWork(
|
|||||||
renderExpirationTime
|
renderExpirationTime
|
||||||
);
|
);
|
||||||
case 12:
|
case 12:
|
||||||
fn = workInProgress.type;
|
a: {
|
||||||
unmaskedContext = workInProgress.pendingProps;
|
fn = workInProgress.type;
|
||||||
var oldProps = workInProgress.memoizedProps;
|
unmaskedContext = workInProgress.pendingProps;
|
||||||
props = fn._currentValue;
|
updateQueue = workInProgress.memoizedProps;
|
||||||
updateQueue = fn._changedBits;
|
props = fn._currentValue;
|
||||||
if (
|
var changedBits = fn._changedBits;
|
||||||
hasLegacyContextChanged() ||
|
if (
|
||||||
0 !== updateQueue ||
|
hasLegacyContextChanged() ||
|
||||||
oldProps !== unmaskedContext
|
0 !== changedBits ||
|
||||||
) {
|
updateQueue !== unmaskedContext
|
||||||
workInProgress.memoizedProps = unmaskedContext;
|
) {
|
||||||
oldProps = unmaskedContext.unstable_observedBits;
|
workInProgress.memoizedProps = unmaskedContext;
|
||||||
if (void 0 === oldProps || null === oldProps) oldProps = 1073741823;
|
var observedBits = unmaskedContext.unstable_observedBits;
|
||||||
workInProgress.stateNode = oldProps;
|
if (void 0 === observedBits || null === observedBits)
|
||||||
0 !== (updateQueue & oldProps) &&
|
observedBits = 1073741823;
|
||||||
propagateContextChange(
|
workInProgress.stateNode = observedBits;
|
||||||
workInProgress,
|
if (0 !== (changedBits & observedBits))
|
||||||
fn,
|
propagateContextChange(
|
||||||
updateQueue,
|
workInProgress,
|
||||||
renderExpirationTime
|
fn,
|
||||||
);
|
changedBits,
|
||||||
renderExpirationTime = unmaskedContext.children;
|
renderExpirationTime
|
||||||
renderExpirationTime = renderExpirationTime(props);
|
);
|
||||||
reconcileChildren(current, workInProgress, renderExpirationTime);
|
else if (updateQueue === unmaskedContext) {
|
||||||
current = workInProgress.child;
|
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
} else
|
break a;
|
||||||
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
}
|
||||||
|
renderExpirationTime = unmaskedContext.children;
|
||||||
|
renderExpirationTime = renderExpirationTime(props);
|
||||||
|
reconcileChildren(current, workInProgress, renderExpirationTime);
|
||||||
|
current = workInProgress.child;
|
||||||
|
} else
|
||||||
|
current = bailoutOnAlreadyFinishedWork(current, workInProgress);
|
||||||
|
}
|
||||||
return current;
|
return current;
|
||||||
default:
|
default:
|
||||||
invariant(
|
invariant(
|
||||||
@ -6554,6 +6557,11 @@ var roots = new Map(),
|
|||||||
"window" !== view &&
|
"window" !== view &&
|
||||||
(view = findNumericNodeHandleFiber(view) || "window");
|
(view = findNumericNodeHandleFiber(view) || "window");
|
||||||
return UIManager.__takeSnapshot(view, options);
|
return UIManager.__takeSnapshot(view, options);
|
||||||
|
},
|
||||||
|
computeComponentStackForErrorReporting: function(reactTag) {
|
||||||
|
return (reactTag = getInstanceFromTag(reactTag))
|
||||||
|
? getStackAddendumByWorkInProgressFiber(reactTag)
|
||||||
|
: "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user