Chromium Code Reviews| Index: lib/compiler/implementation/compile_time_constants.dart |
| diff --git a/lib/compiler/implementation/compile_time_constants.dart b/lib/compiler/implementation/compile_time_constants.dart |
| index d7cbf87a4afc246991dadaddaa74725ce344c33f..e9004e71342e4a2b1b5d8c5f75af1d87d97a7d4c 100644 |
| --- a/lib/compiler/implementation/compile_time_constants.dart |
| +++ b/lib/compiler/implementation/compile_time_constants.dart |
| @@ -613,6 +613,11 @@ class ConstantHandler extends CompilerTask { |
| return buffer; |
| } |
| + StringBuffer writeCanonicalizedJsCode(StringBuffer buffer, Constant value) { |
|
ngeoffray
2012/03/30 08:28:32
How about using this as the only entry point for w
floitsch
2012/03/30 18:11:49
Done.
|
| + value.writeCanonicalizedJsCode(buffer, this); |
| + return buffer; |
| + } |
| + |
| StringBuffer writeJsCodeForVariable(StringBuffer buffer, |
| VariableElement element) { |
| if (!initialVariableValues.containsKey(element)) { |
| @@ -620,12 +625,7 @@ class ConstantHandler extends CompilerTask { |
| element: element); |
| } |
| Constant constant = initialVariableValues[element]; |
| - if (constant.isObject()) { |
| - String name = compiledConstants[constant]; |
| - buffer.add("${compiler.namer.ISOLATE}.prototype.$name"); |
| - } else { |
| - writeJsCode(buffer, constant); |
| - } |
| + constant.writeCanonicalizedJsCode(buffer, this); |
| return buffer; |
| } |