OLD | NEW |
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 part of js_backend; | |
6 | |
7 class ConstantEmitter implements ConstantVisitor { | 5 class ConstantEmitter implements ConstantVisitor { |
8 final Compiler compiler; | 6 final Compiler compiler; |
9 final Namer namer; | 7 final Namer namer; |
10 | 8 |
11 CodeBuffer buffer; | 9 CodeBuffer buffer; |
12 bool shouldEmitCanonicalVersion; | 10 bool shouldEmitCanonicalVersion; |
13 | 11 |
14 ConstantEmitter(this.compiler, this.namer); | 12 ConstantEmitter(this.compiler, this.namer); |
15 | 13 |
16 /** | 14 /** |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 buffer.add(getJsConstructor(constant.type.element)); | 243 buffer.add(getJsConstructor(constant.type.element)); |
246 buffer.add("("); | 244 buffer.add("("); |
247 for (int i = 0; i < constant.fields.length; i++) { | 245 for (int i = 0; i < constant.fields.length; i++) { |
248 if (i != 0) buffer.add(", "); | 246 if (i != 0) buffer.add(", "); |
249 _visit(constant.fields[i]); | 247 _visit(constant.fields[i]); |
250 } | 248 } |
251 buffer.add(")"); | 249 buffer.add(")"); |
252 } | 250 } |
253 } | 251 } |
254 } | 252 } |
OLD | NEW |