ReactFiberStack cursor values are no longer corrupted on pop
Brian Vaughn committed
Dec 21, 2016 at 15:05 UTC
e7a591ed57a1dddd61307f934c41caf520bb3391
1 file changed
+7
-7
src/renderers/shared/fiber/ReactFiberStack.js
+7
-7
@@ -55,6 +55,10 @@ exports.pop = function<T>(
55
}
56
}
57
58
+ cursor.current = index > 0
59
+ ? valueStack[index]
60
+ : (null : any);
61
+
62
valueStack[index] = null;
63
64
if (__DEV__) {
@@ -62,10 +66,6 @@ exports.pop = function<T>(
66
}
67
68
index--;
65
-
66
- cursor.current = index > -1
67
- ? valueStack[index]
68
- : (null : any);
69
};
70
71
exports.push = function<T>(
@@ -73,15 +73,15 @@ exports.push = function<T>(
73
value : any,
74
fiber: Fiber,
75
) : void {
76
- cursor.current = value;
77
-
76
index++;
77
80
- valueStack[index] = value;
78
+ valueStack[index] = cursor.current;
79
80
if (__DEV__) {
81
fiberStack[index] = fiber;
82
}
83
+
84
+ cursor.current = value;
85
};
86
87
exports.reset = function<T>(