Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: pkg/compiler/lib/src/js_backend/constant_emitter.dart

Issue 952643002: Revert "dart2js: Avoid escaping in strings if it's not necessary." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js/builder.dart ('k') | tests/compiler/dart2js/string_escapes2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/constant_emitter.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 2e5d5f6a038a82744a94efc439dd6cca8984f9c6..d4e57fb4717df427d4bd7143626ba143052935b1 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -256,7 +256,9 @@ class ConstantLiteralEmitter
*/
@override
jsAst.Expression visitString(StringConstantValue constant, [_]) {
- return js.escapedString(constant.primitiveValue.slowToString());
+ StringBuffer sb = new StringBuffer();
+ writeJsonEscapedCharsOn(constant.primitiveValue.slowToString(), sb);
+ return new jsAst.LiteralString('"$sb"');
}
@override
« no previous file with comments | « pkg/compiler/lib/src/js/builder.dart ('k') | tests/compiler/dart2js/string_escapes2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698