fix(compiler): properly shim :host:before and :host(:before) (#12171)

fixes #12165
This commit is contained in:
Victor Berchet
2016-10-10 09:15:15 -07:00
committed by Tobias Bosch
parent f782b08f58
commit aa92512ac6
2 changed files with 11 additions and 5 deletions

View File

@ -381,7 +381,10 @@ export class ShadowCss {
if (_polyfillHostRe.test(selector)) {
const replaceBy = this.strictStyling ? `[${hostSelector}]` : scopeSelector;
return selector.replace(_polyfillHostNoCombinatorRe, (hnc, selector) => selector + replaceBy)
return selector
.replace(
_polyfillHostNoCombinatorRe,
(hnc, selector) => selector[0] === ':' ? replaceBy + selector : selector + replaceBy)
.replace(_polyfillHostRe, replaceBy + ' ');
}