(str)
| 146 | } |
| 147 | |
| 148 | function normalizeCodeLocInfo(str) { |
| 149 | if (typeof str !== 'string') { |
| 150 | return str; |
| 151 | } |
| 152 | // This special case exists only for the special source location in |
| 153 | // ReactElementValidator. That will go away if we remove source locations. |
| 154 | str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **'); |
| 155 | // V8 format: |
| 156 | // at Component (/path/filename.js:123:45) |
| 157 | // React format: |
| 158 | // in Component (at filename.js:123) |
| 159 | return str.replace(/\n +(?:at|in) ([^(\[\n]+)[^\n]*/g, function (m, name) { |
| 160 | name = name.trim(); |
| 161 | if (name.endsWith('.render')) { |
| 162 | // Class components will have the `render` method as part of their stack trace. |
| 163 | // We strip that out in our normalization to make it look more like component stacks. |
| 164 | name = name.slice(0, name.length - 7); |
| 165 | } |
| 166 | name = name.replace(/.*\/([^\/]+):\d+:\d+/, '**/$1:**:**'); |
| 167 | return '\n in ' + name + ' (at **)'; |
| 168 | }); |
| 169 | } |
| 170 | |
| 171 | function normalizeComponentStack(entry) { |
| 172 | if ( |
no outgoing calls
no test coverage detected