Edit File by line
/home/barbar84/www/wp-inclu.../js/dist/vendor
File: react-dom.js
/** @license React v16.13.1
[0] Fix | Delete
* react-dom.development.js
[1] Fix | Delete
*
[2] Fix | Delete
* Copyright (c) Facebook, Inc. and its affiliates.
[3] Fix | Delete
*
[4] Fix | Delete
* This source code is licensed under the MIT license found in the
[5] Fix | Delete
* LICENSE file in the root directory of this source tree.
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
'use strict';
[9] Fix | Delete
[10] Fix | Delete
(function (global, factory) {
[11] Fix | Delete
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
[12] Fix | Delete
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
[13] Fix | Delete
(global = global || self, factory(global.ReactDOM = {}, global.React));
[14] Fix | Delete
}(this, (function (exports, React) { 'use strict';
[15] Fix | Delete
[16] Fix | Delete
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
[17] Fix | Delete
// Current owner and dispatcher used to share the same ref,
[18] Fix | Delete
// but PR #14548 split them out to better support the react-debug-tools package.
[19] Fix | Delete
[20] Fix | Delete
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
[21] Fix | Delete
ReactSharedInternals.ReactCurrentDispatcher = {
[22] Fix | Delete
current: null
[23] Fix | Delete
};
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
[27] Fix | Delete
ReactSharedInternals.ReactCurrentBatchConfig = {
[28] Fix | Delete
suspense: null
[29] Fix | Delete
};
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
// by calls to these methods by a Babel plugin.
[33] Fix | Delete
//
[34] Fix | Delete
// In PROD (or in packages without access to React internals),
[35] Fix | Delete
// they are left as they are instead.
[36] Fix | Delete
[37] Fix | Delete
function warn(format) {
[38] Fix | Delete
{
[39] Fix | Delete
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
[40] Fix | Delete
args[_key - 1] = arguments[_key];
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
printWarning('warn', format, args);
[44] Fix | Delete
}
[45] Fix | Delete
}
[46] Fix | Delete
function error(format) {
[47] Fix | Delete
{
[48] Fix | Delete
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
[49] Fix | Delete
args[_key2 - 1] = arguments[_key2];
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
printWarning('error', format, args);
[53] Fix | Delete
}
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
function printWarning(level, format, args) {
[57] Fix | Delete
// When changing this logic, you might want to also
[58] Fix | Delete
// update consoleWithStackDev.www.js as well.
[59] Fix | Delete
{
[60] Fix | Delete
var hasExistingStack = args.length > 0 && typeof args[args.length - 1] === 'string' && args[args.length - 1].indexOf('\n in') === 0;
[61] Fix | Delete
[62] Fix | Delete
if (!hasExistingStack) {
[63] Fix | Delete
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
[64] Fix | Delete
var stack = ReactDebugCurrentFrame.getStackAddendum();
[65] Fix | Delete
[66] Fix | Delete
if (stack !== '') {
[67] Fix | Delete
format += '%s';
[68] Fix | Delete
args = args.concat([stack]);
[69] Fix | Delete
}
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
var argsWithFormat = args.map(function (item) {
[73] Fix | Delete
return '' + item;
[74] Fix | Delete
}); // Careful: RN currently depends on this prefix
[75] Fix | Delete
[76] Fix | Delete
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
[77] Fix | Delete
// breaks IE9: https://github.com/facebook/react/issues/13610
[78] Fix | Delete
// eslint-disable-next-line react-internal/no-production-logging
[79] Fix | Delete
[80] Fix | Delete
Function.prototype.apply.call(console[level], console, argsWithFormat);
[81] Fix | Delete
[82] Fix | Delete
try {
[83] Fix | Delete
// --- Welcome to debugging React ---
[84] Fix | Delete
// This error was thrown as a convenience so that you can use this stack
[85] Fix | Delete
// to find the callsite that caused this warning to fire.
[86] Fix | Delete
var argIndex = 0;
[87] Fix | Delete
var message = 'Warning: ' + format.replace(/%s/g, function () {
[88] Fix | Delete
return args[argIndex++];
[89] Fix | Delete
});
[90] Fix | Delete
throw new Error(message);
[91] Fix | Delete
} catch (x) {}
[92] Fix | Delete
}
[93] Fix | Delete
}
[94] Fix | Delete
[95] Fix | Delete
if (!React) {
[96] Fix | Delete
{
[97] Fix | Delete
throw Error( "ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM." );
[98] Fix | Delete
}
[99] Fix | Delete
}
[100] Fix | Delete
[101] Fix | Delete
var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
[102] Fix | Delete
var funcArgs = Array.prototype.slice.call(arguments, 3);
[103] Fix | Delete
[104] Fix | Delete
try {
[105] Fix | Delete
func.apply(context, funcArgs);
[106] Fix | Delete
} catch (error) {
[107] Fix | Delete
this.onError(error);
[108] Fix | Delete
}
[109] Fix | Delete
};
[110] Fix | Delete
[111] Fix | Delete
{
[112] Fix | Delete
// In DEV mode, we swap out invokeGuardedCallback for a special version
[113] Fix | Delete
// that plays more nicely with the browser's DevTools. The idea is to preserve
[114] Fix | Delete
// "Pause on exceptions" behavior. Because React wraps all user-provided
[115] Fix | Delete
// functions in invokeGuardedCallback, and the production version of
[116] Fix | Delete
// invokeGuardedCallback uses a try-catch, all user exceptions are treated
[117] Fix | Delete
// like caught exceptions, and the DevTools won't pause unless the developer
[118] Fix | Delete
// takes the extra step of enabling pause on caught exceptions. This is
[119] Fix | Delete
// unintuitive, though, because even though React has caught the error, from
[120] Fix | Delete
// the developer's perspective, the error is uncaught.
[121] Fix | Delete
//
[122] Fix | Delete
// To preserve the expected "Pause on exceptions" behavior, we don't use a
[123] Fix | Delete
// try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
[124] Fix | Delete
// DOM node, and call the user-provided callback from inside an event handler
[125] Fix | Delete
// for that fake event. If the callback throws, the error is "captured" using
[126] Fix | Delete
// a global event handler. But because the error happens in a different
[127] Fix | Delete
// event loop context, it does not interrupt the normal program flow.
[128] Fix | Delete
// Effectively, this gives us try-catch behavior without actually using
[129] Fix | Delete
// try-catch. Neat!
[130] Fix | Delete
// Check that the browser supports the APIs we need to implement our special
[131] Fix | Delete
// DEV version of invokeGuardedCallback
[132] Fix | Delete
if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
[133] Fix | Delete
var fakeNode = document.createElement('react');
[134] Fix | Delete
[135] Fix | Delete
var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
[136] Fix | Delete
// If document doesn't exist we know for sure we will crash in this method
[137] Fix | Delete
// when we call document.createEvent(). However this can cause confusing
[138] Fix | Delete
// errors: https://github.com/facebookincubator/create-react-app/issues/3482
[139] Fix | Delete
// So we preemptively throw with a better message instead.
[140] Fix | Delete
if (!(typeof document !== 'undefined')) {
[141] Fix | Delete
{
[142] Fix | Delete
throw Error( "The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous." );
[143] Fix | Delete
}
[144] Fix | Delete
}
[145] Fix | Delete
[146] Fix | Delete
var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
[147] Fix | Delete
// set this to true at the beginning, then set it to false right after
[148] Fix | Delete
// calling the function. If the function errors, `didError` will never be
[149] Fix | Delete
// set to false. This strategy works even if the browser is flaky and
[150] Fix | Delete
// fails to call our global error handler, because it doesn't rely on
[151] Fix | Delete
// the error event at all.
[152] Fix | Delete
[153] Fix | Delete
var didError = true; // Keeps track of the value of window.event so that we can reset it
[154] Fix | Delete
// during the callback to let user code access window.event in the
[155] Fix | Delete
// browsers that support it.
[156] Fix | Delete
[157] Fix | Delete
var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
[158] Fix | Delete
// dispatching: https://github.com/facebook/react/issues/13688
[159] Fix | Delete
[160] Fix | Delete
var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously
[161] Fix | Delete
// dispatch our fake event using `dispatchEvent`. Inside the handler, we
[162] Fix | Delete
// call the user-provided callback.
[163] Fix | Delete
[164] Fix | Delete
var funcArgs = Array.prototype.slice.call(arguments, 3);
[165] Fix | Delete
[166] Fix | Delete
function callCallback() {
[167] Fix | Delete
// We immediately remove the callback from event listeners so that
[168] Fix | Delete
// nested `invokeGuardedCallback` calls do not clash. Otherwise, a
[169] Fix | Delete
// nested call would trigger the fake event handlers of any call higher
[170] Fix | Delete
// in the stack.
[171] Fix | Delete
fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
[172] Fix | Delete
// window.event assignment in both IE <= 10 as they throw an error
[173] Fix | Delete
// "Member not found" in strict mode, and in Firefox which does not
[174] Fix | Delete
// support window.event.
[175] Fix | Delete
[176] Fix | Delete
if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
[177] Fix | Delete
window.event = windowEvent;
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
func.apply(context, funcArgs);
[181] Fix | Delete
didError = false;
[182] Fix | Delete
} // Create a global error event handler. We use this to capture the value
[183] Fix | Delete
// that was thrown. It's possible that this error handler will fire more
[184] Fix | Delete
// than once; for example, if non-React code also calls `dispatchEvent`
[185] Fix | Delete
// and a handler for that event throws. We should be resilient to most of
[186] Fix | Delete
// those cases. Even if our error event handler fires more than once, the
[187] Fix | Delete
// last error event is always used. If the callback actually does error,
[188] Fix | Delete
// we know that the last error event is the correct one, because it's not
[189] Fix | Delete
// possible for anything else to have happened in between our callback
[190] Fix | Delete
// erroring and the code that follows the `dispatchEvent` call below. If
[191] Fix | Delete
// the callback doesn't error, but the error event was fired, we know to
[192] Fix | Delete
// ignore it because `didError` will be false, as described above.
[193] Fix | Delete
[194] Fix | Delete
[195] Fix | Delete
var error; // Use this to track whether the error event is ever called.
[196] Fix | Delete
[197] Fix | Delete
var didSetError = false;
[198] Fix | Delete
var isCrossOriginError = false;
[199] Fix | Delete
[200] Fix | Delete
function handleWindowError(event) {
[201] Fix | Delete
error = event.error;
[202] Fix | Delete
didSetError = true;
[203] Fix | Delete
[204] Fix | Delete
if (error === null && event.colno === 0 && event.lineno === 0) {
[205] Fix | Delete
isCrossOriginError = true;
[206] Fix | Delete
}
[207] Fix | Delete
[208] Fix | Delete
if (event.defaultPrevented) {
[209] Fix | Delete
// Some other error handler has prevented default.
[210] Fix | Delete
// Browsers silence the error report if this happens.
[211] Fix | Delete
// We'll remember this to later decide whether to log it or not.
[212] Fix | Delete
if (error != null && typeof error === 'object') {
[213] Fix | Delete
try {
[214] Fix | Delete
error._suppressLogging = true;
[215] Fix | Delete
} catch (inner) {// Ignore.
[216] Fix | Delete
}
[217] Fix | Delete
}
[218] Fix | Delete
}
[219] Fix | Delete
} // Create a fake event type.
[220] Fix | Delete
[221] Fix | Delete
[222] Fix | Delete
var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers
[223] Fix | Delete
[224] Fix | Delete
window.addEventListener('error', handleWindowError);
[225] Fix | Delete
fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
[226] Fix | Delete
// errors, it will trigger our global error handler.
[227] Fix | Delete
[228] Fix | Delete
evt.initEvent(evtType, false, false);
[229] Fix | Delete
fakeNode.dispatchEvent(evt);
[230] Fix | Delete
[231] Fix | Delete
if (windowEventDescriptor) {
[232] Fix | Delete
Object.defineProperty(window, 'event', windowEventDescriptor);
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
if (didError) {
[236] Fix | Delete
if (!didSetError) {
[237] Fix | Delete
// The callback errored, but the error event never fired.
[238] Fix | Delete
error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
[239] Fix | Delete
} else if (isCrossOriginError) {
[240] Fix | Delete
error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
[241] Fix | Delete
}
[242] Fix | Delete
[243] Fix | Delete
this.onError(error);
[244] Fix | Delete
} // Remove our event listeners
[245] Fix | Delete
[246] Fix | Delete
[247] Fix | Delete
window.removeEventListener('error', handleWindowError);
[248] Fix | Delete
};
[249] Fix | Delete
[250] Fix | Delete
invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
[251] Fix | Delete
}
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
[255] Fix | Delete
[256] Fix | Delete
var hasError = false;
[257] Fix | Delete
var caughtError = null; // Used by event system to capture/rethrow the first error.
[258] Fix | Delete
[259] Fix | Delete
var hasRethrowError = false;
[260] Fix | Delete
var rethrowError = null;
[261] Fix | Delete
var reporter = {
[262] Fix | Delete
onError: function (error) {
[263] Fix | Delete
hasError = true;
[264] Fix | Delete
caughtError = error;
[265] Fix | Delete
}
[266] Fix | Delete
};
[267] Fix | Delete
/**
[268] Fix | Delete
* Call a function while guarding against errors that happens within it.
[269] Fix | Delete
* Returns an error if it throws, otherwise null.
[270] Fix | Delete
*
[271] Fix | Delete
* In production, this is implemented using a try-catch. The reason we don't
[272] Fix | Delete
* use a try-catch directly is so that we can swap out a different
[273] Fix | Delete
* implementation in DEV mode.
[274] Fix | Delete
*
[275] Fix | Delete
* @param {String} name of the guard to use for logging or debugging
[276] Fix | Delete
* @param {Function} func The function to invoke
[277] Fix | Delete
* @param {*} context The context to use when calling the function
[278] Fix | Delete
* @param {...*} args Arguments for function
[279] Fix | Delete
*/
[280] Fix | Delete
[281] Fix | Delete
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
[282] Fix | Delete
hasError = false;
[283] Fix | Delete
caughtError = null;
[284] Fix | Delete
invokeGuardedCallbackImpl$1.apply(reporter, arguments);
[285] Fix | Delete
}
[286] Fix | Delete
/**
[287] Fix | Delete
* Same as invokeGuardedCallback, but instead of returning an error, it stores
[288] Fix | Delete
* it in a global so it can be rethrown by `rethrowCaughtError` later.
[289] Fix | Delete
* TODO: See if caughtError and rethrowError can be unified.
[290] Fix | Delete
*
[291] Fix | Delete
* @param {String} name of the guard to use for logging or debugging
[292] Fix | Delete
* @param {Function} func The function to invoke
[293] Fix | Delete
* @param {*} context The context to use when calling the function
[294] Fix | Delete
* @param {...*} args Arguments for function
[295] Fix | Delete
*/
[296] Fix | Delete
[297] Fix | Delete
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
[298] Fix | Delete
invokeGuardedCallback.apply(this, arguments);
[299] Fix | Delete
[300] Fix | Delete
if (hasError) {
[301] Fix | Delete
var error = clearCaughtError();
[302] Fix | Delete
[303] Fix | Delete
if (!hasRethrowError) {
[304] Fix | Delete
hasRethrowError = true;
[305] Fix | Delete
rethrowError = error;
[306] Fix | Delete
}
[307] Fix | Delete
}
[308] Fix | Delete
}
[309] Fix | Delete
/**
[310] Fix | Delete
* During execution of guarded functions we will capture the first error which
[311] Fix | Delete
* we will rethrow to be handled by the top level error handler.
[312] Fix | Delete
*/
[313] Fix | Delete
[314] Fix | Delete
function rethrowCaughtError() {
[315] Fix | Delete
if (hasRethrowError) {
[316] Fix | Delete
var error = rethrowError;
[317] Fix | Delete
hasRethrowError = false;
[318] Fix | Delete
rethrowError = null;
[319] Fix | Delete
throw error;
[320] Fix | Delete
}
[321] Fix | Delete
}
[322] Fix | Delete
function hasCaughtError() {
[323] Fix | Delete
return hasError;
[324] Fix | Delete
}
[325] Fix | Delete
function clearCaughtError() {
[326] Fix | Delete
if (hasError) {
[327] Fix | Delete
var error = caughtError;
[328] Fix | Delete
hasError = false;
[329] Fix | Delete
caughtError = null;
[330] Fix | Delete
return error;
[331] Fix | Delete
} else {
[332] Fix | Delete
{
[333] Fix | Delete
{
[334] Fix | Delete
throw Error( "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue." );
[335] Fix | Delete
}
[336] Fix | Delete
}
[337] Fix | Delete
}
[338] Fix | Delete
}
[339] Fix | Delete
[340] Fix | Delete
var getFiberCurrentPropsFromNode = null;
[341] Fix | Delete
var getInstanceFromNode = null;
[342] Fix | Delete
var getNodeFromInstance = null;
[343] Fix | Delete
function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
[344] Fix | Delete
getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
[345] Fix | Delete
getInstanceFromNode = getInstanceFromNodeImpl;
[346] Fix | Delete
getNodeFromInstance = getNodeFromInstanceImpl;
[347] Fix | Delete
[348] Fix | Delete
{
[349] Fix | Delete
if (!getNodeFromInstance || !getInstanceFromNode) {
[350] Fix | Delete
error('EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.');
[351] Fix | Delete
}
[352] Fix | Delete
}
[353] Fix | Delete
}
[354] Fix | Delete
var validateEventDispatches;
[355] Fix | Delete
[356] Fix | Delete
{
[357] Fix | Delete
validateEventDispatches = function (event) {
[358] Fix | Delete
var dispatchListeners = event._dispatchListeners;
[359] Fix | Delete
var dispatchInstances = event._dispatchInstances;
[360] Fix | Delete
var listenersIsArr = Array.isArray(dispatchListeners);
[361] Fix | Delete
var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
[362] Fix | Delete
var instancesIsArr = Array.isArray(dispatchInstances);
[363] Fix | Delete
var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
[364] Fix | Delete
[365] Fix | Delete
if (instancesIsArr !== listenersIsArr || instancesLen !== listenersLen) {
[366] Fix | Delete
error('EventPluginUtils: Invalid `event`.');
[367] Fix | Delete
}
[368] Fix | Delete
};
[369] Fix | Delete
}
[370] Fix | Delete
/**
[371] Fix | Delete
* Dispatch the event to the listener.
[372] Fix | Delete
* @param {SyntheticEvent} event SyntheticEvent to handle
[373] Fix | Delete
* @param {function} listener Application-level callback
[374] Fix | Delete
* @param {*} inst Internal component instance
[375] Fix | Delete
*/
[376] Fix | Delete
[377] Fix | Delete
[378] Fix | Delete
function executeDispatch(event, listener, inst) {
[379] Fix | Delete
var type = event.type || 'unknown-event';
[380] Fix | Delete
event.currentTarget = getNodeFromInstance(inst);
[381] Fix | Delete
invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
[382] Fix | Delete
event.currentTarget = null;
[383] Fix | Delete
}
[384] Fix | Delete
/**
[385] Fix | Delete
* Standard/simple iteration through an event's collected dispatches.
[386] Fix | Delete
*/
[387] Fix | Delete
[388] Fix | Delete
function executeDispatchesInOrder(event) {
[389] Fix | Delete
var dispatchListeners = event._dispatchListeners;
[390] Fix | Delete
var dispatchInstances = event._dispatchInstances;
[391] Fix | Delete
[392] Fix | Delete
{
[393] Fix | Delete
validateEventDispatches(event);
[394] Fix | Delete
}
[395] Fix | Delete
[396] Fix | Delete
if (Array.isArray(dispatchListeners)) {
[397] Fix | Delete
for (var i = 0; i < dispatchListeners.length; i++) {
[398] Fix | Delete
if (event.isPropagationStopped()) {
[399] Fix | Delete
break;
[400] Fix | Delete
} // Listeners and Instances are two parallel arrays that are always in sync.
[401] Fix | Delete
[402] Fix | Delete
[403] Fix | Delete
executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
[404] Fix | Delete
}
[405] Fix | Delete
} else if (dispatchListeners) {
[406] Fix | Delete
executeDispatch(event, dispatchListeners, dispatchInstances);
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
event._dispatchListeners = null;
[410] Fix | Delete
event._dispatchInstances = null;
[411] Fix | Delete
}
[412] Fix | Delete
[413] Fix | Delete
var FunctionComponent = 0;
[414] Fix | Delete
var ClassComponent = 1;
[415] Fix | Delete
var IndeterminateComponent = 2; // Before we know whether it is function or class
[416] Fix | Delete
[417] Fix | Delete
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
[418] Fix | Delete
[419] Fix | Delete
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
[420] Fix | Delete
[421] Fix | Delete
var HostComponent = 5;
[422] Fix | Delete
var HostText = 6;
[423] Fix | Delete
var Fragment = 7;
[424] Fix | Delete
var Mode = 8;
[425] Fix | Delete
var ContextConsumer = 9;
[426] Fix | Delete
var ContextProvider = 10;
[427] Fix | Delete
var ForwardRef = 11;
[428] Fix | Delete
var Profiler = 12;
[429] Fix | Delete
var SuspenseComponent = 13;
[430] Fix | Delete
var MemoComponent = 14;
[431] Fix | Delete
var SimpleMemoComponent = 15;
[432] Fix | Delete
var LazyComponent = 16;
[433] Fix | Delete
var IncompleteClassComponent = 17;
[434] Fix | Delete
var DehydratedFragment = 18;
[435] Fix | Delete
var SuspenseListComponent = 19;
[436] Fix | Delete
var FundamentalComponent = 20;
[437] Fix | Delete
var ScopeComponent = 21;
[438] Fix | Delete
var Block = 22;
[439] Fix | Delete
[440] Fix | Delete
/**
[441] Fix | Delete
* Injectable ordering of event plugins.
[442] Fix | Delete
*/
[443] Fix | Delete
var eventPluginOrder = null;
[444] Fix | Delete
/**
[445] Fix | Delete
* Injectable mapping from names to event plugin modules.
[446] Fix | Delete
*/
[447] Fix | Delete
[448] Fix | Delete
var namesToPlugins = {};
[449] Fix | Delete
/**
[450] Fix | Delete
* Recomputes the plugin list using the injected plugins and plugin ordering.
[451] Fix | Delete
*
[452] Fix | Delete
* @private
[453] Fix | Delete
*/
[454] Fix | Delete
[455] Fix | Delete
function recomputePluginOrdering() {
[456] Fix | Delete
if (!eventPluginOrder) {
[457] Fix | Delete
// Wait until an `eventPluginOrder` is injected.
[458] Fix | Delete
return;
[459] Fix | Delete
}
[460] Fix | Delete
[461] Fix | Delete
for (var pluginName in namesToPlugins) {
[462] Fix | Delete
var pluginModule = namesToPlugins[pluginName];
[463] Fix | Delete
var pluginIndex = eventPluginOrder.indexOf(pluginName);
[464] Fix | Delete
[465] Fix | Delete
if (!(pluginIndex > -1)) {
[466] Fix | Delete
{
[467] Fix | Delete
throw Error( "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`." );
[468] Fix | Delete
}
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
if (plugins[pluginIndex]) {
[472] Fix | Delete
continue;
[473] Fix | Delete
}
[474] Fix | Delete
[475] Fix | Delete
if (!pluginModule.extractEvents) {
[476] Fix | Delete
{
[477] Fix | Delete
throw Error( "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not." );
[478] Fix | Delete
}
[479] Fix | Delete
}
[480] Fix | Delete
[481] Fix | Delete
plugins[pluginIndex] = pluginModule;
[482] Fix | Delete
var publishedEvents = pluginModule.eventTypes;
[483] Fix | Delete
[484] Fix | Delete
for (var eventName in publishedEvents) {
[485] Fix | Delete
if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
[486] Fix | Delete
{
[487] Fix | Delete
throw Error( "EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`." );
[488] Fix | Delete
}
[489] Fix | Delete
}
[490] Fix | Delete
}
[491] Fix | Delete
}
[492] Fix | Delete
}
[493] Fix | Delete
/**
[494] Fix | Delete
* Publishes an event so that it can be dispatched by the supplied plugin.
[495] Fix | Delete
*
[496] Fix | Delete
* @param {object} dispatchConfig Dispatch configuration for the event.
[497] Fix | Delete
* @param {object} PluginModule Plugin publishing the event.
[498] Fix | Delete
* @return {boolean} True if the event was successfully published.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function