You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					1 line
				
				28 KiB
			
		
		
			
		
	
	
					1 line
				
				28 KiB
			| 
											5 years ago
										 | {"ast":null,"code":"/** @license React v0.19.1\n * scheduler-tracing.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n  (function () {\n    'use strict';\n\n    var DEFAULT_THREAD_ID = 0; // Counters used to generate unique IDs.\n\n    var interactionIDCounter = 0;\n    var threadIDCounter = 0; // Set of currently traced interactions.\n    // Interactions \"stack\"–\n    // Meaning that newly traced interactions are appended to the previously active set.\n    // When an interaction goes out of scope, the previous set (if any) is restored.\n\n    exports.__interactionsRef = null; // Listener(s) to notify when interactions begin and end.\n\n    exports.__subscriberRef = null;\n    {\n      exports.__interactionsRef = {\n        current: new Set()\n      };\n      exports.__subscriberRef = {\n        current: null\n      };\n    }\n\n    function unstable_clear(callback) {\n      var prevInteractions = exports.__interactionsRef.current;\n      exports.__interactionsRef.current = new Set();\n\n      try {\n        return callback();\n      } finally {\n        exports.__interactionsRef.current = prevInteractions;\n      }\n    }\n\n    function unstable_getCurrent() {\n      {\n        return exports.__interactionsRef.current;\n      }\n    }\n\n    function unstable_getThreadID() {\n      return ++threadIDCounter;\n    }\n\n    function unstable_trace(name, timestamp, callback) {\n      var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;\n      var interaction = {\n        __count: 1,\n        id: interactionIDCounter++,\n        name: name,\n        timestamp: timestamp\n      };\n      var prevInteractions = exports.__interactionsRef.current; // Traced interactions should stack/accumulate.\n      // To do that, clone the current interactions.\n      // The previous set will be restored upon completion.\n\n      var interactions = new Set(prevInteractions);\n      interactions.add(interaction);\n      exports.__interactionsRef.current = interactions;\n      var subscriber = exports.__subscriberRef.current;\n      var returnValue;\n\n      try {\n        if (subscriber !== null) {\n          subscriber.onInteractionTraced(interaction);\n        }\n      } finally {\n        try {\n          if (subscriber !== null) {\n            subscriber.onWorkStarted(interactions, threadID);\n          }\n        } finally {\n          try {\n            returnValue = callback();\n          } finally {\n            exports.__interactionsRef.current = prevInteractions;\n\n            try {\n              if (subscriber !== null) {\n                subscriber.onWorkStopped(interactions, threadID);\n              }\n            } finally {\n              interaction.__count--; // If no async work was scheduled for this interaction,\n              // Notify subscribers that it's completed.\n\n              if (subscriber !== null && interaction.__count === 0) {\n                subscriber.onInteractionScheduledWorkCompleted(interaction);\n              }\n            }\n          }\n        }\n      }\n\n      return returnValue;\n    }\n\n    function unstable_wrap(callback) {\n      var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;\n      var wrappedInteractions = exports.__interactionsRef.current;\n      var subscriber = exports.__subscriberRef.current;\n\n      if (subscriber !== null) {\n        subscriber.onWorkScheduled(wrappedInteractions, threadID);\n      } // Update the pending async work count for the current interactions.\n      // Update after calling subscribers in case of error.\n\n\n      wrappedInteractions.forEach(function (interaction) {\n        interaction.__count++;\n      });\n      var hasRun = false;\n\n      function wrapped() {\n        var prevInteractions = exports.__interactionsRef.cur |