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

Side by Side Diff: pkg/analysis_server/lib/src/status/ast_writer.dart

Issue 855643004: Use UTF-8 when serving web pages for analysis server debug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis_server.src.status.ast_writer; 5 library analysis_server.src.status.ast_writer;
6 6
7 import 'package:analysis_server/src/status/utilities.dart'; 7 import 'dart:convert';
8
8 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
9 10
10 /** 11 /**
11 * A visitor that will produce an HTML representation of an AST structure. 12 * A visitor that will produce an HTML representation of an AST structure.
12 */ 13 */
13 class AstWriter extends UnifyingAstVisitor { 14 class AstWriter extends UnifyingAstVisitor {
14 /** 15 /**
15 * The buffer on which the HTML is to be written. 16 * The buffer on which the HTML is to be written.
16 */ 17 */
17 final StringBuffer buffer; 18 final StringBuffer buffer;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 169 }
169 } 170 }
170 171
171 /** 172 /**
172 * Write the [value] of the property with the given [name]. 173 * Write the [value] of the property with the given [name].
173 */ 174 */
174 void _writeProperty(String name, Object value) { 175 void _writeProperty(String name, Object value) {
175 if (value != null) { 176 if (value != null) {
176 _indent(2); 177 _indent(2);
177 buffer.write('$name = '); 178 buffer.write('$name = ');
178 buffer.write(encodeHtml(value.toString())); 179 buffer.write(HTML_ESCAPE.convert(value.toString()));
179 buffer.write('<br>'); 180 buffer.write('<br>');
180 } 181 }
181 } 182 }
182 } 183 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698