Skip to content

Commit

Permalink
Convert problematic let declarations to var
Browse files Browse the repository at this point in the history
Test Plan: Patch in babel/babel#5236, run `grunt build:modules` with no errors.
  • Loading branch information
sophiebits committed Jan 30, 2017
1 parent fb4c08b commit 851e8ce
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/renderers/dom/fiber/ReactDOMFiber.js
Expand Up @@ -345,7 +345,7 @@ function renderSubtreeIntoContainer(
while (container.lastChild) {
container.removeChild(container.lastChild);
}
const newRoot = DOMRenderer.createContainer(container);
var newRoot = DOMRenderer.createContainer(container);
root = container._reactRootContainer = newRoot;
// Initial mount should not be batched.
DOMRenderer.unbatchedUpdates(() => {
Expand Down
26 changes: 13 additions & 13 deletions src/renderers/shared/ReactDebugTool.js
Expand Up @@ -70,7 +70,7 @@ if (__DEV__) {
var hooks = [];
var didHookThrowForEvent = {};

const callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
var callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) {
try {
fn.call(context, arg1, arg2, arg3, arg4, arg5);
} catch (e) {
Expand All @@ -84,7 +84,7 @@ if (__DEV__) {
}
};

const emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) {
var emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) {
for (var i = 0; i < hooks.length; i++) {
var hook = hooks[i];
var fn = hook[event];
Expand All @@ -107,12 +107,12 @@ if (__DEV__) {

var lifeCycleTimerHasWarned = false;

const clearHistory = function() {
var clearHistory = function() {
ReactComponentTreeHook.purgeUnmountedComponents();
ReactHostOperationHistoryHook.clearHistory();
};

const getTreeSnapshot = function(registeredIDs) {
var getTreeSnapshot = function(registeredIDs) {
return registeredIDs.reduce((tree, id) => {
var ownerID = ReactComponentTreeHook.getOwnerID(id);
var parentID = ReactComponentTreeHook.getParentID(id);
Expand All @@ -131,7 +131,7 @@ if (__DEV__) {
}, {});
};

const resetMeasurements = function() {
var resetMeasurements = function() {
var previousStartTime = currentFlushStartTime;
var previousMeasurements = currentFlushMeasurements;
var previousOperations = ReactHostOperationHistoryHook.getHistory();
Expand All @@ -158,7 +158,7 @@ if (__DEV__) {
currentFlushMeasurements = [];
};

const checkDebugID = function(debugID, allowRoot = false) {
var checkDebugID = function(debugID, allowRoot = false) {
if (allowRoot && debugID === 0) {
return;
}
Expand All @@ -167,7 +167,7 @@ if (__DEV__) {
}
};

const beginLifeCycleTimer = function(debugID, timerType) {
var beginLifeCycleTimer = function(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
Expand All @@ -189,7 +189,7 @@ if (__DEV__) {
currentTimerType = timerType;
};

const endLifeCycleTimer = function(debugID, timerType) {
var endLifeCycleTimer = function(debugID, timerType) {
if (currentFlushNesting === 0) {
return;
}
Expand Down Expand Up @@ -218,7 +218,7 @@ if (__DEV__) {
currentTimerType = null;
};

const pauseCurrentLifeCycleTimer = function() {
var pauseCurrentLifeCycleTimer = function() {
var currentTimer = {
startTime: currentTimerStartTime,
nestedFlushStartTime: performanceNow(),
Expand All @@ -232,7 +232,7 @@ if (__DEV__) {
currentTimerType = null;
};

const resumeCurrentLifeCycleTimer = function() {
var resumeCurrentLifeCycleTimer = function() {
var {startTime, nestedFlushStartTime, debugID, timerType} = lifeCycleTimerStack.pop();
var nestedFlushDuration = performanceNow() - nestedFlushStartTime;
currentTimerStartTime = startTime;
Expand All @@ -249,7 +249,7 @@ if (__DEV__) {
typeof performance.measure === 'function' &&
typeof performance.clearMeasures === 'function';

const shouldMark = function(debugID) {
var shouldMark = function(debugID) {
if (!isProfiling || !canUsePerformanceMeasure) {
return false;
}
Expand All @@ -264,7 +264,7 @@ if (__DEV__) {
return true;
};

const markBegin = function(debugID, markType) {
var markBegin = function(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
Expand All @@ -274,7 +274,7 @@ if (__DEV__) {
performance.mark(markName);
};

const markEnd = function(debugID, markType) {
var markEnd = function(debugID, markType) {
if (!shouldMark(debugID)) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/shared/fiber/ReactChildFiber.js
Expand Up @@ -75,7 +75,7 @@ function coerceRef(current: ?Fiber, element: ReactElement) {
if (mixedRef != null && typeof mixedRef !== 'function') {
if (element._owner) {
const owner : ?(Fiber | ReactInstance) = (element._owner : any);
let inst;
var inst;
if (owner) {
if (typeof owner.tag === 'number') {
const ownerFiber = ((owner : any) : Fiber);
Expand All @@ -87,7 +87,7 @@ function coerceRef(current: ?Fiber, element: ReactElement) {
}
}
invariant(inst, 'Missing owner for string ref %s', mixedRef);
const stringRef = String(mixedRef);
var stringRef = String(mixedRef);
// Check if previous string ref matches new string ref
if (current && current.ref && current.ref._stringRef === stringRef) {
return current.ref;
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/shared/fiber/ReactFiberDevToolsHook.js
Expand Up @@ -29,7 +29,7 @@ if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.supportsFiber
) {
let {
var {
inject,
onCommitFiberRoot,
onCommitFiberUnmount,
Expand Down

0 comments on commit 851e8ce

Please sign in to comment.