Skip to content

Commit

Permalink
fix(compiler): make ShadowCSS shim work on Android browser (angular#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
marclaval authored and vicb committed Aug 29, 2016
1 parent 7dee1ee commit 38069ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/@angular/compiler/src/shadow_css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 38069ab

Please sign in to comment.