| Index: frog/leg/ssa/codegen.dart
|
| diff --git a/frog/leg/ssa/codegen.dart b/frog/leg/ssa/codegen.dart
|
| index fad8f53490ea5fd45fb44311d6566a5880cb33f8..e747396f3912885ede4ed033fbd2a55d11c09da1 100644
|
| --- a/frog/leg/ssa/codegen.dart
|
| +++ b/frog/leg/ssa/codegen.dart
|
| @@ -460,11 +460,6 @@ class SsaCodeGenerator implements HVisitor {
|
| buffer.add(')');
|
| }
|
|
|
| - static String makeStringLiteral(SourceString literal) {
|
| - // TODO(lrn): Escape string content.
|
| - return literal.toString();
|
| - }
|
| -
|
| visitLiteral(HLiteral node) {
|
| if (node.isLiteralNull()) {
|
| buffer.add("(void 0)");
|
| @@ -472,7 +467,13 @@ class SsaCodeGenerator implements HVisitor {
|
| buffer.add('(${node.value})');
|
| } else if (node.isLiteralString()) {
|
| QuotedString string = node.value;
|
| - string.printOn(buffer);
|
| + String quote = string.quoteChar;
|
| + buffer.add(quote);
|
| + string.writeEscaped(buffer, string.quoteCharCode,
|
| + (String reason) {
|
| + compiler.cancel(reason, instruction: node);
|
| + });
|
| + buffer.add(quote);
|
| } else {
|
| buffer.add(node.value);
|
| }
|
|
|