* Caches the source map if it is present in the eval'd source. * @param {string} content - the eval'd source code
(content)
| 204 | * @param {string} content - the eval'd source code |
| 205 | */ |
| 206 | function maybeCacheGeneratedSourceMap(content) { |
| 207 | const support = getSourceMapsSupport(); |
| 208 | if (!(process.env.NODE_V8_COVERAGE || support.enabled || support.generated)) return; |
| 209 | |
| 210 | const sourceURL = extractSourceURLMagicComment(content); |
| 211 | if (sourceURL === null) { |
| 212 | return; |
| 213 | } |
| 214 | const sourceMapURL = extractSourceMapURLMagicComment(content); |
| 215 | if (sourceMapURL === null) { |
| 216 | return; |
| 217 | } |
| 218 | |
| 219 | try { |
| 220 | // Use the sourceURL as the filename, and do not create a duplicate entry. |
| 221 | maybeCacheSourceMap(sourceURL, content, null, true, undefined /** no duplicated sourceURL */, sourceMapURL); |
| 222 | } catch (err) { |
| 223 | // This can happen if the filename is not a valid URL. |
| 224 | // If we fail to cache the source map, we should not fail the whole process. |
| 225 | debug(err); |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Resolves source map payload data from the source url and source map url. |
nothing calls this directly
no test coverage detected
searching dependent graphs…