| 176 | } |
| 177 | |
| 178 | function printWarning(level, format, args) { |
| 179 | // When changing this logic, you might want to also |
| 180 | // update consoleWithStackDev.www.js as well. |
| 181 | { |
| 182 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; |
| 183 | var stack = ReactDebugCurrentFrame.getStackAddendum(); |
| 184 | |
| 185 | if (stack !== '') { |
| 186 | format += '%s'; |
| 187 | args = args.concat([stack]); |
| 188 | } // eslint-disable-next-line react-internal/safe-string-coercion |
| 189 | |
| 190 | |
| 191 | var argsWithFormat = args.map(function (item) { |
| 192 | return String(item); |
| 193 | }); // Careful: RN currently depends on this prefix |
| 194 | |
| 195 | argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it |
| 196 | // breaks IE9: https://github.com/facebook/react/issues/13610 |
| 197 | // eslint-disable-next-line react-internal/no-production-logging |
| 198 | |
| 199 | Function.prototype.apply.call(console[level], console, argsWithFormat); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | var didWarnStateUpdateForUnmountedComponent = {}; |
| 204 | |