(src)
| 5656 | * @param {string} src |
| 5657 | */ |
| 5658 | const getSourceURL= (src)=>{ |
| 5659 | let sourceURL= '<unknown>'; |
| 5660 | |
| 5661 | // Our regular expression matches the last one or two comments with key value |
| 5662 | // pairs at the end of the source, avoiding a scan over the entire length of |
| 5663 | // the string, but at the expense of being able to capture all the (key, |
| 5664 | // value) pair meta comments at the end of the source, which may include |
| 5665 | // sourceMapURL in addition to sourceURL. |
| 5666 | // So, we sublimate the comments out of the source until no source or no |
| 5667 | // comments remain. |
| 5668 | while( src.length> 0) { |
| 5669 | const match= regexpExec(sourceMetaEntriesRegExp, src); |
| 5670 | if( match=== null) { |
| 5671 | break; |
| 5672 | } |
| 5673 | src= stringSlice(src, 0, src.length- match[0].length); |
| 5674 | |
| 5675 | // We skip $0 since it contains the entire match. |
| 5676 | // The match contains four capture groups, |
| 5677 | // two (key, value) pairs, the first of which |
| 5678 | // may be undefined. |
| 5679 | // On the off-chance someone put two sourceURL comments in their code with |
| 5680 | // different commenting conventions, the latter has precedence. |
| 5681 | if( match[3]=== 'sourceURL') { |
| 5682 | sourceURL= match[4]; |
| 5683 | }else if( match[1]=== 'sourceURL') { |
| 5684 | sourceURL= match[2]; |
| 5685 | } |
| 5686 | } |
| 5687 | |
| 5688 | return sourceURL; |
| 5689 | };$h_once.getSourceURL(getSourceURL); |
| 5690 | })() |
| 5691 | , |
| 5692 | // === functors[27] === |
no outgoing calls
no test coverage detected