Mercurial
annotate third_party/bun/node_modules/react/cjs/react-jsx-runtime.development.js @ 78:e7bf9e002850
amend
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Wed, 31 Dec 2025 15:07:43 -0800 |
| parents | de54585a40f1 |
| children |
| rev | line source |
|---|---|
|
12
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
1 /** |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
2 * @license React |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
3 * react-jsx-runtime.development.js |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
4 * |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
5 * Copyright (c) Facebook, Inc. and its affiliates. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
6 * |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
7 * This source code is licensed under the MIT license found in the |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
8 * LICENSE file in the root directory of this source tree. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
9 */ |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
10 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
11 'use strict'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
12 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
13 if (process.env.NODE_ENV !== "production") { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
14 (function() { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
15 'use strict'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
16 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
17 var React = require('react'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
18 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
19 // ATTENTION |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
20 // When adding new symbols to this file, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
21 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
22 // The Symbol used to tag the ReactElement-like types. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
23 var REACT_ELEMENT_TYPE = Symbol.for('react.element'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
24 var REACT_PORTAL_TYPE = Symbol.for('react.portal'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
25 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
26 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
27 var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
28 var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
29 var REACT_CONTEXT_TYPE = Symbol.for('react.context'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
30 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
31 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
32 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
33 var REACT_MEMO_TYPE = Symbol.for('react.memo'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
34 var REACT_LAZY_TYPE = Symbol.for('react.lazy'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
35 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
36 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
37 var FAUX_ITERATOR_SYMBOL = '@@iterator'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
38 function getIteratorFn(maybeIterable) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
39 if (maybeIterable === null || typeof maybeIterable !== 'object') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
40 return null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
41 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
42 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
43 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
44 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
45 if (typeof maybeIterator === 'function') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
46 return maybeIterator; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
47 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
48 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
49 return null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
50 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
51 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
52 var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
53 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
54 function error(format) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
55 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
56 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
57 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
58 args[_key2 - 1] = arguments[_key2]; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
59 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
60 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
61 printWarning('error', format, args); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
62 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
63 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
64 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
65 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
66 function printWarning(level, format, args) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
67 // When changing this logic, you might want to also |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
68 // update consoleWithStackDev.www.js as well. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
69 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
70 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
71 var stack = ReactDebugCurrentFrame.getStackAddendum(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
72 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
73 if (stack !== '') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
74 format += '%s'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
75 args = args.concat([stack]); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
76 } // eslint-disable-next-line react-internal/safe-string-coercion |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
77 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
78 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
79 var argsWithFormat = args.map(function (item) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
80 return String(item); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
81 }); // Careful: RN currently depends on this prefix |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
82 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
83 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
84 // breaks IE9: https://github.com/facebook/react/issues/13610 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
85 // eslint-disable-next-line react-internal/no-production-logging |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
86 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
87 Function.prototype.apply.call(console[level], console, argsWithFormat); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
88 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
89 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
90 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
91 // ----------------------------------------------------------------------------- |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
92 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
93 var enableScopeAPI = false; // Experimental Create Event Handle API. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
94 var enableCacheElement = false; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
95 var enableTransitionTracing = false; // No known bugs, but needs performance testing |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
96 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
97 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
98 // stuff. Intended to enable React core members to more easily debug scheduling |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
99 // issues in DEV builds. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
100 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
101 var enableDebugTracing = false; // Track which Fiber(s) schedule render work. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
102 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
103 var REACT_MODULE_REFERENCE; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
104 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
105 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
106 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
107 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
108 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
109 function isValidElementType(type) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
110 if (typeof type === 'string' || typeof type === 'function') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
111 return true; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
112 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
113 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
114 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
115 if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
116 return true; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
117 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
118 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
119 if (typeof type === 'object' && type !== null) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
120 if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
121 // types supported by any Flight configuration anywhere since |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
122 // we don't know which Flight build this will end up being used |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
123 // with. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
124 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
125 return true; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
126 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
127 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
128 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
129 return false; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
130 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
131 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
132 function getWrappedName(outerType, innerType, wrapperName) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
133 var displayName = outerType.displayName; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
134 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
135 if (displayName) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
136 return displayName; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
137 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
138 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
139 var functionName = innerType.displayName || innerType.name || ''; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
140 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
141 } // Keep in sync with react-reconciler/getComponentNameFromFiber |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
142 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
143 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
144 function getContextName(type) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
145 return type.displayName || 'Context'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
146 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
147 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
148 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
149 function getComponentNameFromType(type) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
150 if (type == null) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
151 // Host root, text node or just invalid type. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
152 return null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
153 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
154 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
155 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
156 if (typeof type.tag === 'number') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
157 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
158 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
159 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
160 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
161 if (typeof type === 'function') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
162 return type.displayName || type.name || null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
163 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
164 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
165 if (typeof type === 'string') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
166 return type; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
167 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
168 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
169 switch (type) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
170 case REACT_FRAGMENT_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
171 return 'Fragment'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
172 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
173 case REACT_PORTAL_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
174 return 'Portal'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
175 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
176 case REACT_PROFILER_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
177 return 'Profiler'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
178 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
179 case REACT_STRICT_MODE_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
180 return 'StrictMode'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
181 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
182 case REACT_SUSPENSE_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
183 return 'Suspense'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
184 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
185 case REACT_SUSPENSE_LIST_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
186 return 'SuspenseList'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
187 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
188 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
189 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
190 if (typeof type === 'object') { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
191 switch (type.$$typeof) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
192 case REACT_CONTEXT_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
193 var context = type; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
194 return getContextName(context) + '.Consumer'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
195 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
196 case REACT_PROVIDER_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
197 var provider = type; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
198 return getContextName(provider._context) + '.Provider'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
199 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
200 case REACT_FORWARD_REF_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
201 return getWrappedName(type, type.render, 'ForwardRef'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
202 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
203 case REACT_MEMO_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
204 var outerName = type.displayName || null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
205 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
206 if (outerName !== null) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
207 return outerName; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
208 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
209 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
210 return getComponentNameFromType(type.type) || 'Memo'; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
211 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
212 case REACT_LAZY_TYPE: |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
213 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
214 var lazyComponent = type; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
215 var payload = lazyComponent._payload; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
216 var init = lazyComponent._init; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
217 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
218 try { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
219 return getComponentNameFromType(init(payload)); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
220 } catch (x) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
221 return null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
222 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
223 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
224 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
225 // eslint-disable-next-line no-fallthrough |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
226 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
227 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
228 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
229 return null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
230 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
231 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
232 var assign = Object.assign; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
233 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
234 // Helpers to patch console.logs to avoid logging during side-effect free |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
235 // replaying on render function. This currently only patches the object |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
236 // lazily which won't cover if the log function was extracted eagerly. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
237 // We could also eagerly patch the method. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
238 var disabledDepth = 0; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
239 var prevLog; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
240 var prevInfo; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
241 var prevWarn; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
242 var prevError; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
243 var prevGroup; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
244 var prevGroupCollapsed; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
245 var prevGroupEnd; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
246 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
247 function disabledLog() {} |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
248 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
249 disabledLog.__reactDisabledLog = true; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
250 function disableLogs() { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
251 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
252 if (disabledDepth === 0) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
253 /* eslint-disable react-internal/no-production-logging */ |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
254 prevLog = console.log; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
255 prevInfo = console.info; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
256 prevWarn = console.warn; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
257 prevError = console.error; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
258 prevGroup = console.group; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
259 prevGroupCollapsed = console.groupCollapsed; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
260 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
261 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
262 var props = { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
263 configurable: true, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
264 enumerable: true, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
265 value: disabledLog, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
266 writable: true |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
267 }; // $FlowFixMe Flow thinks console is immutable. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
268 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
269 Object.defineProperties(console, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
270 info: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
271 log: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
272 warn: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
273 error: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
274 group: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
275 groupCollapsed: props, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
276 groupEnd: props |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
277 }); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
278 /* eslint-enable react-internal/no-production-logging */ |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
279 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
280 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
281 disabledDepth++; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
282 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
283 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
284 function reenableLogs() { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
285 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
286 disabledDepth--; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
287 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
288 if (disabledDepth === 0) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
289 /* eslint-disable react-internal/no-production-logging */ |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
290 var props = { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
291 configurable: true, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
292 enumerable: true, |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
293 writable: true |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
294 }; // $FlowFixMe Flow thinks console is immutable. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
295 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
296 Object.defineProperties(console, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
297 log: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
298 value: prevLog |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
299 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
300 info: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
301 value: prevInfo |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
302 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
303 warn: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
304 value: prevWarn |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
305 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
306 error: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
307 value: prevError |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
308 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
309 group: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
310 value: prevGroup |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
311 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
312 groupCollapsed: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
313 value: prevGroupCollapsed |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
314 }), |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
315 groupEnd: assign({}, props, { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
316 value: prevGroupEnd |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
317 }) |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
318 }); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
319 /* eslint-enable react-internal/no-production-logging */ |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
320 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
321 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
322 if (disabledDepth < 0) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
323 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
324 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
325 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
326 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
327 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
328 var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
329 var prefix; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
330 function describeBuiltInComponentFrame(name, source, ownerFn) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
331 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
332 if (prefix === undefined) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
333 // Extract the VM specific prefix used by each line. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
334 try { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
335 throw Error(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
336 } catch (x) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
337 var match = x.stack.trim().match(/\n( *(at )?)/); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
338 prefix = match && match[1] || ''; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
339 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
340 } // We use the prefix to ensure our stacks line up with native stack frames. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
341 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
342 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
343 return '\n' + prefix + name; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
344 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
345 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
346 var reentry = false; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
347 var componentFrameCache; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
348 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
349 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
350 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
351 componentFrameCache = new PossiblyWeakMap(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
352 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
353 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
354 function describeNativeComponentFrame(fn, construct) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
355 // If something asked for a stack inside a fake render, it should get ignored. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
356 if ( !fn || reentry) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
357 return ''; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
358 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
359 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
360 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
361 var frame = componentFrameCache.get(fn); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
362 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
363 if (frame !== undefined) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
364 return frame; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
365 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
366 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
367 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
368 var control; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
369 reentry = true; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
370 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
371 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
372 Error.prepareStackTrace = undefined; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
373 var previousDispatcher; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
374 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
375 { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
376 previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
377 // for warnings. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
378 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
379 ReactCurrentDispatcher.current = null; |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
380 disableLogs(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
381 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
382 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
383 try { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
384 // This should throw. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
385 if (construct) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
386 // Something should be setting the props in the constructor. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
387 var Fake = function () { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
388 throw Error(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
389 }; // $FlowFixMe |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
390 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
391 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
392 Object.defineProperty(Fake.prototype, 'props', { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
393 set: function () { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
394 // We use a throwing setter instead of frozen or non-writable props |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
395 // because that won't throw in a non-strict mode function. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
396 throw Error(); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
397 } |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
398 }); |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
399 |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
400 if (typeof Reflect === 'object' && Reflect.construct) { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
401 // We construct a different control for this case to include any extra |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
402 // frames added by the construct call. |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
403 try { |
|
de54585a40f1
Adding bun and node modules.
June Park <parkjune1995@gmail.com>
parents:
diff
changeset
|
404 Reflect.construct(Fake, [] |