fix(compiler): make ShadowCSS shim work on Android browser (#11139)

Fixes #11123
This commit is contained in:
Marc Laval 2016-08-29 17:18:55 +02:00 committed by Victor Berchet
parent 7dee1ee4cf
commit 38069aba35
1 changed files with 2 additions and 0 deletions

View File

@ -383,6 +383,8 @@ export class ShadowCss {
// scope via name and [is=name]
private _applySimpleSelectorScope(selector: string, scopeSelector: string, hostSelector: string):
string {
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
_polyfillHostRe.lastIndex = 0;
if (_polyfillHostRe.test(selector)) {
const replaceBy = this.strictStyling ? `[${hostSelector}]` : scopeSelector;
selector = StringWrapper.replace(selector, _polyfillHostNoCombinator, replaceBy);