From 78ad9adc1a0c39a642a9a012d692ac24c825afda Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 7 Sep 2016 16:48:10 -0700 Subject: [PATCH] fix(ShadowCss): fix perf regression (#11420) fixes #11371 --- modules/@angular/compiler/src/shadow_css.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/@angular/compiler/src/shadow_css.ts b/modules/@angular/compiler/src/shadow_css.ts index 80fe96333b..d8b4cb5304 100644 --- a/modules/@angular/compiler/src/shadow_css.ts +++ b/modules/@angular/compiler/src/shadow_css.ts @@ -484,11 +484,11 @@ function stripComments(input: string): string { } // all comments except inline source mapping ("/* #sourceMappingURL= ... */") -const _sourceMappingUrlRe = /[\s\S]*(\/\*\s*#\s*sourceMappingURL=[\s\S]+?\*\/)\s*$/; +const _sourceMappingUrlRe = /\/\*\s*#\s*sourceMappingURL=[\s\S]+?\*\//; function extractSourceMappingUrl(input: string): string { const matcher = input.match(_sourceMappingUrlRe); - return matcher ? matcher[1] : ''; + return matcher ? matcher[0] : ''; } const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;