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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart

Issue 11418115: Fix Unicode issues in dart2js and dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove accidental test expectation dupe Created 8 years, 1 month 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
Index: sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
index e8621a5d91c28c3d0ddf9cfba946603834757f0c..0677013fafc94f4108ec57dc6604db6d5e12241a 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart
@@ -87,23 +87,12 @@ class ConstantEmitter implements ConstantVisitor {
/**
* Write the contents of the quoted string to a [CodeBuffer] in
* a form that is valid as JavaScript string literal content.
- * The string is assumed quoted by single quote characters.
+ * The string is assumed quoted by double quote characters.
*/
- void writeEscapedString(DartString string,
- CodeBuffer buffer,
- Node diagnosticNode) {
- void onError(code) {
- compiler.reportError(
- diagnosticNode,
- 'Unhandled non-BMP character: U+${code.toRadixString(16)}');
- }
- writeJsonEscapedCharsOn(string.iterator(), buffer, onError);
- }
-
void visitString(StringConstant constant) {
- buffer.add("'");
- writeEscapedString(constant.value, buffer, constant.node);
- buffer.add("'");
+ buffer.add('"');
+ writeJsonEscapedCharsOn(constant.value.slowToString(), buffer);
+ buffer.add('"');
}
void emitCanonicalVersion(Constant constant) {

Powered by Google App Engine
This is Rietveld 408576698