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

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

Issue 955613002: 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 d0b286c758e4d978115dd2aebef6a1f089706de1..234e2a01615904554a52c282c033e7ad507e039e 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -287,7 +287,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