(p: string)
| 745 | const attrName = `[${scopeSelector}]`; |
| 746 | |
| 747 | const _scopeSelectorPart = (p: string) => { |
| 748 | let scopedP = p.trim(); |
| 749 | |
| 750 | if (!scopedP) { |
| 751 | return p; |
| 752 | } |
| 753 | |
| 754 | if (p.includes(_polyfillHostNoCombinator)) { |
| 755 | scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector); |
| 756 | if (!p.match(_polyfillHostNoCombinatorOutsidePseudoFunction)) { |
| 757 | const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)([\s\S]*)/)!; |
| 758 | scopedP = before + attrName + colon + after; |
| 759 | } |
| 760 | } else { |
| 761 | // remove :host since it should be unnecessary |
| 762 | const t = p.replace(_polyfillHostRe, ''); |
| 763 | if (t.length > 0) { |
| 764 | const matches = t.match(/([^:]*)(:*)([\s\S]*)/); |
| 765 | if (matches) { |
| 766 | scopedP = matches[1] + attrName + matches[2] + matches[3]; |
| 767 | } |
| 768 | } |
| 769 | } |
| 770 | |
| 771 | return scopedP; |
| 772 | }; |
| 773 | |
| 774 | // Wraps `_scopeSelectorPart()` to not use it directly on selectors with |
| 775 | // pseudo selector functions like `:where()`. Selectors within pseudo selector |
nothing calls this directly
no test coverage detected