MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / ReactFiberStack

Function ReactFiberStack

code/new-context-api/public/app.js:11916–11998  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11914};
11915
11916var ReactFiberStack = function () {
11917 var valueStack = [];
11918
11919 var fiberStack = void 0;
11920
11921 {
11922 fiberStack = [];
11923 }
11924
11925 var index = -1;
11926
11927 function createCursor(defaultValue) {
11928 return {
11929 current: defaultValue
11930 };
11931 }
11932
11933 function isEmpty() {
11934 return index === -1;
11935 }
11936
11937 function pop(cursor, fiber) {
11938 if (index < 0) {
11939 {
11940 warning(false, 'Unexpected pop.');
11941 }
11942 return;
11943 }
11944
11945 {
11946 if (fiber !== fiberStack[index]) {
11947 warning(false, 'Unexpected Fiber popped.');
11948 }
11949 }
11950
11951 cursor.current = valueStack[index];
11952
11953 valueStack[index] = null;
11954
11955 {
11956 fiberStack[index] = null;
11957 }
11958
11959 index--;
11960 }
11961
11962 function push(cursor, value, fiber) {
11963 index++;
11964
11965 valueStack[index] = cursor.current;
11966
11967 {
11968 fiberStack[index] = fiber;
11969 }
11970
11971 cursor.current = value;
11972 }
11973

Callers 1

ReactFiberSchedulerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected