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; | 5 import '../common.dart'; |
| 6 import '../compiler.dart' show Compiler; |
| 7 import '../constants/values.dart'; |
| 8 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; |
| 10 import '../io/code_output.dart'; |
| 11 import '../js/js.dart' as jsAst; |
| 12 import '../js/js.dart' show js; |
| 13 import 'constant_system_javascript.dart'; |
| 14 |
| 15 import 'backend.dart'; |
| 16 import 'namer.dart'; |
6 | 17 |
7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); | 18 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); |
8 | 19 |
9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); | 20 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); |
10 | 21 |
11 /** | 22 /** |
12 * Generates the JavaScript expressions for constants. | 23 * Generates the JavaScript expressions for constants. |
13 * | 24 * |
14 * It uses a given [constantReferenceGenerator] to reference nested constants | 25 * It uses a given [constantReferenceGenerator] to reference nested constants |
15 * (if there are some). It is hence up to that function to decide which | 26 * (if there are some). It is hence up to that function to decide which |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 [value, argumentList]); | 333 [value, argumentList]); |
323 } | 334 } |
324 return value; | 335 return value; |
325 } | 336 } |
326 | 337 |
327 @override | 338 @override |
328 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 339 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
329 return constantReferenceGenerator(constant.referenced); | 340 return constantReferenceGenerator(constant.referenced); |
330 } | 341 } |
331 } | 342 } |
OLD | NEW |