(format, args)
| 9 | const util = require('util'); |
| 10 | |
| 11 | function shouldIgnoreConsoleError(format, args) { |
| 12 | if (process.env.NODE_ENV !== 'production') { |
| 13 | if (typeof format === 'string') { |
| 14 | if (format.indexOf('Error: Uncaught [') === 0) { |
| 15 | // This looks like an uncaught error from invokeGuardedCallback() wrapper |
| 16 | // in development that is reported by jsdom. Ignore because it's noisy. |
| 17 | return true; |
| 18 | } |
| 19 | if (format.indexOf('The above error occurred') === 0) { |
| 20 | // This looks like an error addendum from ReactFiberErrorLogger. |
| 21 | // Ignore it too. |
| 22 | return true; |
| 23 | } |
| 24 | } |
| 25 | } else { |
| 26 | if ( |
| 27 | format != null && |
| 28 | typeof format.message === 'string' && |
| 29 | typeof format.stack === 'string' && |
| 30 | args.length === 0 |
| 31 | ) { |
| 32 | // In production, ReactFiberErrorLogger logs error objects directly. |
| 33 | // They are noisy too so we'll try to ignore them. |
| 34 | return true; |
| 35 | } |
| 36 | } |
| 37 | // Looks legit |
| 38 | return false; |
| 39 | } |
| 40 | |
| 41 | function normalizeCodeLocInfo(str) { |
| 42 | if (typeof str !== 'string') { |
no outgoing calls