feat(compiler): make interpolation symbols configurable (@Component config) (#9367)

closes #9158
This commit is contained in:
Victor Berchet
2016-06-20 09:52:41 -07:00
committed by GitHub
parent 6fd52dfb38
commit 1b28cf71f5
27 changed files with 403 additions and 125 deletions

View File

@ -367,3 +367,7 @@ bool hasConstructor(Object value, Type type) {
String escape(String s) {
return Uri.encodeComponent(s);
}
String escapeRegExp(String s) {
return s.replaceAllMapped(new RegExp(r'([.*+?^=!:${}()|[\]\/\\])'), (Match m) => '\\${m[1]}');
}

View File

@ -466,3 +466,7 @@ export function hasConstructor(value: Object, type: Type): boolean {
export function escape(s: string): string {
return _global.encodeURI(s);
}
export function escapeRegExp(s: string): string {
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
}