| Index: lib/src/js/builder.dart
|
| diff --git a/lib/src/js/builder.dart b/lib/src/js/builder.dart
|
| index b2bdfbca5e04253157fd63e2428bdc0df8215a05..f215da214a6795ed463467790084834a2988e91d 100644
|
| --- a/lib/src/js/builder.dart
|
| +++ b/lib/src/js/builder.dart
|
| @@ -300,9 +300,11 @@ class JsBuilder {
|
| String escaped = value.replaceAll('\\', '\\\\');
|
| // Do not escape unicode characters and ' because they are allowed in the
|
| // string literal anyway.
|
| - escaped = escaped.replaceAllMapped(new RegExp('\n|$quote|\b|\t|\v'), (m) {
|
| + var re = new RegExp('\n|\r|$quote|\b|\f|\t|\v');
|
| + escaped = escaped.replaceAllMapped(re, (m) {
|
| switch (m.group(0)) {
|
| case "\n" : return r"\n";
|
| + case "\r" : return r"\r";
|
| // Quotes are only replaced if they conflict with the containing quote
|
| case '"': return r'\"';
|
| case "'": return r"\'";
|
|
|