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

Side by Side Diff: lib/compiler/implementation/js_backend/constant_emitter.dart

Issue 11230011: Make hasNext a getter instead of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused variable. Created 8 years, 2 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
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/coreimpl_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class ConstantEmitter implements ConstantVisitor { 5 class ConstantEmitter implements ConstantVisitor {
6 final Compiler compiler; 6 final Compiler compiler;
7 final Namer namer; 7 final Namer namer;
8 8
9 CodeBuffer buffer; 9 CodeBuffer buffer;
10 bool shouldEmitCanonicalVersion; 10 bool shouldEmitCanonicalVersion;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 /** 85 /**
86 * Write the contents of the quoted string to a [CodeBuffer] in 86 * Write the contents of the quoted string to a [CodeBuffer] in
87 * a form that is valid as JavaScript string literal content. 87 * a form that is valid as JavaScript string literal content.
88 * The string is assumed quoted by single quote characters. 88 * The string is assumed quoted by single quote characters.
89 */ 89 */
90 void writeEscapedString(DartString string, 90 void writeEscapedString(DartString string,
91 CodeBuffer buffer, 91 CodeBuffer buffer,
92 Node diagnosticNode) { 92 Node diagnosticNode) {
93 Iterator<int> iterator = string.iterator(); 93 Iterator<int> iterator = string.iterator();
94 while (iterator.hasNext()) { 94 while (iterator.hasNext) {
95 int code = iterator.next(); 95 int code = iterator.next();
96 if (identical(code, $SQ)) { 96 if (identical(code, $SQ)) {
97 buffer.add(r"\'"); 97 buffer.add(r"\'");
98 } else if (identical(code, $LF)) { 98 } else if (identical(code, $LF)) {
99 buffer.add(r'\n'); 99 buffer.add(r'\n');
100 } else if (identical(code, $CR)) { 100 } else if (identical(code, $CR)) {
101 buffer.add(r'\r'); 101 buffer.add(r'\r');
102 } else if (identical(code, $LS)) { 102 } else if (identical(code, $LS)) {
103 // This Unicode line terminator and $PS are invalid in JS string 103 // This Unicode line terminator and $PS are invalid in JS string
104 // literals. 104 // literals.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 buffer.add(getJsConstructor(constant.type.element)); 243 buffer.add(getJsConstructor(constant.type.element));
244 buffer.add("("); 244 buffer.add("(");
245 for (int i = 0; i < constant.fields.length; i++) { 245 for (int i = 0; i < constant.fields.length; i++) {
246 if (i != 0) buffer.add(", "); 246 if (i != 0) buffer.add(", ");
247 _visit(constant.fields[i]); 247 _visit(constant.fields[i]);
248 } 248 }
249 buffer.add(")"); 249 buffer.add(")");
250 } 250 }
251 } 251 }
252 } 252 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/lib/coreimpl_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698